-
-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex morlet wavelet (cmor) bugged ? #307
Comments
Can you provide a minimal Python code to reproduce this? |
|
I agree that this does not look right. looking into it a bit more, I am not sure why |
Okay, I think that maybe it is just that the frequency parameters need to be set to a different value than the default. It seems that w = pywt.ContinuousWavelet('cmor')
w.bandwidth_frequency=1.5
w.center_frequency=1 then the transform
|
I don't think there is a bug in the transform as I see the same kind of spectrum when comparing to Matlab's I think we should modify the PyWavelets Certainly we could also use more documentation and examples of the usage conventions for the CWT routines. |
Thanks !
to
is just a factor of 2, so I would expect the same results with a factor of 2 on the scale. In fact that is what we see on the plots : largest coefficients are at scales ~25 with default values and at ~50 otherwise. |
I am not a user of the continuous transforms and have not looked into them in detail, so I do not know why this is offhand. I can confirm that for the same sort of pattern appears in the Matlab (R2012a) output, so this behaviour is not unique to PyWavelets. Matlab result showing the magnitude of the coefficients is in the bottom panel below: |
I found the cause of the error. It can be easily fixed.
int_psi has a size of 1024. Thus for higher scales, np.max(j) >= np.size(int_psi) is true. To fix this, precision has to be increased until np.max(j) >= np.size(int_psi) i sfalse. Should i make a pull request, in which i try to fix this? Should precision increased until it fits, or should set precision as function parameter? |
|
@holgern: a PR would be great! I think accuracy is more important than speed, so doing some sort of check by default is probably best. One option would be to provide a function parameter |
It seems nice to me! |
We can add the mode parameter to cwt. |
When using cwt on a simple sinusoid, cmor gives a weird result :
While non complex morlet or whatever other complex ones such as cgaus gives somethings that seems more correct :
The text was updated successfully, but these errors were encountered: