thấy rằng hai tín hiệu khắc nhau: Tín hiệu thu được trong câu Q4.2 là tín hiệu có chiều dài giới hạn và nhân quả cón tín hiệu của câu Q4.3 là tín hiệu có chiều dai vô hạn và không nhân q
Trang 1% Program P3_1
% Evaluation of the DTFT
clf;
% Compute the frequency samples of the DTFT
w = 0:8*pi/511:2*pi;
num = [2 1];den = [1 -0.6];
h = freqz(num, den, w);
% Plot the DTFT
subplot(2,1,1)
plot(w/pi,real(h));grid
title('Real part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,imag(h));grid
title('Imaginary part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
pause
subplot(2,1,1)
plot(w/pi,abs(h));grid
title('Magnitude Spectrum |H(e^{j\omega})|')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h));grid
title('Phase Spectrum arg[H(e^{j\omega})]')
xlabel('\omega /\pi');
ylabel('Phase in radians');
Q4.2
với giá trị M = 2 tín hiệu có tâm đối xứng
0 2 4 6
j )
/
4
2 0 2
j )
/
50
45
40
35
30
25
20
15
10
5 0
M = 2
Trang 2Q4.3
quả
thấy rằng hai tín hiệu khắc nhau: Tín hiệu
thu được trong câu Q4.2 là tín hiệu có
chiều dài giới hạn và nhân quả cón tín
hiệu của câu Q4.3 là tín hiệu có chiều dai
vô hạn và không nhân quả
ta một bộ lọc có chiều dài hữu hạn và
nhân quả
Q4.7
Q4.8
% 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;
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
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Time index n
0.2 0 0.2 0.4 0.6 0.8
N = 20
Trang 3Q4.9
% 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;
Q4.10
% 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;
Q4.11
- Nếu ta khuếch đại tấn số cắt thì biên độ của tín hiệu thay đổi ở
hai điểm đầu và cuối của tín hiệu
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Time index n
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Time index n
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Trang 4% 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;gain(k,2);
stem(k,y);title('N = 13');axis([0 13 -0.2 0.6]);
xlabel('Time index n');ylabel('Amplitude');grid;
Q4.13
% Program P4_1
% Impulse Response of Truncated Ideal Lowpass
Filter
clf;
fc = 0.25;
n = [-2.5:1:2.5];
y = 2*fc*sinc(2*fc*n);k = n+2.5;
stem(k,y);title('N = 5');axis([0 5 -0.2 0.6]);
xlabel('Time index n');ylabel('Amplitude');grid;
Q4.19
% 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);
xlabel('Time index n');ylabel('Amplitude'); grid;
title('Type 1 FIR Filter');
subplot(2,2,2); stem(n2,num2);
xlabel('Time index n');ylabel('Amplitude'); grid;
title('Type 2 FIR Filter');
subplot(2,2,3); stem(n1,num3);
xlabel('Time index n');ylabel('Amplitude'); grid;
title('Type 3 FIR Filter');
subplot(2,2,4); stem(n2,num4);
xlabel('Time index n');ylabel('Amplitude'); grid;
title('Type 4 FIR Filter');
pause
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Time index n
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.2
0.1 0 0.1 0.2 0.3 0.4 0.5
Time index n
Trang 5subplot(2,2,1); zplane(num1,1);
title('Type 1 FIR Filter');
subplot(2,2,2); zplane(num2,1);
title('Type 2 FIR Filter');
subplot(2,2,3); zplane(num3,1);
title('Type 3 FIR Filter');
subplot(2,2,4); zplane(num4,1);
title('Type 4 FIR Filter');
disp('Zeros of Type 1 FIR Filter are');
disp(roots(num1));
disp('Zeros of Type 2 FIR Filter are');
disp(roots(num2));
disp('Zeros of Type 3 FIR Filter are');
disp(roots(num3));
disp('Zeros of Type 4 FIR Filter 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
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