The Butterworth filter is given by the normalized transfer function
where n is the order of the filter and B_{n}(S) are the normalized Butterworth polynomials given by
for n even and n odd respectively.
This transfer function is normalized (i.e., it is for the Butterworth low pass filter with cutoff frequency 1). Substituting S = s / ω_{c} produces the Laplace transform transfer function of the Butterworth low pass filter, where ω_{c} is the cutoff frequency of the filter. Substituting S = ω_{c} / s produces the Butterworth high pass filter. Substituting S = (s^{2} + ω_{c}^{2}) / (B s) produces the Butterworth band pass filter, where ω_{c} is the midpoint of the pass band and B is the width of the band. Substituting S = B s / (s^{2} + ω_{c}^{2}) produces the Butterworth band stop filter.
Example: transfer function of the second order low pass Butterworth filter
Substituting S = s / ω_{c} and n = 2 produces the transfer function
In general, for any order n, the transfer function of the low pass Butterworth filter can also be written as
To compute the specifications of either digital or analog Butterworth filters from this transfer functions, one must use a significant amount of algebraic / mathematical manipulations. Generally, there are two methods, examples of which are presented below. The first method uses inverse Laplace transforms. It is more mathematically involved, but does not warp the magnitude response of the analog filter. The second method uses the bilinear transformation. It is easier to implement and performs well for digital filters, although it is an approximation.
Example of an impulse invariant second order Butterworth low pass filter
Use the general form of the Butterworth low pass transfer function and set n = 2. The transfer function becomes
Using the definition of s_{k} and partial fraction expansion we get
The filter's impulse response can be obtained with the inverse Laplace transform. The continuous (analog) impulse response is
where y(t) is the output signal and x(t) is the input signal. Substitute t with k to get the discrete form of the impulse response. The Z transform of the impulse response then is
Combine the two terms and use the fact that s_{1} and s_{2} are complex conjugates and that s_{1} s_{2} = ω_{c}^{2} and s_{1}+ s_{2} = 2 ω_{c} cos(3π/4).
The second order Butterworth low pass filter then is
where y(k) is output signal and x(k) is input signal.
Suppose, for example, that the cutoff frequency is ω_{c} = 0.6. The transfer function becomes
and the filter itself is given by
The following graph shows how the filter responds to an impulse.
Given sampling frequency of, say, 2000 Hz, the cutoff frequency translates to ω_{c} = (0.6 * 2000 / (2π)) = 191 Hz. The magnitude response of this example filter is shown on the graph below.
Example of a second order Butterworth low pass filter using the bilinear transformation
An easier way to compute the Z transform transfer function for the Butterworth filter is to use bilinear transformation. The relationship between the Laplace transform and the Z transform is z = e^{sT}, where T is the sampling time (i.e., T = 1/ f_{s}, where f_{s} is the sampling frequency). Thus
Setting, as is usually assumed, T = 1 and substituting s = 2 (z – 1) / (z + 1), we get
Suppose again that the cutoff frequency is ω_{c} = 0.6 (technically, ω_{c} = 2 arctan(0.6/2) ≈ 0.583, because of the warping of the frequency domain by the bilinear transformation). After scaling to obtain 1 at the beginning of the denominator, we get
This filter is different than the impulse invariant filter described above, because the bilinear transformation is an approximation. Here are the magnitude responses of the two filters.
The bilinear transformation filter performs better and is easier to derive. The bilinear transformation, however, warps the frequency response of the filter. A digital Butterworth filter with a cutoff frequency ω_{d}, if implemented in the analog world, will have a cutoff frequency of ω_{a} = 2 tan(ω_{d}/2), and when designing analog filters, we must be careful to pick the right analog cutoff frequency. This said, the bilinear transformation is the easier and more commonly used method.
Higher order Butterworth filters
When designing higher order Butterworth filters we have two choices. We can use the methods above. Those are tedious, as there are a lot of computations involved. Alternatively, we can recognize that the roots s_{k} of the denominator of H(s) are complex conjugate pairs. For example, in a Butterworth filter of order 4, s_{1} and s_{4} are a pair and s_{2} and s_{3} are a pair.
We can rewrite H(s) for the fourth order low pass Butterworth filter as follows.
Both multiples above have real coefficients, since they use complex conjugates. The multiplication of the two transfer functions of two filters of order 2 means that the impulse response of the total filter is the convolution of the impulse responses of the two filters and the filters must be stacked one after the other. The output of the first filter will become the input to the second filter (these are not Butterworth filters, as the roots s_{k} are not the Butterworth ones for order 2, although the bilinear transformation computations use the same computations).
The following graph compares the magnitude responses of the second and fourth order Butterworth filters, where the fourth order Butterworth filter is implemented as two second order filters stacked one after the other and where both filters are computed using bilinear transformations. Note that the two filters cross at around -3 dB, which, typically of Butterworth filters, happens at the cutoff frequency. Here the sampling frequency again is 2000 Hz and the cutoff frequency is ω_{c} = (0.6 * 2000 / (2 π)) = 191 Hz.
Example of a second order high pass Butterworth filter
Substitute S = ω_{c} / s and n = 2 in the transfer function at the top of this topic to obtain
This is the transfer function of the second order high pass Butterworth filter. Use the bilinear transformation s = 2 (z – 1) / (z + 1) to rewrite this transfer function as follows.
When ω_{c} = 0.6 for example, then the transfer function is
Take a sampling frequency of, say, 2000 Hz. The cutoff frequency translates to ω_{c} = 191 Hz, and the transfer function above produces a filter with the following magnitude response.
Example of a second order band pass Butterworth filter
Substitute S = (s^{2} + ω_{c}^{2}) / (B s) and n = 2 to obtain the second order Butterworth band pass filter. The Butterworth band pass and band stop filters take a lot of algebraic manipulation and it is probably easier to simply stack low pass and high pass filters. In any case, the transfer function of the second order Butterworth band pass filter after the bilinear transformation is as follows.
Using, for example, ω_{c} = 0.6 and B = 1 produces the filter
Given a sampling frequency of, say, 2000 Hz, the midpoint frequency translates to ω_{c} = 191 Hz and the band width translates to B = 318 Hz. The magnitude response of this band pass filter is
Butterworth's idea and a simple explanation of the filter derivation
Butterworth aimed at designing a filter that had both a good stop band attenuation as well as uniform (flat) magnitude response in the pass band. The following is a slight modification the desired magnitude response used in the original Butterworth paper.
Assuming that ω and ω_{c} are normalized frequencies and hence span the frequency spectrum between 0 and π, a plot of this desired magnitude response with ω_{c} = 0.6 and three different values of n – 2, 5 and 8 – is shown below. This function indeed behaves like the magnitude response of a low pass filter – one that has a cutoff frequency of ω_{c} and one that improves with larger n.
We note that the Butterworth magnitude response is monotonically decreasing. The first derivative of the Butterworth magnitude response is
This derivative is always negative, as the magnitude response and the frequency are always positive. This means that the magnitude response always decreases and has no ripples.
If we continue taking the derivative of the magnitude response we will note that at ω = 0, all derivatives up to the 2n-th derivative are zero. Thus, this filter is said to have maximally flat magnitude response.
The magnitude response
means that the squared transfer function, with s = j ω, should translate to something like
We can rewrite the squared transfer function expression by solving for the roots of the denominator
For example, when n = 2, the denominator of the squared magnitude response produces four evenly spaced roots
Note that s_{1} and s_{4} are complex conjugates and s_{2} and s_{3} are complex conjugates. Thus, when n = 2
and
where s_{a} and s_{b} are some combination of two of the four roots. (Usually, rather than writing H(s)^{2}, we write H(s)H(-s). We assume that the magnitude response is symmetric around zero, which has benefits. Since Fourier transforms, Laplace transforms, and Z transforms employ sine and cosine functions, which are respectively negative (sin(x) = -sin(-x)) and symmetric (cos(x) = cos(-x)) functions, taking the inverse transform of a symmetric desired magnitude response typically allows us to produce a filter of real valued coefficients. Such filter is sometimes referred to as a "zero phase" filter. That is, the impact of such a filter on the signal depends on the frequency of the signal and not on the phase.)
If we are familiar with IIR filters, we would obviously take the two roots with negative real parts, as that ensures that the filter is stable (s_{2} and s_{3} above). The following is a somewhat simple explanation of why this makes sense.
Since we prefer a transfer function that depends on the frequency and not on the phase, we would pick, again, s_{a} and s_{b} such that the transfer function becomes one of real coefficients. This means taking two complex conjugate roots. We can also note that the complex pairs s_{1} and s_{4} and s_{2} and s_{3} produce similar, but slightly different Z transform functions, denoted by +/- in the function below.
In fact, the pair s_{1} and s_{4} produces
This filter is unstable. If we put a simple wave through it, the sampled values of output will begin increasing indefinitely, which is a matter of simply taking any simple sine or cosine wave and trying it out.
The stability / instability of these two filters can also be explained by saying that a stable system is one that produces reasonable (bound) response to any reasonable (bound) input. The Laplace transform of such system must be bound. Since in practice we only work with nonnegative amplitudes, we want a Laplace transform transfer function be bound for all s for which σ = Re(s) ≥ 0. If the transfer function has denominator roots (poles) where it is not bound, these roots must have negative real parts.
The second order low pass Butterworth filter has four potential poles as described above. Those are shown on here for ω_{c} = 0.6 in the complex s plane. The stable filter can be created by taking the two poles with negative real parts, which are the ones in the left half plane.