]> Sound and music - Analog Filter Designs

Analog Filter Designs

These standard analog lowpass filters can be used as starting points for constructing digital filters. The filter descriptions are usually normalized, that is, the point of interest (such as the -3dB cutoff point) on the imaginary axis is always at $i$. If we want the point of interest to be at ${\omega }_{c}$ instead (we may be designing a filter with a particular cutoff for example), $H\left(s\right)$ can be scaled appropriately by replacing $s$ with $s/{\omega }_{c}$. This procedure is known as prewarping.

Butterworth

The transfer function $H\left(s\right)$ of the $N$-pole Butterworth filter has $N$ poles evenly spaced around the left half of the unit circle. In other words, it has the form $H\left(s\right)=1/\left(s-{p}_{1}\right)\cdots \left(s-{p}_{N}\right)$ where

${p}_{k}={e}^{i\frac{\left(2k+N-1\right)\pi }{2N}}$

The square of its frequency response is

$\mid H\left(i\omega \right){\mid }^{2}=\frac{1}{1+{\omega }^{2N}}$

At a glance, we can see when $\omega =0$ the gain is 1, when $\omega =\infty$ the gain is 0, and when $\omega =1$, the gain is $1/\sqrt{2}$. In some sense the Butterworth is the best possible smooth lowpass filter: it has a maximally flat frequency response at low frequencies since the first $2N$ derivatives of the frequency response take the value zero at $\omega =0$.

Chebyshev

By placing the poles on an ellipse instead of a circle, a lowpass filter with better rolloff can be achieved at the expense of allowing ripples in either the passband (Chebyshev Type I) or the stopband (Chebyshev Type 2).

Elliptic

The Butterworth and Chebyshev filters are special kinds of elliptic filters (also known as Cauer filters). These involve zeros as well as poles, and give very high performance filters at the expense of ripples in both the passband and stopband. They are tedious to compute.

Bessel

Bessel filters have maximally linear phase response at low frequencies, though their frequency response is not as good as the other three lowpass filters described here.

Filter Transformations

Once a lowpass filter is obtained, it may be transformed into other kinds of filters by a simple variable substitution.

Highpass

If $s$ is replaced with $1/s$ in $H\left(s\right)$, we see the value of $H\left(i\omega \right)$ is now what the value of $H\left(1/i\omega \right)=H\left(-i/\omega \right)$ was in the lowpass filter, thus low frequencies will now be cut off, while high ones are let through. This gives us a highpass filter.

Bandpass

Consider replacing $s$ with $s+{c}^{2}/s$. Then $H\left(i\omega \right)$ will now have the value $H\left(i\left(\omega -{c}^{2}/\omega \right)\right)$. Note $\omega -{c}^{2}/\omega$ is zero when $\omega =c$, tends to infinity as $\omega >c$ increases, and tends to minus infinity as $\omega tends to zero. Thus it is as if a lowpass filter has been placed on either side of $c$, which gives a bandpass filter.

To control the bandwidth of this filter, we replace $s$ by $s/B$ before applying the above transformation, where $B$ is the desired bandwidth. This will place the lowpass cutoff at $B$ (instead of 1). Then the positive solutions of $\omega -{c}^{2}/\omega =±B$ are $\omega =\left(±B+\sqrt{{B}^{2}+4{c}^{2}}\right)/2$, and the difference between these two solution is precisely $B$.

Bandstop

By transforming to a highpass filter, and then applying the bandpass transformation, we will have placed a highpass filter on either side of the desired frequency, creating a bandstop (or notch) filter.

In other words, we end up the reciprocal of the above function, that is, we replace $s$ by $s/\left({s}^{2}+{c}^{2}\right)$. As expected, this maps $\omega$ to the reciprocal of the previous case. $i\omega /\left(i\omega +{c}^{2}\right)$ takes the value 0 at zero, approaches infinity as $\omega$ approaches $c$ from below, approaches minus infinity as $\omega$ approaches $c$ from above, and lastly tends to zero as $\omega$ tends to infinity.

Shelving, Peaking

If the output of a lowpass filter is added to the input then the low frequencies are boosted. The combined transfer function has the form $H\left(s\right)=1+{H}_{\mathrm{LP}}\left(s\right)$ where ${H}_{\mathrm{LP}}$ is the transfer function of the lowpass filter. Using this, an analog filter that performs shelving can be designed

Similarly, if the output of a bandpass filter added to the input signal then peaking occurs, that is, a certain band of frequencies is boosted.

The Cookbook Filters

Robert Bristow-Johnson’s text file “Cookbook formulae for audio EQ biquad filter coefficients” describes how to construct various types of analog filters using at most two poles and zeroes, and also derives digital versions of each filter.

Cookbook Lowpass

For a lowpass filter, the text file gives the transfer function

$H\left(s\right)=\frac{1}{{s}^{2}+s/Q+1}$

where $Q$ is a parameter called "resonance". (For $Q=1/\sqrt{2}$ we get the 2-pole Butterworth filter. Increasing $Q$ moves the poles closer to the imaginary axis while keeping them on the unit circle.) The square of the frequency response of this filter is

$\mid H\left(i\omega \right){\mid }^{2}={\mid \frac{1}{1-{\omega }^{2}+i\omega /Q}\mid }^{2}=\frac{1}{{\omega }^{4}-\left(2-1/{Q}^{2}\right){\omega }^{2}+1}$

In particular, $\mid H\left(i\right)\mid =Q$.

Cookbook Bandpass

The cookbook’s bandpass filters are transformed 1-pole Butterworth lowpass filters.

From above the 1-pole Butterworth filter with cutoff $B$ has transfer function

$H\left(s\right)=\frac{B}{s+B}$

Applying the above bandpass transformation gives a filter with transfer function

$H\left(s\right)=\frac{Bs}{{s}^{2}+Bs+1}$

The cookbook describes a bandpass filter with this transfer function (with $Q=1/B$), along with another with peak gain $Q$, which may be obtained by multiplication by $Q$. However, the cookbook measures the bandwidth in octaves, so we get

$\mathrm{BW}=\mathrm{lg}\frac{\sqrt{{B}^{2}+4}+B}{2}-\mathrm{lg}\frac{\sqrt{{B}^{2}+4}-B}{2}$

where $\mathrm{lg}$ denotes log base 2. Thus

${2}^{\mathrm{BW}}=\frac{\sqrt{{B}^{2}+4}+B}{\sqrt{{B}^{2}+4}-B}$

Rearranging gives

${2}^{\mathrm{BW}}{B}^{2}=\left({2}^{\mathrm{BW}}-1{\right)}^{2}$

Thus

$1/Q=B={2}^{\mathrm{BW}/2}-{2}^{-\mathrm{BW}/2}$

which agrees with the formula given in the text file. Transforming to digital changes the bandwidth however: if the bandpass frequencies were ${\omega }_{1},{\omega }_{2}$, after a bilinear transform they are proportional to $\mathrm{arctan}\left({\omega }_{1}\right),\mathrm{arctan}\left({\omega }_{2}\right)$.

Unfortunately it is not possible to obtain a closed formula that relates ${\mathrm{BW}}_{a}$ and ${\mathrm{BW}}_{d}$, but a first-order approximation described in a paper by Robert Bristow-Johnson. gives ${\mathrm{BW}}_{a}={\mathrm{BW}}_{d}{\omega }_{0}/\mathrm{sin}\left({\omega }_{0}\right)$, which is used in the text file.

Cookbook Notch

The transfer function

$H\left(s\right)=\frac{1+{s}^{2}}{1+s/Q+{s}^{2}}$

can be derived from starting with a highpass 1-pole Butterworth filter with cutoff $B$

$H\left(s\right)=\frac{1}{B/s+1}$

and applying the bandpass transformation. Equivalently, we may start from a lowpass 1-pole Butterworth filter and apply the bandstop transformation.