pub struct StreamingMODWT<T: SignalType> {
pub max_levels: usize,
/* private fields */
}Expand description
Streaming MODWT implementation for multi-level real-time processing
Uses an incremental O(L × filter_len) algorithm with SIMD acceleration, computing only the new coefficients when a tick arrives rather than recomputing the entire window.
§Performance
For a DB4 wavelet (L=8) with 4 levels:
- Incremental: O(4 × 8) = O(32) operations per tick
- Uses AVX2 SIMD when available for the convolution
- Zero-allocation in the hot path
Target latency: ~0.5-1.0 μs per tick
Fields§
§max_levels: usizeMaximum decomposition levels
Implementations§
Source§impl<T: SignalType + 'static> StreamingMODWT<T>
impl<T: SignalType + 'static> StreamingMODWT<T>
Sourcepub fn new(
wavelet: Box<dyn Wavelet>,
window: WindowConfig,
max_levels: usize,
) -> Self
pub fn new( wavelet: Box<dyn Wavelet>, window: WindowConfig, max_levels: usize, ) -> Self
Create new streaming MODWT with incremental algorithm
§Arguments
wavelet- The wavelet to use for decompositionwindow- Window configuration (history_size derived from window.size)max_levels- Number of decomposition levels
Sourcepub fn update(&mut self, tick: T) -> Result<Option<StreamingMODWTResult<T>>>
pub fn update(&mut self, tick: T) -> Result<Option<StreamingMODWTResult<T>>>
Process a single tick through the MODWT pyramid
Uses the incremental O(L × filter_len) algorithm with SIMD acceleration. Zero-allocation in the hot path.
§Returns
Returns Some(result) with the latest coefficients if ready,
None if still warming up (insufficient samples for all levels).
Sourcepub fn wavelet_history(&self, level: usize) -> Option<&VecDeque<T>>
pub fn wavelet_history(&self, level: usize) -> Option<&VecDeque<T>>
Get the rolling history of wavelet coefficients for a specific level
Useful for computing variance, volatility, or other statistics over recent coefficients without batch recomputation.
Sourcepub fn scaling_history(&self) -> &VecDeque<T>
pub fn scaling_history(&self) -> &VecDeque<T>
Get the rolling history of scaling coefficients
Sourcepub fn latest_wavelets(&self) -> Vec<T>
pub fn latest_wavelets(&self) -> Vec<T>
Get the latest wavelet coefficients (one per level)
Sourcepub fn latest_scaling(&self) -> T
pub fn latest_scaling(&self) -> T
Get the latest scaling coefficient
Sourcepub fn tick_count(&self) -> u64
pub fn tick_count(&self) -> u64
Get total ticks processed
Auto Trait Implementations§
impl<T> Freeze for StreamingMODWT<T>
impl<T> !RefUnwindSafe for StreamingMODWT<T>
impl<T> Send for StreamingMODWT<T>
impl<T> Sync for StreamingMODWT<T>
impl<T> Unpin for StreamingMODWT<T>where
T: Unpin,
impl<T> !UnwindSafe for StreamingMODWT<T>
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> 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