Inverse Stationary Wavelet Transform

Inverse stationary wavelet transforms are provided for 1D and 2D data.

Note: These inverse transforms are not yet optimized for speed and only support a subset of the forward transform features. Specifically, there is not yet a general n-dimensional inverse transform and these routines do not yet have general axis/axes support.

Multilevel 1D iswt

pywt.iswt(coeffs, wavelet)

Multilevel 1D inverse discrete stationary wavelet transform.

Parameters:

coeffs : array_like

Coefficients list of tuples:

[(cAn, cDn), ..., (cA2, cD2), (cA1, cD1)]

where cA is approximation, cD is details. Index 1 corresponds to start_level from pywt.swt.

wavelet : Wavelet object or name string

Wavelet to use

Returns:

1D array of reconstructed data.

Examples

>>> import pywt
>>> coeffs = pywt.swt([1,2,3,4,5,6,7,8], 'db2', level=2)
>>> pywt.iswt(coeffs, 'db2')
array([ 1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.])

Multilevel 2D iswt2

pywt.iswt2(coeffs, wavelet)

Multilevel 2D inverse discrete stationary wavelet transform.

Parameters:

coeffs : list

Approximation and details coefficients:

[
    (cA_1,
        (cH_1, cV_1, cD_1)
    ),
    (cA_2,
        (cH_2, cV_2, cD_2)
    ),
    ...,
    (cA_n
        (cH_n, cV_n, cD_n)
    )
]

where cA is approximation, cH is horizontal details, cV is vertical details, cD is diagonal details and n is the number of levels. Index 1 corresponds to start_level from pywt.swt2.

wavelet : Wavelet object or name string

Wavelet to use

Returns:

2D array of reconstructed data.

Examples

>>> import pywt
>>> coeffs = pywt.swt2([[1,2,3,4],[5,6,7,8],
...                     [9,10,11,12],[13,14,15,16]],
...                    'db1', level=2)
>>> pywt.iswt2(coeffs, 'db1')
array([[  1.,   2.,   3.,   4.],
       [  5.,   6.,   7.,   8.],
       [  9.,  10.,  11.,  12.],
       [ 13.,  14.,  15.,  16.]])