bartorch.fwt#
- bartorch.fwt()#
Forward multi-level discrete wavelet transform along
axes.BART’s
wavelet, orcdf97for"cdf97".- Parameters:
input (torch.Tensor) – Array to transform; every transformed axis has at least 16 samples.
axes (int or tuple of int) – Axes to transform, as indices into
input.shape.wavelet ({"haar", "dau2", "cdf44", "cdf97"}, default='dau2') – Haar, Daubechies with two vanishing moments, or CDF 4/4 and 9/7 biorthogonal; see Notes.
- Returns:
For
"cdf97", the shape ofinput. Otherwise the coefficients of all transformed axes are flattened into the last ofaxes, and the other transformed axes have size one.- Return type:
torch.Tensor
- Raises:
ValueError – If
waveletis unknown,axesrepeat or are out of range, or a transformed axis is shorter than 16.
Notes
"haar","dau2"and"cdf44"are, along one axis, PyWavelets’wavedecwith"haar","db2"and"bior4.4"inmode="symmetric", concatenated coarse first. Each level keeps(n + taps - 1) // 2coefficients per band, so there are more coefficients than samples unless the filter has two taps and every level’s length is even; levels continue while that half-length is at least 16."cdf97"is CDF 9/7 by lifting, in place, coarse band first, with levels continuing while every transformed axis is longer than 32; one level of an even length is PyWavelets’"bior4.4"inmode="periodization"with the detail band negated.