pub struct BiquadCascade<T, const N: usize> {
pub sections: [Biquad<T>; N],
}Expand description
A cascade of N biquad (second-order) sections.
Filter order is 2*N for all-second-order sections, or 2*N - 1 when the
last section is a degenerate first-order biquad (b2 = a2 = 0).
§Example
use numeris::control::{butterworth_lowpass, BiquadCascade};
// 4th-order Butterworth → 2 biquad sections
let mut lpf: BiquadCascade<f64, 2> = butterworth_lowpass(4, 1000.0, 8000.0).unwrap();
let y = lpf.tick(1.0);Fields§
§sections: [Biquad<T>; N]Implementations§
Source§impl<T: FloatScalar, const N: usize> BiquadCascade<T, N>
impl<T: FloatScalar, const N: usize> BiquadCascade<T, N>
Sourcepub fn tick(&mut self, x: T) -> T
pub fn tick(&mut self, x: T) -> T
Process a single input sample through all sections in series.
Sourcepub fn process(&mut self, input: &[T], output: &mut [T])
pub fn process(&mut self, input: &[T], output: &mut [T])
Process a slice of input samples into an output slice.
§Panics
Panics if output.len() < input.len().
Sourcepub fn process_inplace(&mut self, data: &mut [T])
pub fn process_inplace(&mut self, data: &mut [T])
Process a slice of samples in-place.
Trait Implementations§
Source§impl<T: Clone, const N: usize> Clone for BiquadCascade<T, N>
impl<T: Clone, const N: usize> Clone for BiquadCascade<T, N>
Source§fn clone(&self) -> BiquadCascade<T, N>
fn clone(&self) -> BiquadCascade<T, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy, const N: usize> Copy for BiquadCascade<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for BiquadCascade<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for BiquadCascade<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for BiquadCascade<T, N>where
T: Send,
impl<T, const N: usize> Sync for BiquadCascade<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for BiquadCascade<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for BiquadCascade<T, N>where
T: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for BiquadCascade<T, N>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