Stationary Wavelet Transform (SWT)#
- ptwt.swt(data: Tensor, wavelet: Wavelet | str, level: int | None = None, *, axis: int | Sequence[int] | None = None) list[Tensor][source]#
Compute a multilevel 1d stationary wavelet transform.
This fuction is equivalent to pywt’s
pywt.swt()with trim_approx=True and norm=False.- Parameters:
data (torch.Tensor) – The input time series to transform. By default, the last axis is transformed.
wavelet (Wavelet or str) – A pywt wavelet compatible object or the name of a pywt wavelet. Refer to the output from
pywt.wavelist(kind='discrete')for possible choices.level (int, optional) – The maximum decomposition level. If None, the level is computed based on the signal shape. Defaults to None.
axis – Compute the transform over this axis. If none, the last is used.
- Returns:
Same as
wavedec(). Equivalent topywt.swt()with trim_approx=True.
- ptwt.iswt(coeffs: Sequence[Tensor], wavelet: Wavelet | str, *, axis: int | Sequence[int] | None = None) Tensor[source]#
Invert a 1d stationary wavelet transform.
- Parameters:
coeffs – The wavelet coefficient sequence produced by the forward transform
swt(). Seeptwt.constants.WaveletCoeff1d.wavelet (Wavelet or str) – A pywt wavelet compatible object or the name of a pywt wavelet, as used in the forward transform.
axis – Compute the transform over this axis. If none, the last is used.
- Returns:
A reconstruction of the original
swt()input.