1、附录 A Implementation of Adaptive FIR Filter BasedonTMS320VC5402 Wang Xiaojuan Zhang Ze (Department of Automation, College of Sciences of Technology, Inner MongoliaUniversity, Hohhot 010021 China, ) Abstract The article introduced the design and implementation of the adaptive FIR filter based on DSP (
2、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 added Gauss noise isperformed. Simulation waves are given, and the reference data for the DSP designing is provided. On this
3、 foundation, TMS320VC5402 DSP chip is selected as the center processor to design and implement the adaptive FIR filter. The hardware system design module, the software system design flow chartand the related assembly code are given. The uniformity of simulation results and measurement results and th
4、e filter effect is satisfied. Keywords: Adaptive FIR filter, TMS320VC5402, LMS algorithm. 1 Introduction Adaptive filter is the one of the modern filter. It is an important application of adaptive signal processing that was developed in the 1940s. Adaptive filter has been used widely in system ident
5、ification, noise canceller, adaptive line enhance, adaptiveequalization of communication channel, 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-varyin
6、g signals often need to process, it is impossible to achieve optimal filtering for fixed coefficient filter, soadaptive filter must be designed to track the change of signal and noise. The unique structure and instruction of TMS320VC5402 DSP provide the convenient condition for designing adaptive fi
7、lter. 2 Principle of Adaptive Filter 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 adaptive algorithm, which adjusts the coefficients of that filter to somehow improve its performance. When adaptiv
8、e filter is designed, the autocorrelation function of signals and noises can not be known in advance. During the filtering, with the autocorrelation function of signals and noises changing slowly over time, filter can automatically adapt and adjust to meet the requirements of the minimum mean square
9、d error. Fig 1 Structure of Adaptive Filter Fig 1 shows the 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 filtered signal, Y(n), to g
10、enerate an error signal, e(n). 3 Structure of Filter and LMS Algorithm 3.1 Structure of Adaptive FIR Filter Several types of filter 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,
11、only transversal structure FIR structure is implemented. Transversal structure of adaptive FIR Filter is given by Fig 2 and the filter output signal y(n) is given by nXnW J1-N 0k nk k-nxwny Fig 2 Transversal Structure of Adaptive FIR Filter Where 1,.1, Nnxnxnx JnX is inputvector, ,., 110 nWnWnW n Jn
12、W is weight vector. T denotes Transpose, N is the order of filter. 3.2 LMS Algorithm The basic idea of LMS algorithm is that adjusting the filters coefficients minimize the mean-square error between its output and its desired response, such system output is best estimate of useful signal. The basic
13、LMS algorithm is given by nWnndne X J nXnenWnW 21 Where W(n) is the weight value at this time, W(n+1) is the weight value at next time, 0 is called the step-size. Convergent condition of LMS algorithm is 01/ max , max is the maximal eigenvalue of correlation matrix of input vector X(n). 4 Filter Des
14、ign with MATLAB When designing digital filter, MATLAB is usually used to carry on the assistance design and the simulation. According to above design philosophy, a 10-order adaptive noise canceller was designed. Input signal, ns xxx where nx s *5.0sin*10 , randxn ,dealing with 100 sample. Desired ou
15、tput of filter is nxy s *5.0sin*10 , = 0.002. The partial codes of the adaptive FIR filter design with MATLAB as follows: M-length(x); y-zeros(1,M); H-zeros(1,N);e-zeros(1,M); for n-N:M %adaptive algorithm y(n)-h*x1; %output signal e(n)-d(n)-y(n); %calculate error h-h+u*e(n)*x1; %adjust weight end Simulation waveform are given in Fig 3 The algorithm can be verified and input data of analog filter can be provided for designing of the DSP assemble language through MATLAB simulation at the same time.