Easy to use Discrete Wavelet Transform library, no need to worry about padding, and a variety of wavelets are available.
``` rust
use ndarray::{Array1, Array2, Axis}; use omniwave::{completelydecompose2d, completelyreconstruct_2d, wavelet};
let wave = wavelet::BIOR31;
let raw = Array2::
let mut signal2d = raw.clone();
let mut buffer = Array1::
completelydecompose2d(signal2d.viewmut(), buffer.viewmut(), wave); completelyreconstruct2d(signal2d.viewmut(), buffer.viewmut(), wave);
raw.intoiter() .zip(signal2d) .foreach(|(a, b)| assertabsdiffeq!(a, b, epsilon = 0.0001)); ```
The data need to transform. The length should be even. Failure to meet the length requirement may not result a panic, but the behavior of functions will be undefined.
The left half of the input will be considered as Approx, while the right half will be considered as Detail.
Our filling method named periodic
(in PyWavelets),
ppd
(in Matlab) or wrap
(in numpy.pad).
plaintext
[ A.B.C.D.E.F.G.H ] a.b.c.d ...
↑^^^^^^^^^^^^^^ ↑^^^^^^
Original signal Padding: automatically fill & detach!
The number of wavelet coefficients.