pub struct WaveletTransform { /* private fields */ }Expand description
Wavelet Transform extractor
Performs discrete wavelet transform with configurable wavelet types and decomposition levels. Extracts energy-based features from the resulting coefficients at each level.
Implementations§
Source§impl WaveletTransform
impl WaveletTransform
Sourcepub fn wavelet(self, wavelet: String) -> Self
pub fn wavelet(self, wavelet: String) -> Self
Set the wavelet type
Supported wavelets include:
- “haar”: Haar wavelet (simplest)
- “db4”: Daubechies 4-tap wavelet
- “db8”: Daubechies 8-tap wavelet
- Additional wavelets can be implemented as needed
Sourcepub fn wavelet_type(self, wavelet_type: String) -> Self
pub fn wavelet_type(self, wavelet_type: String) -> Self
Set the wavelet type (alternative method name)
Sourcepub fn levels(self, levels: usize) -> Self
pub fn levels(self, levels: usize) -> Self
Set the number of decomposition levels
More levels provide better frequency resolution but require longer signals. The maximum useful levels is approximately log2(signal_length).
Sourcepub fn mode(self, mode: String) -> Self
pub fn mode(self, mode: String) -> Self
Set the boundary mode for decomposition
Supported modes:
- “symmetric”: Symmetric boundary extension
- “zero”: Zero padding
- “periodic”: Periodic boundary conditions
Sourcepub fn extract_features(
&self,
signal: &ArrayView1<'_, f64>,
) -> SklResult<Array1<f64>>
pub fn extract_features( &self, signal: &ArrayView1<'_, f64>, ) -> SklResult<Array1<f64>>
Extract wavelet-based features from signal
Returns energy features from each decomposition level:
- Detail energies at each level (high-frequency components)
- Final approximation energy (low-frequency component)
Sourcepub fn decompose(
&self,
signal: &ArrayView1<'_, f64>,
) -> SklResult<Vec<(Array1<f64>, Array1<f64>)>>
pub fn decompose( &self, signal: &ArrayView1<'_, f64>, ) -> SklResult<Vec<(Array1<f64>, Array1<f64>)>>
Perform complete wavelet decomposition
Returns the full decomposition tree with coefficients at each level. Useful for reconstruction or more detailed analysis.
Sourcepub fn approximation_coefficients(
&self,
signal: &ArrayView1<'_, f64>,
) -> SklResult<Array1<f64>>
pub fn approximation_coefficients( &self, signal: &ArrayView1<'_, f64>, ) -> SklResult<Array1<f64>>
Get approximation coefficients at the final level
Sourcepub fn detail_coefficients_at_level(
&self,
signal: &ArrayView1<'_, f64>,
target_level: usize,
) -> SklResult<Array1<f64>>
pub fn detail_coefficients_at_level( &self, signal: &ArrayView1<'_, f64>, target_level: usize, ) -> SklResult<Array1<f64>>
Get detail coefficients at a specific level
Sourcepub fn energy_distribution(
&self,
signal: &ArrayView1<'_, f64>,
) -> SklResult<Array1<f64>>
pub fn energy_distribution( &self, signal: &ArrayView1<'_, f64>, ) -> SklResult<Array1<f64>>
Compute relative energy distribution across levels
Sourcepub fn wavelet_entropy(&self, signal: &ArrayView1<'_, f64>) -> SklResult<f64>
pub fn wavelet_entropy(&self, signal: &ArrayView1<'_, f64>) -> SklResult<f64>
Compute entropy of wavelet coefficients
Trait Implementations§
Source§impl Clone for WaveletTransform
impl Clone for WaveletTransform
Source§impl Debug for WaveletTransform
impl Debug for WaveletTransform
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more