pylops.signalprocessing.SWTND¶
- class pylops.signalprocessing.SWTND(dims, axes=(-3, -2, -1), wavelet='haar', level=1, dtype='float64', name='S')[source]¶
N-dimensional Stationary Wavelet operator.
Apply ND-Stationary Wavelet transform along N
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.Defaults to a 3D stationary wavelet transform along the last three dimensions of the input array.
- Parameters:
- dims
tuple Number of samples for each dimension
- axes
tuple, optional Axes along which SWTND 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.
- keys
list Keys of the detail coefficients at each level (in the order they are stacked in the output array).
- 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 N-dimensional multilevel Stationary Wavelet Transform (SWTN) in forward mode and the N-dimensional multilevel Inverse Stationary Wavelet Transform (ISWTN) 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 = ((2**len(axes) - 1) * level + 1, *dims). The first element is the approximation at the final level, followed by the detail coefficients of each level (from the coarsest to the finest) in the order given bykeys.The transform is computed with
trim_approx=Trueandnorm=Truesuch that the adjoint is exactly given by the ISWTN (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()