Inverse Stationary Wavelet Transform

Inverse stationary wavelet transforms are provided.

Note: These inverse transforms are not yet optimized for speed. Only, the n-dimensional inverse transform currently has 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, or 2-tuple of wavelets

Wavelet to use. This can also be a 2-tuple of wavelets to apply per axis.

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.]])

Multilevel n-dimensional iswtn

pywt.iswtn(coeffs, wavelet, axes=None)

Multilevel nD inverse discrete stationary wavelet transform.

Parameters:

coeffs : list

[{coeffs_level_n}, ..., {coeffs_level_1}]: list of dict

wavelet : Wavelet object or name string, or tuple of wavelets

Wavelet to use. This can also be a tuple of wavelets to apply per axis in axes.

axes : sequence of ints, optional

Axes over which to compute the inverse SWT. Axes may not be repeated. The default is None, which means transform all axes (axes = range(data.ndim)).

Returns:

nD array of reconstructed data.

Examples

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