资源描述:
《数字信号处理MATLAB实验程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、2.1clccloseall;n=0:15;p=8;q=2;x=exp(-(n-p).^2/q);figure(1);subplot(3,1,1);stem(n,x);title('exp(-(n-p)^2/q),p=8,q=2');xk1=fft(x,16);q=4;x=exp(-(n-p).^2/q);subplot(3,1,2);xk2=fft(x,16);stem(n,x);title('exp(-(n-p)^2/q),p=8,q=4');q=8;x=exp(-(n-p).^2/q);xk3=fft(x,16);subplot(3,1
2、,3);stem(n,x);title('exp(-(n-p)^2/q),p=8,q=8');%时域特性figure(2);subplot(3,1,1);stem(n,abs(xk1));title('exp(-(n-p)^2/q),p=8,q=2');subplot(3,1,2);stem(n,abs(xk2));title('exp(-(n-p)^2/q),p=8,q=4');subplot(3,1,3);stem(n,abs(xk3));title('exp(-(n-p)^2/q),p=8,q=8');%频域特性%%%%%%%%%%%%
3、%%%%%%%%%%%%%%%%%%%%%%%%%%%p=8;q=8;figure(3);subplot(3,1,1);stem(n,x);title('exp(-(n-p)^2/q),p=8,q=8');xk1=fft(x,16);p=13;x=exp(-(n-p).^2/q);subplot(3,1,2);xk2=fft(x,16);stem(n,x);title('exp(-(n-p)^2/q),p=13,q=8');p=14;x=exp(-(n-p).^2/q);xk3=fft(x,16);subplot(3,1,3);stem(n,
4、x);title('exp(-(n-p)^2/q),p=14,q=8');%时域特性figure(4);subplot(3,1,1);stem(n,abs(xk1));title('exp(-(n-p)^2/q),p=8,q=8');subplot(3,1,2);stem(n,abs(xk2));title('exp(-(n-p)^2/q),p=13,q=8');subplot(3,1,3);stem(n,abs(xk3));title('exp(-(n-p)^2/q),p=14,q=8');%频域特性2.2clcclosealln=0:15
5、;f=0.0625;a=0.1;xb1=exp(-a*n).*sin(2*pi*f*n);xk1=fft(xb1,16);f=0.4375;xb2=exp(-a*n).*sin(2*pi*f*n);xk2=fft(xb2,16);f=0.5625;xb3=exp(-a*n).*sin(2*pi*f*n);xk3=fft(xb3,16);figure(1);subplot(3,1,1);stem(n,xb1);title('f=0.0625');subplot(3,1,2);stem(n,xb2);title('f=0.4375');subpl
6、ot(3,1,3);stem(n,xb3);title('f=0.5625');figure(2);subplot(3,1,1);stem(n,abs(xk1));title('f=0.0625');subplot(3,1,2);stem(n,abs(xk2));title('f=0.4375');subplot(3,1,3);stem(n,abs(xk3));title('f=0.5625');2.3clccloseall;N=8;n=0:N-1;xc=0:7;xd=0:7;form=0:7;if(0<=m&m<=3)xc(m+1)=m;x
7、d(m+1)=4-m;elseif(4<=m&m<=7)xc(m+1)=8-m;xd(m+1)=m-4;endendfigure(1);subplot(2,1,1);stem(n,xc);title('三角波序列');subplot(2,1,2);stem(n,xd);title('反三角波序列');xck=fft(xc,N);xdk=fft(xd,N);figure(2);subplot(2,1,1);stem(n,abs(xck));title('三角波序列8点fft');subplot(2,1,2);stem(n,abs(xdk));t
8、itle('反三角波序列8点fft');figure(3);xck1=fft(xc,32);xdk1=fft(xd,32);subplot(2,1,1);stem(