Single level Inverse Discrete Wavelet Transform.
Parameters: | cA : array_like or None
cD : array_like or None
wavelet : Wavelet object or name
mode : str, optional (default: ‘symmetric’)
axis: int, optional :
|
---|---|
Returns: | rec: array_like :
|
Example:
>>> import pywt
>>> (cA, cD) = pywt.dwt([1,2,3,4,5,6], 'db2', 'smooth')
>>> print pywt.idwt(cA, cD, 'db2', 'smooth')
array([ 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', 'smooth')
>>> A = pywt.idwt(cA, None, 'db2', 'smooth')
>>> D = pywt.idwt(None, cD, 'db2', 'smooth')
>>> print A + D
array([ 1., 2., 3., 4., 5., 6.])
Multilevel 1D Inverse Discrete Wavelet Transform.
Parameters: | coeffs : array_like
wavelet : Wavelet object or name string
mode : str, optional
|
---|
Examples
>>> import pywt
>>> coeffs = pywt.wavedec([1,2,3,4,5,6,7,8], 'db1', level=2)
>>> pywt.waverec(coeffs, 'db1')
array([ 1., 2., 3., 4., 5., 6., 7., 8.])
Direct reconstruction from coefficients.
Parameters: | part : str
coeffs : array_like
wavelet : Wavelet object or name
level : int, optional
take : int, optional
|
---|---|
Returns: | rec : ndarray
|
See also
Examples
>>> import pywt
>>> data = [1,2,3,4,5,6]
>>> (cA, cD) = pywt.dwt(data, 'db2', 'smooth')
>>> pywt.upcoef('a', cA, 'db2') + pywt.upcoef('d', cD, 'db2')
array([-0.25 , -0.4330127 , 1. , 2. , 3. ,
4. , 5. , 6. , 1.78589838, -1.03108891])
>>> n = len(data)
>>> pywt.upcoef('a', cA, 'db2', take=n) + pywt.upcoef('d', cD, 'db2', take=n)
array([ 1., 2., 3., 4., 5., 6.])