1)stem(xn,'.')title('x(n)N=128')Xk=fft(xn);subplot(3,1,2)stem(n*2/N,abs(Xk),'.')title('X(k)模拟频率')subplot(3,1,3)stem(n*100/N,abs(Xk),'.')title('X(k)数字频率')N=50;n=0:N-1;xn=2*cos(4*pi*0.01*n)+5*cos(8*pi*0.01*n);subplot(3,1,1)stem(xn,'.')title('x(n)N=50')Xk=fft(xn);subplot(3,1,2)stem(n*2/N,abs(Xk),'.')title('X(k)模拟频率')subplot(3,1,3)stem(n*100/N,abs(Xk),'.')title('X(k)数字频率')实验一结果:实验二程序:N=200;n=0:N-1;xn=0.2*cos(0.45*pi*n)+sin(0.3*pi*n)-cos(0.31*pi*n-pi/4);subplot(2,1,1)stem(xn,'.')title('x(n)')Xk=fft(xn);subplot(2,1,2)n1=n(1:(N-1)/2)XK1=Xk(1:(N-1)/2)stem(n1*2/N,abs(XK1),'.')title('X(k)')实验二结果:实验三程序:[xn,fs,bits]=wavread('E:/1.wav');xn=xn(20000:26000);N=length(xn);n=0:N-1;subplot(2,1,1)stem(xn,'.')title('x(n)')Xk=fft(xn);subplot(2,1,2)X2=Xk(1:100);n=1:100;stem(n*fs/N,abs(X2),'.')title('X(k)')实验三结果: