pywt icon indicating copy to clipboard operation
pywt copied to clipboard

allow calling CWT with discrete wavelets?

Open grlee77 opened this issue 7 years ago • 7 comments

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.

grlee77 avatar Apr 20 '18 19:04 grlee77

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.

arian-nik avatar Jul 29 '20 22:07 arian-nik

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.

GraLu1992 avatar Mar 26 '21 10:03 GraLu1992

Has there been any update to supporting Daubechies wavelet (e.g. db4) with CWT?

eqsols avatar Jun 15 '22 16:06 eqsols