Experiment6 Butterwrth Filter
Experiment6 Butterwrth Filter
Contents:
Pre-lab
Lab activities: Design and build an active circuit that realizes a fourth-order
low-pass Butterworth filter and experimentally determine the frequency
response (magnitude and phase), step-response and impulse-response.
Post-lab
Links to resources and data sheets:
o The LF351 op amp data sheet
o The LM741 op amp data sheet
o Capacitor types and their application
o WaveForms configuration file: experiment6
Background
We desire a low-pass filter that has a maximally-flat magnitude response, |𝐻(𝜔)|, over the pass-
band region, [−𝜔𝑐 + 𝜔𝑐 ], where 𝜔𝑐 is the radian cutoff frequency. A class of maximally flat
filters can be obtained by utilizing the following Butterworth function, where 𝑛 is the filter order.
1
𝐴(𝜔, 𝑛) = |𝐻(𝜔, 𝑛)| =
𝜔 2𝑛
√1 + (
𝜔𝑐 )
The following is a plot showing the magnitude response of the Butterworth low-pass filter for a
normalized cutoff frequency, 𝜔𝑐 = 1.
The transfer function for an 𝑛th-order Butterworth low-pass filter has no zeros; it is given by
1 1
𝐻(𝑠) = = 𝑛 𝑛−1
(𝑠 − 𝑝1 )(𝑠 − 𝑝2 ) … (𝑠 − 𝑝𝑛 ) 𝑎𝑛 𝑠 + 𝑎𝑛−1 𝑠 + ⋯ + 𝑎1 𝑠 + 𝑎0
𝑗𝜋(2𝑘+𝑛−1)
with poles 𝑝𝑘 = 𝑒 𝑗𝜃𝑘 = 𝑒 2𝑛 , 𝑘 = 1, 2 , … 𝑛. This leads to all filter poles to have negative
real parts (thus assuring a stable filter) and to be symmetrically located on the unit-circle in the
complex plane.
For example, for 𝑛 = 1 the pole is at −1. For 𝑛 = 2 the poles are complex conjugate and are
3𝜋 5𝜋
located at 𝑝1 = 𝑒 𝑗 4 and 𝑝2 = 𝑒 𝑗 4 , as depicted in the figure below.
The 2nd order filter’s transfer function can then be written as
1 1
𝐻(𝑠) = 3𝜋 5𝜋 =
(𝑠 − 𝑒 𝑗 4 ) (𝑠 − 𝑒𝑗 4 ) 𝑠 2 + √2𝑠 + 1
For 𝑛 = 4 the poles are computed and depicted in the figure below.
This leads to the transfer function (prove it and include your solution as part of the pre-lab
assignment)
1
𝐻(𝑠) ≅
𝑠4 + 2.61𝑠 3 + 3.41𝑠 2 + 2.61𝑠 + 1
The following figures show the magnitude and phase spectra associated with the 4th order low-
𝑗𝜔
pass Butterworth filter, with cutoff frequency of 𝜔𝑐 = 10 [obtained by setting 𝑠 = in the
10
above normalized 𝐻(𝑠)]. In practice, we are concerned with the spectra for 𝜔 ≥ 0.
For convenience, we can tabulate the values of the poles and denominator coefficients of 𝐻(𝑠) as
shown in the following table (note that 𝑎0 and 𝑎𝑛 are always 1).
𝜃𝑘 n 𝑎0 𝑎1 𝑎2 𝑎3 𝑎4 𝑎5 𝑎6 𝑎7 𝑎8
𝜋 1 1 1
3𝜋 5𝜋 2 1 √2 1
,
4 4
2𝜋 4𝜋 3 1 2 2 1
, 𝜋,
3 3
5𝜋 7𝜋 9𝜋 11𝜋 4 1 2.61 3.41 2.61 1
, , ,
8 8 8 8
3𝜋 4𝜋 6𝜋 7𝜋 5 1 3.24 5.24 5.24 3.24 1
, , 𝜋, ,
5 5 5 5
6 1 3.87 7.46 9.14 7.46 3.87 1
8 1 5.13 13.14 21.85 25.69 21.85 13.14 5.13 1
The denormalized transfer function for a low-pass Butterworth filter with order 𝑛, dc gain 𝐾 and
cutoff-frequency 𝜔𝑐 can be obtained according to the formula
𝐾
𝐻𝐿𝑃 (𝑠) = 𝑛
𝑠 𝑠 𝑛−1 𝑠
𝑎𝑛 (𝜔 ) + 𝑎𝑛−1 (𝜔 ) + ⋯ + 𝑎1 (𝜔 ) + 1
𝑐 𝑐 𝑐
Example. Obtain a second-order Butterworth low-pass filter with cutoff frequency 𝜔𝑐 =1000
rad/sec and dc gain of 10.
From the above table we have the denominator coefficients 1, √2 and 1. Hence, the normalized
transfer function is
1
𝐻(𝑠) =
𝑠 2 + √2𝑠 + 1
10 107
𝐻𝐿𝑃 (𝑠) = =
𝑠 2 𝑠 𝑠 2 + 103 √2𝑠 + 106
1( ) + √2 ( 3 ) + 1
103 10
Example. Design the above active circuit such that it realizes the 2nd order low-pass Butterworth
filter
107
𝐻𝐿𝑃 (𝑠) =
𝑠 2 + 103 √2𝑠 + 106
Since we are using op-amp circuit with high input impedance and low output impedance, it is
safe to cascade those stages as shown above, without adversely loading the stages. The resistors
in such circuits have to be on the order of Kotherwise you would have to insert a buffer
circuit between the cascaded stages.
Matlab-Based Analog Filter Design Toolbox: AFD
The Analog Filter Design (AFD) Toolbox bundles a suite of tools for analog filter design and
analysis. Given a filter type (high-pass or low-pass) it can calculate pole and zero placements,
display time and frequency-domain system responses, calculate the required resistor and
capacitor values for various active-circuit implementations and complete several other useful
functions.
This toolbox is not part of Matlab and need to be installed as an Add-On. A compressed folder
containing the software is available from the course web page. Download by clicking the Analog
Filter Design for Matlab link. Then extract the files from the downloaded zipped folder. Double-
click the file to install. This will create the Add-On in Matlab, as
shown in the following figure.
The executable script afd.m need to be dragged from the unzipped folder and pasted into the
metadata directory as you can see in the above figure. The toolbox is executed by typing afd at
the Matlab prompt. A tutorial is available on the course webpage (AFD Tutorial). The following
example illustrates the design and active-circuit generation of a (two-stage) fourth-order, low-
pass Butterworth filter with 10kHz cutoff frequency and dc gain of 1. First, enter the values as
shown below.
From the “Analyze” menu we choose “List Transfer Function” and then “Plot Poles and Zeros”
to obtain the following:
The frequency response is obtained by choosing “Plot Frequency Response” from the “Analyze”
menu. The blue trace represents actual 𝑅/𝐶 values and the black trace represents ideal values.
The following are the filter’s step and impulse responses (generated by AFD):
Next, you may design an active Sallen-Key circuit that implements the filter by selecting “Build
Circuit” from the “Build” menu. The two required stages are shown below along with their
component values (5% tolerance elements were chosen).
1. Pre-Lab
Study the above “Background” section which should help you complete the following steps.
a. Install the AFD Toolbox software in Matlab on your PC and generate all of the
simulation results (plots), shown in the previous section, for the 4th order Butterworth
low-pass filter with |𝐻(0)| = 1 and 𝑓𝑐 = 10kHz for: (1) ideal components, and (2) actual
(5% tolerance) components values.
b. Use Mathcad to compare the magnitude repose (|𝐻(𝑓)| 𝑣𝑠 𝑓) of the two filters from Step
a. Employ a logarithmic scale for frequency. Recall that 𝜔 = 2𝜋𝑓 and that each stage has
a transfer function given by
1
𝑅1 𝑅2 𝐶1 𝐶2
𝐻(𝑓) =
1 1 1
(𝑗2𝜋𝑓)2 + (𝑅 𝐶 + 𝑅 𝐶 ) (𝑗2𝜋𝑓) + 𝑅 𝑅 𝐶 𝐶
1 1 2 1 1 2 1 2
Hint: The overall filter transfer function is the product of the transfer functions of the
individual stages. Your plot should look similar to the following plot.
c. Determine (from the frequency response plot, via tracing) the cutoff frequencies of the
ideal and the actual (5% tolerance components) filters.
d. Employ Multisim to verify the frequency response of the filter you designed in Step a.
(use the 5% tolerance components). Also, determine the response of the filter to a 1kHz
square signal. Repeat for a 10kHz frequency. Sample results are shown below.
e. Search your laptop for the folder that contains the configuration file (for WaveForms)
“default.dwf3work” and then download the “experiment6” configuration file and place it
inside that folder. You will need this file for the Lab activity.
It is important to read the following section (as part of the pre-lab assignment) in order to
familiarize yourself with the upcoming lab activity.
2. Lab activity
Make actual measurements of all resistor and capacitor values that you use in the following
circuit. Make sure to take photographs of all circuits that you build in the lab. Also, you are
to save all scope trace images. You will be using these photos/images in your lab report.
a. Use the breadboard to build the 4th order low-pass Butterworth filter that you have
designed and analyzed in the Pre-lab activity. Employ two LF351 op-amps.
You are to ask your lab instructor to double check your circuit wiring before applying
power to your circuit.
b. Connect the input of your filter to the waveform generator. Apply a sine wave with
2Vpp. Monitor the input signal and the filter’s output signal on CH1 and CH2 of the
oscilloscope, respectively. Set CH1 and CH2 to 500mV/div and the time scale to
20𝜇sec/div. Make sure the scope channels are set to “INVERSION: OFF”.
Determine, experimentally, the input sinusoid (cutoff) frequency that leads to about
0.7 Volt amplitude for the output signal. Capture and save the scope’s display image.
The image should display in the measurements bar the following values: input signal
frequency, input signal max voltage, output signal max voltage and the phase
difference between the output and the input. See sample scope image below.
[Note: if the filter’s output signal is noisy attach 0.1𝜇F capacitor between +𝑉𝑠 and
ground and another 0.1𝜇F capacitor between – 𝑉𝑠 and ground]
c. Tabulate the output signal amplitude and phase for the following input frequencies:
1kHz, 2kHz, 3kHz, …, 9kHz, 10kHz.
d. Change the circuit input to a 2Vpp, 50% duty cycle square wave. Determine (and
save the scope’s display image) the filter’s output for the following square wave
frequencies: 2kHz, 3kHz, 4kHz, 5kHz and 10kHz. Set the time scale at 100sec/div
for all cases. The following figure shows the scope traces for the 3kHz case.
e. In this step you will determine the step-response of your filter. Set the input to a 50%
duty cycle, 1kHz square wave with low level at 0Volt and high level at 1 Volt. Set the
scope channels to 200mV/div and 20𝜇sec/div. Set the scope to “averaging mode”
(through the “AQUIRE” menu). Shift the traces vertically and horizontally so that the
response looks like the one in the sample figures below. Save the scope’s display
image. Next, press the CURSOR button and set the mode to “Track” and set CursorA
to CH2. Use the “INTENSITY” knob to position the cursor at the peak of the filter
output. Save the scope’s display image.
f. In this step you will generate the impulse response of the filter. Keep the same
settings as in Step e, but change CH1 and CH2 to 1V/div. Connect the output of the
filter to the input of the differentiator circuit, shown below. Connect the output of the
differentiator to CH2. Set CH2 to “Invert: ON” mode (this is necessary in order to
undo the inversion inherent in the differentiator). The idea here is to generate the
impulse response of the filter as the derivative of the step-response. Move the cursor
so that it reads the time and max amplitude of the impulse response. Measure the
minimum amplitude of the impulse response and the time it occurs at. You will be
comparing these values to those you generated from the AFD simulation from the
Pre-lab. Save the scope’s display image. Refer to the sample shown below.
[Note: For the purpose of your Post-lab analysis, recall that the differentiator
𝑑𝑣𝑖𝑛
input/output relationship is given by: 𝑣𝑜 = −𝑅𝐶 . So, remember that the scope
𝑑𝑡
amplitude measurements that you have made for the impulse-response need to be
normalized by dividing them by 𝑅𝐶 = (20 ∗ 10−3 ) ∗ (0.01 ∗ 10−6 ) = 2 ∗ 10−4]
Use the vertical marker to determine the cutoff frequency of the filter (the
frequency at which the gain is equal to about 0.707). Record the phase value at this
frequency. Use Jing to capture and save the network analyzer image (see below).
As you disassemble your circuit, and in case you forgot to measure element values,
carefully measure and record the actual resistors and capacitors values.
3. Post-lab
Write your lab report according to the required format. Analyze and discuss, in details, all
results obtained from your pre-lab and your lab activity. Compare the theoretical and
experimental performance of the filter. Report the absolute relative errors (in percent) for all
experimental measurement whenever the true (ideal) value is known.
Your report should also include the following simulations:
a. Use the measured resistor and capacitor values and Mathcad to plot the magnitude
and phase responses of the filter and determine the cutoff frequency (in Hz).
b. Use the measured resistor and capacitor values to determine the response of the filter
to a 1 Volt amplitude (2Vpp), 50% duty cycle, 1 kHz square wave. Employ your
Multisim circuit from the pre-lab. Compare your result to the experimental result.
c. Substitute the measured component values of your filter in the denominator of 𝐻(𝑠)
and solve for the two complex conjugate poles of each of the two filter stages; i.e.,
1 1 1
solve for the roots of the quadratic 𝑠 2 + (𝑅 +𝑅 )𝑠 + 𝑅 = 0, for each
1 𝐶1 2 𝐶1 1 𝑅2 𝐶1 𝐶2
stage. Plot the these four poles in the complex plane and compare them to the exact
5𝜋 7𝜋 9𝜋 11𝜋
Butterworth poles:𝑒 𝑗 8 , 𝑒 𝑗 8 , 𝑒 𝑗 8 , 𝑒 𝑗 8 .
d. Use the measured component values to determine the (fourth-order) transfer function
𝐻(𝑠) of your two-stage filter (remember that the overall filter transfer function is the
product of the transfer functions of the individual stages). Then, use Mathcad’s
inverse Laplace Transform command to determine and plot the step-response,
𝐻(𝑠)
𝑦𝑠𝑡𝑒𝑝 (𝑡) = 𝐿−1 { }, and the impulse response, 𝑦𝑖𝑚𝑝𝑢𝑙𝑠𝑒 (𝑡) = 𝐿−1 {𝐻(𝑠)}. Your
𝑠
plots should look very similar to the following plots.