Professional Documents
Culture Documents
Second Order Filters
Second Order Filters
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 1
Prerequisites and New Knowledge
Prerequisite knowledge
• Ability to perform Laplace transform circuit analysis
• Ability to solve for the transfer function of a circuit
• Ability to generate and interpret Bode plots
New knowledge
• Ability to design second-order filters
• Knowledge of the advantages of transfer functions with complex
poles and zeros
• Understanding of resonance
• Familiarity with second-order filter properties
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 2
Motivation
PM !
k
k=0 bk s
Y (s) = PN X(s) = H(s)X(s)
k
k=0 ak s
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 3
Standard Form
N (s)
H(s) = s2 s
2
ωn + Qω n
+1
• Second order filters can be designed as lowpass, highpass,
bandpass, or notch filters
• All four types can be expressed in standard form shown above
• N (s) is a polynomial in s of degree m ≤ 2
– If N (s) = k, the system is a lowpass filter with a DC gain of k
s2
– If N (s) = k ω2 ,the system is a highpass filter with a high
n
frequency gain of k
s
– If N (s) = k Qω n
, the system is a bandpass filter with a
maximum gain of k
2
– If N (s) = k 1 − ωs 2 , the system is a notch filter with a gain
n
of k
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 4
Unity Gain Lowpass
A unity-gain lowpass second-order transfer function is of the form
ωn2 1
H(s) = 2 2
= 2
s + 2ζωn s + ωn
1+ 2ζ ωsn + s
ωn
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 5
Unity Gain Lowpass Continued
The transfer function H(s) can also be expressed in the following form
1 1
H(s) = 2 = 2
1 + 2ζ ωsn + s
ωn 1+ s
Qωn + s
ωn
where
1
Q,
2ζ
The meaning of Q, the Quality factor, will become clear in the
following slides.
1
H(jω) = 2
jω
1 − ωωn + Qω n
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 6
Unity Gain Lowpass Magnitude Response
2 −1
ω jω
20 log10 |H(jω)| = 20 log10 1 − +
ωn Qωn
s 2 2
ω2 ω
= −20 log10 1− 2 +
ωn Qωn
For ω ≪ ωn ,
20 log10 |H(jω)| ≈ −20 log10 |1| = 0 dB
For ω ≫ ωn ,
ω2 ω
20 log10 |H(jω)| ≈ −20 log10 = −40 log10 dB
ωn2 ωn
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 7
Lowpass Magnitude Continued
s 2 2
ω2 ω
20 log10 |H(jω)| = −20 log10 1− 2 +
ωn Qωn
For ω = ωn ,
1
20 log10 |H(jωn )| = −20 log10 = 20 log10 Q = QdB
Q
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 8
Lowpass Magnitude
Complex Poles
40 Q=0.100
Q=0.500
Q=0.707
20 Q=1.000
Q=2.000
Q=10.000
Mag (dB)
0 Q=100.000
−20
−40
−60
−2 −1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 9
Matlab Code
N = 1000;
wn = 1;
Q = [0 .1 0 .5 sqrt (1/2) 1 2 10 100];
w = logspace ( -2 ,2 , N );
nQ = length ( Q );
mag = [];
phs = [];
figure (1);
FigureSet (1 , ’ Slides ’ );
h = semilogx (w ,20* log10 ( mag ));
set (h , ’ LineWidth ’ ,1 .5 );
grid on ;
xlabel ( ’ Frequency ( rad / sec ) ’ );
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 10
ylabel ( ’ Mag ( dB ) ’ );
title ( ’ Complex Poles ’ );
xlim ([ w (1) w ( end )]);
ylim ([ -60 45]);
box off ;
AxisSet (8);
legend ( legendLabels );
print ( ’ B o d e M a g C o m p lex Po le s’ , ’ - depsc ’ );
figure (2);
FigureSet (2 , ’ Slides ’ );
h = semilogx (w , phs );
set (h , ’ LineWidth ’ ,1 .5 );
grid on ;
xlabel ( ’ Frequency ( rad / sec ) ’ );
ylabel ( ’ Phase ( deg ) ’ );
title ( ’ Complex Poles ’ );
xlim ([ w (1) w ( end )]);
ylim ([ -190 10]);
box off ;
AxisSet (8);
legend ( legendLabels );
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 11
Lowpass Phase
1
∠H(jω) = ∠ 2
ω jω
1− ωn + Qωn
For ω ≪ ωn ,
∠H(jω) ≈ ∠1 = 0◦
For ω ≫ ωn ,
1 Qωn
∠H(jω) ≈ ∠ ω =∠− = ∠ − 1 = −180◦
− Qω n
ω
For ω = ωn ,
1 1
∠H(jω) ≈ ∠ = ∠ = ∠ − j = −90◦
Qj j
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 12
Unity Gain Lowpass Phase
Complex Poles
0 Q=0.100
−20 Q=0.500
Q=0.707
−40 Q=1.000
Q=2.000
−60
Q=10.000
Phase (deg)
−80 Q=100.000
−100
−120
−140
−160
−180
−2 −1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 13
Lowpass Comments
1
H(jω) = 2
jω jω
1+ Qωn + ωn
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 14
Lowpass Maximum Magnitude
What is the frequency at which |H(jω)| is maximized?
1 1
H(jω) = 2 |H(jω)| = r 2 2
jω jω
1+ Qωn + ωn 1− ω2
2 + ω
ωn Qωn
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 15
Lowpass Maximum Continued
If Q > 0.707, the maximum magnitude and frequency are as follows:
r
1 Q
ωr = ωn 1 − |H(jω r )| = 1
2Q2 1 − 4Q 2
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 16
Example 1: Passive Lowpass
50 mH R
+
vs(t) 200 nF vo(t)
-
1
LC ωn2 ωn2
H(s) = R 1
= 2 = 2 ωn
s2 + L s + LC
s + 2ζωn s + ωn2 s + Q s + ωn2
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 17
Example 1:Passive Lowpass Continued
r
1
ωn = = 10 k rad/s
LC
R√ R√
ζ = LC = CL = R × 0.001
2L r2
1 L L 1 500
Q = √ = =
LC R CR R
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 18
Example 1: Lowpass Magnitude Response
Resonance Example
40
20
−20
Mag (dB)
−40
R=5Ω
−60 R = 50 Ω
R = 707 Ω
−80 R = 1 kΩ
R = 5 kΩ
−100
R = 50 kΩ
−120
2 3 4 5 6
10 10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 19
Example 1: Lowpass Phase Response
Resonance Example
0
−20
−40
−60
Phase (deg)
−80
−100 R=5Ω
−120 R = 50 Ω
R = 707 Ω
−140
R = 1 kΩ
−160 R = 5 kΩ
R = 50 kΩ
−180
2 3 4 5 6
10 10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 20
Practical Second-Order Filter Tradeoffs
• There are many standard designs for second-order filters
• A library of first and second-order filters is all you need to
synthesize any transfer function
• The ideal transfer functions are identical
• Engineering design tradeoffs are practical
– Cost (number of op amps)
– Complexity
– Sensitivity to component value variation
– Ease of tuning
– Ability to vary cutoff frequencies and/or gains
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 21
Practical Second-Order Filters
• Popular practical second-order filters include
– KRC/Sallen-key filters
– Multiple-feedback filters: more than one feedback path
– State-variable filters
– Biquad/Tow-Thomas filters filters
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 22
Example 2: Lowpass Sallen-Key Filter
C1
R1 R2
+
vs(t) Rb
C2 vo(t)
-
Ra
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 23
Example 2: Questions
• Is the input impedance finite?
• What is the output impedance?
• How many capacitors are in the circuit?
• What is the DC gain?
• What is the “high frequency” gain?
• What is the probable order of the transfer function?
• Solve for the transfer function
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 24
Example 2: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 25
Example 2: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 26
Example 2: Tuning
Ra + Rb
|H(0)| = =k
Ra
1
ωn = √
R1 C1 R2 C2
1
Q= q q q
R2 C2 R1 C2 R1 C1
R1 C1 + R2 C1 + (1 − k) R2 C2
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 27
Example 2: Tuning Tips
RA + RB
|H(0)| =
RA
1
ωn = √
R1 C1 R2 C2
1
Q= q q q
R2 C2 R1 C2 R1 C1
R1 C1 + R2 C1 + (1 − K) R2 C2
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 28
Example 3: Design
√
Design a Sallen-Key lowpass filter with a Q = 1/ 2, corner
frequency of 1000 Hz, and DC gain of 1.
• Redraw the circuit with a DC gain of 1
• Arbitrarily pick C2 = 1 nF, a common capacitor value that is
cheaply and readily available
√
2 −b± b2 −4ac
Hint: Recall that the solution to ax + bx + c = 0 is x = 2a
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 29
Example 3: DC Gain Solution
RA + RB RB
|H(0)| = =1+
RA RA
Pick RB = 0 and RA = ∞
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 30
Example 3: Solution
Define R1 = mR2 and C1 = nC2
1
ωn = √
R1 C1 R2 C2
1
= √
R2 C2 nm
1
Q= q q q
R2 C2 R1 C2 R1 C1
R1 C1 + R2 C1 + (1 − K) R2 C2
√
1 mn
= q √
1
+
pm mn
mn n
√
mn
=
1+m
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 31
Example 3: Solution
mn
2
Q =
1 + 2m + m2
2 mn
m + 2m + 1 = 2
Q
1 2 1 mn
m +m+ =
2 2 2Q2
1 2 mn 1
m + 1− m+ =0
2 2Q2 2
n
β, 2
−1
2Q
1 2 1
m − βm + = 0
2 2
am2 + bm + c = 0
√
−b ± b2 − 4ac p
m= = β + β2 − 1
2a
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 32
Example 3: Solution
1. Arbitrarily pick C2 = 10 nF, a common capacitor value that is
cheaply and readily available
2. Select n such that C
C2
1
≥ 4Q 2
, to ensure solution to quadratic
equation for m = RR2 is real valued
1
• Pick n = 8
• Then C1 = 8Q2 C2 = 80 nF
p n
3. Solve for m = β + β 2 − 1, given β = 2Q2 −1
• m=1
1√
4. Solve for R2 = C2 ωn nm
• R2 = 2.33 kΩ
5. Solve for R1 = mR2 , given m and R2
• R1 = 13.6 kΩ
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 33
Example 3: Magnitude Response
Complex Poles
20
10
−10
Mag (dB)
−20
−30
−40
−50
−60
2 3 4 5
10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 34
Example 3: Phase Response
Complex Poles
0
−20
−40
−60
Phase (deg)
−80
−100
−120
−140
−160
−180
2 3 4 5
10 10 10 10
Frequency (rad/sec)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 35
Example 3: MATLAB Code
RA = inf ;
RB = 0;
C2 = 10e -9;
Q = 1;
fn = 1000;
% = = = = = = = = = = = = = = = = = = = = = = = == = = == = = == = == = = == = = == = = == = = = = = == = = =
% Preprocessing
% = = = = = = = = = = = = = = = = = = = = = = = == = = == = = == = == = = == = = == = = == = = = = = == = = =
dCGain = 1 + RB / RA ;
wn = 2* pi * fn ;
n = 8* Q ^2;
b = n /(2* Q ^2) -1;
m = b + sqrt ( b ^2 -1);
C1 = n* C2 ;
R2 = 1/( wn * C2 * sqrt ( n * m ));
R1 = m* R2 ;
fprintf ( ’ C1 : %5 .3f nF \n ’ , C1 *1 e9 );
fprintf ( ’ C2 : %5 .3f nF \n ’ , C2 *1 e9 );
fprintf ( ’ R1 : %5 .3f kOhms \ n ’ , R1 *1e -3);
fprintf ( ’ R2 : %5 .3f kOhms \ n ’ , R2 *1e -3);
N = 1000;
functionName = sprintf ( ’% s ’ , mfilename ); % Get the function name
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 36
w = logspace (2 ,5 , N );
mag = [];
phs = [];
figure (1);
FigureSet (1 , ’ Slides ’ );
h = semilogx (w ,20* log10 ( bodeMagnitude ) , ’r ’ );
set (h , ’ LineWidth ’ ,1 .5 );
grid on ;
xlabel ( ’ Frequency ( rad / sec ) ’ );
ylabel ( ’ Mag ( dB ) ’ );
title ( ’ Complex Poles ’ );
xlim ([ w (1) w ( end )]);
ylim ([ -60 20]);
box off ;
AxisSet (8);
fileName = sprintf ( ’%s - Magnitude ’ , functionName );
print ( fileName , ’ - depsc ’ );
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
fprintf ( fileIdentifier , ’ \\ newslide \ n ’ );
fprintf ( fileIdentifier , ’ \\ slideheading { Example \\ arabic { exc }: Magnitude Respo nse }\ n ’);
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 37
fprintf ( fileIdentifier , ’ \\ i n c l u d e g ra phi cs[ scale =1]{ Matlab /% s }\ n ’ , fileName );
figure (2);
FigureSet (2 , ’ Slides ’ );
h = semilogx (w , bodePhase , ’r ’ );
set (h , ’ LineWidth ’ ,1 .5 );
grid on ;
xlabel ( ’ Frequency ( rad / sec ) ’ );
ylabel ( ’ Phase ( deg ) ’ );
title ( ’ Complex Poles ’ );
xlim ([ w (1) w ( end )]);
ylim ([ -190 10]);
box off ;
AxisSet (8);
fileName = sprintf ( ’%s - Phase ’ , functionName );
print ( fileName , ’ - depsc ’ );
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
fprintf ( fileIdentifier , ’ \\ newslide \ n ’ );
fprintf ( fileIdentifier , ’ \\ slideheading { Example \\ arabic { exc }: Phase Response }\ n ’ );
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
fprintf ( fileIdentifier , ’ \\ i n c l u d e g ra phi cs[ scale =1]{ Matlab /% s }\ n ’ , fileName );
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
fprintf ( fileIdentifier , ’ \\ newslide \ n ’ );
fprintf ( fileIdentifier , ’ \\ slideheading { Example \\ arabic { exc }: MATLAB Code }\ n ’ );
fprintf ( fileIdentifier , ’ % % = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = == = = == = = = == = = == = = = == = = == = = = == = = == = = == = = = == = = == \n ’
fprintf ( fileIdentifier , ’\ t \\ matlabcode { Matlab /% s.m }\ n ’ , functionName );
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 38
Example 4: Highpass Sallen-Key Filter
R1
C1 C2
+
vs(t) Rb
R2 vo(t)
-
Ra
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 39
Example 4: Questions
• Is the input impedance finite?
• What is the output impedance?
• How many capacitors are in the circuit?
• What is the DC gain?
• What is the “high frequency” gain?
• What is the probable order of the transfer function?
• Solve for the transfer function
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 40
Example 4: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 41
Example 4: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 42
Example 4: Solution
2
s
ωn
H(s) = K 2
s s
1+ Qωn + ωn
RB
K =1+
RA
1
ωn = √
R1 C1 R2 C2
1
Q= q q q
R1 C1 R1 C2 R2 C2
R2 C2 + R2 C1 + (1 − K) R1 C1
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 43
Example 5: Bandpass Sallen-Key Filter
R3
R1 C2
+
Rb
vs(t) C1 R2 vo(t)
-
Ra
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 44
Example 5: Questions
• Is the input impedance finite?
• What is the output impedance?
• How many capacitors are in the circuit?
• What is the DC gain?
• What is the “high frequency” gain?
• What is the probable order of the transfer function?
• Solve for the transfer function
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 45
Example 5: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 46
Example 5: Work Space
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 47
Transfer Function Synthesis
You can build almost any transfer function with integrators, adders, &
subtractors
N (s) X(s)
Y (s) = H(s)X(s) = X(s) = N (s) = U (s)N (s)
D(s) D(s)
where
1
U (s) , X(s)
D(s)
D(s) , bn sn + bn−1 sn−1 + · · · + b1 s + b0
X(s) = bn sn U (s) + bn−1 sn−1 U (s) + · · · + b1 sU (s) + b0 U (s)
n 1 n−1
s U (s) = X(s) − bn−1 s U (s) − · · · − b1 sU (s) − b0 U (s)
bn
Y (s) = U (s)N (s)
= an sn U (s) + an−1 sn−1 U (s) + · · · + a1 sU (s) + a0 U (s)
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 48
Transfer Function Synthesis Diagram
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 49
Transfer Function Synthesis Clean Diagram
Σ Σ Σ Σ y(t)
an an−1 a2 a1 a0
x(t)
+ Σ
1 1 1 1
bn s s s
-
Σ bn−1
Σ b2
Σ b1
b0
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 50
Example 6: Transfer Function Synthesis
Draw the block diagram for the following transfer function:
s3 + 5s2 + 2
H(s) = 4
s + 17s3 + 82s2 + 130s + 100
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 51
Analog Filters Summary
• There are many types of filters
• Second-order filters can implement the four basic types
– Second-order
– Lowpass & Highpass
– Bandpass & Bandstop
– Notch
• For a given H(s), there are many implementations & tradeoffs
• Second order filters are fundamentally different than first-order
filters because they can have complex poles
– Causes a resonance
J. McNames Portland State University ECE 222 Second Order Filters Ver. 1.04 52