The idwt() function reconstructs data from the given coefficients by performing single level Inverse Discrete Wavelet Transform.
Parameters: |
|
---|
Example:
>>> import pywt
>>> (cA, cD) = pywt.dwt([1,2,3,4,5,6], 'db2', 'sp1')
>>> print pywt.idwt(cA, cD, 'db2', 'sp1')
[ 1. 2. 3. 4. 5. 6.]
One of the neat features of idwt() is that one of the cA and cD arguments can be set to None. In that situation the reconstruction will be performed using only the other one. Mathematically speaking, this is equivalent to passing a zero-filled array as one of the arguments.
Example:
>>> import pywt
>>> (cA, cD) = pywt.dwt([1,2,3,4,5,6], 'db2', 'sp1')
>>> A = pywt.idwt(cA, None, 'db2', 'sp1')
>>> D = pywt.idwt(None, cD, 'db2', 'sp1')
>>> print A + D
[ 1. 2. 3. 4. 5. 6.]
Performs multilevel reconstruction of signal from the given list of coefficients.
Parameters: |
|
---|
Example:
>>> import pywt
>>> coeffs = pywt.wavedec([1,2,3,4,5,6,7,8], 'db2', level=2)
>>> print pywt.waverec(coeffs, 'db2')
[ 1. 2. 3. 4. 5. 6. 7. 8.]
Direct reconstruction from coefficients.
Parameters: |
|
---|
Example:
>>> import pywt
>>> data = [1,2,3,4,5,6]
>>> (cA, cD) = pywt.dwt(data, 'db2', 'sp1')
>>> print pywt.upcoef('a', cA, 'db2') + pywt.upcoef('d', cD, 'db2')
[-0.25 -0.4330127 1. 2. 3. 4. 5.
6. 1.78589838 -1.03108891]
>>> n = len(data)
>>> print pywt.upcoef('a',cA,'db2',take=n) + pywt.upcoef('d',cD,'db2',take=n)
[ 1. 2. 3. 4. 5. 6.]