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
axesof a multi-dimensional array of sizedims.Note that the Stationary Wavelet operator is an overload of the
pywtimplementation of the stationary wavelet transform. Refer to https://pywavelets.readthedocs.io for a detailed description of the input parameters.- Parameters:
- dims
tuple Number of samples for each dimension
- axes
tuple, optional Axes along which SWT2D is applied
- wavelet
str, optional Name of wavelet type. Use
pywt.wavelist(kind='discrete')for a list of available wavelets.- level
int, optional Number of scaling levels (must be >=1).
- dtype
str, optional Type of elements in input array.
- name
str, optional Name of operator (to be used by
pylops.utils.describe.describe)
- dims
- Attributes:
- pad
pylops.basicoperators.Pad Padding operator used to pad the input signal to the next multiple of
2**levellength.- waveletadj
str Name of the adjoint wavelet type.
- dims
tuple Shape of the array after the adjoint, but before flattening.
For example,
x_reshaped = (Op.H * y.ravel()).reshape(Op.dims).- dimsd
tuple Shape of the array after the forward, but before flattening.
For example,
y_reshaped = (Op * x.ravel()).reshape(Op.dimsd).- shape
tuple Operator shape.
- pad
- Raises:
- ModuleNotFoundError
If
pywtis not installed- ValueError
If
waveletdoes not belong topywt.families- ValueError
If
levelis 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=Trueandnorm=Truesuch 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()