Assignment_08_Sept_23_-
Assignment_08_Sept_23_-
(EET 2051)
2. Theory
s2
H 2 ( s )= ❑
b) High pass filter: 2 Ω0
s+ s +Ω20
Q
❑
Ω0
Q
c) Band pass filter: H 3 ( s )= ❑
2 Ω0 2
s + s +Ω0
Q
2
s
2
¿+ Ω0
d) Band reject filter: H 4 ( s ) = ❑ ¿
Ω
s + 0 s+ Ω20
2
Q
2|Page
❑
Ω
s − 0 s+ Ω20
2
Q
e) All pass filter: H 5 ( s )= ❑
2 Ω0 2
s + s +Ω0
Q
Here Ω 0 is the corner frequency of the filter and the factor Q determines the quality
factor of the filter.
The Sallen-Key topology was introduced by R. P. Sallen and E. L. Key of MIT Lincoln
Laboratory in 1955. The generalized Sallen-Key Circuit is given in Fig. 1.
K
H ( s )=
Z 1 Z 2 Z 1 Z2 Z 1 (1−K ) Eqn. 1
+ + + +1
Z3 Z4 Z3 Z3 Z4
K Z3 Z4
⟹ H ( s )= Eqn. 2
Z 1 Z 2 +Z 1 Z 4 + Z 2 Z 4 + Z 1 Z3 (1−K )+ Z 3 Z 4
R4
where K=1+ .
R3
The circuit diagram of the Low Pass Sallen Key Circuit has been shown in Fig. 2.
3|Page
Fig. 2: A second-order Sallen–Key LPF.
K
R1 R2 C 1 C 2 K Ω20
H ( s )= = Eqn. 3
[ ]
❑
2 R 1 C 1+ R 2 C 1+ R 1 C 2 (1−K ) 1 2 Ω0 2
s +s + s + s +Ω0
R1 R2 C 1 C 2 R1 R2 C 1 C 2 Q
K
2
R 1 R2 C 1 C 2 K Ω0
H ( s )= = ❑
1 Ω0
s 2 +s [ R 2 C 2+ R1 C 2 + R2 C 1 (1−K ) ] + 2
s+
2
s+ Ω0
R 1 R2 C 1 C 2 Q
Ra
Where K=1+ .
Rb
2 1
Ω0 = 2
R1 R2 C
1
⟹ f 0= Eqn. 4
2 ΠC √ R 1 R2
And
Q=
√ R1 R2 Eqn. 5
R2 + R1 (2−K)
In selecting the four elements C , R1 , R 2, and K to realize the three filter parameters we
have some freedom of choice. Since, in practice, the available capacitor values are
usually limited let us choose a convenient value for C .
Also, let us assume that the dc gain is not important and can be fixed at K . Then we
may select R1=R 2=R and obtain with
4|Page
1
Q=
3−K
1
R=
Ω0 C
Rb Eqn. 7
1
K=3− =1+
Q Ra
⟹ Rb= 2−( 1
)
R
Q a
EXAMPLE 01
Design a Sallen—Key lowpass filter with f o=12.5 KHz and no peaking. Use an LM741
Opamp. The
DC gain is not specified.
SOLUTION
o R1=R 2=Ra=1.273 k Ω
o
(
Rb =Ra 2−
1
)
0.707
=746 Ω
Fig. 3: The circuit design for Example 01 and test results. The cursor is at the
—3 dB point (cursor
readout: 12.5 kHz, 1.02 dB).
5|Page
The RC—CR transformation is a simple special case of the general method suitable for
active RC filters. We shall discuss it here specifically for the Sallen—Key circuit although
it is applicable for other RC—Opamp configurations.
EXAMPLE 02
Design a Sallen—Key lowpass filter with f 0=12.5 kHz and Q=5 . The dc gain is not
specified. Use the RC—CR transformation to design a high pass with the same
specifications of pole frequency and quality factor. LM741 Opamps are to be used.
SOLUTION
Choosing C=0.1 μF
o
( 15 )=2.29 k Ω
R B=R A 2−
Fig.5 shows the lowpass and high pass circuits and their performance.
The dc gain of the lowpass and the high-frequency gain of the highpass are 9.25
dB as designed, and f 0=12.5 kHz . The dip and subsequent rise in gain at high
frequencies are caused by higher-order opamp dynamics.
6|Page
Note that gain at s= j Ω0 is T ( j Ω0 )KQ=14.3∨23.1 dB.
Fig. 5: The lowpass and highpass circuits for Example 02 and test set-up and
the test performance
The Sallen-Key band-pass circuit in Figure 16–33 has the following transfer function:
KRC Ω0 s
H ( s )= 2 2 2
1+ RC Ω0 ( 3−K ) s+ R C Ω0 s
7|Page
Fig. 6: The Bandpass Sallen Key circuit
Where
1
f 0=
2 πRC
R2
K=1+
R1
K
A0 =
3−K
1
Q=
3−K
The Sallen-Key circuit has the advantage that the quality factor ( Q ) can be varied via
the inner gain ( K ) without modifying the mid frequency ( f 0). A drawback is, however,
that Q and A0 cannot be adjusted independently.
Care must be taken when K approaches the value of 3, because then A0 becomes
infinite and causes the circuit to oscillate.
To set the mid frequency of the band-pass, specify f 0 and C and then solve for R .
1
R=
2 π f0C
Because of the dependency between Q and A0 , there are two options to solve for R2:
2 A 0−1
R 2=
1+ A0
or to design for a specific Q
2 Q−1
R 2=
Q
EXAMPLE 03
Design a second-order band-pass filter with f0 = 1 kHz and BW = 100 Hz. What
is its resonance gain?
Modify the circuit for a resonance gain of 20 dB.
SOLUTION
8|Page
9|Page
2.6. BAND REJECT SALLEN – KEY FILTERS
The circuit of Fig. 7 consists of a twin-T-network and a gain block to provide positive
feedback via the top capacitance. The T-networks provide alternative forward paths
through which Vi can reach the amplifier’s input: the low-frequency path R-R, and the
high-frequency path C-C, indicating H → K at the frequency extremes. At intermediate
frequencies, however, the two paths provide opposing phase angles, indicating a
tendency of the two forward signals to cancel each other out at the amplifier’s input.
We thus anticipate a notch response.
RB
K=1+
RA
1
f 0=
2 πRC
1
Q=
4−2 K
The design of this filter can be done as the previous filters.
EXAMPLE 04
SOLUTION
10 | P a g e
3. Implementation
2.7. Objective 01
The objective here is to implement a MATLAB program that takes the following inputs:
Filter Type (LPF, HPF, BPF or BRF)
f 0 in Hz
Q -factor
DC Gain / Mid-frequency gain for BPF
And provides the values of the components ( R1 , R 2 , C 1 , C 2 , R A , RB ) for the Sallen Key
Circuit.
Use the Example 01 and 02 values to check that your program is running correctly.
Code
clc;
clear all;
close all;
Case=input("Lowpass/Highpass :: BandPass/BandReject 1::2 ");
C=input("Enter Capacitor Value: ");
if Case==1
fo=input("Enter Cutoff-Frequency: ");
Q=input("Enter Quality Factor: ");
Ra=1/(fo*2*pi*C);
Rb=(2-(1/Q))*Ra;
fprintf("Ra = R1 = R2 = %f", Ra);
fprintf("\n Rb = %f", Rb);
Case_A=input("\n LowPass::HighPass 1::2 ")
11 | P a g e
if Case_A==1
imshow(imread("LOWPASS.png"));
else
imshow(imread("HIGHPASS.png"));
end
else
fo=input("Enter Center-Frequency: ");
B_W=input("Enter the BandWidth: ");
Q_factor=fo/B_W
R=1/(fo*2*pi*C);
R1=10*10^3;
Case_B=input("BandPass::BandReject 1::2 ");
if Case_B==1
k=3-(1/Q_factor);
R2=(k-1)*R1;
fprintf("R = %f", R);
fprintf("\n R1 = %f", R1);
fprintf("\n R2 = %f", R2);
imshow(imread("BANDPASS.png"));
else
k=(4-(1/Q_factor))/2;
R2=(k-1)*R1;
fprintf("R = %f", R);
fprintf("\n R1 = %f", R1);
fprintf("\n R2 = %f", R2);
imshow(imread("BANDREJECT.png"));
end
end
Output (Command Window and/or Plots)
12 | P a g e
2.8. Objective 02
Implement the circuits given in Example 01 and 02 in a suitable simulation platform like
MultiSim or QUCS with the
Component values given by the program in Objective 01.
Component values that are available practically.
In each case find the frequency response of the circuit and find the percentage
deviation in Gain and corner frequency. Comment on the results.
Code / Circuit
Example 1:
Example 2:
13 | P a g e
Output (Command Window and/or Plots)
Example 1:
Example 2:
14 | P a g e
4. Conclusion
Make a list of all the new MATLAB in-built functions that you learned in this assignment
set.
Describe (in your own words and handwriting) what you have learned in this
assignment set.
___________________________
(Signature of the Student)
Date:_____/____/_____
15 | P a g e