why pywavelet Wavelet() does not accept all built-in wavelets?
Asked Answered
B

1

5

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.

Blas answered 16/12, 2016 at 17:0 Comment(0)
R
7

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.

Rhamnaceous answered 20/1, 2017 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.