数字信号处理实验报告
subplot(3,2,1); stem(n1,abs(XK16),'.')
title('x1(n)的16点变换');xlabel('n');ylabel('|XK16|') grid; hold on; n2=0:7; subplot(3,2,2); stem(n2,abs(XK8),'.')
title('x1(n)的8点变换');xlabel('n');ylabel('|XK8|') grid; hold on;
xn2=[4 3 2 1 1 2 3 4]; XK8=fft(xn2,8); XK16=fft(xn2,16); n1=0:15; subplot(3,2,3); stem(n1,abs(XK16),'.')
title('x2(n)的16点变换');xlabel('n');ylabel('|XK16|') grid; hold on; n2=0:7; subplot(3,2,4);
- 11 -
数字信号处理实验报告
stem(n2,abs(XK8),'.')
title('x2(n)的8点变换');xlabel('n');ylabel('|XK8|') hold on; grid;
xn=[1 2 3 4 4 3 2 1]; XK8=fft(xn,8); XK16=fft(xn,16); n1=0:15; subplot(3,2,5); stem(n1,abs(XK16),'.')
title('x3(n)的16点变换');xlabel('n');ylabel('|XK16|') grid; hold on; n2=0:7; subplot(3,2,6); stem(n2,abs(XK8),'.')
title('x3(n)的8点变换');xlabel('n');ylabel('|XK8|') 实验结果:
- 12 -
数字信号处理实验报告
实验结果分析:对序列x(n)进行N点的DFT即对x(ejw)在{0 2pi)进行N点等间隔采样则第一行的两个图分别是对x(n)的16点和8点的采样
2由第二 三行的四个图可知由序列x2(n)=x((n+3))8R8(n)则当序列进行8点的DFT时满足循环移位关系则,则8点的DFT的结果的X(K)的模相等,而进行16点的DFT时不满足循环位移所以16点的DFT的模不相等、 实验二程序 clc; clear all; n=0:15;
x4n=cos(pi*n/4); X4K16=fft(x4n,16); n1=0:15; subplot(3,2,1);
- 13 -
数字信号处理实验报告
stem(n1,abs(X4K16))
title('x4(n)的16点变换');xlabel('w/pi');ylabel('X4K16') n=0:7;
x4n=cos(pi*n/4); X4K8=fft(x4n,8); n2=0:7
subplot(3,2,2); stem(n2,abs(X4K8),'.')
title('x4(n)的8点变换');xlabel('w/pi');ylabel('X4K8') n=0:15;
x5n=cos(pi*n/4)+cos(pi*n/8); X5K16=fft(x5n,16); n1=0:15 subplot(3,2,3); stem(n1,X5K16,'.')
title('x5(n)的16点变换');xlabel('w/pi');ylabel('X5K16') n=0:7;
x5n=cos(pi*n/4)+cos(pi*n/8); X5K8=fft(x5n,8); n2=0:7
subplot(3,2,4); stem(n2,X5K8,'.')
- 14 -
数字信号处理实验报告
title('x5(n)的8点变换');xlabel('w/pi');ylabel('X5K8')
实验程序三 n=0:15; Fs=64; t=n/Fs;
x8t=cos(pi*8*t)+cos(pi*16*t)+cos(pi*20*t); XK16=fft(x8t,16); n1=0:15; subplot(3,1,1) stem(n1,abs(XK16),'.')
title('16点的变换');xlabel('n');ylabel('幅度') grid;
- 15 -