Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 19 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
19
Dung lượng
234,5 KB
Nội dung
June 20, 1998 Name :Trần Quốc Lắm 1063739 Nguyễn Minh Đẵng 1063723 Laboratory Exercise 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 moving average filter of Eq (2.13) for ≤ ω ≤ 2π is shown below: % Program P3_1 plot(w/pi,abs(h));grid % Evaluation of the DTFT title('Magnitude Spectrum | clf; H(e^{j\omega})|') % Compute the frequency samples xlabel('\omega /\pi'); of the DTFT ylabel('Amplitude'); w = 0:8*pi/511:2*pi; subplot(2,1,2) m = 5; plot(w/pi,angle(h));grid num =ones(1,m)/m; title('Phase Spectrum h = freqz(num, 1, w); arg[H(e^{j\omega})]') % Plot the DTFT xlabel('\omega /\pi'); subplot(2,1,1) ylabel('Phase in radians'); This program was run for the following three different values of the corresponding frequency responses are shown below: Magnitude Spectrum |H(ejω )| Amplitude 0.5 0 0.2 0.4 0.6 0.8 1.2 1.4 1.6 1.8 1.6 1.8 ω /π Phase Spectrum arg[H(ejω )] Phase in radians -2 -4 0.2 0.4 0.6 0.8 1.2 ω /π 1.4 M and the plots of The types of symmetries exhibited by the magnitude and phase spectra are due to The type of filter represented by the moving average filter is - - The results of Question Q2.1 can now be explained as follows Q4.2 The plot of the frequency response of the causal LTI discrete-time system of Question Q4.2 obtained using the modified program is given below : Magnitude Spectrum |H(ejω )| Amplitude 0.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.8 0.9 ω /π Phase Spectrum arg[H(ejω )] Phase in radians -1 -2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 ω /π The type of filter represented by this transfer function is Q4.3 - The plot of the frequency response of the causal LTI discrete-time system of Question Q4.3 obtained using the modified program is given below : Magnitude Spectrum |H(ejω )| Amplitude 0.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.8 0.9 ω /π Phase Spectrum arg[H(ejω )] Phase in radians -2 -4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 ω /π The type of filter represented by this transfer function is - The difference between the two filters of Questions 4.2 and 4.3 is – phổ pha khác I shall choose the filter of Question Q4.2 for the following reason - Vì đáp ứng pha tốt Q4.4 The group delay of the filter specified in Question Q4.4 and obtained using the function grpdelay is shown below: Magnitude Spectrum |H(ejω )| Amplitude 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.8 0.9 ω /π Phase Spectrum arg[H(ejω )] Phase in radians 0.5 -0.5 -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 ω /π From this plot we make the following observations : Q4.5 The plots of the first 100 samples of the impulse responses of the two filters of Questions 4.2 and 4.3 obtained using the program developed in Question Q3.50 are shown below: impule x 10 Amplitude -1 -2 -3 -4 10 20 30 40 50 60 70 80 90 100 60 70 80 90 ω /π impule 0.8 0.6 0.4 0.2 Amplitude -0.2 -0.4 -0.6 -0.8 -1 -1.2 10 20 30 40 50 100 ω /π From these plots we make the following observations : Q4.6 The pole-zero plots of the two filters of Questions 4.2 and 4.3 developed using zplane are shown below: 1.5 1.5 Imaginary Part Imaginary Part 0.5 -0.5 -1 0.5 -0.5 -1 -1.5 -1.5 -2 -2.5 -2 -1.5 -1 -0.5 0.5 Real Part 1.5 -2 2.5 -2.5 From these plots we make the following observations : 4.2 -2 -1.5 -1 -0.5 0.5 Real Part 1.5 2.5 Ta có cực khác TYPES OF TRANSFER FUNCTIONS Project 4.2 Filters A copy of Program P4_1 is given below: % Program P4_1 y = 2*fc*sinc(2*fc*n);k = n+6.5; % Impulse Response of Truncated stem(k,y);title('N = 13');axis([0 Ideal Lowpass Filter 13 -0.2 0.6]); clf; xlabel('Time index fc = 0.25; n');ylabel('Amplitude');grid; n = [-6.5:1:6.5]; Answers: Q4.7 The plot of the impulse response of the approximation to the ideal lowpass filter obtained using Program P4_1 is shown below: N = 13 0.6 0.5 0.4 Amplitude 0.3 0.2 0.1 -0.1 -0.2 Time index n 10 12 The length of the FIR lowpass filter is - 13 The statement in Program P4_1 determining the filter length is 6.5:1:6.5]; - n = [- The parameter controlling the cutoff frequency is Q4.8 – Fc = 0.25 The required modifications to Program P4_1 to compute and plot the impulse response of the FIR lowpass filter of Project 4.2 with a length of 20 and a cutoff frequency of ωc = 0.45 are as indicated below: % 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; stem(k,y);title('N = 20');axis([0 20 -0.2 1]); xlabel('Time index n');ylabel('Amplitude');grid; The plot generated by running the modified program is given below : N = 20 0.8 Amplitude 0.6 0.4 0.2 -0.2 Q4.9 10 12 Time index n 14 16 18 20 The required modifications to 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 indicated below: % 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; stem(k,y);title('N = 15');axis([0 20 -0.2 0.6]); xlabel('Time index n');ylabel('Amplitude');grid; The plot generated by running the modified program is given below : N= 15 0.6 0.5 Am plitude 0.4 0.3 0.2 0.1 -0.1 -0.2 10 T im eindex n 15 Q4.10 The MATLAB program to compute and plot the amplitude response of the FIR lowpass filter of Project 4.2 is given below: % 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; plot(k,y);title('N = 13');axis([0 13 -0.2 0.6]); xlabel('Time index n');ylabel('Amplitude');grid; N = 13 0.6 0.5 0.4 Amplitude 0.3 0.2 0.1 Plots of the amplitude response of lowpass filter for several values of N are shown below: -0.1 -0.2 the N = 15 Time index n N=19 10 12 N = 19 0.6 0.5 0.4 Amplitude 0.3 0.2 0.1 -0.1 -0.2 Time index n 10 12 N = 15 0.6 0.5 0.4 Amplitude 0.3 0.2 0.1 -0.1 -0.2 Time index n 10 12 From these plots we can make the following observations – Không thay đổi theo N A copy of Program P4_2 is given below: % Program P4_2 plot(w/pi,g);grid % Gain Response of a Moving axis([0 -50 0.5]) Average Lowpass Filter xlabel('\omega clf; /\pi');ylabel('Gain in dB'); M = 2; title(['M = ', num2str(M)]) num = ones(1,M)/M; [g,w] = gain(num,1); Answers: M=2 -5 Q4.11 -10 -15 Gain in dB -20 -25 -30 -35 -40 -45 -50 0.1 0.2 0.3 0.4 0.5 ω /π 0.6 0.7 0.8 0.9 A plot of the gain response of a length-2 moving average filter obtained using Program P4_2 is shown below: From 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 of a cascade of K length-2 moving average filters are given below: % Program P4_2 [g,w] = gain(num,1); % Gain Response of a Moving plot(w/pi,g);grid Average Lowpass Filter axis([0 -50 0.5]) clf; xlabel('\omega M = 2; /\pi');ylabel('Gain in dB'); num =[1 1]/M; title(['M = ', num2str(M)]) The plot of the gain response for a cascade of sections obtained using the modified program is shown below: M=3 -5 -10 -15 Gain in dB -20 -25 -30 -35 -40 -45 -50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ω /π From the plot it can be seen that the 3-dB cutoff frequency of the cascade is at Q4.13 - 0.31 The required modifications to Program P4_2 to compute and plot the gain response of the highpass filter of Eq (4.42) are given below : % Program P4_2 plot(w/pi,g);grid % Gain Response of a Moving axis([0 -50 0.5]) Average Lowpass Filter xlabel('\omega clf; /\pi');ylabel('Gain in dB'); M = 5; title(['M = ', num2str(M)]) num =[1 -1 -1 1]/M; [g,w] = gain(num,1); The plot of the gain response for shown below: M = obtained using the modified program is M=5 -5 -10 -15 Gain in dB -20 -25 -30 -35 -40 -45 -50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ω /π From the plot we can see that the 3-dB cutoff frequency is at Q4.14 From Eq (4.16) for a 3-dB cutoff frequency – 0.82 ωc at 0.45π we obtain α = 0.0787 Substituting this value of α in Eqs (4.15) and (4.17) we arrive at the transfer function of the first-order IIR lowpass and highpass filters, respectively, given by HLP(z) = HHP(z) = The plots of their gain responses obtained using MATLAB are shown below : 10 M=5 -5 -10 -15 Gain in dB -20 -25 -30 -35 -40 -45 -50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.6 0.7 0.8 0.9 ω /π M=5 -5 -10 -15 Gain in dB -20 -25 -30 -35 -40 -45 -50 0.1 0.2 0.3 0.4 0.5 ω /π From these plots we observe that the designed filters _ meet the specifications A plot of the magnitude response of the sum HLP(z) + HHP(z) obtained using MATLAB is given below: From this plot we observe that the two filters are - A plot of the sum of the square-magnitude responses of HLP(z) and HHP(z) obtained using MATLAB is given below: < Insert MATLAB figure(s) here paste > From this plot we observe that the two filters are Q4.15 From Eq (4.24), we get substituting Substituting this value of Copy from figure window(s) and - K = 10, B = 1.86 B and ωc = 0.3π in Eq (4.23) we obtain α = -0.31 11 Using 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 H LP,10 (z) = ⋅ = – α z −1 Substituting (7.85+7.85z-1)/(2+13.7z-1) ωc = 0.3π in Eq (4.16) we obtain α = Using this value of IIR lowpass filter H LP,1(z) = α in Eq (4.15) we arrive at the transfer function of a first-order – α + z −1 ⋅ = (7.7+7.7z-1)/(2+13.4z-1) – α z −1 The gain responses of H LP,10 (z) and H LP,1(z) plotted using MATLAB are shown below: HHP M = 21 -5 -5 -10 -10 -15 -15 -20 -20 Gain in dB Gain in dB -25 -30 -25 -30 -35 -35 -40 -40 -45 -45 -50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 -50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ω /π ω /π < Insert From these plots we make the following observation Q4.16 Substituting - ωo = 0.61π in Eq (4.19) we get β = cos(0.61π) = ∆ω3dB = 0.15π in Eq (4.20) we get (1 + α )cos(0.15π) − 2α = 0, whose solution yields α = and α = Substituting Substituting the value of β and the first value of α in Eq (4.18) we arrive at the transfer function of the IIR bandpass transfer function 12 HBP,1(z) = Substituting the value of β and the second value of α in Eq (4.18) we arrive at the transfer function of the IIR bandpass transfer function HBP,2(z) = Next using the zplane command we find the pole locations of HBP,1(z) and HBP,2(z) from which we conclude that the stable transfer function HBP(z) is given by The plot of the gain response of the stable transfer function HBP(z) obtained using MATLAB is shown below: < Insert MATLAB figure(s) here paste > Copy from figure window(s) and Using the same value of α and β in Eq (4.21) we next obtain the transfer function 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 paste > Copy from figure window(s) and From these plots we observe that the designed filters do/do not meet the specifications A plot of the magnitude response of the sum HBP(z) + HBS(z) obtained using MATLAB is given below: < Insert MATLAB figure(s) here paste > From this plot we observe that the two filters are Copy from figure window(s) and - A plot of the sum of the square-magnitude responses of HBP(z) and HBS(z) obtained using MATLAB is given below: < Insert MATLAB figure(s) here paste > From this plot we observe that the two filters are 13 Copy from figure window(s) and - Q4.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 L are shown below: < Insert MATLAB figure(s) here paste > Copy from figure window(s) and From these plots we observe that the comb filter has _ notches at ωk = _ = _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 = is given by G(z) = H1(zL) = Plots of the magnitude response of the above comb filter for the following values of L are shown below < Insert MATLAB figure(s) here paste > Copy from figure window(s) and From these plots we observe that the comb filter has _ notches at _ and _ peaks at Q4.19 ωk = _ 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 -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); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); subplot(2,2,2); stem(n2,num2); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); subplot(2,2,3); stem(n1,num3); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); subplot(2,2,4); stem(n2,num4); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); pause subplot(2,2,1); zplane(num1,1); title('Type FIR Filter'); subplot(2,2,2); zplane(num2,1); title('Type FIR Filter'); subplot(2,2,3); zplane(num3,1); title('Type FIR Filter'); subplot(2,2,4); zplane(num4,1); title('Type FIR Filter'); disp('Zeros of Type FIR Filter are'); 14 ωk = disp(roots(num1)); disp('Zeros of Type FIR Filter are'); disp(roots(num2)); disp('Zeros of Type FIR Filter are'); -50 -100 Amplitude Amplitude 0 Time index n Type FIR Filter -50 -100 100 100 50 50 Amplitude - Các tínhiệu cho ta thấy giá trị M tínhiệu khác : tínhiệu giá trị M chẵn tínhiệu giá trị M lẽ Tínhiệu có M=8 a = 1.979 Tínhiệu có M= a = Type FIR Filter Type FIR Filter 100 100 Tínhiệu có M= a = 50 50 Tínhiệu có M = a = Amplitude - disp(roots(num3)); disp('Zeros of Type FIR Filter are'); disp(roots(num4)); -50 -100 Time index n Time index n Type FIR Filter 10 Time index n 10 -50 -100 The plots of the impulse responses of the four FIR filters generated by running Program P4_3 are given below: From the plots we make the following observations : Filter #1 is of length with a therefore a Type linear-phase FIR filter impulse response and is Filter #2 is of length with a therefore a Type linear-phase FIR filter impulse response and is Filter #3 is of length with a therefore a Type linear-phase FIR filter impulse response and is 15 Filter #4 is of length with a therefore a Type linear-phase FIR filter impulse response and is From the zeros of these filters generated by Program P4_3 we observe that : Filter #1 has zeros at z = Filter #2 has zeros at z = Filter #3 has zeros at z = Filter #4 has zeros at z = Plots of the phase response of each of these filters obtained using MATLAB are shown below: < Insert MATLAB figure(s) here paste > Copy from figure window(s) and From these plots we conclude that each of these filters have Q4.20 The group delay of Filter # is - The group delay of Filter # is - The group delay of Filter # is - The group delay of Filter # is - The plots of the impulse responses Program P4_3 are 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 -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); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); subplot(2,2,2); stem(n2,num2); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); subplot(2,2,3); stem(n1,num3); xlabel('Time index n');ylabel('Amplitude'); grid; phase of the four FIR filters generated by running title('Type FIR Filter'); subplot(2,2,4); stem(n2,num4); xlabel('Time index n');ylabel('Amplitude'); grid; title('Type FIR Filter'); pause subplot(2,2,1); zplane(num1,1); title('Type FIR Filter'); subplot(2,2,2); zplane(num2,1); title('Type FIR Filter'); subplot(2,2,3); zplane(num3,1); title('Type FIR Filter'); subplot(2,2,4); zplane(num4,1); title('Type FIR Filter'); disp('Zeros of Type FIR Filter are'); disp(roots(num1)); disp('Zeros of Type FIR Filter are'); disp(roots(num2)); disp('Zeros of Type FIR Filter are'); 16 disp(roots(num3)); disp('Zeros of Type FIR Filter are'); - disp(roots(num4)); Filter #1 has zeros at z -50 -100 - Filter #2 has zeros at z Filter #3 has zeros at z Filter #4 has zeros at z = Amplitude - = Time index n Type FIR Filter -50 -100 100 100 50 50 Amplitude = Amplitude - Amplitude - Các tínhiệu cho ta thấy giá trị M tínhiệu khác : tínhiệu giá trị M chẵn tínhiệu giá trị M lẽ Tínhiệu có M=8 a = 1.979 Tínhiệu có M= a = Type FIR Filter Type FIR Filter 100 100 Tínhiệu có M= a = 50 50 Tínhiệu có M = a = -50 -100 = Time index n Time index n Type FIR Filter 10 Time index n 10 -50 -100 From the plots we make the following observations : Filter #1 is of length with a therefore a Type linear-phase FIR filter impulse response and is Filter #2 is of length with a therefore a Type linear-phase FIR filter impulse response and is Filter #3 is of length with a therefore a Type linear-phase FIR filter impulse response and is Filter #4 is of length with a therefore a Type linear-phase FIR filter impulse response and is From the zeros of these filters generated by Program P4_3 we observe that : Filter #1 has zeros at z = Filter #2 has zeros at z = Filter #3 has zeros at z = Filter #4 has zeros at z = Plots of the phase response of each of these filters obtained using MATLAB are shown below: 17 < Insert MATLAB figure(s) here paste > Copy from figure window(s) and From these plots we conclude that each of these filters have The group delay of Filter # is - The group delay of Filter # is - The group delay of Filter # is - The group delay of Filter # is - phase Answers: Q4.21 A plot of the magnitude response of H1(z) obtained using MATLAB is shown below: < Insert MATLAB figure(s) here paste > Copy from figure window(s) and From this plot we observe that the magnitude response has a maximum at with a value = ω= Using zplane we observe that the poles of H1(z) are the unit circle and hence the transfer function is/is not stable Since the maximum value of the magnitude response of H1(z) is = , we scale 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 paste > Copy from figure window(s) and From this plot we observe that the magnitude response has a maximum at with a value = ω= Using zplane we observe that the poles of G1(z) are the unit circle and hence the transfer function is/is not stable Since the maximum value of the magnitude response of G1(z) is = G1(z) by _ and arrive at a bounded-real transfer function G2(z) = 18 , we scale 4.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 paste > From the above pole-zero plots we observe that Q4.24 Copy from figure window(s) and - Using Program P4_4 we tested the stability of H 1(z) and arrive at the following stability test parameters {k i}: From these parameters we conclude that H1(z) is _ Using Program P4_4 we tested the stability of H 2(z) and arrive at the following stability test parameters {k i}: From these parameters we conclude that H2(z) is Q4.25 _ Using Program P4_4 we tested the root locations of D(z) and arrive at the following stability test parameters {k i}: From these parameters we conclude that all roots of D(z) are circle Q4.26 Using Program P4_4 we tested the root locations of D(z) and arrive at the following stability test parameters {k i}: From these parameters we conclude that all roots of D(z) are circle Date : the unit Signature : 19 the unit ... Các tín hiệu cho ta thấy giá trị M tín hiệu khác : tín hiệu giá trị M chẵn tín hiệu giá trị M lẽ Tín hiệu có M=8 a = 1.979 Tín hiệu có M= a = Type FIR Filter Type FIR Filter 100 100 Tín hiệu. .. Các tín hiệu cho ta thấy giá trị M tín hiệu khác : tín hiệu giá trị M chẵn tín hiệu giá trị M lẽ Tín hiệu có M=8 a = 1.979 Tín hiệu có M= a = Type FIR Filter Type FIR Filter 100 100 Tín hiệu. .. -30 -35 -40 -45 -50 0.1 0.2 0.3 0 .4 0.5 0.6 0.7 0.8 0.9 ω /π From the plot we can see that the 3-dB cutoff frequency is at Q4. 14 From Eq (4. 16) for a 3-dB cutoff frequency – 0.82 ωc at 0 .45 π we