Closed gummif closed 9 years ago
What's the rationale for having two ways to construct the wavelet types? I would prefer just to create them directly. Also for continuous wavelets the scales (or frequencies or periods) and wavenumber must be specifiable. Otherwise, this looks good to me, although my knowledge of discrete wavelets is limited.
Well, for those who might not be familiar with what kind of wavelet a cdf9/7
is, it can be constructed in a user friendly way with wavelet("cdf9/7")
. It can e.g. not be constructed using OrthoFilter("cdf9/7")
, but rather BiOrthoFilter("cdf9/7")
. But I guess it is not stricly necessary.
I'm not sure what you mean, but your cwt
code could be used almost verbatim, with minor changes:
abstract MotherWavelet{T<:Real} <: ContinuousWavelet{T}
# or maybe replace all MotherWavelet by ContinuousWavelet
function cwtft{T <: Real}(signal::Vector{T}, w::ContinuousWavelet{T}, fs::Real=1)
t = ContinuousWaveletTransform(w, nextfastfft(length(signal)), fs)
evaluate!(Array(Complex{T}, length(signal), size(t.bases, 2)), t, signal)
end
API suggestion for high level functions: For
DiscreteWavelet
boundary treatment is controlled by type parameterT<:WaveletBoundary
. Forcwtft
boundaries are naturally periodic and forcwt
boundaries are specified explicitly as an input.The wavelet type structure under
abstract WaveletType
. Strikethrough types are not included in the package (yet).abstract FilterWavelet
OrthoFilter
BiOrthoFilterabstract LSWavelet
GLS
abstract ContinuousWavelet
abstract MotherWavelet(maybe?)typealias DiscreteWavelet Union(FilterWavelet, LSWavelet)
The type parameter (e.g.
OrthoFilter{T<:WaveletBoundary}
) determines the treatment of boundary extensions.PerBoundary
is default.The wavelet types are created either directly (
OrthoFilter{T<:WaveletBoundary}(name::String)
) or using the wavelet contructors.Both can also accept input of type
(class::String, n::Union(Integer,String))
.I believe this is a quite intuitive and simple API which is consistent for all transforms. Having boundary types as a parameter is also in the style of julia and can potentially simplify some of the code. Suggestions and criticism welcome.