Electronics

Biquad Filter Cheat Sheet

Biquad coefficients for common filter types — low-pass, high-pass, peaking EQ, shelf.

Form

Direct-form transferH(z) = (b₀ + b₁ z⁻¹ + b₂ z⁻²) / (1 + a₁ z⁻¹ + a₂ z⁻²)
Difference equationy[n] = b₀x[n] + b₁x[n−1] + b₂x[n−2] − a₁y[n−1] − a₂y[n−2]
ω₀= 2π · f₀ / fs
α= sin(ω₀) / (2 · Q)

Low-pass (RBJ biquad)

b₀= (1 − cos ω₀) / 2
b₁= 1 − cos ω₀
b₂= (1 − cos ω₀) / 2
a₀= 1 + α
a₁= −2 · cos ω₀
a₂= 1 − α

High-pass

b₀= (1 + cos ω₀) / 2
b₁= −(1 + cos ω₀)
b₂= (1 + cos ω₀) / 2
a₀/a₁/a₂Same as LP

Peaking EQ (gain A)

A= 10^(dB_gain / 40)
b₀= 1 + α · A
b₁= −2 · cos ω₀
b₂= 1 − α · A
a₀= 1 + α / A
a₁= −2 · cos ω₀
a₂= 1 − α / A

Normalization

  • Divide all coefficients by a₀ so the leading denominator coefficient is 1.
  • Q typically 0.707 for maximally flat (Butterworth Q).
  • Higher Q → sharper peak; lower Q → gentler.

Worked example: 1 kHz low-pass at 48 kHz

For f₀ = 1,000 Hz, fs = 48,000 Hz and Q = 0.707: ω₀ = 2π × 1,000 / 48,000 = 0.13090 rad. Then cos ω₀ = 0.99144 and sin ω₀ = 0.13053, so α = 0.13053 / (2 × 0.707) = 0.09231.

The low-pass coefficients are b₀ = (1 − 0.99144) / 2 = 0.00428, b₁ = 0.00856, b₂ = 0.00428, a₀ = 1.09231, a₁ = −1.98288 and a₂ = 0.90769. Dividing everything by a₀ gives b₀ = 0.003916, b₁ = 0.007832, b₂ = 0.003916, a₁ = −1.8153 and a₂ = 0.8310. A quick check: at DC the gain is (b₀ + b₁ + b₂) / (1 + a₁ + a₂) = 0.015664 / 0.0157, which is about 1 within the rounding of these four-digit values, as a low-pass should be.

Practical rules

  • Precision gets harder as the cutoff falls. When f₀ is tiny compared with fs, the poles sit close to z = 1 and the coefficients differ only in the last digits. In 32-bit float the filter can drift or become unstable, so use double precision or a state-variable structure for very low frequencies.
  • Frequencies near Nyquist warp. The bilinear transform compresses the frequency axis; a peak placed above about fs / 4 will be narrower than the design Q suggests.
  • Check stability. A biquad is stable when both poles are inside the unit circle: |a₂| < 1 and |a₁| < 1 + a₂ (after dividing by a₀).
  • Mind the sign convention. The cookbook writes the denominator as 1 + a₁z⁻¹ + a₂z⁻². SciPy and MATLAB use the same convention, but some libraries store the negated a values. Test the DC gain to check.

Notes

  • Reference: Robert Bristow-Johnson's "Cookbook formulae for audio EQ biquad filter coefficients".
  • Cascade biquads for higher-order filters (two biquads = 4th order).
Was this article helpful?