Introduction

Turn the bass knob on your speaker, add reverb to a podcast, cut the hiss from a phone call — every one of those operations runs through a biquad filter. The name comes from bi-quadratic: both the numerator and denominator of its transfer function are second-degree polynomials. Despite that modest algebra, the biquad is the fundamental building block of nearly all digital audio processing.

The complete filter is defined by just five real numbers — conventionally called b0b_0, b1b_1, b2b_2 (feedforward coefficients) and a1a_1, a2a_2 (feedback coefficients). Change those five numbers and the same algorithm becomes a low-pass filter, a high-pass filter, a peaking equalizer, a notch, a resonant shelf — anything you can draw on a frequency-response curve.

What makes biquads so powerful is also what makes them interesting algorithmically: a single output sample depends not only on the current and two previous inputs, but on the two previous outputs. That feedback loop is what gives biquads their efficiency — a handful of multiplications per sample achieves response curves that would otherwise require a filter with hundreds of taps.

Try It

Below is a resonant low-pass biquad filter. Drag the Cutoff slider to sweep the peak across the spectrum, and adjust Q (resonance) to make it sharper or flatter. The curve shows exactly what the filter does to every frequency.

<!-- {{c_html_desc}} -->
<div class="controls">
  <label>
    <span class="lbl">{{lbl_cutoff}}: <b id="fc-val">800</b> Hz</span>
    <input type="range" id="fc" min="80" max="18000" step="10" value="800">
  </label>
  <label>
    <span class="lbl">{{lbl_q}}: <b id="q-val">5.0</b></span>
    <input type="range" id="q-slider" min="0.5" max="20" step="0.1" value="5.0">
  </label>
</div>
<canvas id="plot" width="560" height="280" title="{{canvas_title}}"></canvas>
<div class="info" id="info">{{lbl_loading}}</div>
/* {{c_css_desc}} */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #f4f6f8; color: #222; padding: .5rem; }
.controls { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
label { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.lbl { font-size: .85rem; min-width: 140px; }
input[type=range] { flex: 1; min-width: 120px; accent-color: #1d3557; }
canvas { display: block; background: #fff; border: 1px solid #cdd9e3; border-radius: 8px; width: 100%; max-width: 560px; }
.info { font-size: .82rem; color: #555; margin-top: .4rem; min-height: 1.2em; }
// Code not found

Notice how a high Q value creates a sharp peak just before the cutoff — that's the resonance that gives synthesizers their signature "wah" sound. The biquad computes this entire shape with just five multiplications and four additions per sample, which is why it appears in every DSP chip ever made.

The Math

The biquad's output y[n]y[n] for input x[n]x[n] follows the direct-form I difference equation:

y[n]=b0x[n]+b1x[n1]+b2x[n2]a1y[n1]a2y[n2]y[n] = b_0\,x[n] + b_1\,x[n-1] + b_2\,x[n-2] - a_1\,y[n-1] - a_2\,y[n-2]

Taking the z-transform of both sides turns this recurrence into a rational function of zz, the transfer function:

H(z)=b0+b1z1+b2z21+a1z1+a2z2H(z) = \frac{b_0 + b_1\,z^{-1} + b_2\,z^{-2}}{1 + a_1\,z^{-1} + a_2\,z^{-2}}

The frequency response is what you hear: substitute z=ejωz = e^{j\omega} on the unit circle and the magnitude H(ejω)|H(e^{j\omega})| tells you how much the filter amplifies or attenuates each frequency ω\omega.

Turning knobs into coefficients. Robert Bristow-Johnson's Audio EQ Cookbook (1994, updated 2021) gives closed-form formulas for every common filter shape. For a resonant low-pass filter with cutoff f0f_0 and quality factor QQ:

ω0=2πf0/fs,α=sin(ω0)/(2Q)\omega_0 = 2\pi f_0 / f_s, \quad \alpha = \sin(\omega_0)/(2Q)

b0=1cosω02,b1=1cosω0,b2=b0,a0=1+αb_0 = \tfrac{1-\cos\omega_0}{2},\quad b_1 = 1-\cos\omega_0,\quad b_2 = b_0,\quad a_0 = 1+\alpha

a1=2cosω0,a2=1α(all divided by a0)a_1 = -2\cos\omega_0,\quad a_2 = 1-\alpha \quad (\text{all divided by } a_0)

Poles and zeros. The two roots of the denominator polynomial are the filter's poles; the two roots of the numerator are its zeros. A pole close to the unit circle creates a peak in the response (resonance); a zero on the unit circle creates a perfect null. Moving the five coefficients moves the poles and zeros and thus sculpts the response curve.

Numerical stability. Because each output feeds back into itself, accumulated round-off errors can push an IIR filter to instability if the poles stray outside the unit circle. Well-designed coefficient formulas and double-precision arithmetic keep this risk vanishingly small for audio rates, but it is something digital filter designers always track.

See also: the discrete Fourier transform family that biquad filters complement in the frequency domain, and compression algorithms that lean on the same perceptual audio models.

Where It Matters

The same five-coefficient structure shows up across every domain that processes signals:

  • Music production and mixing: every parametric EQ band on a mixing console is a biquad peaking filter. Boost or cut a frequency band by adjusting gain, f0f_0 and QQ — nothing else changes.
  • Synthesizers and electronic music: the resonant low-pass filter that defines the sound of classic analog synthesizers (Moog ladder, Roland 303) is emulated in software with a chain of biquads tuned to track the keyboard pitch.
  • Telecommunications: voice codecs remove DC offset, suppress powerline hum (50/60 Hz), and boost presence — all with a few biquad stages tuned at codec design time.
  • Room correction and hearing aids: automatic equalization measures the room's impulse response and inverts it with a bank of biquads, flattening the frequency response to what the engineer intended.
  • Biomedical signal processing: ECG and EEG amplifiers use biquad notch filters to suppress powerline interference, and biquad low-pass filters to band-limit signals before analog-to-digital conversion.
  • Control systems: biquad-style second-order sections appear in PID controllers and servo loops, where the same poles-and-zeros algebra describes mechanical resonances rather than audio frequencies.

The biquad is so universal because the cost is fixed: five multiplications and four additions per sample, regardless of sample rate or cutoff. For real-time DSP on embedded hardware, that predictability is essential.

Conclusion

The biquad filter is a remarkable compression of ideas. A difference equation with five free parameters captures every useful second-order frequency response — low-pass, high-pass, peak, shelf, notch, all-pass. Change the five numbers and you change the sound; the algorithm itself never changes.

That economy of expression is the hallmark of good mathematical engineering: a structure general enough to model any second-order system, yet specific enough to be computed in a single tight loop that runs on the cheapest microcontroller alive. The next time you adjust an EQ, add warmth to a recording, or hear your phone cut the wind noise, you are listening to the biquad at work.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/biquad-filters/Content licensed under CC BY-NC 4.0.