Closed cyschneck closed 2 months ago
Great question @cyschneck. Unfortunately I really don't know the answer. I think it's been like this since it was first written (before 2010).
Thanks, I'll have to keep digging
For future reference, based on some research I believe this originated from the same equation used for the Complex Morlet in Matlab from Computational Signal Processing with Wavelets
Teolis, Anthony. Computational Signal Processing with Wavelets. Boston, MA: Birkhäuser Boston, 1998. https://doi.org/10.1007/978-1-4612-4142-3.
On page 65-66, the Morlet wavelet is referred to as:
Specifically, the (mother) Morlet wavelet is defined as:
Which seems to match PyWavelets:
I'll need to keep looking to see why it is defined differently in this one reference location compared to the more common definition I see elsewhere since both the Teolis book and the Torrence/Compo paper came out in the same year, but thanks!
While the amplitude is different, the closest match I've found is a bandwidth of sqrt(pi) and a center frequency of 6/2*pi (so it is close to the default Morlet of 6). The amplitude difference is the result of some constant that is missing that Torrence/Compo is using. I'll see if I can find where they derive their equation with the $\pi$^(-1/4) from
So, for future reference, using B=sqrt(pi)
and C=6/2pi
produces the graph above, with the same intersects along 0.0, but a smaller amplitude.
To generate a matching wavelet, B needs to somehow be both 2
and sqrt(pi
) to match the Torrence and Compo formula:
To match, setting B=2
and multiplying the entire wavelet by a constant value sqrt(2)*pi^(1/4)
Thank you for all the details @cyschneck! I am sure this will help the next person who looks into this definition.
I am working on replicating behavior from Torrence and Compo in PyWavelets using the Complex Morlet function. The Morlet function in the Torrence and Compo is not a Morlet function, but a Complex Morlet function, so it should be similar to the
cmor
function in PyWavelets.Previously, a![Untitled](https://github.com/PyWavelets/pywt/assets/22159116/3f5caac1-3564-441f-a479-da82b89f58cf)
cmor1.5-1.0
was recommended. While this is close, the wavelets do not match.I think essentially the issue that I've encountered is that the definition of the Complex Morlet function in Torrence and Compo (Table 1) is:![image](https://github.com/PyWavelets/pywt/assets/22159116/375053ed-d15f-481b-9a70-a5eaf6a9cc36)
Whereas the PyWavelets Complex Morlet Wavelet is defined as:![image](https://github.com/PyWavelets/pywt/assets/22159116/f42a0cc8-5db3-414e-bad6-a9b0188aa073)
While this seems to match the equation for a Complex Morlet Wavelet that is in Matlab, the equation does not match the Torrence/Compo paper that is referenced at the top of the CWT page.
There does not doesn't appear to be any definitions of bandwidth and center frequency that can be used in
cmor
that will make the behaviors match since Torrence and Compo is using $\pi$^ (-0.25) and PyWavelets is using $\pi$ ^ (-0.5)The wiki definition and SciPy's Morlet function (before it was deprecated) also appear to match the equation described in Torrence/Compo. Where does PyWavelet's definition of a Complex Morlet come from?