1、数字信号处理实验六1, 例 1:nx=0:8*pi;x=sin(nx/2)+sin(10*nx)/3;subplot(3,1,1);stem(nx,x);a=1,-0.34319,0.60439,-0.20407;b=0.1321,0.3963,0.3963,0.1321;nh=0:9;h=impz(b,a,nh);subplot(3,1,2);stem(nh,h);y=dlsim(b,a,x);subplot(3,1,3);stem(y);例 2:a=a,-0.9;b=1,0.9;x01=0;y01=0;xi=filtic(b,a,x01,y01);N=40;n=0:N-1;x=(exp(-
2、0.05+j*0.4)*n).*n=2;y=filter(b,a,x,xi);subplot(2,2,1),stem(n,real(x);title(输入信号 x(n)的实部);subplot(2,2,2),stem(n,imag(x);title(输入信号 x(n)的虚部);subplot(2,2,3),stem(n,real(x);title(系统响应 y(n)的实部);subplot(2,2,4),stem(n,imag(x);title(系统响应 y(n)的虚部);例 3:a=1,-1.5,0.5;b=1;N=20;n=0:N-1;x=0.25.n;x0=zeros(1,N);y01=
3、4,10;xi=filtic(b,a,y01);y0=filter(b,a,x0,xi);xi0=filtic(b,a,0);y1=filter(b,a,x,xi0);y=filter(b,a,x,xi);y2=(1/3)*(1/4).n+(1/2).n+(2/3).*ones(1,N);subplot(2,3,1),stem(n,x);title(输入信号 x(n);subplot(2,3,2),stem(n,y0);title(信号的零输入响应);subplot(2,3,3),stem(n,y1);title(信号的零状态响应);subplot(2,2,3),stem(n,y);title
4、(用 filter 求系统的完全响应 y(n);subplot(2,2,4),stem(n,y2);title(用公式求系统的完全响应 y(n);2, (1):nx=0:10;x=0,0,0,1,1,1,1,1,1,1,1;subplot(3,1,1);stem(nx,x);a=1,-0.5,1,-0.5;b=1,-1,1;y01=0;x01=0;nh=0:9;h=impz(b,a,nh);subplot(3,1,2);stem(nh,h);y=dlsim(b,a,x);subplot(3,1,3);stem(y);(2):nx=0:10;x=1,0,0,0,0,-1,0,0,0,0,0;su
5、bplot(3,1,1);stem(nx,x);a=1,-0.5,1,-0.5;b=1,-1,1;y01=0;x01=0;nh=0:9;h=impz(b,a,nh);subplot(3,1,2);stem(nh,h);y=dlsim(b,a,x);subplot(3,1,3);stem(y);(3):nx=0:10;n=0,0,0,1,1,1,1,1,1,1,1;x=(exp(0.1*nx).*n;subplot(3,1,1);stem(nx,x);a=1,-0.5,1,-0.5;b=1,-1,1;y01=0;x01=0;nh=0:9;h=impz(b,a,nh);subplot(3,1,2)
6、;stem(nh,h);y=dlsim(b,a,x);subplot(3,1,3);stem(y);(4):nx=0:10;n=0,0,0,1,1,1,1,1,1,1,1;x=0.5.*nx.*n;subplot(3,1,1);stem(nx,x);a=1,-0.5,1,-0.5;b=1,-1,1;y01=0;x01=0;nh=0:9;h=impz(b,a,nh);subplot(3,1,2);stem(nh,h);y=dlsim(b,a,x);subplot(3,1,3);stem(y);3, (1):a=1,-0.602012,0.495684,-0.0359244;b=0.187632,
7、0.241242,0.241242,0.187632;N=20;n=0:N-1;x=n=3;x0=zeros(1,N);y01=5,5;xi=filtic(b,a,y01);y0=filter(b,a,x0,xi);xi0=filtic(b,a,0);y1=filter(b,a,x,xi0);y=filter(b,a,x,xi);subplot(2,2,1),stem(n,x);title(输入信号 x(n);subplot(2,2,2),stem(n,y0);title(信号的零输入响应);subplot(2,2,3),stem(n,y1);title(信号的零状态响应);subplot(2
8、,2,4),stem(n,y);title(用 filter 求系统的完全响应 y(n);(2):a=1,-0.602012,0.495684,-0.0359244;b=0.187632,0.241242,0.241242,0.187632;N=10;n=0:N-1;x=1,1,1,1,1,0,0,0,0,0;x0=zeros(1,N);y01=5,5;xi=filtic(b,a,y01);y0=filter(b,a,x0,xi);xi0=filtic(b,a,0);y1=filter(b,a,x,xi0);y=filter(b,a,x,xi);subplot(2,2,1),stem(n,x)
9、;title(输入信号 x(n);subplot(2,2,2),stem(n,y0);title(信号的零输入响应);subplot(2,2,3),stem(n,y1);title(信号的零状态响应);subplot(2,2,4),stem(n,y);title(用 filter 求系统的完全响应 y(n);(3):a=1,-0.602012,0.495684,-0.0359244;b=0.187632,0.241242,0.241242,0.187632;N=20;n=0:N-1;x=cos(2*pi/3)+sin(3*pi/10)*n);x0=zeros(1,N);y01=5,5;xi=f
10、iltic(b,a,y01);y0=filter(b,a,x0,xi);xi0=filtic(b,a,0);y1=filter(b,a,x,xi0);y=filter(b,a,x,xi);subplot(2,2,1),stem(n,x);title(输入信号 x(n);subplot(2,2,2),stem(n,y0);title(信号的零输入响应);subplot(2,2,3),stem(n,y1);title(信号的零状态响应);subplot(2,2,4),stem(n,y);title(用 filter 求系统的完全响应 y(n);(4):a=1,-0.602012,0.495684,
11、-0.0359244;b=0.187632,0.241242,0.241242,0.187632;N=20;n=0:N-1;x=(0.6*n).*n=3;x0=zeros(1,N);y01=5,5;xi=filtic(b,a,y01);y0=filter(b,a,x0,xi);xi0=filtic(b,a,0);y1=filter(b,a,x,xi0);y=filter(b,a,x,xi);subplot(2,2,1),stem(n,x);title(输入信号 x(n);subplot(2,2,2),stem(n,y0);title(信号的零输入响应);subplot(2,2,3),stem(n,y1);title(信号的零状态响应);subplot(2,2,4),stem(n,y);title(用 filter 求系统的完全响应 y(n);系别: 物理与电子工程系班级: 07 电信 2 班姓名: 杨磊时间: 2010-5-13