Infinite Impulse Response (IIR) Filters are different to FIR filters in that the impulse response never ends. This is due to the main difference in design as IIR filters incorporate a feedback path. This architecture of IIR filters makes them the best candidate when approximating analog filters. Before we get in to analog modeling, it is important to understand some common design methods of IIR filters. In this article I want to talk specifically about IIR Filters and how we can make prototype designs. All code for this article can be found on my GitHub.

Introduction

Before we understand virtual analog filters we should take the time to understand the common filter prototypes. Filter prototypes, or classes, were invented as a means of quickly creating a template filter with certain design trade-offs. There are four filter prototypes that you need to understand:

  • Butterworth Filter
  • Chebyshev Filter Type I
  • Chebyshev Filter Type II
  • Elliptic Filter

There are more filter classes besides those listed above. Not all filter prototypes used for continuous systems can be correctly translated to the digital domain. However, these four classes are in the filter design class in the JUCE framework and this is why I am explaining them.

When designing IIR filters in a software suite such as MATLAB, you will often see a diagram of this sort:

Essentially, we are asking, how can we make a line that will not touch the shaded areas and meet our design specifications. As you can see, we have a lot to play with. We can change a filter’s deviation in the pass-band, deviation in the stop-band, stop-band attenuation, transition bandwidth and cutoff frequency. The variables used in this diagram are as follows:

This gives us two primary parameters that we use in the design stage. We will probably return to these terms and definitions in a future article where I demonstrate an example filter design process. [1]

In this article we will not be going over the mathematics involved in designing the different filter classes. That would likely make this article too long. For the sake of brevity, we are going to focus on the different filter prototypes and compare them. Furthermore, we will only be focusing on creating prototype low-pass filters in this article.

Butterworth

A low-pass Butterworth filter is an all-pole filter with a a squared magnitude response (we will return to this definition in the future) [1]. The number of poles is defined as the filter order. The defining characteristic of a Butterworth filter is that it is monotonic in both the pass-band and stop-band. Monotonic means that it does not exhibit any rippling in those regions. The engineering trade-off is that the transition band is wide. As a result, you must use a much higher order Butterworth to get a sharper filter cutoff. The following graph shows a Butterworth filter of order = [1, 2, 4, 5]. As you can imagine, the wall of diminishing returns hits you pretty hard. The black line marks filter cutoff.

Chebyshev Type I

Chebyshev Type I filters allow one to design a filter where deviation in the pass band is allowable. As a result, the pass band exhibits ripples while the stop band is monotonic. The upside is that you can achieve a narrower transition band. In other words, you are trading a lower discriminatory factor for a better selectivity factor. [1]

It is typical in audio devices to aim to achieve a pass band ripple of ± 3 dB or less. In this filter I have specified that the minimum allowable attenuation would be 6 dB in the pass band.

Chebyshev Type II

Chebyshev Type II filters allow one to design a filter where deviation in the stop band is allowable. As a result, the pass band is monotonic while the stop band exhibits ripples. The upside is that you can achieve a narrower transition band just like the Type I but your cutoff will move for the sake of reaching the stop band frequency sooner. Notice below how the stop band ripples are different depending on even and odd filter orders. [1]

It is typical in audio devices to aim to achieve a stop-band attenuation of -60 dB or more. In this filter I have specified that the minimum allowable attenuation would be -54 dB for the stop band.

Elliptic

Elliptic filters provide a nice balance between the Chebyshev variants. In an Elliptic filter, there is ripple in both the pass band and stop band but the transition band width can be made even narrower. [1] All code for this article can be found on my GitHub.

In this filter, I have specified that the filter could exhibit a 6 dB deviation in the pass band and stop bands. As a result, we have an incredibly sharp cutoff for a given filter order.

Trade-Offs in the Time Domain

Of course, as you know from all of my articles, the time domain and frequency domain are inextricably linked. Every modification we make in the frequency domain aspects of a filter has direct implications to the impulse response. So it would be wise of us to look at each of these prototypes and compare their impulse responses for a given filter order. The following graph shows the resulting impulse response that each prototype yields at the same cutoff frequency for the same order N=4. All code for this article can be found on my GitHub.

As you can see, the filters with the smallest transition bands and largest deviations in the pass-band exhibit the longest decay time. The reasons for this are too long for this article. However, I want you to think of these IIR filter prototypes as an analogous method to the window design method for FIR filters. The steeper the filter we require, the longer the trailing impulse response. The question is:

Is this longer decay audible?

The answer is: Not likely. You can feasibly make resonators on this principle of designing for a high selectivity factor. But the main concern for the long impulse response comes into play when analyzing the effects of a filter on a signal used to control a system. The bottom line is:

Does the shape of the signal matter?

We will return to this concept when we examine linear phase filters and why they are used. Please note that the magnitude-phase response of filters is something that we have not discussed yet.

Conclusion

In this article, I have given a brief overview of the classic analog filter prototypes. It should be clear how they can be used to create an IIR filter for a given set of specifications. In this article, we have compared the four different methods found in the JUCE filter design class. In a future article, I want to explain more about IIR filters and their design. Perhaps, it will be useful to explain, at length, the design process of an example filter. There is so much to cover. Until then:

Be good to each other and take it easy…

-Will ☜(゚ヮ゚☜)

Bibliography/Citations/Resources:

[1] Schaums Outline of Digital Signal Processing, 2nd Edition (Schaum’s Outlines)

[2] Understanding Digital Signal Processing

Liked it? Take a second to support William Fehlhaber on Patreon!

Shopping cart

Subtotal
Shipping and discount codes are added at checkout.
Checkout

Sign up here to learn about our premium courses and more!

 

Thank you for being a part of The Audio Programmer Community!