Đang tải... (xem toàn văn)
Bài tập lớn môn Xử lý tín hiệu số phần II
Lập trình Matlab.a.code:num=[1 0]; den=[1 -0.7]; h=tf(num,den)Transfer function:- .ss 0 7b. Đáp ứng tần số biên độ.Code:[h w]=freqz([1],[1 -0.7],1024); phi=180*unwrap(angle(h))/pi; subplot(2,1,1),plot(w,abs(h)),grid;xlabel('Frequancy(radian)'),ylabel('Magnitude');d.x(n)=δ(n-3)h(n)=0,7nu(n).code:h=[1 0.7 0.49 0.343 0.2401 0.16807 0.1176 0.082 0.0576 0.04 0.028];subplot(2,1,2);stem(0:10,h);xlabel('n'),ylabel('h(n)'); x=[0 0 0 1 0 0 0 0 0 0 0]; subplot(2,1,2);stem(0:10,x);xlabel('n'),ylabel('x(n)');y=conv(x,h);subplot(2,1,2);stem(y);xlabel('n'),ylabel('y(n)');e.x(n)=u(n)-u(n-2) h(n)=0,7nu(n).code:n0=10; n=-n0:n0; u1=n>=0; u2=(n-2)>=0;x=u1-u2;h=(0.7).^n;h1=h.*u1; k1=-n0:n0; y=conv(x,h1); length_output=length(x)+length(h1)-1; k2=linspace(-2*n0,2*n0,length_output);subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;subplot(2,1,2);stem(k1,h1);xlabel('n'),ylabel('h(n)');grid; subplot(2,1,2);stem(k2,y);xlabel('n'),ylabel('y(n)');grid; f.x(n)=0,5nu(n)h(n)=0,7nu(n)code:n0=10; n=-n0:n0; u=n>=0; f=(1/2).^n; x=f.*u; f1=(0.7).^n; h=f1.*u; k1=-n0:n0; y=conv(x,h); length_output=length(x)+length(h)-1; k2=linspace(-2*n0,2*n0,length_output); subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;subplot(2,1,2);stem(k1,h);xlabel('n'),ylabel('h(n)');grid;subplot(2,1,2);stem(k2,y);xlabel('n'),ylabel('y(n)');grid; . Matlab.a.code:num=[1 0]; den=[1 -0.7]; h=tf(num,den)Transfer function:- .ss 0 7b. Đáp ứng tần số biên độ.Code:[h w]=freqz([1],[1 -0.7],1024); phi=180*unwrap(angle(h))/pi;