Họ và tên: Dương Phúc Phương MSV: 2019604542 Mã đề: 15 Bài làm: Câu 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Họ và tên: Dương Phúc Phương

MSV: 2019604542

Mã đề: 15

Bài làm:

Câu 1:
n = [0:1:12];
xn = [-0.4 2.7 1.5 0.5 1 1 -0.6 3.3 -5 2 -1 2.3 3.4];
subplot(311);
stem(n,xn);
title('Cau 1a: x(n)');
un = stepseq(0,0,12);
hn = ((0.9).^n).*un;
subplot(312);
stem(n,hn);
title('Cau 1b: h(n)');
[y,ny] = conv_m(xn,n,hn,n);
subplot(313);
stem(ny,y);
title('Cau 1c: y(n)=x(n)*h(n)');

Caau 2:
n = [0:20]
un = stepseq(0,0,20);
xn = sigshift(un,n,3);
a1 = [1 0.368 0 0 0.334]; b1 = [0.3 -0.372 0.367 0 0];
a2 = [1 -0.072 -0.85]; b2 = [0.23 -0.52 0.32];
a3 = [1 0.713 0 0 0.853 0 0]; b3 = [1.24 -0.523 0 0 0 0 0.323];
y1 = filter(b1,a1,xn);
y2 = filter(b2,a2,y1);
y3 = filter(b3,a3,y2);
subplot(211);
stem(n,xn);
axis([-1 21 -0.5 1.5]);
title('Tin hieu tac dong: x(n)=u(n-3)');
subplot(212);
stem(n,y3);
axis([-1 21 -5 5]);
title('Tin hieu ra: y(n)');
Caau 3:
num = [1 -4.262 0 0 0 0 1.342];
den = [1 3.823 0 0 -0.832 0 0];
w=-4*pi:8*pi/511:4*pi;
hz = freqz(den,num,w);
subplot(231);plot(w/pi,real(hz));
title('Phan thuc')
subplot(232);plot(w/pi,imag(hz));
title('Phan ao');
subplot(233);plot(w/pi,abs(hz));
title('Pho bien do');
hn = impz(den,num);
subplot(234);
stem(hn);
title('dap ung xung don vi');
subplot(235);
zplane(num,den);
title('diem cuc,diem khong');

You might also like