Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 576
scrx2 Avatar asked Dec 16 '16 17:12

scrx2


1 Answers

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.

like image 62
Michalina Pacholska Avatar answered Oct 27 '22 16:10

Michalina Pacholska