HBP,1z = transfer function of the IIR bandpass transfer function HBP,2z = by < Insert MATLAB figures here.. > of a stable IIR bandstop filter as HBSz = The plot of the gain response of
Trang 1June 20, 1998
Name:Tr n Qu c L m 1063739ầ ố ắ
Nguyễn Minh Đẵng 1063723
Laboratory Exercise 4 LINEAR, TIME-INVARIANT DISCRETE-TIME SYSTEMS:
FREQUENCY-DOMAIN REPRESENTATIONS 4.1 TRANSFER FUNCTION AND FREQUENCY RESPONSE
Project 4.1 Transfer Function Analysis
Answers:
Q4.1
The modified Program P3_1 to compute and plot the magnitude and phase spectra of a
% Program P3_1
% Evaluation of the DTFT
clf;
% Compute the frequency samples
of the DTFT
w = 0:8*pi/511:2*pi;
m = 5;
num =ones(1,m)/m;
h = freqz(num, 1, w);
% Plot the DTFT
subplot(2,1,1)
plot(w/pi,abs(h));grid
subplot(2,1,2) plot(w/pi,angle(h));grid
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0
0.5
1
Magnitude Spectrum |H(e j ω )|
ω / π
-2 0 2 4
Phase Spectrum arg[H(e j ω )]
Trang 2The types of symmetries exhibited by the magnitude and phase spectra are due to
The results of Question Q2.1 can now be explained as follows
-
0
0.5
1
-2
-1
0
1
2
2
Trang 30 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.5
1
Magnitude Spectrum |H(e )|
ω / π
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phase Spectrum arg[H(e j ω )]
ω / π
nhau
t t h n ố ơ
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
2
4
6
8
Magnitude Spectrum |H(ejω )|
ω / π
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
-0.5
0
0.5
1
Phase Spectrum arg[H(ejω )]
ω / π
Questions 4.2 and 4.3 obtained using the program developed in Question Q3.50
Trang 40 10 20 30 40 50 60 70 80 90 100
-1.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
impule
ω / π
zplane are shown below:
4
0 10 20 30 40 50 60 70 80 90 100
-4
-3
-2
-1
0
1
2
3
4
5
6x 10
ω / π
Trang 5-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
Real Part
4.2 TYPES OF TRANSFER FUNCTIONS
Project 4.2 Filters
% Program P4_1
% Impulse Response of Truncated
Ideal Lowpass Filter
clf;
fc = 0.25;
n = [-6.5:1:6.5];
y = 2*fc*sinc(2*fc*n);k = n+6.5;
13 -0.2 0.6]);
Answers:
0 2 4 6 8 10 12
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
N = 13
Time index n
[-6.5:1:6.5];
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -2
-1.5 -1 -0.5 0 0.5 1 1.5 2
Real Part
Trang 6The parameter controlling the cutoff frequency is – Fc = 0.25
response of the FIR lowpass filter of Project 4.2 with a length of 20 and a cutoff
% Program P4_1
% Impulse Response of
Truncated Ideal Lowpass Filter
clf;
fc = 0.45;
n = [-10:1:10];
y = 2*fc*sinc(2*fc*n);k = n+10;
Program P4_1 to compute and plot the impulse response of the FIR lowpass filter of Project 4.2 with a length of 15 and a cutoff frequency of ωc = 0.65 are as
% Program P4_1
% Impulse Response of
Truncated Ideal Lowpass Filter
clf;
fc = 0.65;
n = [-7.5:1:7.5];
y = 2*fc*sinc(2*fc*n);k = n+7.5;
6
0 2 4 6 8 10 12 14 16 18 20 -0.2
0 0.2 0.4 0.6 0.8
N = 20
Time index n
-0 2 -0 1 0 0.1 0.2 0.3 0.4 0.5 0.6
N = 1 5
Trang 7Q4.10 The MATLAB program to compute and plot the amplitude response of the FIR
% Program P4_1
% Impulse Response of Truncated
Ideal Lowpass Filter
clf;
fc = 0.25;
n = [-6.5:1:6.5];
y = 2*fc*sinc(2*fc*n);k =
n+6.5;
lowpass filter for several
-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6
N = 13
Time index n
Trang 80 2 4 6 8 10 12
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
N = 15
Time index n
% Program P4_2
% Gain Response of a Moving
Average Lowpass Filter
clf;
M = 2;
num = ones(1,M)/M;
[g,w] = gain(num,1);
plot(w/pi,g);grid axis([0 1 -50 0.5])
Answers:
Q4.11 A plot of the gain response of a
length-2 moving average filter obtained using Program P4_2 is
8
-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6
Time index n
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-50
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
ω / π
M = 2
Trang 9From the plot it can be seen that the 3-dB cutoff frequency is at – 0.5
Q4.12 The required modifications to Program P4_2 to compute and plot the gain response
% Program P4_2
% Gain Response of a Moving
Average Lowpass Filter
clf;
M = 2;
num =[1 1]/M;
[g,w] = gain(num,1);
plot(w/pi,g);grid axis([0 1 -50 0.5])
The plot of the gain response for a cascade of 3 sections obtained using the
-50
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
M = 3
Q4.13 The required modifications to Program P4_2 to compute and plot the gain response
% Program P4_2
% Gain Response of a Moving
Average Lowpass Filter
clf;
M = 5;
num =[1 -1 1 -1 1]/M;
[g,w] = gain(num,1);
plot(w/pi,g);grid axis([0 1 -50 0.5])
Trang 10The plot of the gain response for M = 5 obtained using the modified program is
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-50
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
M = 5
Q4.14 From Eq (4.16) for a 3-dB cutoff frequency ωc at 0.45 π we obtain α = 0.0787
function of the first-order IIR lowpass and highpass filters, respectively, given by
HLP(z) =
HHP(z) =
10
Trang 110 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-50
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
ω / π
M = 5
A plot of the magnitude response of the sum HLP(z) + HHP(z) obtained using
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
Q4.15 From Eq (4.24), we get substituting K = 10, B = 1.86
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-50
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
ω / π
Trang 12Using this value of α in Eq (4.22) we arrive at the transfer function of the cascade
of 10 IIR lowpass filters as
1 – α z 1
10
= (7.85+7.85z-1)/(2+13.7z-1)
IIR lowpass filter
HLP,1(z) = 1 – α
1 – α z 1 = (7.7+7.7z-1)/(2+13.4z-1)
< Insert
Q4.16 Substituting ωo = 0.61 π in Eq (4.19) we get β = cos(0.61 π ) =
Substituting ∆ω3dB = 0.15 π in Eq (4.20) we get (1 + α2)cos(0.15 π ) − 2 α = 0,
transfer function of the IIR bandpass transfer function
12
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -50
-45 -40 -35 -30 -25 -20 -15 -10 -5 0
M = 21
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -50
-45 -40 -35 -30 -25 -20 -15 -10 -5 0
HHP
Trang 13HBP,1(z) =
transfer function of the IIR bandpass transfer function
HBP,2(z) =
by
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
of a stable IIR bandstop filter as
HBS(z) =
The plot of the gain response of the transfer function HBS(z) obtained using MATLAB is shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
From these plots we observe that the designed filters do/do not meet the
A plot of the magnitude response of the sum HBP(z) + HBS(z) obtained using
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
Trang 14Q4.17 The transfer function of a comb filter derived from the prototype FIR lowpass filter
of Eq (4.38) is given by
G(z) = H0(zL) =
Plots of the magnitude response of the above comb filter for the following values of
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
= _and _ peaks at ωk = _ = _, where k = 0, 1, , _.
Q4.18 The transfer function of a comb filter derived from the prototype FIR highpass filter
of Eq (4.41) with M = 2 is given by
G(z) = H1(zL) =
Plots of the magnitude response of the above comb filter for the following values of
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
From these plots we observe that the comb filter has _ notches at ωk = _
Q4.19 A copy of Program P4_3 is given below:
% Program P4_3
% Zero Locations of Linear Phase
FIR Filters
clf;
b = [1 -8.5 30.5 -63];
num1 = [b 81 fliplr(b)];
num2 = [b 81 81 fliplr(b)];
num3 = [b 0 -fliplr(b)];
num4 = [b 81 -81 -fliplr(b)];
n1 = 0:length(num1)-1;
n2 = 0:length(num2)-1;
subplot(2,2,1); stem(n1,num1);
subplot(2,2,2); stem(n2,num2);
subplot(2,2,3); stem(n1,num3);
subplot(2,2,4); stem(n2,num4);
pause subplot(2,2,1); zplane(num1,1);
subplot(2,2,2); zplane(num2,1);
subplot(2,2,3); zplane(num3,1);
subplot(2,2,4); zplane(num4,1);
are');
14
Trang 15are');
disp(roots(num2));
are');
disp(roots(num3));
are');
disp(roots(num4));
- Các tín hiệu kế tiếp nhau cho ta thấy các giá trị M của tín hiệu là khác nhau : tín
hiệu 1 và 3 thì giá trị M chẵn và tín hiệu 2 và 4 thì giá trị M lẽ.
- Tín hiệu 1 có M=8 và a = 1.979
- Tín hiệu 2 có M= 9 và a = 1
- Tín hiệu 3 có M= 8 và a = 0
- Tín hiệu 4 có M = 9 và a = 1
The plots of the impulse responses of the four FIR filters generated by running Program
From the plots we make the following observations:
-100 -50 0 50 100
Time index n
Type 1 FIR Filter
-100 -50 0 50 100
Time index n
Type 2 FIR Filter
-100 -50 0 50 100
Time index n
Type 3 FIR Filter
-100 -50 0 50 100
Time index n
Type 4 FIR Filter
Trang 16Filter #4 is of length with a impulse response and is
Plots of the phase response of each of these filters obtained using MATLAB are
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
Q4.20 The plots of the impulse responses of the four FIR filters generated by running
% Program P4_3
% Zero Locations of Linear Phase
FIR Filters
clf;
b = [1 -8.5 30.5 -63];
num1 = [b 81 fliplr(b)];
num2 = [b 81 81 fliplr(b)];
num3 = [b 0 -fliplr(b)];
num4 = [b 81 -81 -fliplr(b)];
n1 = 0:length(num1)-1;
n2 = 0:length(num2)-1;
subplot(2,2,1); stem(n1,num1);
subplot(2,2,2); stem(n2,num2);
subplot(2,2,3); stem(n1,num3);
subplot(2,2,4); stem(n2,num4);
pause subplot(2,2,1); zplane(num1,1);
subplot(2,2,2); zplane(num2,1);
subplot(2,2,3); zplane(num3,1);
subplot(2,2,4); zplane(num4,1);
are');
disp(roots(num1));
are');
disp(roots(num2));
are');
16
Trang 17are');
disp(roots(num4));
- Các tín hiệu kế tiếp nhau cho ta thấy các giá trị M của tín hiệu là khác nhau : tín
hiệu 1 và 3 thì giá trị M chẵn và tín hiệu 2 và 4 thì giá trị M lẽ.
- Tín hiệu 1 có M=8 và a = 1.979
- Tín hiệu 2 có M= 9 và a = 1
- Tín hiệu 3 có M= 8 và a = 0
- Tín hiệu 4 có M = 9 và a = 1
Plots of the phase response of each of these filters obtained using MATLAB are
-100 -50 0 50 100
Time index n
Type 1 FIR Filter
-100 -50 0 50 100
Time index n
Type 2 FIR Filter
-100 -50 0 50 100
Time index n
Type 3 FIR Filter
-100 -50 0 50 100
Time index n
Type 4 FIR Filter
Trang 18< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
Answers:
Q4.21 A plot of the magnitude response of H1(z) obtained using MATLAB is shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
H1(z) by _ and arrive at a bounded-real transfer function
H2(z) =
Q4.22 A plot of the magnitude response of G1(z) obtained using MATLAB is shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
G1(z) by _ and arrive at a bounded-real transfer function
G2(z) =
18
Trang 194.3 STABILITY TEST
A copy of Program P4_4 is given below:
< Insert program code here Copy from m-file(s) and paste >
Answers:
Q4.23 The pole-zero plots of H1(z) and H2(z) obtained using zplane are shown below:
< Insert MATLAB figure(s) here Copy from figure window(s) and paste >
Q4.24 Using Program P4_4 we tested the stability of H1(z) and arrive at the following
Q4.25 Using Program P4_4 we tested the root locations of D(z) and arrive at the following
circle.
Q4.26 Using Program P4_4 we tested the root locations of D(z) and arrive at the following
circle.