




免费预览已结束,剩余9页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
附录aimplementation of adaptive fir filter based on tms320vc5402wang xiaojuan zhang ze(department of automation, college of sciences of technology,inner mongolia university, hohhot 010021 china, )abstractthe article introduced the design and implementation 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 added 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 the adaptive fir filter. the hardware system design module, the software system design flow chart and the related assembly code are given. the uniformity of simulation results and measurement results and the filter effect is satisfied.keywords: adaptive fir filter, tms320vc5402, lms algorithm.1 introductionadaptive 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 identification, noise canceller, adaptive line enhance, adaptive equalization 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-varying signals often need to process, it is impossible to achieve optimal filtering for fixed coefficient filter, so adaptive 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 filter.2 principle of adaptive filteradaptive 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 adaptive 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 squared error.fig 1 structure of adaptive filterfig 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 generate an error signal, e(n).3 structure of filter and lms algorithm3.1 structure of adaptive fir filterseveral 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, 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 byfig 2 transversal structure of adaptive fir filterwhere is input vector, is weight vector. t denotes transpose, n is the order of filter.3.2 lms algorithmthe 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 lms algorithm is given bywhere 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/ , is the maximal eigenvalue of correlation matrix of input vector x(n).4 filter design with matlabwhen 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, where , , dealing with 100 sample. desired output of filter is ,=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 algorithmy(n)-h*x1; %output signale(n)-d(n)-y(n); %calculate errorh-h+u*e(n)*x1; %adjust weightendsimulation waveform are given in fig 3the 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.5 application of adaptive fir filter in tms320vc54025.1 hardware system based on tms320vc5402 tms320vc5402 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-bit host-port interface (hpi8), two multi-channel buffered serial ports (mcbsps), two hardware timers and so on.fig 4 shows the structure of hardware design system. the system consists of tms320vc5402 and other peripherals.fig 4 structure of systemthe tlc320ac01 is analog interface circuit(aic) .this device integrates a 14-bit-resolution adc and dac, a band-pass switched-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 eight available data registers; adc channel and a dac channel operate synchronously, the data transfer is in2s-complement format; eprom is 32k8bit, with tms320vc5402 compose of 32kb bootloader in the address range 8000h0ffffh; saram and tms320vc5402 constitute 32k external program memory in the address range 48000h48fffh and 16k external data memory in the address range 40000h7ffffh.5.2 software system based on tms320vc5402the 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 assembly language to complete. fig 5 shows the low chart of software program design. bk is fir circular buffer size, and block-repeat counter (brc) is set 99. the initialization of hardware contains: clock, 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 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 data.the lms, st|mpy, and rptbd instructions on the 54x can reduce the execution time of code for adaptive filtering. lms algorithm is given by lms xmem , ymem.the lms instruction can be explained by macxmem+ ,ymem+,b; b-b+(*coeff+ *input +)| add xmem ,16, a ; a-(*coeff+a) 16st a,*coeff+0% ; load coefficient to coff_buffer|mpy *input,alms *coeff,*input+ ;filtering, b-accumulatefiltered output y, a-final coefficientlms end:sth a,*coeff+0% ;store final coefficientsth b,*output ;store the filtered outputld *refer+,a ;load refer datasub *output+,a ;compute errorstl a,*errorld delta,tmpy *error+,a ; compute u*e(n)sth a,deltauld deltau,t ;t=u*emar *+input(#-9) ;modify input buffer pointer,banz loop,*ar6-complete: nopthen compiling, assembling and linking to create the coff files for tms320vc5402, and loading the files to dsp target system to run by simulator, using debugger to debug. measuring wave has be gain as followscomparing fig 6(b) with fig 6(c), we get that it is automatic adjustment through about 5 seconds after system starts, their 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. accordingly the filter effect is better.6 conclusionin this paper, adaptive fir filter was designed by the combination of matlab simulation and the hardware system of tms320vc5402, 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.references1 simon haykin. adaptive filter theory m. beijing: publishing house of electronics industry, 2002.2 guo senmao, yan yunsheng. digital signal processors m. publishing house of tsinghua university. 2005.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.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.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.author biographywang xiaojuan: graduate student, with department of automation, college of sciences and technology of inner mongolia university and majoring in signal process and intelligence system.附录b基于tms320vc5402的自适应fir滤波器的设计王晓娟 张泽(中国,呼和浩特010021,内蒙古大学,科学技术学院,自动化系)摘要本文介绍基于dsp (数字信号处理器)的自适应fir滤波器的设计与实现 。首先,用matlab进行了自适应fir滤波器的结构和算法的模拟实验,其中自适应滤波器的输入信号包括高斯噪声。模拟波形,给出了为设计dsp的参考数据。在此基础上, 选取tms320vc5402的dsp芯片为中心处理器设计与实现自适应fir滤波器。并且给出了硬件系统的设计模块,软件系统设计的流程图及相关的汇编代码。仿真结果的均匀性和测量结果和过滤器的效果是满意的关键词 自适应fir滤波器,tms320vc5402,lms算法。1 引言自适应滤波器是一个现代的过滤器。这是自适应信号处理的一个重要应用,这项技术发展于20世纪40年代。自适应滤波器已被广泛使用在系统辨识,噪声消除,自适应谱线增强,自适应均衡的沟通渠道,线性预测,自适应阵列天线等领域。自适应滤波器对应于固定系数滤波器。在数字信号处理,一些不可预知的信号,噪音或时间变信号往往需要过程,这是不可能实现的最优滤波固定系数滤波器,所以自适应滤波器的设计必须要跟踪的变化信号和噪声。独特的结构和指令tms320vc5402的dsp的提供方便条件的设计自适应滤波器。2 自适应滤波的原则 自适应滤波器构成由两个基本部分组成:一是过滤器,应用于对处理外来的信号进行处理,也就是过滤,二是自适应算法,也就是调整系数的过滤器,在某种程度上改善其效果。当设计自适应滤波器时,信号的自相关函数和噪声不能在事先知道。在过滤时,信号的自相关函数和噪声的变化缓慢,随着时间的推移,过滤器可以自动适应和调整,以满足最低平均误差平方的要求。图1显示自适应滤波器的结构。目的是过滤输入的信号,x(n),自适应滤波器以与期望信号d(n) 相匹配的这种方式工作。理想的信号d(n),从过滤信号y(n)中减去,以产生一个错误的信号e(n)。图1结构自适应滤波器3过滤器的结构和lms算法3.1结构自适应fir滤波器 设计的自适应滤波器,可以实现几种类型的过滤器结构,如无限脉冲响应(iir)或有限脉冲响应(fir)。在本文中,只介绍横向结构的杉木结构。自适应fir滤波器的横向结构由图2给出,过滤器的输出信号y(n)而且是权重向量。t指偏移量,n是过滤器的阶数。 图2 横向结构的自适应fir滤波器3.2 lms算法lms算法的基本思想是调整过滤器的系数,以达到尽量减少实际输出与期望之间的误差的目的,这样的系统的输出是有用信号的最乐观的估计。 基本lms算法,如下式所示其中,w(n)是这一时刻的权值,w(n+1)为下一时刻的权值, 0称为步。lms算法的收敛条件是01/ ,其中是相关矩阵的输入向量x(n)的最大特征值。 4滤波器的设计与matlab 在设计数字滤波器时,通常用matlab来对设计和模拟进行辅助。 根据上述的设计理念,设计一个10阶自适应噪声抵消器。输入信号,其中, ,处理100个样本。理想过滤器的输出是,=0.002。 基于matlab设计的自适应fir滤波器的部分代码如下:m-length(x); y-zeros(1,m);h-zeros(1,n);e-zeros(1,m);for n-n:m 1-x(n:-1:n-n+1);y(n)-h*x1; e(n)-d(n)-y(n); h-h+u*e(n)*x1; end仿真波形如图3所示该算法可核实和数据输入的模拟滤波器可提供设计的dsp汇编语言,通过matlab仿真在同一时间内。 5应用自适应fir滤波器在tms320vc5402的 5.1硬件系统基于tms320vc5402 tms320vc5402是16位,定点dsp芯片,它是ti公司第五代的产品,其核心电源为1.8 v和io 电源为3.3v;工作速度可达到100mips;片上外设包括:增强的8位主机接口(hpi8) ,两个多通道缓冲串行端口(mcbsps) ,两个硬件定时器等。 图4显示硬件设计系统的结构。该系统由tms320vc5402与其它外围设备组成。图4结构系统该tlc320ac01是模拟接口电路(aic)。此器件集成了14位分辨率的adc和dac ,带通开关电容抗锯齿输入滤波器,低通开关电容输出重建滤波器。内部电路的配置和性能参数可以通过设定多通道控制寄存器来进行;渠道adc和渠道dac的运作是同步的,数据传输是二进制补码格式; eprom的大小为32k8bit; tms320vc5402的32 kb的引导地址范围为8000h-0ffffh ; saram和tms320vc5402的32k的外部程序存储器在地址范围48000h -48fffh和16k外部数据存储器在地址范围为40000h -7ffffh 。5.2软件系统基于tms320vc5402 dsp的集成开发环境是ccs(code compo ser studio),是ti公司所提供的。 ccs与模拟器xds510一起使用。自适应fir滤波器的软件设计使用汇编语言完成。图5给出了软件程序设计流程图。 图5流程图bk是fir循环缓冲区的大小,块重复计数器(brc)设为99。硬件的初始化包含:时钟,中断,内存, mcbsp0,ac01和片上计时器,然后主程序
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 决算补充合同范例
- 10类采购合同样本
- 会场租赁合同样本
- 2025年何时签订租房合同
- 养殖基地合作合同标准文本
- 养殖金蝉售卖合同样本
- 农村院落收购合同样本
- 农村流动养殖合同范例
- 农药化肥供应合同样本
- 农村人买房合同标准文本
- 信息安全等级保护管理办法
- 2025年光大银行校园招聘笔试参考题库(带答案)
- 旅拍店合伙人协议书范本
- 握笔姿势详解全解课件
- DB13(J)∕T 8377-2020 建筑施工安全管理标准
- 吊装施工施工组织设计
- 2019人教版高中英语选择性必修三单词表
- 七年级地理欧洲西部
- Seminar_带SPL的安全集成
- 国家开放大学《电工电子技术》章节自测题参考答案
- GB∕T 16754-2021 机械安全 急停功能 设计原则
评论
0/150
提交评论