4.1. Wavelet Information¶
import cr.sparse.wt as wt
4.1.1. Wavelet families¶
wt.families()
['haar', 'db', 'sym', 'coif', 'bior', 'rbio', 'dmey']
4.1.1.1. List of all supported wavelets¶
print(wt.wavelist())
['bior1.1', 'bior1.3', 'bior1.5', 'bior2.2', 'bior2.4', 'bior2.6', 'bior2.8', 'bior3.1', 'bior3.3', 'bior3.5', 'bior3.7', 'bior3.9', 'bior4.4', 'bior5.5', 'bior6.8', 'cmor', 'coif1', 'coif2', 'coif3', 'coif4', 'coif5', 'coif6', 'coif7', 'coif8', 'coif9', 'coif10', 'coif11', 'coif12', 'coif13', 'coif14', 'coif15', 'coif16', 'coif17', 'db1', 'db2', 'db3', 'db4', 'db5', 'db6', 'db7', 'db8', 'db9', 'db10', 'db11', 'db12', 'db13', 'db14', 'db15', 'db16', 'db17', 'db18', 'db19', 'db20', 'db21', 'db22', 'db23', 'db24', 'db25', 'db26', 'db27', 'db28', 'db29', 'db30', 'db31', 'db32', 'db33', 'db34', 'db35', 'db36', 'db37', 'db38', 'dmey', 'haar', 'mexh', 'rbio1.1', 'rbio1.3', 'rbio1.5', 'rbio2.2', 'rbio2.4', 'rbio2.6', 'rbio2.8', 'rbio3.1', 'rbio3.3', 'rbio3.5', 'rbio3.7', 'rbio3.9', 'rbio4.4', 'rbio5.5', 'rbio6.8', 'sym2', 'sym3', 'sym4', 'sym5', 'sym6', 'sym7', 'sym8', 'sym9', 'sym10', 'sym11', 'sym12', 'sym13', 'sym14', 'sym15', 'sym16', 'sym17', 'sym18', 'sym19', 'sym20']
4.1.1.2. List of wavelets for a specific family¶
print(wt.wavelist('sym'))
['sym2', 'sym3', 'sym4', 'sym5', 'sym6', 'sym7', 'sym8', 'sym9', 'sym10', 'sym11', 'sym12', 'sym13', 'sym14', 'sym15', 'sym16', 'sym17', 'sym18', 'sym19', 'sym20']
print(wt.wavelist('bior'))
['bior1.1', 'bior1.3', 'bior1.5', 'bior2.2', 'bior2.4', 'bior2.6', 'bior2.8', 'bior3.1', 'bior3.3', 'bior3.5', 'bior3.7', 'bior3.9', 'bior4.4', 'bior5.5', 'bior6.8']
4.1.2. An orthogonal discrete wavelet¶
wavelet = wt.build_wavelet(f"db2")
print(wavelet)
Wavelet db2
Family name: Daubechies
Short name: db
Filters length: 4
Orthogonal: True
Biorthogonal: True
Symmetry: asymmetric
DWT: True
CWT: False
dec_lo, dec_hi, rec_lo, rec_hi = wavelet.filter_bank
print(dec_lo)
print(dec_hi)
print(rec_lo)
print(rec_hi)
[-0.12940952 0.22414386 0.8365163 0.4829629 ]
[-0.4829629 0.8365163 -0.22414386 -0.12940952]
[ 0.4829629 0.8365163 0.22414386 -0.12940952]
[-0.12940952 -0.22414386 0.8365163 -0.4829629 ]
wavelet.dec_lo
DeviceArray([-0.12940952, 0.22414386, 0.8365163 , 0.4829629 ], dtype=float32)
wavelet.dec_hi
DeviceArray([-0.4829629 , 0.8365163 , -0.22414386, -0.12940952], dtype=float32)
wavelet.rec_lo
DeviceArray([ 0.4829629 , 0.8365163 , 0.22414386, -0.12940952], dtype=float32)
wavelet.rec_hi
DeviceArray([-0.12940952, -0.22414386, 0.8365163 , -0.4829629 ], dtype=float32)
wavelet.orthogonal
True
wavelet.biorthogonal
True
wavelet.compact_support
True
wavelet.name
'db2'
wavelet.family_name
'Daubechies'
wavelet.short_name
'db'
wavelet.vanishing_moments_psi
2
wavelet.vanishing_moments_phi
0
wavelet.symmetry
<SYMMETRY.ASYMMETRIC: 0>
wavelet.inverse_filter_bank
(DeviceArray([-0.12940952, 0.22414386, 0.8365163 , 0.4829629 ], dtype=float32),
DeviceArray([-0.4829629 , 0.8365163 , -0.22414386, -0.12940952], dtype=float32),
DeviceArray([ 0.4829629 , 0.8365163 , 0.22414386, -0.12940952], dtype=float32),
DeviceArray([-0.12940952, -0.22414386, 0.8365163 , -0.4829629 ], dtype=float32))
4.1.3. A biorthogonal discrete wavelet¶
wavelet = wt.build_wavelet("bior2.2")
print(wavelet)
Wavelet bior2.2
Family name: Biorthogonal
Short name: bior
Filters length: 6
Orthogonal: False
Biorthogonal: True
Symmetry: symmetric
DWT: True
CWT: False
wavelet.filter_bank
(DeviceArray([ 0. , -0.17677669, 0.35355338, 1.0606601 ,
0.35355338, -0.17677669], dtype=float32),
DeviceArray([-0. , 0.35355338, -0.70710677, 0.35355338,
-0. , 0. ], dtype=float32),
DeviceArray([0. , 0.35355338, 0.70710677, 0.35355338, 0. ,
0. ], dtype=float32),
DeviceArray([ 0. , 0.17677669, 0.35355338, -1.0606601 ,
0.35355338, 0.17677669], dtype=float32))
wavelet = wt.build_wavelet(f"rbio2.4")
print(wavelet)
Wavelet rbio2.4
Family name: Reverse biorthogonal
Short name: rbio
Filters length: 10
Orthogonal: False
Biorthogonal: True
Symmetry: symmetric
DWT: True
CWT: False