pylops.signalprocessing.SWT

class pylops.signalprocessing.SWT(dims, axis=-1, wavelet='haar', level=1, dtype='float64', name='S')[source]

One dimensional Stationary Wavelet operator.

Apply 1D-Stationary Wavelet Transform along an axis of a multi-dimensional array of size dims.

Note that the Stationary Wavelet operator is an overload of the pywt implementation of the stationary wavelet transform. Refer to https://pywavelets.readthedocs.io for a detailed description of the input parameters.

Parameters:
dimsint or tuple

Number of samples for each dimension

axisint, optional

Axis along which SWT is applied

waveletstr, optional

Name of wavelet type. Use pywt.wavelist(kind='discrete') for a list of available wavelets.

levelint, optional

Number of scaling levels (must be >=1).

dtypestr, optional

Type of elements in input array.

namestr, optional

Name of operator (to be used by pylops.utils.describe.describe)

Attributes:
padpylops.basicoperators.Pad

Padding operator used to pad the input signal to the next multiple of 2**level length.

waveletadjstr

Name of the adjoint wavelet type.

dimstuple

Shape of the array after the adjoint, but before flattening.

For example, x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).

dimsdtuple

Shape of the array after the forward, but before flattening.

For example, y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).

shapetuple

Operator shape.

Raises:
ModuleNotFoundError

If pywt is not installed

ValueError

If wavelet does not belong to pywt.families

ValueError

If level is smaller than 1

Notes

The Stationary Wavelet operator applies the multilevel Stationary Wavelet Transform (SWT) in forward mode and the multilevel Inverse Stationary Wavelet Transform (ISWT) in adjoint mode.

Contrarily to the Discrete Wavelet Transform (see pylops.signalprocessing.DWT), the SWT does not decimate the coefficients at each level; as a result, the transform is shift-invariant but redundant. All coefficients have the same size of the (padded) input signal and are stacked along a new leading axis of the output, i.e., dimsd = (level + 1, *dims) in the order [cA_n, cD_n, ..., cD_2, cD_1].

The transform is computed with trim_approx=True and norm=True such that the adjoint is exactly given by the ISWT (with the dual wavelet in the case of biorthogonal wavelets). For orthogonal wavelets, the operator is also a tight frame, i.e., \(\mathbf{S}^H \mathbf{S} = \mathbf{I}\).

Methods

__init__(dims[, axis, wavelet, level, ...])

adjoint()

apply_columns(cols)

Apply subset of columns of operator

cond([uselobpcg, backend])

Condition number of linear operator.

conj()

Complex conjugate operator

div(y[, niter, densesolver])

Solve the linear problem or divide by a scalar

dot(x)

Dot-product

eigs([neigs, symmetric, niter, uselobpcg, ...])

N-most significant eigenvalues of a linear operator.

matmat(X[, pool])

Matrix-matrix multiplication.

matvec(x)

Matrix-vector multiplication.

reset_count()

Reset counters

rmatmat(X[, pool])

Matrix-matrix multiplication.

rmatvec(x)

Adjoint matrix-vector multiplication.

todense([backend])

Return dense matrix.

toimag([forw, adj])

Imag operator

toreal([forw, adj])

Real operator

tosparse()

Return sparse matrix.

trace([neval, method, backend])

Trace of linear operator.

transpose()