pub struct ThreeBandParametricBiquad {
pub sample_rate: f32,
pub low_shelf: Df2tBiquad,
pub mid_peak: Df2tBiquad,
pub high_shelf: Df2tBiquad,
}Expand description
3-Band Parametric Equalizer consisting of cascaded DF2T biquads:
- Low Shelf (200 Hz anchor)
- Mid Peaking (1000 Hz anchor)
- High Shelf (8000 Hz anchor)
Fields§
§sample_rate: f32Sample rate the coefficients were computed for (clamped to ≥ 8 kHz).
low_shelf: Df2tBiquadLow shelf stage at ANCHOR_LOW_HZ (200 Hz).
mid_peak: Df2tBiquadMid peaking stage at ANCHOR_MID_HZ (1 kHz).
high_shelf: Df2tBiquadHigh shelf stage at ANCHOR_HIGH_HZ (8 kHz).
Implementations§
Source§impl ThreeBandParametricBiquad
impl ThreeBandParametricBiquad
Sourcepub fn new(sample_rate: f32) -> Self
pub fn new(sample_rate: f32) -> Self
Create an EQ at flat unity response (0 dB on all bands), coefficients snapped to target so no ramping occurs on the first quantum.
Sourcepub fn snap_to_target(&mut self)
pub fn snap_to_target(&mut self)
Snap active coefficients directly to target (useful on init or seek).
Sourcepub fn reset_states(&mut self)
pub fn reset_states(&mut self)
Reset internal filter state registers (clear delay lines).
Sourcepub fn set_band_gains_db(
&mut self,
low_gain_db: f32,
mid_gain_db: f32,
high_gain_db: f32,
)
pub fn set_band_gains_db( &mut self, low_gain_db: f32, mid_gain_db: f32, high_gain_db: f32, )
Configure band gains in decibels for the next 128-sample quantum.
Sourcepub fn set_from_spectral_coeffs(&mut self, c0: f32, c1: f32, c2: f32)
pub fn set_from_spectral_coeffs(&mut self, c0: f32, c1: f32, c2: f32)
Map continuous Jakob & Hanika spectral polynomial coefficients $(c_0, c_1, c_2)$ directly to the 3-band acoustic parameters.
Sourcepub fn process_quantum(&mut self, buffer: &mut [f32; 128])
pub fn process_quantum(&mut self, buffer: &mut [f32; 128])
Process a single 128-sample quantum in-place with zero allocations. Injects $10^{-24}$ DC offset into each sample to prevent mobile ARM NEON denormal stalls.
Sourcepub fn process_slice(&mut self, input: &[f32], output: &mut [f32])
pub fn process_slice(&mut self, input: &[f32], output: &mut [f32])
Process a caller-supplied slice of arbitrary length (multiple of 128 recommended). Zero heap allocation.
Trait Implementations§
Source§impl Clone for ThreeBandParametricBiquad
impl Clone for ThreeBandParametricBiquad
Auto Trait Implementations§
impl Freeze for ThreeBandParametricBiquad
impl RefUnwindSafe for ThreeBandParametricBiquad
impl Send for ThreeBandParametricBiquad
impl Sync for ThreeBandParametricBiquad
impl Unpin for ThreeBandParametricBiquad
impl UnsafeUnpin for ThreeBandParametricBiquad
impl UnwindSafe for ThreeBandParametricBiquad
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more