程序清单如下M=15;N=20;nx=1:15;nh=1:20;xn=sin(0.4*nx);hn=0.9.^nh;L=pow2(nextpow2(M+N-1));Xk=fft(xn,L);Hk= fft(hn,L);Yk=Xk.*Hk;yn=ifft(Yk,L);ny=1:Lsubplot(3,1,1);stem(nx,xn,'.');title('x(n)');subplot(3,1,2);stem(nh,hn,'.');title('h(n)');subplot(3,1,3);stem(ny,real(yn),'.');title('y(n)'); |