Sunday, August 31, 2014

Butterworth Filter Design

Untitled (Wolfram Mathematica 9.0 for Students - Personal Use Only : www.wolfram.com)
by Michael Delany
With download included in conclusion

Introduction

Its very common to want to develop a filter that has a response similar to an ideal low pass filter. With the ideal low pass filter, frequencies less than some value are allowed to pass, while others are rejected. This is the idea behind use of the Butterworth filter.



The image above is the ideal low pass filter that we would like to have, but realistically you can’t always get what you want. So, with that said we’ll design something that’s “close enough” according to engineering design specifications. First, we need to go over some concepts used for filter design in general.

Filter Design Specifications

Since the ideal filter isn’t realizable, there will be some design parameters we will design against. The first one is the parameter known as the passband ripple. This is the maximum allowable peak to peak ripple in the passband in decibels (dB). Between the passband and stopband there is a section called the transition band. The transition band is where the attenuation is starting to occur, but hasn’t reached the minimum desired stopband attenuation . The frequency where the passband stops is and where the stopband starts is .

One thing to note about the Butterworth filter is that it’s an all pole filter. In addition, there are a certain number of stages of cascaded filters needed to realize entire filter design. Once the design parameters , , , and are determined by the designer, the order (number of poles) of the filter is set.

Regardless of the number of poles in the Butterworth filter, at frequency , the value of the transfer function will be



where ε is computed from . For example, lets say we want to design a filter that only varies by 1 dB in the passband region. Then using the following equation we can calculate ε:

In the above equation, using 1 dB as the passband ripple value we get ε as 0.508847. Now we must set some other design parameters. In addition, we need to determine what we want for . Lets say that in the stopband, we want the attenuation to be 12 dB; therefore, is 12 dB.

Referring to Figure 2, we want the attenuation at noted greater than or equal to to fulfill our design considerations.

In this case, is the cutoff frequency of the filter and is a value that we choose, noting that it will be more difficult to realize the filter as gets close to .

As an example let’s use the following numbers.

= 1 dB
= 12 dB
= 10 kHz * 2π rad
= 15 kHz * 2π rad

Using the slide bar above, we can read off the order (press the + button to see the order) until the value for becomes greater than = 12 dB. This value happens to be five (5), which means that the Butterworth filter is going to need five poles to meet our design specifications.

Constructing the Filter Design

The Butterworth filter is going to place all of the poles at the same location . Using the following code we can compute the normalized filter transfer function. Later, we’ll use the normalized design as a template for filters of different impedances and our cutoff frequency . As can be seen in the pole diagram below, is currently normalized to 1 [rad/s].

Good. So now that we have the transfer function, let’s take a look at the poles and what their values are.

The Butterworth filter employs poles at the same frequency which are spaced evenly around the left-hand side of the s-plane. Let’s extract the poles and see what they look like. It should be noted that when the order of the filter is odd, there will be one real pole and the others will be complex conjugates. If the order of the filter is even, then all the poles will be complex conjugates. Using a For[ ] loop to iterate over the List, the poles are:

From here, we’ll take all of the poles and convert them to combination of second order and single pole transfer functions.

As a sanity check, let’s take a look at the tranfer function

One thing to note at this point are the poles of the transfer function. Right now there are five poles and as said earlier, this is an all pole filter. We also said that the final transfer function for the entire filter is a combination of 2nd order transfer functions and a single pole is added if the order of the transfer function is odd. The following is the standard form for a second order transfer function. Something we discussed in blog post 1, Plotting Transfer Functions with Mathematica.

T(ω) =

For the the fifth order filter contructed above, we see that taking to be normalized to 1 [rad/s] yields the coefficient attached to the s term equal to 2ζ. Let’s just call this number d:

d = 2ζ

So, in the example above, the d coefficients are =1.61803 and =0.61804. We’ll use a well known active filter topology called the unity gain Sallen-Key topology, which when normalized looks like:

Now that we have the normalized filter design, all we have to do is scale the impedance and the frequency to match our use. Following the steps in Don Lancaster’s Active Filter Cookbook...

TO SCALE IMPEDANCE:

Multiply all resistors and divide all capacitors by the new value expressed in units of 10k

TO SCALE FREQUENCY:

Keep the ratio of both frequency determining capacitors constant. Double the capacitors to halve the frequency and vice versa. If the 1-kHz capacitor value is 0.016 μF, changing to 1600pF will raise the frequency to 10kHz. Similarly, a 0.16 μF capacitor will lower the frequency to 100Hz.

As you can see, the cutoff frequency for the filter will be 1/2πRC when you ignore the factor of 2/d and d/2. Now all we have to do is change the capacitors to reflect our design specifications originally of a cutoff frequency of 10kHz. To do this, we’ll decrease our capacitor values by a factor of 10 to increase the cutoff frequency by a factor of 10.

Therefore, once we’ve picked all of our component values, all we need to do is multiply by the factors of d/2 and 2/d. Each stage will realize a complex conjugate pair and a single active low pass filter could be used for the single pole. All of these stages can then be cascaded to achieve the desired filter.

Conclusion

From the books I’ve read, I’ve noticed not all books contain all of the information necessary to truly design a Butterworth filter. Hopefully the combination of sources used for this post bridge these gaps. The filter we designed was used to overcome the problem of realizing an ideal low pass filter. We determined the order of the filter based on some design parameters known as the passband ripple, stopband attenuation, cutoff frequency and stopband starting frequency.

Once we determined the order of the filter, we broke it down into stages that were cascaded together. Some stages were second order filters that used the unity Sallen-Key topology and others were active filter low pass circuits. Each of these stages are known as normalized filters, whereby just the component values can be changed to achieve the functionality required.

With that said, the Mathematica notebook file is also available for download. So if you ever need to do a Butterworth filter design, you can use this as a quick template for building one.

Download: ()

Sources

1. Lancaster, Don. “Low-pass Filter Circuits.” Active-filter Cookbook. Indianapolis: H.W. Sams, 1975. 121-27. Print.

2. Lancaster, Don. “First and Second-Order Networks” Active-filter Cookbook. Indianapolis: H.W. Sams, 1975. 43-47. Print.

3. Sedra, Adel S., and Kenneth C. Smith. “Filters and Tuned Amplifiers.” Microelectronic Circuits. 6th ed. New York: Oxford UP, 1998. 1254-267. Print.

1 comment:

  1. Thanks for the comment Otavio! The book I referenced for these figures was source number 3 in the bibliographies, Sedra and Smith's Microelectronic Circuits (specifically the filters section).

    You can get this book very cheap online and it's a great reference book.

    One thing I don't think I mentioned is that the Butterworth filter has the flattest response possible in the passband compared to other active filters.

    ReplyDelete