實驗三數(shù)字信號處理.doc
1. 假設(shè)系統(tǒng)用下面差分方程描述: y(n)=x(n)+ay(n-1)假設(shè)a=0.7, 0.8, 0.9 , 分別在三種情況下分析系統(tǒng)的頻率特性,并打印幅度特性曲線。解:B=1;A=1,-0.7;subplot(3,3,3);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)-0.7y(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,2);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,6);subplot(3,3,1);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性);B=1;A=1,-0.8;subplot(3,3,6);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)-0.8y(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,5);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,6);subplot(3,3,4);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性);B=1;A=1,-0.9;subplot(3,3,9);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)-0.9y(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,8);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,6);subplot(3,3,7);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性); 圖形如下所示:2. 假設(shè)系統(tǒng)用下面差分方程描述: y(n) = x(n) +ax(n-1)假設(shè)a=0.7, 0.8, 0.9 , 分別在三種情況下分析系統(tǒng)的頻率特性,并打印幅度特性曲線。解:B=1,0.7;A=1;subplot(3,3,3);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)+0.7x(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,2);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,2);subplot(3,3,1);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性);B=1,0.8;A=1;subplot(3,3,6);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)+0.8x(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,5);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,2);subplot(3,3,4);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性);B=1,0.9;A=1;subplot(3,3,9);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=x(n)+0.9x(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,3,8);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(0,2,0,2);subplot(3,3,7);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性); 圖形如下所示:3. 假設(shè)系統(tǒng)函數(shù)用下式描述: y(n)=1.273y(n-1)-0.81y(n-2)+x(n)+x(n-1)試分析它的頻率特性,要求打印其幅度特性曲線,并求出峰值頻率和谷值頻率。解:B=1,1;A=1,-1.273,0.8;subplot(3,1,3);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title(y(n)=1.273y(n-1)-0.81y(n-2)+x(n)+x(n-1)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,1,1);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(-0.1,2.1,0,15);subplot(3,1,2);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性); 圖形輸出如下:4. 假設(shè)系統(tǒng)函數(shù)用下式描述:(另加的一個) y(n)=0.66y(n-7)-0.77y(n-8)+0.88x(n)-0.99x(n-5)試分析它的頻率特性,要求打印其幅度特性曲線。解:B=0.88,0,0,0,0,-0.99;A=1,0,0,0,0,0,0,-0.66,0.77;subplot(3,1,3);zplane(B,A);xlabel(實部Re);ylabel(虛部Im);title( y(n)=0.66y(n-7)-0.77y(n-8)+0.88x(n)-0.99x(n-5)傳輸函數(shù)零、極點分布);grid onH,w=freqz(B,A,whole);subplot(3,1,1);plot(w/pi,abs(H),linewidth,2);grid on;xlabel(omega/pi);ylabel(|H(ejomega)|);title(幅頻響應(yīng)特性);axis(-0.1,2.1,0,15);subplot(3,1,2);plot(w/pi,angle(H),linewidth,2);grid on;axis(-0.1,2.1,-3,3);xlabel(omega/pi);ylabel(phi(omega);title(相頻響應(yīng)特性);