【正文】
處理. 實(shí)驗(yàn)結(jié)果表明,所仿真的F IR濾波器能實(shí)現(xiàn)濾波功能.關(guān)鍵詞: DSP。 數(shù)字濾波器Abstract: Figures filter is in accordance with the design process, a group of the number of entries in the sequence of arithmetic and converted to another group, output figures, thus signal the format and content to reach to signal or the object of the filtering。 F IR。模擬輸入數(shù)據(jù)由C語言程序?qū)崿F(xiàn),然后用. copy命令將C語言程序生成的數(shù)據(jù)文件firinput拷貝到DSP程序中. DSP程序?qū)崿F(xiàn)讀入數(shù)據(jù)、濾波、顯示波形等方面的任務(wù). 完成F IR濾波器的程序框圖如圖3所示,可知F IR濾波器的DSP實(shí)現(xiàn)主要由以下4方面的內(nèi)容組成.3. 1 模擬輸入數(shù)據(jù)的生成 用C語言程序生成輸入數(shù)據(jù),通過. copy匯編命令將生成的數(shù)據(jù)文件拷貝到匯編程序中,作為F IR濾波器的輸入數(shù)據(jù). C語言程序運(yùn)行后所生成的數(shù)據(jù)文件名為firinput,生成firinput數(shù)據(jù)文件的C語言程序如下所示:include stdio. hinclude math. hmain ( ) { int i?! ILE fp?! for ( i = 0。 i + + ) { f[ i] = ( cos(23 3. 141592653 i3 1000 /25000) + cos (23 3. 141592653 i3 5000 /25000) +cos(23 3. 141592653 i3 10000 /25000) ) /6。 } fclose ( fp) 。另外還對(duì)各變量賦值,具體的程序如下: . def _c_int00 . mmregs swcr . set 2bh t_ar2 . set 066h t_ar3 . set 067h out_wave_buf . set 0d00h data_in . set 0f00h N . set 51 fir_coef_buf . set 100h fir_data . set 200h . text rs b _c_int00 _c_int00: stm 2020h, pmst ssbx intm ssbx sxm ssbx frct stm 10h, 26h stm 10h, 36h stm 0ffh, sp ld 0, dp stm 0ffffh, ifr stm 20h, imr stm 02492h, swwsr stm 0, swcr保存濾波結(jié)果輸出單元初始化DSP讀入新數(shù)據(jù)并存放到棧頂濾波處理產(chǎn)生輸入數(shù)據(jù)待濾波的樣本點(diǎn)數(shù)(256點(diǎn))處理完成?結(jié)束是否圖3 循環(huán)尋址的方法實(shí)現(xiàn)FIR數(shù)字濾波程序框可看出