pub struct WaveletPacket {
pub coefficients: Vec<Vec<f64>>,
pub levels: usize,
}Expand description
Wavelet packet decomposition tree.
Stores all sub-band coefficients produced by full wavelet packet decomposition up to a specified number of levels.
Fields§
§coefficients: Vec<Vec<f64>>All node coefficient vectors in the packet tree (breadth-first order).
levels: usizeNumber of decomposition levels.
Implementations§
Source§impl WaveletPacket
impl WaveletPacket
Sourcepub fn new_haar(signal: &[f64], levels: usize) -> Self
pub fn new_haar(signal: &[f64], levels: usize) -> Self
Build a wavelet packet decomposition using the Haar transform.
After construction, coefficients contains 2^levels leaf nodes.
Sourcepub fn new(signal: &[f64], levels: usize, family: WaveletFamily) -> Self
pub fn new(signal: &[f64], levels: usize, family: WaveletFamily) -> Self
Build a wavelet packet decomposition using a specified wavelet family.
Uses the given WaveletFamily for all decomposition steps.
Sourcepub fn best_basis(&self) -> Vec<usize>
pub fn best_basis(&self) -> Vec<usize>
Return the index of the leaf node with highest energy (best basis heuristic).
Sourcepub fn best_basis_entropy(&self) -> Vec<usize>
pub fn best_basis_entropy(&self) -> Vec<usize>
Select the best basis using minimum Shannon entropy criterion.
Returns the indices of the leaf nodes forming the minimum-entropy basis. This implements a greedy search over the leaf nodes of the full packet tree.
Sourcepub fn energy_distribution(&self) -> Vec<f64>
pub fn energy_distribution(&self) -> Vec<f64>
Compute the energy (sum of squares) in each leaf node.
Sourcepub fn entropy_distribution(&self) -> Vec<f64>
pub fn entropy_distribution(&self) -> Vec<f64>
Compute the Shannon entropy of each leaf node’s coefficients.
Sourcepub fn total_energy(&self) -> f64
pub fn total_energy(&self) -> f64
Return the total energy across all leaf nodes.
Trait Implementations§
Source§impl Clone for WaveletPacket
impl Clone for WaveletPacket
Source§fn clone(&self) -> WaveletPacket
fn clone(&self) -> WaveletPacket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WaveletPacket
impl RefUnwindSafe for WaveletPacket
impl Send for WaveletPacket
impl Sync for WaveletPacket
impl Unpin for WaveletPacket
impl UnsafeUnpin for WaveletPacket
impl UnwindSafe for WaveletPacket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.