pub struct WaveletTransform;Expand description
Haar wavelet multi-level decomposition and reconstruction.
The Haar wavelet is the simplest orthogonal wavelet. The transform iteratively applies the single-level forward transform to the approximation coefficients, producing a hierarchy of detail sub-bands.
Implementations§
Source§impl WaveletTransform
impl WaveletTransform
Sourcepub fn haar_forward(signal: &[f64]) -> (Vec<f64>, Vec<f64>)
pub fn haar_forward(signal: &[f64]) -> (Vec<f64>, Vec<f64>)
Forward single-level Haar transform.
Returns (approx, detail) each of length signal.len() / 2.
Sourcepub fn haar_inverse(approx: &[f64], detail: &[f64]) -> Vec<f64>
pub fn haar_inverse(approx: &[f64], detail: &[f64]) -> Vec<f64>
Inverse single-level Haar transform.
Reconstructs a signal of length 2 * approx.len().
Sourcepub fn decompose(signal: &[f64], levels: usize) -> Vec<Vec<f64>>
pub fn decompose(signal: &[f64], levels: usize) -> Vec<Vec<f64>>
Multi-level Haar decomposition.
Returns a Vec of length levels + 1:
- index 0: final (coarsest) approximation
- indices 1..=levels: detail coefficients (finest at index 1)
Sourcepub fn reconstruct(coeffs: &[Vec<f64>]) -> Vec<f64>
pub fn reconstruct(coeffs: &[Vec<f64>]) -> Vec<f64>
Multi-level Haar reconstruction from decomposed coefficients.
Input coeffs must be in the same format as returned by WaveletTransform::decompose.
Auto Trait Implementations§
impl Freeze for WaveletTransform
impl RefUnwindSafe for WaveletTransform
impl Send for WaveletTransform
impl Sync for WaveletTransform
impl Unpin for WaveletTransform
impl UnsafeUnpin for WaveletTransform
impl UnwindSafe for WaveletTransform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.