pub struct LowPassFilterBlock<S>where
S: Sample,{
pub cutoff: Parameter<S>,
pub resonance: Parameter<S>,
/* private fields */
}Expand description
SVF-based low-pass filter for efficient, stable filtering.
Uses the TPT (Topology Preserving Transform) SVF algorithm which is:
- Stable at all cutoff frequencies
- Has no delay-free loops
- Maintains consistent behavior regardless of sample rate
Output is scaled by a compensation factor based on Q and cutoff frequency to preserve passband gain while limiting the resonance peak (target ≤ 2.0).
Fields§
§cutoff: Parameter<S>Cutoff frequency in Hz (20-20000).
resonance: Parameter<S>Resonance (Q factor, 0.5-10.0, default 0.707 = Butterworth).
Implementations§
Source§impl<S> LowPassFilterBlock<S>where
S: Sample,
impl<S> LowPassFilterBlock<S>where
S: Sample,
Sourcepub fn new(cutoff: f64, resonance: f64) -> LowPassFilterBlock<S>
pub fn new(cutoff: f64, resonance: f64) -> LowPassFilterBlock<S>
Create a new low-pass filter with the given cutoff and resonance.
Sourcepub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Set the sample rate for coefficient calculation.
Trait Implementations§
Source§impl<S> Block<S> for LowPassFilterBlock<S>where
S: Sample,
impl<S> Block<S> for LowPassFilterBlock<S>where
S: Sample,
Source§fn process(
&mut self,
inputs: &[&[S]],
outputs: &mut [&mut [S]],
modulation_values: &[S],
context: &DspContext,
)
fn process( &mut self, inputs: &[&[S]], outputs: &mut [&mut [S]], modulation_values: &[S], context: &DspContext, )
Process audio through this block. Read more
Source§fn input_count(&self) -> usize
fn input_count(&self) -> usize
Returns the number of input ports this block accepts.
Source§fn output_count(&self) -> usize
fn output_count(&self) -> usize
Returns the number of output ports this block produces.
Source§fn modulation_outputs(&self) -> &[ModulationOutput]
fn modulation_outputs(&self) -> &[ModulationOutput]
Returns the modulation outputs this block provides. Read more
Source§fn channel_config(&self) -> ChannelConfig
fn channel_config(&self) -> ChannelConfig
Returns how this block handles multi-channel audio. Read more
Auto Trait Implementations§
impl<S> Freeze for LowPassFilterBlock<S>where
S: Freeze,
impl<S> RefUnwindSafe for LowPassFilterBlock<S>where
S: RefUnwindSafe,
impl<S> Send for LowPassFilterBlock<S>
impl<S> Sync for LowPassFilterBlock<S>
impl<S> Unpin for LowPassFilterBlock<S>where
S: Unpin,
impl<S> UnwindSafe for LowPassFilterBlock<S>where
S: 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