pub struct WindowProcessor { /* private fields */ }
Expand description
Provides fixed size windows extracted from a stream of arbitrarily sized input buffers. Supports downsampling and partially overlapping windows. Useful for implementing algorithms operating on consecutive windows of the same size.
Implementations§
Source§impl WindowProcessor
impl WindowProcessor
Sourcepub fn new(
downsampling: usize,
downsampled_window_size: usize,
downsampled_hop_size: usize,
) -> Self
pub fn new( downsampling: usize, downsampled_window_size: usize, downsampled_hop_size: usize, ) -> Self
Creates a new WindowProcessor
instance.
§Arguments
downsampling
- The downsampling factor (1 corresponds to no downsampling)downsampled_window_size
- The window size after downsampling.downsampled_hop_size
- The distance, after downsampling, between the start of windows. Must not be zero and not be greater thandownsampled_window_size
.
pub fn reset(&mut self)
Sourcepub fn downsampling(&self) -> usize
pub fn downsampling(&self) -> usize
Returns the downsampling factor.
Sourcepub fn downsampled_hop_size(&self) -> usize
pub fn downsampled_hop_size(&self) -> usize
Returns the hop size after downsampling.
Sourcepub fn downsampled_window_size(&self) -> usize
pub fn downsampled_window_size(&self) -> usize
Returns the window size after downsampling.
Auto Trait Implementations§
impl Freeze for WindowProcessor
impl RefUnwindSafe for WindowProcessor
impl Send for WindowProcessor
impl Sync for WindowProcessor
impl Unpin for WindowProcessor
impl UnwindSafe for WindowProcessor
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