Compare Biquad Lowpass Filters

Simple demo to compare the original WebAudio Biquad lowpass or highpass filter with a new Biquad filters using the Audio EQ Cookbook formula.


\(Q\) dB, original

\(Q_{new}\) linear


Cutoff (Hz)


Master Gain

Select Filter

Original Biquad
New Biquad

Source

Noise
Cauldron
Waves
Ticking clock
Sawtooth

Filter Type

Lowpass
Highpass

Detailed Description

Original Biquad Design

This is an examination of the lowpass and highpass Biquad filter in WebAudio. You can choose to listen to the effect of two biquad filters. The original is the original Biquad filter in WebAudio, with the entered Q value. This Q value is in dB. From the graphs, you can see that the selected Q value is the same as the peak value of the frequency response.

More specifically, the filter coefficients are computed using this formula for \(\alpha_B\): $$ \begin{align*} \alpha_B &= \frac{\sin\omega_0}{2} \sqrt{\frac{4-\sqrt{16-\frac{16}{Q_L^2}}}{2}} \\ Q_L &= 10^\frac{Q}{20} \end{align*} $$

New Biquad Design

If you select the "New Biquad" you will get to hear the effect of the biquad filter using the formulation from the Audio EQ Cookbook that defines the filter differently. This Q value is a linear value. When you select the "New Biquad", a biquad filter is constructed (using the original biquad filter formulation of course) that would produce the same effect as this Audio Cookbook design. The equivalent Q value is displayed below the Q input box. above.

The Audio EQ Cookbook computes the coefficients using $$ \alpha_B = \frac{\sin \omega_0}{2Q_{new}} $$

From this, we can see that the new Audio EQ Cookbook filter can be simulated using WebAudio's biquad using the relationship $$ \frac{1}{Q_{new}} = \sqrt{\frac{4-\sqrt{16-\frac{16}{Q_L^2}}}{2}} $$ or $$ Q_L = \frac{2Q_{new}^2}{\sqrt{4Q_{new}^2-1}} $$ Thus, given \(Q_L\) or \(Q_{new}\) we can convert from one filter design to the other.

Note, however, that there are restrictions on this conversion. From the first equation, it's clear that \(Q_L \ge 1\) to produce a non-complex \(Q_{new}\). Fortunately, this is always true for WebAudio because the \(Q\) parameter is in dB and must be strictly positive. This implies \(Q_L \ge 1\).

The converse, however, is not true. From the second equation, we must have \(Q_{new} \ge \frac{1}{2}\) to ensure \(Q_L\) is real. This implies that there are low pass (and high pass) analog filters that can be designed that cannot be represented by WebAudio's low pass (or high pass) biquad filters.