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
axisof 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
intortuple Number of samples for each dimension
- axis
int, optional Axis along which SWT 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 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=Trueandnorm=Truesuch 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()