pylops.signalprocessing.SWT2D

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

Two dimensional Stationary Wavelet operator.

Apply 2D-Stationary Wavelet Transform along two axes 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:
dimstuple

Number of samples for each dimension

axestuple, optional

Axes along which SWT2D 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 2-dimensional multilevel Stationary Wavelet Transform (SWT2) in forward mode and the 2-dimensional multilevel Inverse Stationary Wavelet Transform (ISWT2) in adjoint mode.

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 = (3 * level + 1, *dims) in the order [cA_n, cH_n, cV_n, cD_n, ..., cH_1, cV_1, cD_1].

The transform is computed with trim_approx=True and norm=True such that the adjoint is exactly given by the ISWT2 (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[, axes, 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()

Examples using pylops.signalprocessing.SWT2D

Wavelet transform

Wavelet transform

05. Image deblurring

05. Image deblurring