pywt
pywt copied to clipboard
allow calling CWT with discrete wavelets?
A user on the mailing list asked why Haar and Daubechies wavelets are not allowed for cwt. In Matlab R2012b, the cwt does allow using 'haar', 'db4', etc as the wavelet name. However, in R2016b Matlab apparently replaced their cwt with a new implementation that operates differently. Apparently the old cwt is still available as well.
I can verify that our existing code does actually already give the same coefficients as R2012b Matlab for the Daubechies wavelets if we change the following line:
https://github.com/PyWavelets/pywt/blob/bf7be1f4293b44a85a34dbce24b4f4573137775d/pywt/_cwt.py#L72
to
if hasattr(wavelet, 'complex_cwt') and wavelet.complex_cwt
so that an AttributeError is avoided.
I am not an expert in CWT analysis, so I don't know if there are strong use cases for these wavelets in a CWT analysis in practice.
One of the cases where CWT is useful is when derivative of a noisy signal is to be calculated. In this case, 'db' and 'sym' wavelets are useful depending on their vanishing moments. So modifying CWT to support these two popular wavelet families would broaden the applications of CWT in Python.
Facing the same issue that I want to use Daubechies wavelets for cwt. Are there any concerns about the theory behind it, or why hasn't this functionality been implemented yet? I've only done a cursory reading of wavelet transform theory so far, but as far as I understand the difference between dwt and cwt should really only be in the way the scaling and shifting parameters are discretized.
Has there been any update to supporting Daubechies wavelet (e.g. db4) with CWT?