Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
1
LABORATORY 6: Transfer Functions, Filters, and Bode Plots Material covered:
First Order Filters Multi-stage Circuits Bode Plots Design Problem
Part A: First Order Filters
Overview Notes: Decibels: When considering the magnitude of the transfer function, a log-log plot is useful for gaining physical insight to the circuit. Typically, the vertical axis has units of Decibels (dB). The magnitude of the transfer function can be converted to
dB by using the relationship sHsV
sV
in
out log20log20
[dB]. Using this formula,
when we plot the transfer function of a first order circuit, we can make some observations. Cutoff frequency: The cutoff frequency of a first order circuit is defined as the
frequency at which the amplitude of the output voltage is 2
1 the amplitude of the
input voltage. In other words the ratio of output to input is 2
1
sV
sV
in
out .
Substituting that value into the above dB expression, at the cutoff frequency the expression evaluates to -3dB. The cutoff frequency is often referred to as the 3dB point. In first order circuits, the cutoff frequency occurs when the magnitudes of the real part and the imaginary part of transfer function denominator are the same. Passband: The frequency range where the output signal has approximately a constant amplitude. Stopband: The frequency range where the output signals are attenuated relative to passband . In the stopband of a first order circuit, a 20dB difference occurs every
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
2
time the frequency changes one order of magnitude. For example, in a low pass filter with a cutoff frequency of 1kHz, the dB value of |H(jω)| at 50kHz would have a value 20dB lower than the the dB value of |H(jω)| at 5kHz. This attribute is called a reduction of 20dB/decade. (We will discuss these concepts in class.)
We will be performing frequency sweeps in the upcoming labs. We will need to configure the voltage component to an AC voltage source by right clicking and putting 1V in the AC analysis section as shown in the figure below.
You must choose the AC Analysis tab in the simulation profile.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
3
To perform frequency sweeps;
1) Edit the simulation command and select the AC Analysis Tab 2) Change the “Type of sweep:” to Decade 3) To generate smoother, more accurate plots, choose 100 points per decade. 4) You will then need to select the frequency limits. These limits will likely
depend on your circuit. For the first order circuits, we want the lower limit to be well below the cutoff frequency and the upper limit to be well above the cutoff frequency. For the above circuit, we will use a range of 1Hz-1E6Hz
5) LTSpice will output a graph with both amplitude and phase plotted on the right and left hand axes respectively.
a. The amplitude is expressed in dB. b. Phase is expressed in degrees.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
4
A.1. RL Filter Circuit Calculations
Determine the transfer function for the voltage across the resistor,
HVR(s) = ______________________
Determine the transfer function for the voltage across the inductor,
HVL(s) = ______________________
What is the cutoff frequency for this circuit? _________________
As the frequency approaches zero (DC), the voltage across the inductor approaches _________
As the frequency approaches infinity, the voltage across the inductor approaches _________
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
5
When measuring the voltage across the inductor, is this circuit a low pass filter or a high pass filter? A.1. RL Filter Circuit Simulation and Experiment Build the circuit. Set your source amplitude to 2Vpp (1V amplitude) with a 0V offset and adjust the frequency as indicated in the table. Measure the output voltage amplitude and phase across the inductor for various frequencies and fill in the following table with your calculations, LTSpice, Analog Discovery Board measurements.
Inductor
Magnitude Phase
[Degrees]
Freq. [Hz]
Rad. Freq.
[rad/s] Calculated LTSpice Measured Calculated LTSpice Measured
47.7
159
477
fc
1590
4770
15.9k
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
6
If there are any significant differences between measured and calculated results, comment on possible reasons. (Recall the characteristics of a real inductor.) For your above measured results, determine the magnitude in dB and the phase of the transfer function. When calculating the transfer function magnitude, remember to divide to divide the output magnitude by the source amplitude (which in this case is 1). The phase can be obtained directly from your measured results in the previous table.
Radial Frequency
[rad/s] log(ω)
20log|H(s)| [dB]
Phase sH
300
1E3
3E3
ωc
1E4
3E4
1E5
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
7
Using your measured results, generate a log-log plot (dB-log (ω)) of the magnitude of the transfer function vs. frequency. Also, plot the angle (phase) of the transfer function against log(ω). For the same circuit, perform an AC Sweep in LTSpice and compare your results.
Magnitude
Is the cutoff frequency a -3dB point? Does your stopband display a 20dB/decade drop?
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
8
Phase
What is the change of phase between ω = 300 [rad/s] and ω = 5E4 [rad/s]? Is your result consistent with expectations from the transfer function?
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
9
Part B: Second Order Filters and Bode Plots Overview Notes: Two stage circuits:
H2(s)H1(s)
+++
----
+
Vout2Vout1 Vin2Vin1
The above figure represents a two stage circuit. Recall, the transfer function relates
the ratio the input to the output of a stage, sHsV
sV
in
out . In the above figure,
recognize that Vout1 = Vin2. The transfer function can be applied to each stage. Applying the transfer function to each stage we can derive the equation,
sVsHsHsVsHsVsHsV inoutinout 11212222 . Finally, the relationship
between Vout2 and Vin1 can be written as sHsHsV
sV
in
out12
1
2 . This equation is the
product of the two transfer functions. By designing each stage to produce a particular circuit response, the final output can be designed to meet a specific goal.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
10
Filter types:
Lowpass filter
Highpass Filter
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
11
Bandpass Filter
Notch/Bandstop Filter
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
12
B1: Multi-stage Filter Circuit Calculations
Vin
R1
1k
R21k
R3
~9k
R4
1k
0
U1
OPAMP
+
-OUT
0
C11E-6 C2
1E-6
Vout
0
Determine the transfer function for the voltage across the capacitor, C2
H(s) = ________________________________ (symbolically)
This circuit is which of the following? highpass filter, lowpass filter, bandpass filter, notch filter What are the zeros of the transfer function? __________________ What are the poles of the transfer function? ________________ What is the gain of the passband, in dB?__________________ What is the slope of the stopband in dB/decade? __________________
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
13
B2: Multi-stage Filter Circuit Simulation and Experiment Build the circuit and measure the output voltage for various frequencies. Your source amplitude should 200mV. Your Oscilloscope V/div should be 0.5V/div or less. Fill in the following table with your calculations and Analog Discovery Board measurements. Remember to scale your measured output voltage with your input voltage to obtain the transfer function. Reminder: The amplifier requires +9/-9 voltage connections. You should double check your batteries and make sure they still have close to a 9V supply. Sometimes, storing them in the kits without a cover results in a short circuit connection across the leads, which discharges the battery.
Magnitude, |H(s)|
Frequency [Hz]
Calculated Measured 20log|H(s)|
(use measured value)
15.9
48
159
488
1590
Using your measured results, generate a Bode plot of the magnitude. Compare the measured results to your analytic expression and a LTSpice simulation.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
14
B3: Multi-stage Filter Circuit Calculations
Vin1
R1
100
R21k
R3
~9k0
U2
OPAMP
+
-OUT
0
C11E-6
VoutC2
1E-6
R41k
0 Determine the transfer function for the voltage across the resistor, R4.
H(s) = ________________________________ (symbolically)
This circuit is which of the following? highpass filter, lowpass filter, bandpass filter, notch filter What are the zeros of the transfer function? __________________ What are the poles of the transfer function? ________________ What is the gain of the passband, in dB?__________________ What is the slope of the stopband(s) in dB/decade? __________________
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
15
B4: Multi-stage Filter Circuit Simulation and Experiment Build the circuit and measure the output voltage for various frequencies. Your source amplitude should 200mV. Your Oscilloscope V/div should be 0.5V/div or less. Fill in the following table with your calculations and Analog Discovery Board measurements. Remember to scale your measured output voltage with your input voltage to obtain the transfer function.
Magnitude, |H(s)|
Frequency [Hz]
Calculated Measured 20log|H(s)|
(use measured value)
15.9
48
159
488
1590
Using your measured results, generate a Bode plot of the magnitude. Compare the measured results to your analytic expression and LTSpice simulation.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
16
Part C: Filter Design Problem Design a lowpass filter that meets the following specifications.
1. Cutoff frequency: 1.59kHz 2. 60dB rolloff in the stopband 3. A single unity gain opamp 4. |H(jω)| -3dB relative to the passband at the cutoff frequency. (Remember
a triple pole has a -9dB correction relative to the straight line approximation. You will need to underdamp a second order circuit.)
5. Use L and C component values found in your kit. You can use resistors found on the center table in the laboratory room.
Some flexibility exists in meeting the specifications. In design problems, perfection is not usually possible, but deviations should be small. If you don’t quite meet specification, explain why and explain what you would do to fix the problem. C.1. Filter Design Calculations Determine the transfer function that meets the above specifications
H(s) = ________________________________ (symbolically) Draw the circuit, labeling the component values
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
17
C.2. Filter Design Simulation and Calculations Build the circuit and verify that the specifications are met by taking measurements at appropriate frequencies. You should base your Vin amplitude around that setting.
Magnitude, |H(s)|
Radial Frequency
[rad/s] Calculated
Measured |Vout|/|Vin|
20log|H(s)| (use measured
value)
100
300
1E3
3E3
9E3
10E3
15E3
20E3
30E3
100E3
Due to the steep rolloff and noise effects, you may have difficulty obtaining data as you move further into the stopband. For the same circuit, perform an AC Sweep in LTSpice and compare your results.
Alpha Laboratories
ECSE-2010 Fall 2018
Written by J. Braunstein Revised by S. Sawyer Summer 2018: 8/23/2018 Rensselaer Polytechnic Institute Troy, New York, USA
18
Part D. Alpha Lab Applications Link https://ecse.rpi.edu/~ssawyer/CircuitsFall2018_all/Labs/Unit3/BetaDS3.pdf EXTRA CREDIT ONLY: This extra credit is 10 points toward final exam grade. Find the EASTER EGG! https://ecse.rpi.edu/~ssawyer/CircuitsFall2018_all/Labs/Unit3/SuperMarioBros_Mixed.wav Analyze the frequency components of the song with your microphone and analog discovery board.
a. Provide a screenshot of the raw incoming signal as well as its frequency spectrum.
b. Discuss how the frequency spectrum will affect your BPF design.
2. Attempt to filter the signal with a passive RLC circuit. Describe how it has affected your signal
and whether it is sufficient. (You do not have to demonstrate the passive RLC on demonstration
day, however; the schematic and analysis should be described.)
3. What is an active filter? Attempt to filter the signal with an active filter. How much noise
attenuation is good enough? Describe how you came this conclusion and how you measured to
ensure you have met this specification.
4. Provide a simulated Bode plot of your passive and active BPF circuits. Compare it to an
experimental Bode plot measured by the Analog Discovery board.
5. Provide a screenshot of the filtered signal from the physical circuit using the Analog Discovery
Board.
a. You must show the EASTER EGG signal with no noise visually.
b. You must demonstrate the signal audibly without noise.
c. You must decode the signal and tell me what the EASTER EGG says (what it means!)