为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

基于SystemGenerator的FFT算法的实现

2017-09-25 15页 doc 101KB 85阅读

用户头像

is_482581

暂无简介

举报
基于SystemGenerator的FFT算法的实现基于SystemGenerator的FFT算法的实现 文章编号:1007-757X(2009)10-0045-03 基于 System Generator 的 FFT 算法的实现 黄 赟,余有灵 摘 要:System Generator for DSP 是 Xilinx 公司开发的基于 Simulink 图形环境的 DSP 开发工具。利用 System Generator 工具, 即使是没有多少 FPGA 设计经验的设计人员也能够快速开发出高性能的 FPGA 来实现 DSP 算法。本文介绍了一种采用 XILINX 公司...
基于SystemGenerator的FFT算法的实现
基于SystemGenerator的FFT算法的实现 文章编号:1007-757X(2009)10-0045-03 基于 System Generator 的 FFT 算法的实现 黄 赟,余有灵 摘 要:System Generator for DSP 是 Xilinx 公司开发的基于 Simulink 图形环境的 DSP 开发工具。利用 System Generator 工具, 即使是没有多少 FPGA 设计经验的设计人员也能够快速开发出高性能的 FPGA 来实现 DSP 算法。本文介绍了一种采用 XILINX 公司的 Virtex-2 Pro 系列的 FPGA 芯片实现 FFT 算法的设计,并利用 System Generator 把 FFT 算法映射到 FPGA 资源中。实验表明:该方法具有操作简单、设计灵活、效率高等优点。 关键词:快速傅立叶变换;现场可编程门阵列;System Generator 中图法分类号:TP911.72 文献标志码:A FFT 算法及 System Generator 简介 1 0引言 FFT 是 DFT(离散傅里叶变换)的快速算法,而 DFT 近年来,数字信号处理已经成为通信等领域里的一个极 是数字信号处理中常用的一种算法,用来对信号频谱进行分 为重要的技术。目前来看,实现数字信号处理主要有两种形 [2]析,其基本公式是 式:一种是使用单片机或数字信号处理器,以 TI 公司的 N ?1 nk MSP430 系列单片机和 TMS320 系列数字信号处理器为代 X (k ) = DFT[ x(n)] = x(n)W(1) ? Nn =0 表;另一种是应用专用集成电路芯片或可编程大规模集成电 式中旋转因子为 路实现,这一方面主要是以 FPGA 为主流。 π2 ? jnk nk (2) N W= e N MATLAB/SimulinkMATLAB模型/C源程序 系统设计与仿真另外,x(n) 表示时域信号,X(k) 表示频域信号,FFT 运算的基本单元是蝶形运算单元,对于 N 点 FFT 需要 logN 2System Generator 汇编生成目标文件 生成VHDL/Verilog(*.obj) 级运算,每级需要 N/2 个蝶型运算单元。[3] System Generator For DSP是 Xilinx 公司的系统级建模 链接生成可执行代码 ISE综合、实现 工具,其中设置了 Xilinx 特有的 DSP 功能的 IP 核,包括了 (*.cmd) 生成二进制bit文件 基本 DSP 函数和逻 辑算 符,如 FIR ( Finite Impulse 下载到FPGA 算法实现 Response)、FFT(Fast Fourier Transform)、存储器、数学函 数、转换器、延时线等等。因为相当数量 DSP 开发人员不 (硬件实现)(软件实现) 熟悉 FPGA 等电路硬件设计,他们使用 Matlab 验证算法, 图 1. DSP 设计流程 图 2. FPGA 设计流程 运用汇编或 C 语言编程,基本不使用硬件描述语言实现数通过比较图 1 和图 2 可知,DSP 处理器是通过改变软 字设计。正因为如此, Xilinx 公司开发了基于 Matlab 的 FPGA件设计来能实现不同的功能,其硬件结构具有不可变性,这 设计工具。它可在 Simulink 中实现 FPGA 电路的系统级建 就限制了 DSP 处理器在当前许多要求结构能随时变更场合 模,并自动生成硬件描述语言和 Modelsim 测试程序,支持 中的应用,如某些医用设备、导航设备、工业控制等。而软硬件协同仿真,并能在 Xilinx FPGA 上自动实现硬件系 FPGA 是通过改变硬件的结构来实现不同的功能,其灵活的 统。 现场可配置特性使得 FPGA 构成的数字信号处理系统非常 [1]易于修改易于测试及硬件升级。 但 FPGA 并未在数字信号处理领域获得广泛应用,其主 2 FFT 算法实现流程 要原因就在于:大部分的 DSP 设计者通常对 C 语言或 MATLAB 工具很熟悉,却不了解硬件描述语言 VHDL 和 根据 FFT 算法的原理以及 System Generator 工具的特 Verilog HDL。 基于上述原因,本文介绍了一种基于 System Generator 点,可以在 System Generator 中完成 FFT 算法的设计,然后 for DSP 的 FFT 算法的实现方法,并给出了硬件模型和仿真结 自动生成 HDL 代码,通过 ISE 软件生成位流文件下载到 果。 FPGA 中,从而完成整个设计。 图 3 所示的是本文 FFT 算法的实现流程,它主要包括 4 个基本步骤: ——————————— 作者简介:黄 赟,同济大学电子与信息学院,硕士研究生,上海 201804 余有灵,同济大学电子与信息工程学院,副教授,博士,上海 201804 1)系统模型设计; x=sin(2*pi/25*t); y=fft(x,N); 2)验证与仿真; 3)自动代码生成;r=real(y); 4)ISE 执行流程及 ModelSim 仿真i=imag(y); subplot(1,1,1); plot(k,r); subplot(1,1,1); plot(k,i); 通过以上程序得到正弦信号通过 512 点 FFT 处理后的 MATAB 理论计算结果如图 5。 图 3. FFT 算法实现流程图 2.1 系统模型设计 在 Simulink 环境中建立一个 mdl 模型文件,用图形方 式调用 System Generator 和其它的 Simulink 原图形模块, 构成系统级或算法级设计框图如图 4 所示。 a)实部结果 图 4. FFT 系统级设计模型 [4] 模型中所用模块的简要介绍如下: *Gateway in 和 Gateway out 模块:用于双浮点精度数 据和定点数据之间的转换。 *System Generator 模块:提供 Matlab 和硬件设计环境 b)虚部结果 ISE 的接口,可在指定目录中产生可在 ISE 软件下实现的硬 图 5. MATLAB 理论计算结果 件描述语言。 (2)信号在 FFT 模型中的处理 *Delay 模块:构成一个时延环节,可以配置其延迟时 在仿真前先对 Gateway in 模块和 FFT v3_2 模块进行一 钟周期的整数倍。 下参数配置: FIFO 模块:用于实现一组 FIFO 列。* Gateway in 模块 FFT v3_2 模块:为离散傅立叶变换(DFT)提供了一 *Output type:Signed种有效算法。该模块根据不同的结构和实现方式有三种模式 Number of bits:16 可供选择:(1)流水线,Streaming I/O 结构;(2)基 4,Burst Binary point:15 I/O 结构;(3)基 2,Burst I/O 结构。Quantization:Round 2.2 验证与仿真 为了证明模型设计的正确性,需要对模Overflow:Saturate 型进行测试试 Sample period:1 验,将 FFT 模型的仿真结果与 MATLAB 的理论计算结果进 FFT v3_2 模块:行比较,完成对所建立模型的测试工作。 Impliment:Pipelined Streaming I/O (1)信号在 MATLAB 中的处理Number of sample points:512 系统的输入函数为,点数 N,512, Output ordering:Natural order Scaling:Unscaled 采样周期为 1s,在 MATLAB 中实现 FFT 处理的程序描述如 [5] Rounding mode:Truncation下: Phase factor bit width:8n=512; 将参数配置好后在 Simulink 的 FFT 模型的输入端输入n=0:511; 正弦信号,然后选择 simulink/start,待仿 t=1*n; 真结束后查看 scope 模块所显示的仿真结果如图 6 所示。 k=n; 通过上面的测试实验,证明所建立的 FFT 模型是满足 要求的,下面就需要将 FFT 模型转换成 HDL 代码。双击打 开 System Generator 模块的系统设定对话框,在该对话框中 设定好目标器件的型号(Virtex2Pro xc2vp30-7fg676)、综合 工具(XST)、产生语言种类(Verilog)等参数,并且选中“Create test bench”选项,之后启动 System Generator 模块,将在指 定目录中产生可在 ISE 软件下实现的硬件描述语言,并且自 动生成设计的测试代码。 2.4 ISE 执行流程及 ModelSim 仿真 在产生硬件描述语言后,打开 ISE 工程对生成的文件进 行综合,综合无误后使用 ModelSim 打开 test bench 输入测 a)实部结果 试波形对设计模型进行仿真,结果如图 7 所示。 图 7. ModelSim 仿真结果 可见设计达到预计要求,最后根据所选的芯片型号和封 装形式写出管脚约束文件,然后对设计的文件进行翻译、映 b)虚部结果 射、布局布线来完成实现,实现结束后可在 ISE 中查看 Map图 6. FFT 模型仿真结果 比较图 5 和图 6 的波形,可以看出 FFT 模型处理后的 Report(映射)和 Place and Route Report(布局布线报 结果和 Matlab 的理论计算结果的波形基本一致,得到的都 告)如表 1 所示。最后产生 bit 流文件并下载入 FPGA 配置 是频率单一的实部和虚部。 [6] 芯片即完成了 FFT 的设计全过程。需要说明的是:在图 6 中实部和虚部的输出都是从横坐 表 1. 实现结果 标的 1118 点开始的,这是因为 FFT 模型中的 FFT v3_2 模块 参数选择的是 Pipelined Streaming I/O 模式,在该模式下输 Number of Slices 22% 出需要延迟一段处理时间然后才能连续输出,这里横坐标的 Number of Slice Flip Flops 18% Number of bonded IOBs 12% 1118 点实际上就是输出的起始点,也就是输出的 的 k, Number of 4 input LUTs 15% 0 的位置。 (3)误差分析Maximum Frequency 146.713MHZ 上面只是从波形的角度对结果进行了分析,接下来还需 对图 5 和图 6 所得波形的具体数值进行误差分析。对于 512 3 点处理结果,由于 FFT 的对称性,可取图 5 和图 6 的前 256 个数据进行误差分析。为便于分析和描述,并针对该正弦信 号的频率特征,仅取前 32 个数据进行误差分析,即 K 取 0, 本文提出了基于 System Generator 的设计方法,以 FFT 31。的实现为例介绍了整个设计流程,从模型的建立到 FPGA 上 通过对前 32 个数据的分析可以得出,实部和虚部数据 的实现都是在图形化的设计环境中进行的, 设计思路清晰、 相对误差大部分控制在 0.5%左右,有几个数据的相对误差 效果明显,避开了 HDL 的复杂编程,使设计者将更多的时 稍微大一些,但总体上符合精度要求。这表明建立的 FFT 间用在对算法的优化上,提高了效率,缩短了开发时间。也 模型可以达到一定的处理精度。为 DSP 设计者开发基于 FPGA 的 DSP 算法提供了快速通道。 5 6 XkK20 而且在图 和图 中,()在 ,处实部和虚部 N5121s均出现了峰值,由于本设计 ,,采样周期为 ,由此 参考文献 可计算出输入信号的频率为,与实际输入 的正弦信号的频率相吻合。试验结果进一步证明了 FFT 模[1]唐俊英. 基于 DSP Builder 的数字信号处理器的设计[ J ]. 型的可靠性。 (下转第 54 页)2.3 自动代码生成 for (j = 0; j < 10; j++) {if((k%8)==0) {j++;i++;} 4 结束语 k++;} } 本文给 出了 基于 ColdFire 的调 试桩 GDBStub for } ColdFire 的具体实现方法,可供相关研发人员参考。该调试 表 2 给出了使用 GDBStub for ColdFire 对上述实例进行 代理已被成功应用到作者参与开发的 ColdFire 嵌入式调试 系统中,效果良好。嵌入式调试工具是进行嵌入式开发的关 单步执行等具体调试过程中对应的部分收发 RSP 报文。 键工具,对于嵌入式调试技术的研究必将促进国内嵌入式调 试工具的发展,推动嵌入式技术的进步。 参考文献 [1] 黄红燕.GDBstub的剖析与改进[ J ](电子技术应用,2006, (5):13-16( [2]. 王宜怀,陈建明,蒋银珍著(基于32位ColdFire构建嵌 入式系统[M](北京:电子工业出版社,2009:24-25( [3] 单开涛.嵌入式远程调试中目标机模块若干关键技术的 研究与实现[D].杭州:浙江大学硕士学位论文,2006( [4] 龚伟.基于gdb的嵌入式系统调试器的设计与实现[D](西 安:电子科技大学硕士学位论文,2006( (收稿日期:) 2009-08-05 (上接第 47 页) 学, 2006. 邢台职业技术学院学报, 2005, (03). [6]Castillo Atoche,A.; Perez Cortes, M.; Vazquez Castillo, J.; [2]张亚宜, 米琦, 高倩. 基于 FPGA 的 FFT 处理器设计[ J ]. Atoche Ensenat, R.; FFT Implementation for Electronic 中国民航大学学报, 2007,(02). Holograms using Field Programmable Gate Array ,C , [3]Xilinx. System Generator [G] .USA: Xilinx Inc, 2006. [4]代 //Devices, Circuits and Systems, Proceedings of the 6th 钦, 冯永新. 基于 System Generator 的 FIR 滤波器的设 International Caribbean Conference on 26-28 April 2006 计与实现[ J ]. 电子技术, 2007,(Z2). [5]蔡可红. 基于 FPGA 的 FFT 设计与实现[D]. 南京理工大Page(s):115 – 119. (收稿日期:2009-06-11) (上接第 44 页) [9]张永录.唐代长安词典[K].西安:陕西人民出版社,1980. [10]173. [12]金显贺,王昌长,王忠东,等.一种用于在线检测 局部放电 张加铨,关景时,程鹏.常用药物手册[K].北京:人民卫生出 的数字滤波 技术 [J]. 清华大学学报 : 自然科学 版社,1982:337. 版,1993,33(4):62,67. B. 期刊文章 [13]闵周植. „东方美学的前景?笔谈:全球化时代东方美学的 [序号] 主要责任者. 文献题名[J]. 刊名(建议外文刊名后加 角色[J].文史哲,2001,(1):16,18.ISSN 号),年,卷(期):起止页码. [11]何龄修.读顾城《南明 史》[J].中国史研究,1998,(3):167, 欢迎广大读者提宝贵意见 communication network optimization framework based on cloud computing model, can simplify the steps, enhance the work efficiency, reduce costs, and lay the foundation for in-depth study. Keywords:Cloud computing; Mobile communication; Network optimization; VisualizationImplementation of FFT Algorithm Based on the System Generator………………………………………………………………(45) HUANG Yun,YU You-ling(School of Electronic and Information Engineering, Tongji University, Shanghai 201804, China) Abstract:The System Generator for DSP (Digital Signal Processing), developed by Xinlinx Inc. is a development tool based on the graphic environment of Simulink. Using System Generator, developers with little FPGA design experience can quickly create production quality FPGA implementations of DSP algorithms. This paper introduces a project flow to accomplish FFT algorithm with the FPGA chip of Virtex-2 Pro series from XILINX. And we use the System Generator to map the FFT algorithm onto FPGA resources. The experiment shows that this method has many advantages, such as simple operation, flexible design, and high efficiency and so on. Keywords: FFT; FPGA; System generator Simulation of Active Jamming on Radar Using COM-based Mixed Programming………………………………………………(48) YU Xiao-hui,LUO Peng-fei(School of Electronic Science and Engineering, National University of Defense Technology, Changsha,Hualan 410073, China) Abstract:MATLAB and VC are two common software development platforms, and each of them has its advantages and disadvantages. COM (Component Object Model)-based mixed programming of MATLAB and VC takes full advantage of both MATLAB and VC, which balances the efficiency of programming and the speed of program running. In the thesis, this technology was used to realize the simulation of active jamming on radar, make user interface in VC and call the functions of active jamming on radar programmed in MATLAB. Ratio noise jamming signals, noise frequency-modulation jamming signals and noise amplitude-modulation jamming signals can be produced according to user?s command in the user interface. Keywords:COM; Mixed programming; Ratio noise jamming; Noise frequency-modulation jamming; Noise amplitude-modulation jamming Research on GDBStub Application of Debugging on ColdFire MCUs……………………………………………………………(52)12XU Li-hua ,CHEN Yi (1.Suzhou Vocational University, Suzhou 215104, China;2 .Carel (China) Electronics Co. Ltd, Suzhou 215006, China) Abstract: GDBStub is a technology of remote debugging on embedded software with PC, which supports the development of debugging tools of embedded software. ColdFire MCUs has been applied widely in embedded system. A method of how to design and implement GDBStub for ColdFire MCUs is approached, after the analysis of GDBStub technology. The GDBStub works together with GDB in PC from serial ports for joint debugging the embedded software on target MCU. At last an example of debugging with GDBStub is given. Keywords: Embedded system; Remote debugging; GDBStub; ColdFire Design and Development of Exam System in LAN Based on Windows Server 2008………………………………………………(55) HUANG Xiao-ping(Dept.of Computer Science & Engineering, Shanghai Jiaotong University, Shanghai 200030, China) Abstract:This paper introduces design and implementation of key techniques of the experiment exam system in local area network based on Windows Server 2008.Specificy speaking,to implement the setup of experiment test system by using the techniques of Client/Server,Share folder,Batch script ,Mapping network drive. Keywords:Experiment exam; Share folder; Mapping network drive; Batch script; Security; Sending examination paper; Receiving paper; Cleanup. Research and Solutions on Business Self-locking for OCS…………………………………………………………………………(57) LIU Min, LIANG Yue(Beijing Chao-Yang Hospital Infomation Center, Beijing 100020, China) Abstract: An Order Communication System take orders as core, combine with the ideas of Business Process, it is a direction of development of hospital information system. The OCS standardizes the business processes, but also to adapt to the concurrency of medical activity, so it is necessary lock on the core business in the flow of orders, the article on business self-locking of the research and solutions. Keywords: OCS; Business self-locking; Optimistic locking; Pessimistic locking Application of NAT Technology in the Share of Colleges and Universities Many Campus Resource Sharing…………………(59)1 2 SUN We i-xi ,GOU Hong-ling ( 1 .Departmen t Of Computer Science , We inan teachers university, Shanxi, We iNan 714000,China.2.DepartmentOf Mathematic and Information Science ,Weinan teachers university, Shanxi, WeiNan 714000, China) Abstract: After simply introduing the work principle, the paper solves the problem of the IP address shortage and address overlap in the share of colleges and universities many Campus resource was shared, through the instance analysis with NAT technology. Keywords: NAT work principle; NAT type; Address shortage; Address overlap Learners’s Carden The Data Transaction between SQL Server Database and Oracle DatabaseBased on ADO.NET………………………………(61) FU Yi-yu, LIN Kai-yan(College of Electronic Engineering, Tongji University, Shanghai, China) Abstract: SQL SERVER and ORACLE are very important databases, and they are widely used. Sometimes for the specific function, the data of these two kind of database need to interact.Because the existing transmission methods are quite complicated, and easy to have problems which are difficult to solve, how to use the convenient interactive surface realize data remote real-time transmissions in these two kinds of database? This is the key point of this article, which use the ADO.NET to solve the problem. Keywords:ADO.NE T; Net Service Name; Timer Address:1954 Huashan R d.,Shanghai,P.R. China Zip Code:200030 Tel:86-21-62933230Fax:86-21-62933230 Email:smcaa@online.sh.cn URL:http//wxdy.chinajournal.net.cn IP:202.96.210.198Publisher:Shanghai Microcomputer Application AssociationCode Number:M 6329 Distributor:International Book Trading Corporation(P.0.Box 399,Beijing)
/
本文档为【基于SystemGenerator的FFT算法的实现】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索