

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、<p><b> 附錄A</b></p><p> Implementation of Adaptive FIR Filter Based on TMS320VC5402</p><p> Wang Xiaojuan Zhang Ze</p><p> (Department of Automation, College of
2、 Sciences of Technology,</p><p> Inner Mongolia University, Hohhot 010021 China, )</p><p><b> Abstract</b></p><p> The article introduced the design and implementatio
3、n of the adaptive FIR filter based on DSP (Digital Signal Processor). Firstly, simulate experiment of the adaptive FIR filter structure and algorithm is carried out by MATLAB, and adaptive filtering of the input signal a
4、dded Gauss noise is performed. Simulation waves are given, and the reference data for the DSP designing is provided. On this foundation, TMS320VC5402 DSP chip is selected as the center processor to design and implement t
5、he adapti</p><p> Keywords: Adaptive FIR filter, TMS320VC5402, LMS algorithm.</p><p> 1 Introduction</p><p> Adaptive filter is the one of the modern filter. It is an important a
6、pplication of adaptive signal processing that was developed in the 1940s. Adaptive filter has been used widely in system identification, noise canceller, adaptive line enhance, adaptive equalization of communication chan
7、nel, linear predication, adaptive array antenna and so on. Adaptive filter is opposite to fixed coefficients filter. During digital signal processing, a number of unpredictable signals, noises or time-varying si</p>
8、;<p> 2 Principle of Adaptive Filter</p><p> Adaptive filter consists of two basic parts: the filter which applies the required processing on the incoming signal which is to be filtered, and an ada
9、ptive algorithm, which adjusts the coefficients of that filter to somehow improve its performance. When adaptive filter is designed, the autocorrelation function of signals and noises can not be known in advance. During
10、the filtering, with the autocorrelation function of signals and noises changing slowly over time, filter can automatically ada</p><p> Fig 1 Structure of Adaptive Filter</p><p> Fig 1 shows t
11、he structure of adaptive filter. The objective is to filter the input signal, X(n), with an adaptive filter in such a manner that it matches the desired signal, d(n). The desired signal, d(n), is subtracted from the filt
12、ered signal, Y(n), to generate an error signal, e(n).</p><p> 3 Structure of Filter and LMS Algorithm</p><p> 3.1 Structure of Adaptive FIR Filter</p><p> Several types of filter
13、 structures can be implemented in the design of the adaptive filters such as Infinite Impulse Response (IIR) or Finite Impulse Response (FIR). In this application note, only transversal structure FIR structure is impleme
14、nted. Transversal structure of adaptive FIR Filter is given by Fig 2 and the filter output signal y(n) is given by</p><p> Fig 2 Transversal Structure of Adaptive FIR Filter</p><p> Where is
15、input vector, is weight vector. T denotes Transpose, N is the order of filter.</p><p> 3.2 LMS Algorithm</p><p> The basic idea of LMS algorithm is that adjusting the filter’s coefficients mi
16、nimize the mean-square error between its output and its desired response, such system output is best estimate of useful signal.</p><p> The basic LMS algorithm is given by</p><p> Where W(n)
17、is the weight value at this time, W(n+1) is the weight value at next time,µ >0 is called the step-size.</p><p> Convergent condition of LMS algorithm is 0<µ<1/ , is the maximal eigenvalu
18、e of correlation matrix of input vector X(n).</p><p> 4 Filter Design with MATLAB</p><p> When designing digital filter, MATLAB is usually used to carry on the assistance design and the simul
19、ation.</p><p> According to above design philosophy, a 10-order adaptive noise canceller was designed. Input signal, where , , dealing with 100 sample. Desired output of filter is ,µ=0.002.</p>
20、<p> The partial codes of the adaptive FIR filter design with MATLAB as follows:</p><p> M-length(x); y-zeros(1,M);</p><p> H-zeros(1,N);e-zeros(1,M);</p><p> for n-N:M
21、 %adaptive algorithm</p><p> y(n)-h*x1'; %output signal</p><p> e(n)-d(n)-y(n); %calculate error</p><p> h-h+u*e(n)*x1; %adjust weight</p><p><b
22、> end</b></p><p> Simulation waveform are given in Fig 3</p><p> The algorithm can be verified and input data of analog filter can be provided for designing of the DSP assemble langu
23、age through MATLAB simulation at the same time.</p><p> 5 Application of Adaptive FIR Filter in TMS320VC5402</p><p> 5.1 hardware system based on TMS320VC5402 </p><p> TMS320VC54
24、02 is 16-bit, fixed-point DSP chip ,and it is the fifth generation of products of TI Company, its core supply is 1.8v and IO supply is 3.3v; the working speed may reach 100MIPS; on-chip peripherals contain: an enhanced 8
25、-bit host-port interface (HPI8), two multi-channel buffered serial ports (McBSPs), two hardware timers and so on.</p><p> Fig 4 shows the structure of hardware design system. The system consists of TMS320VC
26、5402 and other peripherals.</p><p> Fig 4 Structure of system</p><p> The TLC320AC01 is analog interface circuit(AIC) .This device integrates a 14-bit-resolution ADC and DAC, a band-pass switc
27、hed-capacitor antialiasing input filter, a low-pass switched-capacitor output-reconstruction filter. The internal circuit configuration and performance parameters are determined by reading control information into the ei
28、ght available data registers; ADC channel and a DAC channel operate synchronously, the data transfer is in2s-complement format; EPROM is 32K×8bit, with TMS320</p><p> 5.2 Software system based on TMS32
29、0VC5402</p><p> The Integrates DSP development environment is CCS (Code Compo ser Studio) that is provided by TI. CCS cooperates with simulator XDS510. The adaptive FIR filter software design uses the assem
30、bly language to complete. Fig 5 shows the low chart of software program design. </p><p> BK is FIR circular buffer size, and block-repeat counter (BRC) is set 99. The initialization of hardware contains: cl
31、ock, interrupt, RAM, McBSP0, AC01 and timer on chip, then endless loop is running in the main program until interrupt of timer comes. Initialization of AC01 uses the synchronous serial port and skillfully applies command
32、 idle 1. After the initialization data is transmitted then the system waits for the transmission interrupt of the serial port to guarantee safe transmission of dat</p><p> The LMS, ST||MPY, and RPTBD instru
33、ctions on the ’54x can reduce the execution time of code for adaptive filtering. LMS algorithm is given by LMS Xmem , Ymem.</p><p> The LMS instruction can be explained by MACXmem+ ,Ymem+,B; B-B+(*coeff+
34、215; *input +)|| { ADD Xmem ,16, A ; A-(*coeff+A) << 16}</p><p> Where Xmem points to coefficient, and Ymem points to signal. The LMS algorithm calculates the filter output and updates each coefficien
35、t in the filter in parallel.</p><p> Due to TMS320VC5402 is fixed-point DSP, so input data, refer data and step-size need to take format Q.15, then these data must be changed Q.15 fixed-point format, respec
36、tively multiply by . Circular addressing and overflow would be noted in assemble program. </p><p> Fig 5 Flow chat</p><p> Using MATLAB verify algorithm, and obtaining sample values of input s
37、ignal and desired signal, copying these data to assemble program, compile assemble file, parts of assemble codes given by:</p><p><b> loop: </b></p><p><b> LD #0,B</b>&
38、lt;/p><p> STM #8,BRC ;Repeat 256 times</p><p> RPTBD lms end-1</p><p> MPY *input,A ;A-u*e*x</p><p> LMS *coeff,*input+ ;B-B+coeff*input, A-A+
39、0-A>>16</p><p> ST A,*coeff+0% ; load coefficient to coff_buffer</p><p> ||MPY *input,A</p><p> LMS *coeff,*input+ ;filtering, B-accumulate</p><p>
40、 filtered output y, A-final coefficient</p><p><b> lms end:</b></p><p> STH A,*coeff+0% ;store final coefficient</p><p> STH B,*output ;store the filt
41、ered output</p><p> LD *refer+,A ;load refer data</p><p> SUB *output+,A ;compute error</p><p> STL A,*error</p><p> LD @delta,T</p><
42、;p> MPY *error+,A ; compute u*e(n)</p><p> STH A,@deltau</p><p> LD @deltau,T ;T=u*e</p><p> MAR *+input(#-9) ;modify input buffer pointer,</p>
43、;<p> BANZ loop,*AR6-</p><p> complete: nop</p><p> Then compiling, assembling and linking to create the COFF files for TMS320VC5402, and loading the files to DSP target system to run
44、 by simulator, using debugger to debug. Measuring wave has be gain as follows</p><p> Comparing Fig 6(b) with Fig 6(c), we get that it is automatic adjustment through about 5 seconds after system starts, th
45、eir error reduces gradually, the system converges, convergence rate is dependent on the appropriate choice of , and we can obtain from Fig 6(d) that the longer the response time is, the smaller the error is. Ac
46、cordingly the filter effect is better.</p><p> 6 Conclusion</p><p> In this paper, adaptive FIR filter was designed by the combination of MATLAB simulation and the hardware system of TMS320VC5
47、402, and it makes fully use of the special structure and instruction. The method has been proved to be effective and feasible by the simulation results and measure results.</p><p> References</p><
48、;p> 1 Simon Haykin. Adaptive Filter Theory [M]. Beijing: Publishing House of Electronics Industry, 2002.</p><p> 2 Guo Senmao, Yan Yunsheng. Digital Signal Processors [M]. Publishing House of tsingh
49、ua university. 2005.</p><p> 3 Ma Weifu, Lei Yong, Teng Huan. Achievement of Adaptive Filtering with Lms algorithm and DSP [J].Journal of Sichuan University (Natural Science Edition).Vol.41,Oct,2004.</
50、p><p> 4 Sun, Xu. Kuo, Sen M. Active narrowband noise control systems using cascading adaptive filters [J]. IEEE Transactions on Audio Speech and Language Processing; 15(2), FEB 2007.</p><p>
51、5 Zhi ZY, Han RC, Pan F, Zuo L, Yu SY. Implementation of a kind of FIR filter based on TMS320F240 DSP [J].6th International Symposium on Test and Measurement; Vol. 1-9,Conference Proceedings, 2005.</p><p>
52、 Author Biography</p><p> Wang Xiaojuan: Graduate student, with Department of Automation, College of Sciences and Technology of Inner Mongolia University and majoring in signal process and intelligence sys
53、tem.</p><p><b> 附錄B</b></p><p> 基于TMS320VC5402的自適應FIR濾波器的設計</p><p> 王曉娟 張澤(中國,呼和浩特010021,內蒙古大學,科學技術學院,自動化系)</p><p><b> 摘要</b></p>&l
54、t;p> 本文介紹基于DSP (數(shù)字信號處理器)的自適應FIR濾波器的設計與實現(xiàn) 。首先,用MATLAB進行了自適應FIR濾波器的結構和算法的模擬實驗,其中自適應濾波器的輸入信號包括高斯噪聲。模擬波形,給出了為設計DSP的參考數(shù)據(jù)。在此基礎上, 選取TMS320VC5402的DSP芯片為中心處理器設計與實現(xiàn)自適應FIR濾波器。并且給出了硬件系統(tǒng)的設計模塊,軟件系統(tǒng)設計的流程圖及相關的匯編代碼。仿真結果的均勻性和測量結果和過濾器的
55、效果是滿意的</p><p> 關鍵詞 自適應FIR濾波器,TMS320VC5402,LMS算法。</p><p><b> 1 引言</b></p><p> 自適應濾波器是一個現(xiàn)代的過濾器。這是自適應信號處理的一個重要應用,這項技術發(fā)展于20世紀40年代。自適應濾波器已被廣泛使用在系統(tǒng)辨識,噪聲消除,自適應譜線增強,自適應均衡的溝通渠
56、道,線性預測,自適應陣列天線等領域。自適應濾波器對應于固定系數(shù)濾波器。在數(shù)字信號處理,一些不可預知的信號,噪音或時間變信號往往需要過程,這是不可能實現(xiàn)的最優(yōu)濾波固定系數(shù)濾波器,所以自適應濾波器的設計必須要跟蹤的變化信號和噪聲。獨特的結構和指令TMS320VC5402的DSP的提供方便條件的設計自適應濾波器。</p><p> 2 自適應濾波的原則</p><p> 自適應濾波器構成由兩
57、個基本部分組成:一是過濾器,應用于對處理外來的信號進行處理,也就是過濾,二是自適應算法,也就是調整系數(shù)的過濾器,在某種程度上改善其效果。當設計自適應濾波器時,信號的自相關函數(shù)和噪聲不能在事先知道。在過濾時,信號的自相關函數(shù)和噪聲的變化緩慢,隨著時間的推移,過濾器可以自動適應和調整,以滿足最低平均誤差平方的要求。</p><p> 圖1顯示自適應濾波器的結構。目的是過濾輸入的信號,X(n),自適應濾波器以與期望信
58、號d(n) 相匹配的這種方式工作。理想的信號d(n),從過濾信號Y(n)中減去,以產生一個錯誤的信號e(n)。</p><p> 圖1結構自適應濾波器</p><p> 3過濾器的結構和LMS算法3.1結構自適應FIR濾波器 設計的自適應濾波器,可以實現(xiàn)幾種類型的過濾器結構,如無限脈沖響應(IIR)或有限脈沖響應(FIR)。在本文中,只介紹橫向結構的杉木結構。自適應FIR濾波
59、器的橫向結構由圖2給出,過濾器的輸出信號y(n)而且是權重向量。T指偏移量,n是過濾器的階數(shù)。 </p><p> 圖2 橫向結構的自適應FIR濾波器</p><p><b> 3.2 LMS算法</b></p><p> LMS算法的基本思想是調整過濾器的系數(shù),以達到盡量減少實際輸出與期望之間的誤差的目的,這樣的系統(tǒng)的輸出是有用信號的最
60、樂觀的估計。 基本LMS算法,如下式所示</p><p> 其中,W(n)是這一時刻的權值,W(n+1)為下一時刻的權值,μ > 0稱為步。LMS算法的收斂條件是0<µ<1/ ,其中是相關矩陣的輸入向量X(n)的最大特征值。 4濾波器的設計與MATLAB </p><p> 在設計數(shù)字濾波器時,通常用MATLAB來對設計和模擬進行輔助。
61、 根據(jù)上述的設計理念,設計一個10階自適應噪聲抵消器。輸入信號,其中, ,,處理100個樣本。理想過濾器的輸出是,µ=0.002。 基于MATLAB設計的自適應FIR濾波器的部分代碼如下:</p><p> M-length(x); y-zeros(1,M);</p><p> H-zeros(1,N);e-zeros(1,M);</p><p&
62、gt; for n-N:M </p><p> 1-x(n:-1:n-N+1);</p><p> y(n)-h*x1'; </p><p> e(n)-d(n)-y(n); </p><p> h-h+u*e(n)*x1; </p><p><b> end
63、</b></p><p><b> 仿真波形如圖3所示</b></p><p> 該算法可核實和數(shù)據(jù)輸入的模擬濾波器可提供設計的DSP匯編語言,通過MATLAB仿真在同一時間內。 5應用自適應FIR濾波器在TMS320VC5402的 </p><p> 5.1硬件系統(tǒng)基于TMS320VC5402 </p>&l
64、t;p> TMS320VC5402是16位,定點DSP芯片,它是TI公司第五代的產品,其核心電源為1.8 V和IO 電源為3.3V;工作速度可達到100MIPS;片上外設包括:增強的8位主機接口(HPI8) ,兩個多通道緩沖串行端口(McBSPs) ,兩個硬件定時器等。 </p><p> 圖4顯示硬件設計系統(tǒng)的結構。該系統(tǒng)由TMS320VC5402與其它外圍設備組成。</p><p
65、><b> 圖4結構系統(tǒng)</b></p><p> 該TLC320AC01是模擬接口電路(AIC)。此器件集成了14位分辨率的ADC和DAC ,帶通開關電容抗鋸齒輸入濾波器,低通開關電容輸出重建濾波器。內部電路的配置和性能參數(shù)可以通過設定多通道控制寄存器來進行;渠道ADC和渠道DAC的運作是同步的,數(shù)據(jù)傳輸是二進制補碼格式; EPROM的大小為32K×8bit; TMS3
66、20VC5402的32 KB的引導地址范圍為8000h-0ffffh ; SARAM和TMS320VC5402的32K的外部程序存儲器在地址范圍48000h -48fffh和16k外部數(shù)據(jù)存儲器在地址范圍為40000h -7ffffh 。</p><p> 5.2軟件系統(tǒng)基于TMS320VC5402 </p><p> DSP的集成開發(fā)環(huán)境是CCS(Code Compo ser Stu
67、dio),是TI公司所提供的。 CCS與模擬器XDS510一起使用。自適應FIR濾波器的軟件設計使用匯編語言完成。圖5給出了軟件程序設計流程圖。 </p><p><b> 圖5流程圖</b></p><p> BK是FIR循環(huán)緩沖區(qū)的大小,塊重復計數(shù)器(BRC)設為99。硬件的初始化包含:時鐘,中斷,內存, McBSP0,AC01和片上計時器,然后主程序無限循環(huán)
68、運行,直到中斷定時器的到來。使用同步串行端口初始化AC01,并巧妙地適用于指揮閑置1 。后初始化數(shù)據(jù)傳輸系統(tǒng),然后等待傳輸中斷的串行端口,以保證安全的數(shù)據(jù)傳輸。</p><p> 運行在TMS320VC5402的LMS, ST||MPY, and RPTBD指令,可以減少自適應濾波代碼的執(zhí)行時間。LMS算法如下所示</p><p> LMS Xmem , Ymem</p>
69、<p> 該LMS指示可以解釋為MACXmem+ ,Ymem+,B; B-B+(*coeff+ × *input +)|| { ADD Xmem ,16, A ; A-(*coeff+A) << 16} 由于TMS320VC5402是定點的DSP ,所以輸入數(shù)據(jù),相關數(shù)據(jù)和步長需要采取Q15格式,然后這些數(shù)據(jù)必須改變?yōu)镼15固定點格式,分別乘以215。在組裝程序時要指出循環(huán)尋址和溢
70、出。 用MATLAB驗證算法,并取得輸入信號和期望信號的樣本值,復制組裝程序中的這些數(shù)據(jù),匯編程序,其程序如下所示:</p><p> loop: LD #0,B</p><p> STM #8,BRC ;Repeat 256 times</p><p> RPTBD lms end-1</p><p>
71、; MPY *input,A ;A-u*e*x</p><p> LMS *coeff,*input+ ;B-B+coeff*input, A-A+0-A>>16</p><p> ST A,*coeff+0% ; load coefficient to coff_buffer</p><p> ||MPY
72、 *input,A</p><p> LMS *coeff,*input+ ;filtering, B-accumulate</p><p> filtered output y, A-final coefficient</p><p><b> lms end:</b></p><p> STH A
73、,*coeff+0% ;store final coefficient</p><p> STH B,*output ;store the filtered output</p><p> LD *refer+,A ;load refer data</p><p> SUB *output+,A
74、 ;compute error</p><p> STL A,*error</p><p> LD @delta,T</p><p> MPY *error+,A ; compute u*e(n)</p><p> STH A,@deltau</p><p> LD @deltau
75、,T ;T=u*e</p><p> MAR *+input(#-9) ;modify input buffer pointer,</p><p> BANZ loop,*AR6-</p><p> complete: nop</p><p> 然后編譯,組裝和鏈接,以生成TMS320VC5402的COF
76、F文件,并載入DSP目標系統(tǒng)模擬器由運行,使用調試器調試。測量波如下所示</p><p> 比較Fig 6(b) 和Fig 6(c),我們可以得到,通過約5秒鐘系統(tǒng)啟動后,自動調整,其誤差逐漸減少,該系統(tǒng)收斂,收斂速度依賴于合適方法,我們可以從Fig 6(d)知道,反應時間越長,誤差越小。因此,過濾效果越好。</p><p><b> 6結論</b></p&
77、gt;<p> 在本文中,采用TMS320VC5402的硬件系統(tǒng)結合MATLAB仿真的方法設計的自適應FIR濾波器,使得特殊結構和指令得到充分的利用。由模擬結果和測量結果,已證明該方法是有效和可行的。</p><p><b> 參考文獻</b></p><p> 1 Simon Haykin, Adaptive Filter Theory [M].
78、北京電子工業(yè)出版社, 2002 。</p><p> 2 郭森茂,閆生.數(shù)字信號處理器模式[M].清華大學出版社,2005年。</p><p> 3 馬偉夫,雷雍,歡騰.實現(xiàn)自適應濾波的LMS算法和DSP [J].四川大學學報(自然科學版). Vol.41 , 2004年10月。</p><p> 4 許嘉璐,郭志森.窄帶主動噪聲控制系統(tǒng)的級聯(lián)自適應濾波器[J
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 畢業(yè)設計---基于tms320vc5402的fir濾波器設計與實現(xiàn)
- 基于tms320vc5402的led顯示系統(tǒng)設計
- 基于TMS320VC5402的語音檢測器.pdf
- 基于DSP芯片TMS320VC5402的開發(fā)系統(tǒng)設計.pdf
- 基于TMS320VC5402的DTMF信號檢測系統(tǒng).pdf
- 基于TMS320VC5402的激光測距儀設計.pdf
- 基于TMS320VC5402的高速信號采集系統(tǒng)的設計.pdf
- dsp課程設計-- 基于tms320vc5509 dsp的fir濾波器設計
- dsp課程設計--基于tms320vc5509 dsp的fir濾波器設計
- 基于TMS320VC5402 DSP的信息加密系統(tǒng)的研究.pdf
- 基于TMS320VC5402的靜態(tài)圖像采集與壓縮.pdf
- 基于TMS320VC5402的語音處理系統(tǒng)的研究與設計.pdf
- dsp課程設計---基于tms320c5402的fir數(shù)字濾波器設計
- 基于tms320vc5402的g.729語音編解碼器研究
- g.723.1標準在tms320vc5402上的實現(xiàn)
- 基于TMS320VC5402的移頻軌道信號參數(shù)檢測儀的設計.pdf
- 基于tms320vc5402的g.721語音壓縮系統(tǒng)的構建和實現(xiàn)
- dsp課程設計--基于tms320vc5402語音采集壓縮存儲與回放
- 基于FPGA的自適應FIR濾波器的實現(xiàn).pdf
- 基于FPGA的自適應FIR濾波器設計與優(yōu)化.pdf
評論
0/150
提交評論