您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > DSP实验四--有限冲激响应滤波器
1(FIR)12FIR3FIRlMATLABFIR2FIRDSPs(TMS320C5402)(FiniteImpulseResponseFIR)(InfiniteImpulseResponseIIR)11FIRh(n)Ny(n)x(n)x(n-1)x(n-2),x(n-(N1))110()()()NkYnhkxnk-==-∑1GeneratedbyFoxitPDFCreator©FoxitSoftware(1)ZFIR210()()/()()NkkHZYZXZhkZ--===∑2H(Z)Z(1)FIRFIR()jdHeωFIR10()()NjjnnHehneωω--==∑()jdHeω()hn()dhn()dhn()wn()dhn()()()dhnwnhn=.3cωa{,0,,()jaccccjdeHeωωωωωωωππωω--≤≤≤--=4(3)GeneratedbyFoxitPDFCreator©FoxitSoftware[]sin()1()2()cccjajncdcnahneednaωωωωωωωππω---==-∫512Na-=01nN≤≤-[]sin()()()()()ccdcnahnhnnnaωωωπω-==-6nh(n)=0Blackman24()0.420.5cos0.08cos()11NnnnRnNNππω⎡⎤⎛⎞⎛⎞=-+⎜⎟⎜⎟⎢⎥--⎝⎠⎝⎠⎣⎦7128Blackman22lkhz128FIRBlackman33FIRN(N)ts(tsGeneratedbyFoxitPDFCreator©FoxitSoftware)NtsFIRTMS320C54XFIRA/D()x(n)NFIRFIRD/A(CCS)N-1FIRNh(n)MATLABFIRIIRFIRFIRMatlabMatlabFIRFIRlFIR2FlRlMATLABFIRFlRlFIRHammingB=FIRl(N,Wn,kaiser(N+l4))NFIRWn4kaiserB4WnWn0-10-pi0-Fs/2()WnFcWn=2*Fc/FsFIRWnFIRlpiFIR1FIRlGeneratedbyFoxitPDFCreator©FoxitSoftware=2*2/10=0.4(0.4*pi=1.26)W2=2*4/l0=0.8(0.8*pi=2.51)2MatlabB=FIRl(80[WlW2])B3C54XDSP(1)H(Z)2e+15lCCSprojectNewfir(c:\ti\myprojects)CCSfir.pjtftp(myprojects\fir)2ProjectAddFilesc:\ti\myprojcots\firfir.c(LinkerCommandFile*.cmd)fir.cmdAddFilesProjectc:\ti\C5400\cgtools\libObject(*.o*,*.1ib)rts.lib3#includestdio_h#definelength256intinput[1ength],output[1ength]voidfilter(intxin[]intxout[]intninth[])staticvoiddataIO(void)staticinth[37]=(-78-152-210-173Is355737983903413-374-1139-1443-9105822792515469637640696351542792582910-1443-1139-37441390398373735518-173-210-152-78)/*Q15*/staticintxl[length+37]GeneratedbyFoxitPDFCreator©FoxitSoftware**/voidfilter(intxin[],intxout[]intn,inth[]){inti,jlongsumfor(i=0;ilength;i++)x1[i]=xin[i]for(i=length;ilength+37;i++)x1[i]=xin[i-length]for(i=0;ilength;i++){sum=0for(j=0;jn;j++)sum+=(long)h[j]*xl[i-j+n-l]xout[i]=sum15}}voidmain(){dataIO()filter(input,output,37,h);**}staticvoiddataIO(){/*dodataI/O*/return}4(Project-Build)Loadfir.out(File-Loadprogram-fir.out)FileI/OdataIO()togglebreakpointtoggleprobepointfilefileI/OfileinputaddfileGeneratedbyFoxitPDFCreator©FoxitSoftware:c:\..\fir_in.datReplaceProbePointfir.cline20-FILEIN:c:\..\fir_in.dat5view-graph-time/frequency,graphpropertylogDisplayTypeFFTMagnitudeGraphTitleinputstartaddressinputAcquisitionBufferSize256FFTFramesize80DspDataType16-bitsignedintegerSamplingRate16000okinputbufferGraphTitleoutputStartAddressoutputokcleardisplayAnimateAnimate----lBlackmanBlackman804.5KHz2lKHz----4KHz()310KHzGeneratedbyFoxitPDFCreator©FoxitSoftware
本文标题:DSP实验四--有限冲激响应滤波器
链接地址:https://www.777doc.com/doc-7223680 .html