您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 北京邮电大学数字的信号处理实验的二
实用标准文案精彩文档数字信号处理实验二XX班XXXX一.实验要求:(1)假设信号x(n)由下述信号组成:这个信号有两根主谱线0.3pi和0.302pi靠的非常近,而另一根谱线0.45pi的幅度很小,请选择合适的长度N和窗函数,用DFT分析其频谱,得到清楚的三根谱线。(2)已知:N=25。这里Q=0.9+j0.3。可以推导出,首先根据这个式子计算X(k)的理论值,然后计算输入序列x(n)的32个值,再利用基2时间抽选的FFT算法,计算x(n)的DFTX(k),与X(k)的理论值比较(要求计算结果最少6位有效数字)。二.实验分析:(1)本实验可使用matlab中自带的fft函数求得x(n)的傅里叶变换,难点在于选择合适的N值以及清楚的谱线。a.对于N值的选择,由于x(n)中包含的三个分量的周期分别为2*pi/0.45*pi=40/9,2*pi/0.3pi=20/3,2*pi/0.302pi=1000/151,x(n)的周期为1000,为得到清晰的谱线,选取N=1000,则Wk=2*pi*k/1000;所以三条谱线的k1=450,k2=300,k3=302;b.在使谱线清洗时,只需利用axis选取合适的窗函数即可。(2)本实验即为要求先利用25点DFT的定义计算求得其25点DFT,再利用基2-FFT算法求得其DFT,并且将两者进行比较。三.实验内容的实现(1)A.代码:n=0:1:999;xn=0.001*cos(0.45*pi*n)+sin(0.3*pi*n)-cos(0.302*pi*n);yn=fft(xn,1000);%对xn进行1000点DFTk1=0:1:499;wk=2*pi/1000*k1;y1=yn(1:1:500);%由于镜像对称只需看一半即可subplot(3,1,1);stem(wk/pi,abs(y1));title('SamplesofDTFTMagnitude');xlabel('frequencyinpiunits');axis([0,1,0,600]);subplot(3,1,2);stem(wk/pi,abs(y1));axis([0.25,0.35,0,600]);%观察300,302处的谱线subplot(3,1,3);stem(wk/pi,abs(y1));axis([0.4,0.5,0,1]);%观察450处谱线B.结果如图:11nkkk001()()()0,111NNNnNNnnNQXkxnWQWkNQWL,00010450303024().*cos(.)sin(.)cos(.)xnnnn实用标准文案精彩文档(2)A.代码:formatlongQ=0.9+0.3i;n=0:24;x=Q.^n;y1=(1-Q^25)./(1-Q.*exp(-j*2*pi*n/25));%根据公式计算25点DFTx2=[x,0,0,0,0,0,0,0];y2=fft(x2);%使用基2FFT算法计算n2=0:1:31;for(m=1:25)y3(m)=y1(m)-y2(m);end;subplot(3,1,1);stem(n,abs(y1));axis([0,32,0,15]);title('N=25DFT');xlabel('n');subplot(3,1,2);stem(n2,abs(y2));axis([0,32,0,15]);title('N=32FFT');xlabel('n');subplot(3,1,3);stem(m,abs(y3));axis([0,25,0,15]);title('误差');xlabel('n');B.结果:a.误差序列:y3=Columns1through2-0.000000000000000-0.000000000000000i5.817439454324326-实用标准文案精彩文档0.941040324114136iColumns3through4-9.272989245757216+1.806567024126041i-1.055728571003527+0.006165567483396iColumns5through60.109680274228142+0.312117411678918i-0.132227359831744+0.656545304970248iColumns7through8-0.491115210532073+0.330164381661244i-0.302355254463930-0.104401629339881iColumns9through100.071488794285995-0.066464473299359i0.078075844225558+0.210934398903539iColumns11through12-0.161974868948978+0.209654292048469i-0.176095334975308-0.034516239063079iColumns13through140.060246199972530-0.092272809496693i0.154494521140728+0.108487641370809iColumns15through16-0.006434841285029+0.208660575204784i-0.095307033403866+0.059377350932753iColumns17through180.068999600677699-0.043113757045075i0.222166621724661+0.111157325552887iColumns19through20实用标准文案精彩文档0.130789688425025+0.289360758130739i0.001288211584027+0.236449570229325iColumns21through220.118110781165706+0.132488509392841i0.344473749291525+0.292907236433923iColumns23through240.363759326481941+0.632526704462872i0.268854435642791+0.852006047941478iColumn250.501096763217777+1.111762593982078ib.DFT基2-FFT误差序列的频谱
本文标题:北京邮电大学数字的信号处理实验的二
链接地址:https://www.777doc.com/doc-5467792 .html