omni-wave

Easy to use Discrete Wavelet Transform library, no need to worry about padding, and a variety of wavelets are available.

``` rust

use approx::assertabsdiff_eq;

use ndarray::{Array1, Array2, Axis}; use omniwave::{completelydecompose2d, completelyreconstruct_2d, wavelet};

let wave = wavelet::BIOR31; let raw = Array2::::fromshapevec((8, 8), vec![0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,99.,99., 0., 0., 0., 0., 0.,99.,99.,99.,99., 0., 0., 0.,99.,99.,99.,99.,99.,99., 0., 0.,99.,99.,99.,99.,99.,99., 0., 0., 0.,99.,99.,99.,99., 0., 0., 0., 0., 0.,99.,99., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,]).unwrap();

let mut signal2d = raw.clone(); let mut buffer = Array1::::zeros(signal2d.lenof(Axis(0)) + wave.windowsize() - 2);

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)); ```

Knowledges

Signal

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.

Padding

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!

Window

The number of wavelet coefficients.