Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài Bài
1 tập lớn môn học Xử lý số tín hiệu (2016)
1
70
cuadosotan
chu
dac tinh bien
sonhat(N=61)
0.9
60
0.8
0.7
50
0.6
wR
bien do
40
30
0.5
0.4
0.3
20
0.2
10
0
-200
0.1
-150
0
-50
-40
-30
-100
-50
-20
0
-10
50
tan so
0
100
n
10
150
20
30
200
40
50
dac
tinhthuc
tan so phuc
dac tinh tan so
phan
70
60
80
50
60
30
20
truc thuc
pho thuc
40
40
20
0
10
-20
50
0
200
100
0
-10
0
-100
-20
Sinh viên:
-200
Trang:
SinhTrang:
viên:
-150
-100
truc
-50 ao
0
tan so
-50
50
-200
100
150
Trang:
200
tan so
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so phan ao
50
40
30
20
pho ao
10
0
-10
-20
-30
-40
-50
-200
-150
-100
-50
0
50
100
150
200
150
200
tan so
dac tinh argument tan so
4
3
2
argument
1
0
-1
-2
-3
-4
-200
SinhTrang:
viên:
-150
-100
-50
0
tan so
50
100
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so roi rac
80
truc thuc
60
40
20
0
-20
1
0.5
40
20
0
0
-0.5
-20
-1
truc ao
-40
tan so
dac tinh tan so phan thuc roi rac
70
60
50
pho thuc
40
30
20
10
0
-10
-30
Trang:
Sinh
viên:
-20
-10
0
tan so
10
20
30
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so phan ao roi rac
1
0.8
0.6
0.4
pho ao
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-30
-20
-10
0
10
20
30
tan so
dac tinh tan so bien do roi rac
70
60
50
bien do
40
30
20
10
0
-30
Sinh viên:
-20
-10
0
tan so
10
20
30
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so argument roi rac
4
3
pho argument
2
1
0
-1
-2
-3
-4
-30
-20
-10
0
10
20
30
tan so
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 3
Dap ung xung bo loc so thuc te
0.5
0.4
Dap ung
0.3
0.2
0.1
0
-0.1
-0.2
-50
-40
-30
-20
-10
0
10
20
30
40
50
thoi gian
Dac tinh bien do tan so cua bo loc so thuc te
1.4
1.2
Bien do
1
0.8
0.6
0.4
0.2
0
Sinh viên:-200
-150
-100
-50
0
tan so
50
100
150
200
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 4
cua so bartlett(N=61)
1
0.9
0.8
0.7
wR
0.6
0.5
0.4
0.3
0.2
0.1
0
-50
-40
-30
-20
-10
0
10
20
30
40
50
n
dac tinh tan so phuc
30
truc thuc
20
10
0
-10
-20
40
20
200
100
0
0
-20
Sinh viên:
truc ao
-100
-40
-200
tan so
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh bien do tan so
35
30
bien do
25
20
15
10
5
0
-200
-150
-100
-50
0
50
100
150
200
150
200
tan so
dac tinh tan so phan thuc
30
25
20
pho thuc
15
10
5
0
-5
-10
-15
-200
Sinh viên:
-150
-100
-50
0
tan so
50
100
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so phan ao
30
20
pho ao
10
0
-10
-20
-30
-200
-150
-100
-50
0
50
100
150
200
150
200
tan so
dac tinh argument tan so
4
3
2
argument
1
0
-1
-2
-3
-4
-200
Sinh viên:
-150
-100
-50
0
tan so
50
100
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so roi rac
30
truc thuc
20
10
0
-10
-20
1
0.5
30
0
10
-0.5
-1
truc ao
-10
-20
-30
20
0
tan so
dac tinh tan so phan thuc roi rac
30
25
20
pho thuc
15
10
5
0
-5
-10
-15
-30
-20
-10
0
tan so
Sinh viên:
10
20
30
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so phan ao roi rac
0.8
0.6
0.4
pho ao
0.2
0
-0.2
-0.4
-0.6
-0.8
-30
-20
-10
0
10
20
30
tan so
dac tinh tan so bien do roi rac
30
25
bien do
20
15
10
5
0
-30
-20
-10
0
tan so
Sinh viên:
10
20
30
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
dac tinh tan so argument roi rac
4
3
pho argument
2
1
0
-1
-2
-3
-4
-30
-20
-10
0
10
20
30
tan so
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 5
Dap ung xung bo loc so thuc te
0.6
0.5
Dap ung
0.4
0.3
0.2
0.1
0
-0.1
-50
-40
-30
-20
-10
0
10
20
30
40
50
thoi gian
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 6
Dac tinh bien do tan so cua bo loc so thuc te
1
0.9
0.8
0.7
bien do
0.6
0.5
0.4
0.3
0.2
0.1
0
-200
-150
-100
-50
0
50
100
150
200
tan so
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 2
dac tinh tan so bo loc so ly tuong
1
pho
0.8
0.6
0.4
0.2
0
-200
-150
-100
-50
0
50
100
150
200
300
400
tan so
dac tinh tan so bo loc so thuc te
1.4
1.2
1
pho
0.8
0.6
0.4
0.2
Sinh
0
-400
viên:
-300
-200
-100
0
tan so
100
200
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Phụ Lục
Bài 1
clear
clc
N=61
w=rectwin(N);
n=-(N-1)/2:(N-1)/2;
N1=fix(3*(N-1)/4);
n1=-N1:N1;
for i=1:length(n1)
if (n1(i)>=(1-N)/2)&(n1(i)<=(N-1)/2)
w1(i)=w(i-N1+(N-1)/2);
else w1(i)=0;
end
end
figure(1)
stem(n1,w1,'LineWidth',2);
grid on
xlabel('n','FontSize', 12);ylabel('wR','FontSize', 12);title('cua so chu nhat(N=61)','FontSize', 16);
t=-180:0.18:180;
for k=1:length(t)
W(k)=0;
for a=1:N
W(k)=W(k)+w(a)*exp(-(a-1)*j*t(k)*pi/180);
end
end
figure(2)
plot3(t,imag(W),real(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('truc ao','FontSize', 12);zlabel('truc thuc','FontSize', 12); title('dac tinh
tan so phuc','FontSize', 16);
figure(3)
plot(t,abs(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('bien do','FontSize', 12);title('dac tinh bien do tan so','FontSize', 16);
figure(4)
plot(t,real(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('pho thuc','FontSize', 12);title('dac tinh tan so phan thuc','FontSize', 16);
figure(5)
plot(t,imag(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('pho ao','FontSize', 12);title('dac tinh tan so phan ao','FontSize', 16);
figure(6)
plot(t,angle(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('argument','FontSize', 12);title('dac tinh argument tan so','FontSize', 16);
Wk=fft(w);
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
for i=1:N
if(i<=((N-1)/2))
Wk1(i)=Wk(i+(N+1)/2);
else
Wk1(i)=Wk(i-(N-1)/2);
end
end
figure(7)
stem3(n,imag(Wk1),real(Wk1),'LineWidth',2)
grid on;
xlabel('tan so','FontSize', 12);ylabel('truc ao','FontSize',
12);zlabel('truc thuc','FontSize', 12);title('dac tinh tan so roi
rac','FontSize', 16);
figure(8)
stem(n,real(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho thuc','FontSize',
12);title('dac tinh tan so phan thuc roi rac','FontSize', 16);
figure(9)
stem(n,imag(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho ao','FontSize',
12);title('dac tinh tan so phan ao roi rac','FontSize', 16);
figure(10)
stem(n,abs(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('bien do'),'FontSize',
12;title('dac tinh tan so bien do roi rac','FontSize', 16);
for i=1:N
pha(i)=exp(-j*(N-1)/N*pi*n(i));
end
figure(11)
stem(n,angle(pha),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho argument','FontSize',
12);title('dac tinh tan so argument roi rac','FontSize', 16);
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bai 2
clear
clc
wc=85;
N=61;
n=linspace(-180,180,2001);
for i=1:length(n)
if (n(i)>=-wc)&(n(i)<=wc)
H(i)=1;
else H(i)=0;
end
end
figure(1)
plot(n,H,'LineWidth', 2); grid on;axis([-200 200 0 1.1]);
xlabel('tan so', 'FontSize', 12); ylabel('pho', 'FontSize',
12);title('dac tinh tan so bo loc so ly tuong', 'FontSize', 16);
t=-180:0.18:180;
for i=1:length(t)
if t(i)==0
WR(i)=65;
else
WR(i)=sin(t(i)*65*pi/180/2)/sin(t(i)*pi/180/2);
end
end
Ht=conv(H,(WR))/2/1000;
k=-360:0.18:360;
figure(2)
plot(k,abs(Ht),'LineWidth', 2);
xlabel('tan so', 'FontSize', 12);ylabel('pho', 'FontSize', 12);title('dac
tinh tan so bo loc so thuc te', 'FontSize', 16);
grid on
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 3
clear
clc
wc=85;
N=61;
N1=fix(3*(N-1)/4);
n=-N1:N1;
for i=1:length(n)
if n(i)==0
hlt(i)=wc/180;
else
hlt(i)=1/(pi*n(i))*sin(wc*pi/180*n(i));
end
end
for i=1:length(n)
if (n(i)>=(1-N)/2)&(n(i)<=(N-1)/2)
wr(i)=1;
else
wr(i)=0;
end
end
for i=1:length(n)
htt(i)=hlt(i)*wr(i);
end
figure(1)
stem(n,htt,'LineWidth', 2);
xlabel('thoi gian', 'FontSize', 12); ylabel('Dap ung', 'FontSize', 12);
title('Dap ung xung bo loc so thuc te', 'FontSize', 16);
grid on;
t=-180:0.18:180;
for k=1:length(t)
H(k)=0;
for i=1:length(n)
H(k)=H(k)+htt(i)*exp(-j*t(k)*pi/180*n(i));
end
end
figure(2)
plot(t,abs(H),'LineWidth', 2);
xlabel('tan so', 'FontSize', 12); ylabel('Bien do', 'FontSize', 12);
title('Dac tinh bien do tan so cua bo loc so thuc te', 'FontSize', 16);
grid on;
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 4
clear
clc
N=61
w=bartlett(N);
n=-(N-1)/2:(N-1)/2;
N1=fix(3*(N-1)/4);
n1=-N1:N1;
for i=1:length(n1)
if (n1(i)>=(1-N)/2)&(n1(i)<=(N-1)/2)
w1(i)=w(i-N1+(N-1)/2);
else w1(i)=0;
end
end
figure(1)
stem(n1,w1,'LineWidth',2);
grid on
xlabel('n','FontSize', 12);ylabel('wR','FontSize', 12);title('cua so
bartlett(N=61)','FontSize', 16);
t=-180:0.18:180;
for k=1:length(t)
W(k)=0;
for a=1:N
W(k)=W(k)+w(a)*exp(-(a-1)*j*t(k)*pi/180);
end
end
figure(2)
plot3(t,imag(W),real(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('truc ao','FontSize',
12);zlabel('truc thuc','FontSize', 12); title('dac tinh tan so
phuc','FontSize', 16);
figure(3)
plot(t,abs(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('bien do','FontSize',
12);title('dac tinh bien do tan so','FontSize', 16);
figure(4)
plot(t,real(W),'LineWidth',2);
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
grid on
xlabel('tan so','FontSize', 12);ylabel('pho thuc','FontSize',
12);title('dac tinh tan so phan thuc','FontSize', 16);
figure(5)
plot(t,imag(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('pho ao','FontSize',
12);title('dac tinh tan so phan ao','FontSize', 16);
figure(6)
plot(t,angle(W),'LineWidth',2);
grid on
xlabel('tan so','FontSize', 12);ylabel('argument','FontSize',
12);title('dac tinh argument tan so','FontSize', 16);
Wk=fft(w);
for i=1:N
if(i<=((N-1)/2))
Wk1(i)=Wk(i+(N+1)/2);
else
Wk1(i)=Wk(i-(N-1)/2);
end
end
figure(7)
stem3(n,imag(Wk1),real(Wk1),'LineWidth',2)
grid on;
xlabel('tan so','FontSize', 12);ylabel('truc ao','FontSize',
12);zlabel('truc thuc','FontSize', 12);title('dac tinh tan so roi
rac','FontSize', 16);
figure(8)
stem(n,real(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho thuc','FontSize',
12);title('dac tinh tan so phan thuc roi rac','FontSize', 16);
figure(9)
stem(n,imag(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho ao','FontSize',
12);title('dac tinh tan so phan ao roi rac','FontSize', 16);
figure(10)
stem(n,abs(Wk1),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('bien do'),'FontSize',
12;title('dac tinh tan so bien do roi rac','FontSize', 16);
for i=1:N
pha(i)=exp(-j*(N-1)/N*pi*n(i));
end
figure(11)
stem(n,angle(pha),'LineWidth',2); grid on
xlabel('tan so','FontSize', 12);ylabel('pho argument','FontSize',
12);title('dac tinh tan so argument roi rac','FontSize', 16);
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bai 5
wc=85;
N=61;
N1=fix(3*(N-1)/4);
n=-N1:N1;
for i=1:length(n)
if n(i)==0
hlt(i)=wc/180;
else
hlt(i)=1/(pi*n(i))*sin(wc*pi/180*n(i));
end
end
w=bartlett(N);
for i=1:length(n)
if (n(i)>=(1-N)/2)&(n(i)<=(N-1)/2)
w1(i)=w(i-N1+(N-1)/2);
else w1(i)=0;
end
end
for i=1:length(n)
htt(i)=hlt(i)*w1(i);
end
figure(1)
stem(n,htt,'LineWidth',2);
xlabel('thoi gian','FontSize', 12); ylabel('Dap ung','FontSize', 12);
title('Dap ung xung bo loc so thuc te','FontSize', 16);
grid on;
t=-180:0.18:180;
for k=1:length(t)
H(k)=0;
for i=1:length(n)
H(k)=H(k)+htt(i)*exp(-j*t(k)*pi/180*n(i));
end
end
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 6
wc=85;
N=61;
N1=fix(3*(N-1)/4);
n=-N1:N1;
for i=1:length(n)
if n(i)==0
hlt(i)=wc/180;
else
hlt(i)=1/(pi*n(i))*sin(wc*pi/180*n(i));
end
end
w=bartlett(N);
for i=1:length(n)
if (n(i)>=(1-N)/2)&(n(i)<=(N-1)/2)
w1(i)=w(i-N1+(N-1)/2);
else w1(i)=0;
end
end
for i=1:length(n)
htt(i)=hlt(i)*w1(i);
end
t=-180:0.18:180;
for k=1:length(t)
H(k)=0;
for i=1:length(n)
H(k)=H(k)+htt(i)*exp(-j*t(k)*pi/180*n(i));
end
end
figure(1)
plot(t,abs(H),'LineWidth',2);
xlabel('tan so','FontSize', 12); ylabel('bien do','FontSize', 12);
title('Dac tinh bien do tan so cua bo loc so thuc te','FontSize', 16);
grid on
Sinh viên:
Trang:
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 2
dac tinh tan so bo loc so ly tuong
1
pho
0.8
0.6
0.4
0.2
0
-200
-150
-100
-50
0
50
100
150
200
300
400
Trang:
tan so
dac tinh tan so bo loc so thuc te
1.4
1.2
bien do
1
0.8
0.6
0.4
0.2
0
-400
Sinh viên:
-300
-200
-100
0
tan so
100
200
Bài tập lớn môn học Xử lý số tín hiệu (2016)
Bài 2
clear
clc
wc=85;
N=61;
n=linspace(-180,180,2001);
for i=1:length(n)
if (n(i)>=-wc)&(n(i)<=wc)
H(i)=1;
else H(i)=0;
end
end
figure(1)
plot(n,H,'LineWidth', 2); grid on;axis([-200 200 0 1.1]);
xlabel('tan so', 'FontSize', 12); ylabel('pho', 'FontSize',
12);title('dac tinh tan so bo loc so ly tuong', 'FontSize', 16);
t=-180:0.18:180;
for i=1:length(t)
if t(i)==0
WR(i)=N;
else
WR(i)=sin(t(i)*N*pi/180/2)/sin(t(i)*pi/180/2);
end
end
Ht=conv(H,(WR))/2/1000;
k=-360:0.18:360;
figure(2)
plot(k,abs(Ht),'LineWidth', 2);
hold on
r=1/sqrt(2)
plot(n,r,'r:')
s=1-1/sqrt(2)
plot(n,s,'g:')
xlabel('tan so', 'FontSize', 12);ylabel('bien do', 'FontSize',
12);title('dac tinh tan so bo loc so thuc te', 'FontSize', 16);
grid on
Sinh viên:
Trang: