diff --git a/doc/source/ref/iswt-inverse-stationary-wavelet-transform.rst b/doc/source/ref/iswt-inverse-stationary-wavelet-transform.rst index 5c0836a31..f351a36ab 100644 --- a/doc/source/ref/iswt-inverse-stationary-wavelet-transform.rst +++ b/doc/source/ref/iswt-inverse-stationary-wavelet-transform.rst @@ -15,6 +15,19 @@ Multilevel 1D ``iswt`` .. autofunction:: iswt +With the default ``trim_approx=False``, :func:`swt` returns one +``(cA, cD)`` pair per level. If you stack these pairs into a NumPy array, +restore the pairs before passing the coefficients to :func:`iswt`. The +stacked array can have the same shape as trimmed coefficients from a +multidimensional signal. + +>>> import numpy as np +>>> import pywt +>>> x = np.arange(1., 9.) +>>> stacked = np.asarray(pywt.swt(x, 'haar', level=2)) +>>> pairs = [tuple(level) for level in stacked] +>>> np.testing.assert_allclose(pywt.iswt(pairs, 'haar'), x) + Multilevel 2D ``iswt2`` ~~~~~~~~~~~~~~~~~~~~~~~