Product

Matched-magnitude biquads for anti-cramping EQ DSP

How Infinite avoids Nyquist cramping in its 5-band EQ using Vicanek matched-magnitude biquads, cut-side inversion, minimax Q matching, and lock-free smoothing.

Naman Soni2 December 2026 · 7 min read

Frequency response plot and signal flow diagram comparing a cramped bilinear-transform RBJ biquad against Infinite's matched-magnitude biquad at 10 kHz and 15 kHz, plus main-thread coefficient design feeding ParamMailbox
on this page
  1. Why bilinear-transform biquads cramp at Nyquist
  2. Impulse-invariant poles and the phi-basis
  3. Cut-side inversion for stability
  4. Minimax matching for resonant shelves and peaks
  5. Lock-free coefficient delivery and Butterworth cascades
  6. Honest limits and trade-offs
  7. Try it in Infinite

Anyone who has swept a parametric bell or high shelf above 10 kHz at a 44.1 kHz or 48 kHz sample rate has heard Nyquist cramping. Standard digital equalisers built from Robert Bristow-Johnson's Audio EQ Cookbook use the bilinear transform to map an analog $s$-plane prototype onto the digital $z$-plane. Because the bilinear transform warps the infinite analog frequency axis into $[0, \pi]$ via $\omega_a = \frac{2}{T}\tan(\omega_d / 2)$, any filter approaching $f_s / 2$ gets squashed against Nyquist: bell curves turn asymmetric and narrow, high shelves collapse into steep spikes, and lowpass slopes drop vertically to zero before reaching $f_s / 2$.

The usual workaround is to oversample the entire EQ by 2x or 4x, which doubles or quadruples per-sample filter work and adds anti-aliasing filter latency. In Infinite, the EQ node (EqKernel) takes a different route: it keeps the audio thread at the base sample rate and designs every stage with matched-magnitude biquads (src/audio/dsp/MatchedBiquad.h), following Martin Vicanek's 2016 formulation with two extensions for cut-side stability and high-Q minimax accuracy.

Frequency response plot and signal flow diagram comparing a cramped bilinear-transform RBJ biquad against Infinite's matched-magnitude biquad at 10 kHz and 15 kHz, plus main-thread coefficient design feeding ParamMailbox
Frequency response plot and signal flow diagram comparing a cramped bilinear-transform RBJ biquad against Infinite's matched-magnitude biquad at 10 kHz and 15 kHz, plus main-thread coefficient design feeding ParamMailbox

Why bilinear-transform biquads cramp at Nyquist

The bilinear transform preserves stability and maps the $j\omega$ axis cleanly onto the unit circle, but it maps $\omega_a = \infty$ directly to $\omega_d = \pi$ (Nyquist). At low frequencies, $\tan(\omega_d / 2) \approx \omega_d / 2$, so a 200 Hz bell behaves almost identically to its analog prototype. At 12 kHz or 16 kHz in a 44.1 kHz session, the tangent nonlinearity compresses the upper skirt of the filter toward zero gain at 22.05 kHz.

That compression breaks two things at once:

  1. Asymmetric high-frequency bells: A symmetrical boost on a log-frequency plot becomes pinched on its upper side, shifting the perceived centre and reducing air-band smoothness.
  2. Distorted shelves and slopes: A 12 dB/oct lowpass or high shelf loses its analog rolloff shape near Nyquist, forcing engineers to oversample an otherwise linear processor just to keep its top octave accurate.

Impulse-invariant poles and the phi-basis

Instead of warping the whole $s$-plane with a bilinear substitution, MatchedBiquad separates pole placement from numerator design:

  1. Impulse-invariant poles: MatchedBiquad::Poles() maps the normalised analog denominator $d_2 s^2 + d_1 s + d_0$ directly to digital feedback coefficients using $w_p = w_0 \sqrt{d_0 / d_2}$ and damping ratio $\zeta = d_1 / (2\sqrt{d_0 d_2})$:

$$a_1 = -2 e^{-\zeta w_p} \cos\left(\min\left(w_p \sqrt{1 - \zeta^2},\, \pi\right)\right), \quad a_2 = e^{-2\zeta w_p}$$ (switching to $\cosh$ for overdamped poles where $\zeta \ge 1$).

  1. Three-point magnitude matching: MatchThreePoint() expresses squared magnitude in Vicanek's $\phi$-basis, where $\phi_1 = \sin^2(\omega / 2)$, $\phi_0 = 1 - \phi_1$, and $\phi_2 = 4 \phi_0 \phi_1$:

$$|H(e^{j\omega})|^2 = \frac{B_0 \phi_0 + B_1 \phi_1 + B_2 \phi_2}{A_0 \phi_0 + A_1 \phi_1 + A_2 \phi_2}$$ Because $\phi_0 = 1$ at DC ($\omega = 0$) and $\phi_1 = 1$ at Nyquist ($\omega = \pi$), $B_0$ and $B_1$ lock the digital magnitude to the exact analog magnitude at DC and Nyquist. $B_2$ then solves the third constraint at a match frequency $\omega_m = \min(\omega_0, 0.9\pi)$.

  1. Spectral factorisation: From $(B_0, B_1, B_2)$, the feedforward coefficients $(b_0, b_1, b_2)$ are recovered in closed form, guaranteeing a minimum-phase numerator without iterative root finding.

Lowpass, highpass, bandpass, notch, and allpass prototypes follow the same pole structure with prototype-specific zero constraints (for instance, a double zero at DC for highpass, unit-circle zeros at $\omega_0$ for notch, and reversed denominator coefficients for an exact $|H| = 1$ allpass).

Cut-side inversion for stability

A subtle pitfall in direct magnitude-matched shelves and peaks appears on the cut side. When a peak filter cuts by 15 dB at high Q, its analog zeros sit close to the $j\omega$ axis while its poles are wide. Designing the cut numerator directly can force $B_2$ negative enough to require clamping during spectral factorisation, introducing magnitude error.

MatchedBiquad::Design() avoids clamping altogether through cut-side inversion. For kLowShelf or kPeak with gainDb < 0, and for kHighShelf with gainDb > 0 (since a high-shelf boost at gainDb > 0 has the same pole/zero damping asymmetry relative to DC as a low-shelf cut), Design() flips the sign of gainDb, solves the well-damped boost prototype, and swaps numerator and denominator via MatchedBiquad::Invert():

$$H_{\text{cut}}(z) = \frac{1}{H_{\text{boost}}(z)} \implies b'_0 = \frac{1}{b_0},\quad b'_1 = \frac{a_1}{b_0},\quad b'_2 = \frac{a_2}{b_0},\quad a'_1 = \frac{b_1}{b_0},\quad a'_2 = \frac{b_2}{b_0}$$

Because the boost numerator is minimum-phase by construction, its roots sit inside the unit circle, so inverting them into poles is unconditionally stable and exact.

Minimax matching for resonant shelves and peaks

Matching at DC, Nyquist, and $\omega_0$ works well for gentle curves ($Q \le 0.75$), where the magnitude peak sits right at $\omega_0$. However, a resonant shelf or high-Q peak has its overshoot bump displaced away from $\omega_0$, leaving the peak of the bump unconstrained. In testing on MatchedBiquad, a Q = 3 high shelf at 10 kHz (44.1 kHz sample rate) drifted 2.4 dB off the analog prototype at 13.7 kHz when matched strictly at $\omega_0$.

For any shelf or peak with q > 0.75, MatchedBiquad::MatchThreePointMinimax() replaces the single $\omega_m$ point with a small minimax search:

  • It builds a 32-point log-spaced reference grid across $[\max(\omega_0 / 8, 10^{-4}), \min(8\omega_0, 0.95\pi)]$ from the analog prototype AnalogMag2().
  • It tests 16 candidate match frequencies across $[0.5\omega_0, \min(3\omega_0, 0.9\pi)]$ alongside $\omega_0$ itself, evaluating DigitalMag2() across the 32-point grid.
  • It keeps the candidate with the smallest worst-case dB error over the band.

Because $\omega_0$ is always included as the baseline candidate, minimax matching never performs worse than the single-point match, and the entire search costs roughly 500 magnitude evaluations on the main thread.

Lock-free coefficient delivery and Butterworth cascades

All exp(), cos(), sqrt(), and minimax evaluations stay off the real-time audio thread. In EqKernel::PushParams() (src/audio/dsp/EqKernel.cpp), Infinite computes coefficients on the main thread whenever parameters change and pushes 5 precomputed floats (b0, b1, b2, a1, a2) per stage into a lock-free ParamMailbox.

On the audio thread, EqKernel::ProcessBlock() runs 5 fixed bands in series with up to 3 cascaded biquad stages per band (supporting 12, 24, and 36 dB/oct highpass and lowpass slopes):

  • True Butterworth stage Qs: Rather than repeating a $Q = 0.707$ stage two or three times (which rounds the corner to $-6$ dB or $-9$ dB), EqDsp::StageQ() uses exact 4th-order (0.5412, 1.3066) and 6th-order (0.5176, 0.7071, 1.9319) Butterworth stage Qs, scaling resonance on the sharpest stage only.
  • Click-free band bypass: Disabled bands do not branch on an enable flag per sample. Instead, EqDsp::ConfigureBypass() pushes identity coefficients (b0 = 1, b1 = 0, b2 = 0, a1 = 0, a2 = 0) into the mailbox, so parameter smoothing crossfades the band out cleanly without clicks and makes an all-off EQ a bit-exact identity pass.
  • Shared response curve: Both the DSP kernel and the EQ node's visualiser call EqDsp::ConfigureStage(), ensuring the curve drawn on the node body always matches the filter running on the audio thread.

Honest limits and trade-offs

Matched-magnitude biquads are not a universal replacement for every filter in Infinite:

  • Phase response near Nyquist: MatchedBiquad matches the analog magnitude response up to Nyquist, not the analog phase response. For minimum-phase anti-aliasing in nonlinear processors such as Saturator and Drive, Infinite uses polyphase elliptic IIR or linear-phase FIR oversampling instead.
  • Per-sample modulation rate: Because MatchThreePointMinimax() runs on the main thread inside PushParams(), audio-rate FM of EQ cutoff is smoothed at control/mailbox rate rather than recomputing 500-point minimax fits per sample. For audio-rate or nonlinear ZDF ladder filtering, use the Filter node.
  • Project scope: Infinite is a young, active project: it does not ship an AAX plugin target, and hardware audio inputs are refused in headless CLI mode.

Try it in Infinite

Download Infinite and drop an EQ node after any Analog, FM, or Sampler chain to test high-frequency shelves and resonant peaks near 14 to 18 kHz at 44.1 kHz or 48 kHz without oversampling overhead. You can also explore ready-made synth and mixing chains in the Infinite preset library.

Keep reading