Filter Tunings
Filter tunings are specific tunings of filters to optimize a particular characteristic of it’s response. Filter tuning directly specifies what the filters polynomials must be in it’s transfer function (see What Are Transfer Functions, Poles and Zeroes for more info).
- Butterworth Optimized for the flattest response through the pass-band, at the expense of having a low transition between the pass and stop-band.
- Chebyshev: Designed to have a steep transition between the pass and stop-band (but not the steepest, Elliptic tuning claims that award), at the expense of gain ripple in either the pass or stopband (type 1 or type 2). Also called Chevyshev, Tschebychev, Tschebyscheff or Tchevysheff, depending on exactly how you translate the original Russian name. There are two types of Chebyshev filters:
- Type 1: Type 1 Chebyshev filters (a.k.a. just a Chebyshev filter) have ripple in the passband, but no ripple in the stopband.
- Type 2: Type 2 Chebyshev filters (a.k.a. an inverse Chebyshev filter) have ripple in the stopband, but no ripple in the passband.
- Bessel: Optimized for linear phase response up to (or down to for high-pass filters) the cutoff frequency , at the expense of a slower transition to the stop-band. This is useful to minimizing the signal distortion (a linear phase response in the frequency domain is a constant time delay in the time domain).
- Elliptic: Designed to have the fastest transition from the passband to the stopband, at the expense of ripple in both of these bands (Chebyshev optimization only produces ripple in one of the bands but is not as fast in the transition). Also called Cauer filters or Rational Chebyshev filters.
These filters are explained in more detail below. If you are interested in visual comparisons, you can skip straight to the Comparisons Between Filter Tunings section.
Butterworth Tunings
Tuning a filter for a Butterworth response gives a filter which is maximally flat in the passband, and rolls off towards zero in the stopband. The price you pay for this is slower roll-off into the stop-band, compared with Chebyshev or Elliptic tunings.
Butterworth tunings are defined as a filter whose magnitude is1:
where:
is the angular frequency
is the order of the filter
The normalized Butterworth polynomial of degree is given by2:
Below is a table of the normalized factored Butterworth polynomials for order . The polynomial is useful in this form as each product forms either a first or second-order partial filter which can be directly implemented by a standard filter topology (e.g. RC filter for a first-order section, Sallen-Key for a second-order section). These polynomials were generated with the Butterworth polynomial equation above. The polynomials are normalized by setting (the characteristic frequency).
All numbers are rounded to 3 decimal places.
n | polynomial |
---|---|
1 | ((s + 1)) |
2 | ((s^2 + 1.414 s + 1)) |
3 | (\left(s + 1\right) \left(s^2 + 1.0 s + 1\right)) |
4 | (\left(s^2 + 0.765 s + 1\right) \left(s^2 + 1.848 s + 1\right)) |
5 | (\left(s + 1\right) \left(s^2 + 0.618 s + 1\right) \left(s^2 + 1.618 s + 1\right)) |
6 | (\left(s^2 + 0.518 s + 1\right) \left(s^2 + 1.414 s + 1\right) \left(s^2 + 1.932 s + 1\right)) |
7 | (\left(s + 1\right) \left(s^2 + 0.445 s + 1\right) \left(s^2 + 1.247 s + 1\right) \left(s^2 + 1.802 s + 1\right)) |
8 | (\left(s^2 + 0.39 s + 1\right) \left(s^2 + 1.111 s + 1\right) \left(s^2 + 1.663 s + 1\right) \left(s^2 + 1.962 s + 1\right)) |
Using these polynomials , we can write the transfer function of a Butterworth filter as2:
This transfer function gives the bode plots in This is a placeholder for the reference: fig-butterworth-bode-plot-for-various-n (by taking the magnitude and arg of the transfer function).
The Butterworth polynomial coefficients for an -order filter can be calculated with this product-based equation1:
where:
(ignore the above equation for )
There is also a recursive formula to calculate the coefficients, but we’ll just use the product based one. The below table shows the Butterworth polynomial coefficients calculated with this equation, up to (8th order filter).
n | polynomial |
---|---|
1 | ((s + 1)) |
2 | ((s^2 + 1.414 s + 1)) |
3 | (\left(s + 1\right) \left(s^2 + 1.0 s + 1\right)) |
4 | (\left(s^2 + 0.765 s + 1\right) \left(s^2 + 1.848 s + 1\right)) |
5 | (\left(s + 1\right) \left(s^2 + 0.618 s + 1\right) \left(s^2 + 1.618 s + 1\right)) |
6 | (\left(s^2 + 0.518 s + 1\right) \left(s^2 + 1.414 s + 1\right) \left(s^2 + 1.932 s + 1\right)) |
7 | (\left(s + 1\right) \left(s^2 + 0.445 s + 1\right) \left(s^2 + 1.247 s + 1\right) \left(s^2 + 1.802 s + 1\right)) |
8 | (\left(s^2 + 0.39 s + 1\right) \left(s^2 + 1.111 s + 1\right) \left(s^2 + 1.663 s + 1\right) \left(s^2 + 1.962 s + 1\right)) |
For example, the above table tells you for order the Butterworth polynomial is . If expand the factorized version we should arrive at the same polynomial:
Yay, they are the same! If you are ever wanting to generate the Butterworth polynomial coefficients yourself, here is a Python function that returns you the Butterworth coefficients for any order :
Chebyshev Tunings
Chebyshev-tuned filters with even order numbers (e.g. 2nd order, 4th order, …) generate ripples above the 0dB line, filters with odd order numbers (e.g. 3rd order, 5th order, …) generate ripples below the 0dB line.
Chebyshev-tuned filters can be further broken down into two types:
- Type I: Ripple in the pass-band, no ripple in the stop-band. This is the most common type of Chebyshev-tuned filter, as it has faster roll-off. Sometimes referred to just as a Chebyshev filter (with no mention that it’s Type I).
- Type II: No-ripple in the pass-band, ripple in the stop-band. Also known as an inverse Chebyshev-tuned filter. This is not as popular as Type I as it’s roll-off is not as steep.
Because Chebyshev filters have ripple in the pass-band, their cutoff frequency is usually defined in a completely different way to all other filter optimizations. Rather than specifying as the -3dB point, the for Chebyshev filters is defined at the point at which the gain leaves the allowed ripple region (i.e. > 0.5dB for a 0.5dB Chebyshev filter, > 3dB for a 3dB Chebyshev filter).
A Type I Chebyshev tuned filter of order has a gain response of3:
where:
is the damping factor
is the characteristic frequency
is a Chebyshev polynomial of the first kind with order
The ripple in the passband may have multiple maxima and minima. However, the peaks of each maxima/minima have the same amplitude (i.e. they are bounded by a fixed value). This is known as equiripple behaviour, and stems from the core definition of a Type I Chebyshev polynomial.
The driving factor behind the Chebyshev tunings is the Chebyshev polynomials of the first kind. They are defined by4:
You can calculate the Chebyshev polynomials of the first kind with the recursive definition4:
The first 6 Chebyshev polynomials are shown below:
These are special polynomials in which the leading coefficient (coefficient in front of the highest power of ) is the largest value it can be whilst the polynomial is bounded between on the interval 4. You can see this interesting behaviour in the graph in This is a placeholder for the reference: fig-chebyshev-poly-graph. It shows the first 6 Chebyshev polynomials through to . Note that , and is somewhat hidden by the horizontal bounding line.
The below Python function can be used to calculate the Chebyshev polynomial coefficients of the first kind, for a given order . Although we could build up a recursive function and use sympy to find them based of the recursive equation above, it’s easier just to use the numpy.polynomial
module which provides a function to calculate them.
Bessel Tunings
A Bessel tuned filter is one which has a maximally linear phase response. This corresponds to a maximally flat group/phase delay (the time it takes for a signal to pass through as a function of frequency). This behaviour preserves the shapes of filtered signals in the passband, which is a desirable property for audio signals. It is also sometimes called Bessel-Thomson tuned filters because W. E. Thomson who worked out how to apply Bessel functions to electronic filters in 19495.
The transfer function of a low-pass Bessel tuned filter is6:
where is a reverse Bessel polynomial (more on this below), is the characteristic frequency and .
The reverse Bessel polynomials are given by6:
where is a coefficient given by:
However, by this definition of the reverse Bessel polynomials, is indeterminate. So instead, is defined as:
The above equations were used to generate the table below, which lists the reverse Bessel polynomials of degree 0 to 8.
Degree (n) | Reverse Bessel Polynomial |
---|---|
0 | (1) |
1 | (s + 1) |
2 | (s^2 + 3 s + 3) |
3 | (s^3 + 6 s^2 + 15 s + 15) |
4 | (s^4 + 10 s^3 + 45 s^2 + 105 s + 105) |
5 | (s^5 + 15 s^4 + 105 s^3 + 420 s^2 + 945 s + 945) |
6 | (s^6 + 21 s^5 + 210 s^4 + 1260 s^3 + 4725 s^2 + 10395 s + 10395) |
7 | (s^7 + 28 s^6 + 378 s^5 + 3150 s^4 + 17325 s^3 + 62370 s^2 + 135135 s + 135135) |
8 | (s^8 + 36 s^7 + 630 s^6 + 6930 s^5 + 51975 s^4 + 270270 s^3 + 945945 s^2 + 2027025 s + 2027025) |
The visually demonstrate the flat group delay of the Bessel tuned filter, we can plot the group delay of the Bessel-tuned 4th-order low-pass filter vs. a number of other popular tunings. The below plot shows the group delay for Bessel, Butterworth, Chebyshev and Elliptic tuned filter. The critical frequency was set to for all filter tunings. All filters are 4th-order. As you can see in This is a placeholder for the reference: fig-tuning-comparison-group-delay, the Bessel tuned filter has the flattest group delay.
This also means that a Bessel-tuned filter has the least ringing due to a step response, as shown in the plot in This is a placeholder for the reference: fig-tuning-comparison-step-response (more on this in the Comparisons Between Filter Tunings section).
Elliptic Tunings
Elliptic-tuned filters (a.k.a. a Cauer or Zolotarev filter7, but not to be confused with the Cauer/ladder filter topology) is a filter that is optimized for the fastest transition in gain from the passband to the stopband. The ripple has constant magnitude in the passband, and the same applies in the stopband (equal ripple)8. This does not however mean that the amount of ripple in the passband is the same as what is in the stopband!
Whereas most tunings are defined with a transfer function, the Elliptic filter is a special case where it is defined by it’s gain. The gain for a lowpass Elliptic tuned filter is8:
where:
is the ripple factor
is the nth-order elliptic rational function
is the selectivity factor ()
is the characteristic frequency, in radians per second
The big problem is that the elliptic ration function cannot be easily expressed algebraically!9 It’s general definition involves a Jacobi elliptic cosine function and the elliptic integral7. Diving into this would be a headache, so we’re just going to take the easy option and use the Python scipy.signal.ellip()
function to provide us with the transfer function coefficients.
You can generate an Elliptical filter in Python using the scipy package:
where N
is the order of the filter, rp
is the maximum ripple allowed below unity in the passband, rs
is the minimum attenuation required in the stopband, and Wn
is the critical (characteristic) frequency. The returned b
and a
are arrays of the transfer function numerator and denominator coefficients.
Comparisons Between Filter Tunings
The following parameters were used for the filters:
- All filters are 4th-order filters.
- Characteristic frequency of . For Butterworth and Bessel tunings the characteristic frequency is defined as the point. For Chebyshev and Elliptic filter tunings the characteristic frequency is defined as the point where the ripple leaves the allowable amount in the passband.
- A rather arbitrary of passband ripple was allowed for both the Chebyshev and Elliptic filters.
- Being even more arbitrary, the Elliptic filter was allowed to rise back up to in the stopband.
With the above specified, the transfer function of each filter is fully defined.
Now we can finally look at some comparisons. The plot in This is a placeholder for the reference: fig-tuning-comparison-gain-db compares the gain response of each filter tuning. Both axis are logarithmic. You can clearly see the Elliptic-tuned filter winning the race.
I think the difference is gain response can be better viewed with linear x and y axes So we’ll drop the in favour of and get rid of the logarithmic x-axis, as shown in This is a placeholder for the reference: fig-tuning-comparison-gain-linear.
The linear axes helps to highlight the spread in behaviour between the different tunings. Look at that ripple in the passband with the Chebyshev and Elliptic filter tunings!
This is a placeholder for the reference: fig-tuning-comparison-phase-log shows the phase response of each filter tuning.
What you can’t easily pick out with logarithmic frequency axis is how linear the phase response is. So let’s replot the above but with a linear x-axis (frequency). We’ll stop plotting at twice the characteristic frequency.
A comparison of group delay for the various filter tunings is shown in This is a placeholder for the reference: fig-tuning-comparison-group-delay. You can clearly shows the flat group delay of the Bessel filter, and the horrible response of the Chebyshev/Elliptic filter tunings.
The step response is also interesting to look at. The input step was from to and the output of each filter is shown in This is a placeholder for the reference: fig-tuning-comparison-step-response.
The Bessel-tuned filter shows the least amount of ringing. This is what we would expect, as the Bessel-filter is optimized to have the flattest group delay. All frequencies get delayed by roughly the same amount, and so the output is not “distorted”. Ringing is a result of different frequencies being delayed by different amounts of time (remember that an input step response essentially has frequency components at all frequencies, hence why it is a good testcase for a filter).
Further Reading
If you want to learn more about transfer functions, the Laplace transform, gain/phase plots and group delay, check out the What Are Transfer Functions, Poles, And Zeroes? page.
If you are interested in actually building a filter with these filter tunings, you’ll have to learn how to apply a specific filter tuning to a particular filter topology. For general filter topologies, see the Analog Filters page. For info specific to the popular 2nd-order Sallen-Key filter, see the Sallen-Key Filters page.
Footnotes
-
Wikipedia (2022, Aug 25). Butterworth Filter. Retrieved 2022-10-08, from https://en.wikipedia.org/wiki/Butterworth_filter. ↩ ↩2
-
Pieter P (2021, Jul 15). Butterworth Filters. Retrieved 2022-10-06, from https://tttapa.github.io/Pages/Mathematics/Systems-and-Control-Theory/Analog-Filters/Butterworth-Filters.html. ↩ ↩2
-
Wikipedia (2022, Oct 11). Chebyshev Filter. Retrieved 2022-10-14, from https://en.wikipedia.org/wiki/Chebyshev_filter. ↩
-
Wikipedia (2022, Oct 16). Chebyshev polynomials. Retrieved 2022-10-16, from https://en.wikipedia.org/wiki/Chebyshev_polynomials. ↩ ↩2 ↩3
-
W. E. Thomson (1949, Nov). Delay networks having maximally flat frequency characteristics. 621.392.5: Paper No. 872 - Radio section. ↩
-
Wikipedia (2022, Oct 16). Bessel filter. Retrieved 2022-10-20, from https://en.wikipedia.org/wiki/Bessel_filter. ↩ ↩2
-
Sophocles J. Orfanidis (2006, Nov 20). Lecture Notes on Elliptic Filter Design. Rutgers University: Department of Electrical & Computer Engineering. Retrieved 2022-09-20, from https://www.ece.rutgers.edu/~orfanidi/ece521/notes.pdf. ↩ ↩2
-
Wikipedia (2022, Jan 30). Elliptic filter. Retrieved 2022-09-20, from https://en.wikipedia.org/wiki/Elliptic_filter. ↩ ↩2
-
Recording Blogs. Elliptic filter. Retrieved 2022-10-26, from https://www.recordingblogs.com/wiki/elliptic-filter. ↩