A Julia package for generating Generalized Morse Wavelets (GMW) (see e.g. (Lilly and Olhede 2012)) and their derivatives.
The first order Generalized Morse Wavelets are defined in frequency by:
where
In practice, Generalized Morse Wavelest can be used to compute
continuous wavelet transforms. Given a signal
The wavelet coefficient of a signal
where
This package also provide Generalized Morse Wavelets at higher order,
although their use is more limited as their properties in frequency are
not yet well understood for varying shape parameters
To generate the analytic part of a first order k=0
Generalized Morse
Wavelet, normalized in energy normalization=:L2
, with N=1024
time
samples, with shape parameters \beta=1
,\gamma=3
, and at scale a=5
and time index u=512
, use:
using GMW
using FFTW
k=0
a=5
u=512
β=1
γ=3
N=1024
normalization=:L2
g_fft=gmw(k,a,u,β,γ,N,normalization) # Analytic part of the wavelet of size div(N,2)+1
g_time=irfft(g_fft,N) # real part of the corresponding complex analytic generalized morse wavelet
In order to compute continuous wavelet tranforms, we also provide a
handy function gmw_grid
to initialize a bank of Generalized Morse
Wavelets whose frequency peaks are logarithmically positionned in
frequency.
With the scales
The parameters of the bank are then computed using:
J=8
Q=4
wmin=0 # Minimum frequency peak allowed
wmax=pi # Maximum frequency peak allowed
normalization=:peak # Wavelet frequency peak normalized to 1
g_params=gmw_grid(β,γ,J,Q,wmin,wmax) # Get the parameters of GMW bank, returns params in the form [a,u,β,γ]
g=gmw(0,g_params[1]...,N,normalization) # Get the first wavelet of the bank (g_params starts from the lowest scale)
The resulting bank of wavelets have their frequency peaks JQ
.
Now given our bank of filters we can compute the continuous wavelet
transform of a given signal
conv(x,g) = irfft(rfft(x) .* g,N) # For simplicity here we only compute the real part of the continuous wavelet transform
get_gmw(g_p) = gmw(0,g_p...,N,normalization)
x = randn(N)
x_cwt = [ conv(x,get_gmw(g_p)) for g_p in g_params] # Continous Wavelet transform
Let’s visualize the transform:
using Plots
heatmap(hcat(x_cwt...)')
- documentation, add math definitions of GMWs
- add self-dual filter bank as practical test
- first-order derivative for higher order GMWs
- second-derivatives of GMWs
Lilly, J. M., and S. C. Olhede. 2012. “Generalized Morse Wavelets as a Superfamily of Analytic Wavelets.” IEEE Transactions on Signal Processing 60 (11): 6036–41. https://doi.org/10.1109/tsp.2012.2210890.
Footnotes
-
The reason is that it depends on the localization of the zeros of high order Laguerre polynomials ↩