Skip to main content

Module biquad_df2t

Module biquad_df2t 

Source
Expand description

Direct Form II Transposed (DF2T) 3-Band Parametric Biquad Filter.

Designed for the Webizen AudioWorklet real-time audio thread:

  • DF2T Topology: 2 state variables per biquad, superior numerical stability against low-frequency pole quantization (200 Hz low-shelf anchor).
  • Denormal Prevention: Injects $10^{-24}$ DC offset into raw samples, preventing subnormal stall penalties (up to 100x) on mobile ARM NEON FPUs.
  • 128-Sample Quantum Ramping: Trigonometric coefficient updates occur strictly at quantum boundaries (2.67 ms @ 48 kHz). Inner sample loop linearly ramps coefficients using 5 scalar additions per sample, eliminating zipper noise and audio clicks.
  • Zero-Heap Hot Path: Evaluates directly into caller-supplied slices, delegating RBJ Audio EQ Cookbook synthesis and DF2T recurrence math to etalon_signal::filter.

Structs§

BiquadCoeffs
Normalized biquad filter coefficients $H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2}}{1 + a_1 z^{-1} + a_2 z^{-2}}$.
Df2tBiquad
Single DF2T biquad filter with linear coefficient ramping.
Df2tState
Direct Form II Transposed filter state registers.
ThreeBandParametricBiquad
3-Band Parametric Equalizer consisting of cascaded DF2T biquads:

Constants§

ANCHOR_HIGH_HZ
High-frequency shelf anchor (Hz).
ANCHOR_LOW_HZ
Low-frequency shelf anchor (Hz).
ANCHOR_MID_HZ
Mid-frequency peaking band anchor (Hz).
AUDIO_WORKLET_DF2T_JS
Standalone JavaScript snippet for standard AudioWorkletProcessor registration.
DENORMAL_DC_OFFSET
DC offset injected per sample to prevent subnormal-FPU stall penalties.
QUANTUM_SIZE
AudioWorklet render quantum — coefficient updates and ramping occur at these boundaries (2.67 ms @ 48 kHz).