Struct AllPassFilter
pub struct AllPassFilter { /* private fields */ }Expand description
First-order all-pass filter with variable cutoff frequency.
Transfer function: H(z) = (a + z⁻¹) / (1 + a*z⁻¹) where a = (1 - tan(πf₀/fs)) / (1 + tan(πf₀/fs))
Phase shift varies from 0° at DC to -180° at Nyquist, with -90° at f₀.
Implementations§
§impl AllPassFilter
impl AllPassFilter
pub fn new(cutoff: f64, sample_rate: f64) -> AllPassFilter
pub fn new(cutoff: f64, sample_rate: f64) -> AllPassFilter
Create a new all-pass filter with given cutoff frequency.
pub fn set_cutoff(&mut self, freq: f64)
pub fn set_cutoff(&mut self, freq: f64)
Set the cutoff frequency (Hz).
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset filter state.
pub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Update sample rate.
Trait Implementations§
§impl Clone for AllPassFilter
impl Clone for AllPassFilter
§fn clone(&self) -> AllPassFilter
fn clone(&self) -> AllPassFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AllPassFilter
impl RefUnwindSafe for AllPassFilter
impl Send for AllPassFilter
impl Sync for AllPassFilter
impl Unpin for AllPassFilter
impl UnsafeUnpin for AllPassFilter
impl UnwindSafe for AllPassFilter
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