Any idea why pywt.Wavelet()
gives an error for certain built-in wavelets?
Is there a fundamental (mathematical) reason?
pywt.Wavelet(i)
exits with
ValueError: Invalid wavelet name.
for i=
'cgau1', 'cgau2', 'cgau3', 'cgau4', 'cgau5', 'cgau6', 'cgau7'
'cgau8', 'cmor', 'fbsp', 'gaus1', 'gaus2', 'gaus3', 'gaus4', 'gaus5'
'gaus6', 'gaus7', 'gaus8', 'mexh', 'morl'
From the doc of pywavelet
class pywt.Wavelet(name[, filter_bank=None])
Describes properties of a wavelet identified by the specified wavelet name. In order to use a built-in wavelet the name parameter must be a valid wavelet name from the pywt.wavelist() list.
Those wavelets are continuous, so you need to create them by:
pywt.ContinuousWavelet('mexh')
and use continuous wavelet transform, which takes discrete data (array) as input:
pywt.cwt(data, scales, wavelet)
I don't know what is the real reason of this distinction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With