Skip to main content

Module wavelet

Module wavelet 

Source
Expand description

Discrete Wavelet Transform (DWT) primitive: single-level orthonormal filter bank.

This module provides the numerical core of the wavelet milestone: the orthonormal Daubechies filter tables (Haar/db1 through db10, in filters) and one single-level DWT step that perfectly reconstructs its input.

  • Analysis ([single_level_analysis]): a signal is convolved with the analysis low-pass filter (dec_lo) and high-pass filter (dec_hi), then downsampled by 2, yielding an approximation and a detail coefficient vector. Under BoundaryMode::Periodic each has length ceil(n/2); under BoundaryMode::Symmetric each has length n (the signal is mirror-extended to 2n internally).
  • Synthesis ([single_level_synthesis]): the exact inverse of analysis — the approximation and detail are scattered back through the transpose of the orthogonal even-length core and summed to reconstruct the original signal.

Two boundary handling modes (BoundaryMode) are supported, and analysis / synthesis form an exact adjoint pair under each independently:

  • BoundaryMode::Periodic — circular (wrap-around) convolution; the signal is used as-is when even, or extended by one sample when odd.
  • BoundaryMode::Symmetric — half-point boundary reflection; the signal is mirror-extended to length 2n internally.

Both modes route through one orthogonal even-length periodic core whose transpose is its exact inverse, so single-level analysis followed by synthesis reconstructs any signal of any length to ≤1e-10 relative error for every in-scope family and both boundary modes — the property multi-level (Mallat pyramid) construction builds on. The rec_lo/rec_hi (time-reversed) synthesis filters are exposed on [filters::FilterBank] for downstream use and verified by the filter-invariant tests, though this single-level engine reconstructs via the core transpose.

No crate-root or prelude re-exports are added in this phase (deferred to a later phase); the module is reachable only as crate::wavelet::....

Modules§

filters
Orthonormal Daubechies filter-coefficient tables and family → filter-bank lookup.
regression
Wavelet-domain scalar-on-function regression (wcr, WAV-03).

Structs§

WaveletCoeffs
Multi-level orthogonal DWT coefficients (the Mallat pyramid) for one signal.

Enums§

BoundaryMode
Boundary handling for the single-level convolution/downsampling step.
WaveletFamily
A wavelet family: Haar (db1) or Daubechies of a given vanishing-moment order.

Functions§

decompose
Multi-level orthogonal DWT: decompose a signal into a Mallat coefficient pyramid.
decompose_matrix
Multi-level orthogonal DWT over every row (curve) of an [FdMatrix].
max_level
Maximum useful decomposition depth for a signal of length signal_len.
reconstruct
Invert decompose: reconstruct the original signal from a coefficient pyramid.