基于FPGA的数字滤波器的设计Graduation Design(Thesis) of Chongqing University Design of Digital Filter Based on FPGAUndergraduate: Huang JianhuaSupervisor: Yang LishengMajor: Electronic Information EngineeringCollege of Communication Engineering Chongqing UniversityJune 2013摘要数字信号处理在通信、雷达、声纳等中有着广泛的应用。
数字滤波器的设计是数字信号处理的关键技术之一,有着十分重要的理论和实际意义。
随着数字技术的不断发展,在许多场合,数字滤波器正在快速取代模拟滤波器。
FPGA(现场可编程门阵列)在现代数字电路设计中发挥着越来越重要的作用。
从设计简单的接口电路到设计复杂的状态机,FPGA所扮演的角色已经不容忽视。
本论文完成了基于FPGA的FIR和IIR数字滤波器的设计与实现。
本论文首先理论分析讨论了数字滤波器的设计方法,并使用MATLAB工具验证采用哪种窗函数来设计FIR数字滤波器,使用哪种模拟滤波器原型映射IIR数字滤波器。
然后根据模拟滤波器的技术指标来确定数字滤波器的技术指标,在MATLAB环境下按照数字滤波器的技术指标设计数字滤波器,并得到滤波器系数,编程实现系数量化,并且比较分析量化前后系统响应的差异,由此得到合适的量化等级。
然后在ISE软件平台下根据MATLAB工具得到的量化系数,使用VHDL语言进行FIR和IIR滤波器算法模块编程,同时对AMP电路(可编程预放大器)模块、AD电路(模拟到数字转换器)模块和DA电路(数字到模拟转换器)模块分别进行编程配置,并且对各模块进行严格的软件仿真验证,其中AMP电路模块、AD电路模块和DA电路模块必须进行硬件验证。
最后将所有软件和硬件验证无误的模块整合,下载到FPGA硬件中,进行功能验证。
验证结果符合设计要求。
关键词:FIR滤波器,IIR滤波器,MATLAB,FPGA,VHDLABSTRACTDigital signal processing has been widely used in communications, radar, sonar and many other fields. The design of digital filter is one of the key technologies of digital signal processing, which has a very important theoretical and practical significance. As digital technology continues to develop, on many occasions, the digital filter is rapidly replacing analog filters. FPGA (field-programmable gate array) in modern digital circuit design is playing an increasingly important role. From the design simple interface circuit to the design of the complex state machine, FPGA's role has not been to ignore. This thesis accomplishes a FPGA-based FIR and IIR digital filter design and implementation. This thesis first theoretically analyses the method of digital filter design ,with MATLAB tool verifying which window function is suitable for the FIR digital filter design, which analog filter prototype maps IIR digital filter . And according to the technical specifications of the analog filter the paper determines the specifications of the digital filter. Next in the MATLAB environment in accordance with the technical specifications of the digital filter the paper designs digital filters.And the paper gets the filter coefficients, programming to quantify the coefficients. And the paper has comparative analysis of before and after quantitative differences the system response, thereby obtaining a suitable quantization levels. Then in the ISE software platform according to the obtained quantized coefficients with MATLAB tools, the paper uses VHDL language to program FIR and IIR filter algorithm module. While the AMP circuit (programmable pre-amplifier) module, AD circuit (analog to digital converter) circuit module and DA (digital to analog converter) module are programmed to be configured. And each module has rigorous software simulation, where AMP, AD and DA circuit module must have hardware verification. Finally the paper integrates all the software and hardware verification correct modules, downloading to the FPGA hardware for the functional verification. The Verified result meets the design requirements.Key words:FIR filter, IIR filter, MATLAB, FPGA, VHDL目录摘要 (I)ABSTRACT (II)目录 (III)1 绪论 (1)1.1 课题研究背景及意义 (1)1.2 国内外研究现状 (1)1.3 研究思路 (3)2 FIR数字滤波器简介 (4)2.1 FIR数字滤波器的原理 (4)2.2 FIR数字滤波器的基本结构 (4)2.3 线性相位FIR数字滤波器的结构 (5)2.4 FIR数字滤波器的设计方法 (6)3 IIR数字滤波器简介 (8)3.1 IIR数字滤波器的原理 (8)3.2 IIR数字滤波器的基本结构 (8)3.3 IIR数字滤波器的设计方法 (10)4 MATLAB程序设计 (13)4.1 MATLAB简介 (13)4.2 FIR滤波器设计 (13)4.3 IIR滤波器设计 (17)5 VHDL程序设计 (23)5.1 VHDL语言简介 (23)5.2 DA电路配置 (23)5.3 AMP电路配置 (27)5.4 AD电路配置 (30)5.5 FIR滤波器设计 (33)5.6 IIR滤波器设计 (36)5.7 总体设计 (39)6 结论 (42)参考文献 (43)1 绪论1.1 课题研究背景及意义数字信号处理(Digital Signal Processing,DSP)技术是从20世纪60年代以来,随着信息学科和计算机学科的高速发展而迅速发展起来的一门新兴学科。
因为多数科学和工程遇到的是模拟信号,所以以前都是研究模拟信号处理的理论和实现。
但是模拟信号处理难以做到高精度,受环境影响较大,可靠性差,且不灵活等。
随着电子技术的飞速发展,加之数字信号处理技术的不断成熟和完善,数字信号处理已经逐渐取代模拟信号处理。
相比于模拟信号处理,数字信号处理具有精度高、灵活性高、可靠性强、容易大规模集成、时分复用、可获得高性能指标、二维和多维处理等优点[1]。
数字信号处理广泛应用在滤波与变换、通信、语音、图像、消费电子、工业控制和自动化、医疗、军事等领域。
并且,数字信号处理在数字汇聚、远程会议系统、融合网络、数字图书馆、多媒体通信、个人信息终端等新兴领域有很大的应用前景。
数字滤波器是数字信号处理中很重要的一个分支。
数字滤波器是对数字信号实现滤波的离散时间系统,它将输入的数字序列通过特定运算转变为所需的数字序列[2]。
根据冲激响应函数的时域特性,可将数字滤波器分为两种,即无限长冲激响应IIR滤波器和有限长冲激响应FIR滤波器。
数字滤波器一般由数字乘法器、加法器和延时单元组成的一种算法或装置。
模拟滤波器分为有源和无源的,有源滤波器主要由集成运放、电阻、电容构成,无源的滤波器主要由R,L,C构成[3]。
模拟滤波器的物理构成导致存在电压漂移、温度漂移和噪声等问题。
模拟滤波器还存在一个很严重的问题,当技术指标改变时,其常常要更换电容、电感、运放等元件,相当繁琐。
FPGA(Field-Programmable Gate Array),即现场可编程门阵列,与早期的PROM、PLA、PAL、GAL、EPLD等可编程器件相比,在结构、工艺、集成度、功能、速度和灵活性方面都有很大的改进和提高[4]。
FPGA的在线可重编程特性使FPGA设计灵活性得到很大的提高。