pub struct BoxStackFilter<T: Float> { /* private fields */ }Expand description
FIR filter made from a stack of BoxFilters.
This filter has a non-negative impulse (monotonic step response), making it useful for smoothing positive-only values.
Implementations§
Source§impl<T: Float> BoxStackFilter<T>
impl<T: Float> BoxStackFilter<T>
Sourcepub fn new(max_size: usize, layers: usize) -> Self
pub fn new(max_size: usize, layers: usize) -> Self
Create a new box stack filter with the specified maximum size and number of layers
Sourcepub fn optimal_ratios(layer_count: usize) -> Vec<f32>
pub fn optimal_ratios(layer_count: usize) -> Vec<f32>
Returns an optimal set of length ratios (heuristic for larger depths)
Sourcepub fn layers_to_bandwidth(layers: usize) -> f32
pub fn layers_to_bandwidth(layers: usize) -> f32
Approximate (optimal) bandwidth for a given number of layers
Sourcepub fn layers_to_peak_db(layers: usize) -> f32
pub fn layers_to_peak_db(layers: usize) -> f32
Approximate (optimal) peak in the stop-band
Sourcepub fn resize(&mut self, max_size: usize, layer_count: usize)
pub fn resize(&mut self, max_size: usize, layer_count: usize)
Sets size using an optimal (heuristic at larger sizes) set of length ratios
Sourcepub fn resize_with_ratios(&mut self, max_size: usize, ratios: Vec<f32>)
pub fn resize_with_ratios(&mut self, max_size: usize, ratios: Vec<f32>)
Sets the maximum (and current) impulse response length and explicit length ratios
Auto Trait Implementations§
impl<T> Freeze for BoxStackFilter<T>
impl<T> RefUnwindSafe for BoxStackFilter<T>where
T: RefUnwindSafe,
impl<T> Send for BoxStackFilter<T>where
T: Send,
impl<T> Sync for BoxStackFilter<T>where
T: Sync,
impl<T> Unpin for BoxStackFilter<T>where
T: Unpin,
impl<T> UnwindSafe for BoxStackFilter<T>where
T: UnwindSafe,
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