Biquad Filter Calculator

MagnitudedB
Point at the curve for an exact reading
Phasedegrees
Point at the curve for an exact reading
Coefficients
Stablepoles0.91159pole radius−0.00 dBgain at DC−∞ dBgain at Nyquist

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

A biquad is five numbers. Pick the filter, and the calculator writes b0, b1, b2, a1 and a2 for your sample rate and draws what they do to magnitude, phase and delay.

Filter types and what Q means in each

The eight second-order types follow Robert Bristow-Johnson’s Audio EQ Cookbook. The two first-order types are bilinear transforms of a one-pole filter and roll off at 6 dB per octave.

Type Frequency is Q controls
Low-pass, high-pass the −3 dB corner at Q 0.7071 the peak at the corner; 0.7071 is Butterworth
Band-pass the centre, at 0 dB the width, roughly frequency / Q
Notch the null the width of the cut
All-pass where phase reaches −180° how fast the phase turns
Peaking the centre of the bell the width of the bell
Low shelf, high shelf the midpoint of the slope the slope; above 0.7071 it overshoots

Gain applies to the peaking and shelf types only. At 0 dB all three reduce to a pass-through.

A worked example

A low-pass at 1000 Hz with Q 0.7071 at 48000 Hz comes out as:

b0 = 0.00391612348716
b1 = 0.00783224697431
b2 = 0.00391612348716
a1 = -1.81533961166
a2 = 0.831004105611

Run it as y[n] = b0 x[n] + b1 x[n-1] + b2 x[n-2] - a1 y[n-1] - a2 y[n-2]. The same filter at 44100 Hz needs different numbers, which is why the sample rate is an input and not a footnote.

Output formats

  • Plain lists the five values by name.
  • Web Audio builds an IIRFilterNode with feedforward and feedback arrays.
  • C arrays writes b[3] and a[3] with a leading 1 for a0.
  • CMSIS-DSP writes { b0, b1, b2, -a1, -a2 }, the order and signs arm_biquad_cascade_df1_f32 expects.
  • SciPy / MATLAB SOS writes one row [b0, b1, b2, 1, a1, a2] for sosfilt.

Frequency warping near Nyquist

The cookbook maps an analog prototype onto the unit circle with the bilinear transform, which squeezes the whole analog axis into 0 to Nyquist. The design pre-warps the centre frequency, so the corner or peak lands where you set it. The width does not get the same correction: a bell at 15 kHz and 44100 Hz is narrower on its upper side than the same Q at 1 kHz. Read the plot, not the Q, when a filter sits in the top octave.

Low frequencies and coefficient precision

A 20 Hz high-pass at 96000 Hz has poles at radius 0.99907, and a1 is −1.99815, within 0.002 of −2. All the information about the corner lives in the last digits. Stored as 32-bit floats and run in direct form, such a section is noisy and drifts off frequency. Keep these coefficients in doubles, or use a structure built for low corners, and check the result by pasting the rounded values back into the calculator.

Group delay

The second plot switches between phase and group delay. Delay is shown in samples, with milliseconds in the reading under the cursor. It is computed from the coefficients directly, not from differences of the phase curve, so it stays correct beside a sharp resonance. At the exact frequency of a notch the delay has no value, and the line breaks there.

Questions about Biquad Filter Calculator

What does the calculator take, and what does it give back?

It takes a filter type, a sample rate, a frequency, a Q and, for peaking and shelf filters, a gain. It gives back the five coefficients b0, b1, b2, a1 and a2 with a0 normalised to 1, and plots the magnitude, phase and group delay they produce. There is no audio file to load.

Which sign convention do the a coefficients use?

The transfer function is (b0 + b1 z^-1 + b2 z^-2) / (1 + a1 z^-1 + a2 z^-2), so the difference equation subtracts the feedback terms. That is the convention of the Audio EQ Cookbook, SciPy, MATLAB and Web Audio's IIRFilterNode. CMSIS-DSP adds its feedback terms instead, so its a1 and a2 carry the opposite sign; the CMSIS-DSP format writes them that way.

Why does Web Audio's BiquadFilterNode give a different curve for the same Q?

For its lowpass and highpass types, BiquadFilterNode reads Q as a resonance in decibels, not as the linear Q of the cookbook, and its shelf types ignore Q. To get the response plotted here, pass the coefficients to an IIRFilterNode, which takes them as they are.

How do I make a steeper filter than 12 dB per octave?

Cascade sections and give each its own Q. A fourth-order Butterworth low-pass is two sections at the same frequency with Q 0.5412 and Q 1.3066. A fourth-order Linkwitz-Riley is two sections with Q 0.7071 each.

Can I check coefficients I already have?

Yes. Open Check existing coefficients and paste five numbers in the order b0 b1 b2 a1 a2, or six with a0 in fourth place. Brackets, commas, f suffixes and variable names are ignored. Tick the CMSIS-DSP box when the feedback terms are stored negated.

What does an unstable result mean?

A pole sits on or outside the unit circle, so the output grows without limit instead of settling. Designs from the sliders are always stable. Pasted coefficients become unstable through a sign error on a1 or a2, or through rounding when a low-frequency filter is stored in too few bits.

Why is the group delay not flat?

A biquad is a recursive filter, and its phase is not a straight line. Delay peaks near the corner frequency and rises with Q. A filter with the same delay at every frequency has to be a linear-phase FIR.

Related tools

Browse all tools