版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、快速傅立叶变换(FFT)的实现一、实验目的1.了解FFT的原理及算法;2.了解DSP中FFT的设计及编程方法;3.熟悉FFT的调试方法;二、实验原理FFT是一种高效实现离散付立叶变换的算法,把信号从时域变换到频域,在频域分析处理信息。对于长度为N的有限长序列x(n),它的离散傅里叶变换为: ,称为旋转因子,或蝶形因子。 在x(n)为复数序列的情况下,计算X(k): 对某个k值,需要N次复数乘法、(N-1)次复数加法;对所有N个k值,需要次复数乘法和N(N-1)次复数加法。对于N相当大时(如1024)来说,直接计算它的DFT所作的计算量是很大的,FFT的基本思想在于:利用的周期性即: 对称性:将
2、原有的N点序列分成两个较短的序列,这些序列的DFT可以很简单的组合起来得到原序列的DFT。按时间抽取的FFTDIT FFT信号流图如图5.1所示:图5.1 时间抽取的FFTDIT FFT信号流图FFT算法主要分为以下四步。第一步 输入数据的组合和位倒序把输入序列作位倒序是为了在整个运算最后的输出中得到的序列是自然顺序。第二步 实现N点复数FFT 第一级蝶形运算;第二级蝶形运算;第三级至log2N级蝶形运算;FFT运算中的旋转因子是一个复数,可表示: 为了实现旋转因子的运算,在存储空间分别建立正弦表和余弦表,每个表对应从0度到180度,采用循环寻址来对正弦表和余弦表进行寻址。 第三步 功率谱的计
3、算 X(k)是由实部和虚部组成的复数:;计算功率谱时只需将FFT变换好的数据,按照实部和虚部求它们的平方和,然后对平方和进行开平方运算。 第四步 输出FFT结果。三、实验内容与步骤. 本实验要求使用FFT变换求一个时域信号的频域特性,并从这个频域特性求出该信号的频率值,然后使用DSP汇编语言对FFT的DSP编程。. 将计算机与DES-320PPA教学实验系统连接好,打开实验箱电源,然后运行CCS软件。2.新建fft.pjt工程文件,并输入FFT的DSP程序及命令链接文件。如下:*Radix-2,DIT,Real-input FFT Program * fft.asm *.mmregs.glob
4、al reset,start,sav_sin,sav_idx,sav_grp .def start,_c_int00 .data DATA.space1024 .copy fft.inc N.set128LOGN.set7 sav_grp.usecttempv,3sav_sin.setsav_grp+1sav_idx.setsav_grp+2OUTPUT.usectOUTPUT,256BOS.usectstack,0FhTOS.usectstack,1 .copy twiddle1.inc .copy twiddle2.inc.text_c_int00b start nopnopstart:S
5、TM#TOS,SPLD#0,DPSSBXFRCT STM #2*N,BK STM#INPUT,AR3STM#DATA,AR7MVMMAR7,AR2STM#N-1,BRCRPTBDplend-1STM #N,AR0LDM AR3,A READA *AR2+ ADD #1,AREADA *AR2+MAR*AR3+0Bplend:STM#0,BKLD#-1,ASMMVMMAR7,AR2STM#DATA+2,AR3STM #N/2-1,BRCLD*AR2,16,ARPTBDs1end-1STM#3,AR0SUB*AR3,16,A,BADD*AR3,16,ASTHA,ASM,*AR2+STB,*AR3+
6、|LD*AR2,ASUB*AR3,16,A,BADD*AR3,16,ASTHA,ASM,*AR2+0STB,*AR3+0%|LD*AR2,As1end:MVMMAR7,AR2STM#DATA+4,AR3STM#N/4-1,BRCLD*AR2,16,ARPTBDs2end-1STM#5,AR0SUB*AR3,16,A,BADD*AR3,16,ASTHA,ASM,*AR2+STB,*AR3+|LD*AR2,ASUB*AR3,16,A,BADD*AR3,16,ASTHA,ASM,*AR2+STHB,ASM,*AR3+MAR*AR3+ADD*AR2,*AR3,ASUB*AR2,*AR3-,BSTHA,
7、ASM,*AR2+SUB*AR2,*AR3,ASTB,*AR3|LD*AR3+,BSTA,*AR2|ADD*AR2+0%,ASTA,*AR3+0%|LD*AR2,As2end:STM#512,BKST#128,sav_sinSTM#128,AR0STM#TWI2,AR4STM #TWI1,AR5STM#-3+LOGN,AR7ST#-1+N/8,sav_grpSTM#3,AR6ST#8,sav_idxstage:STM#DATA,AR2LDsav_idx,AADD*(AR2),ASTLMA,AR3MVDKsav_grp,AR1group: MVMDAR6,BRCRPTBDbend-1LD*AR4
8、,TMPY*AR3+,AMACR*AR5+0%,*AR3-,AADD*AR2,16,A,BSTB,*AR2|SUB*AR2+,BSTB,*AR3|MPY*AR3+,AMASR*AR3,*AR4+0%,AADD*AR2,16,A,BSTB,*AR3+|SUB*AR2,BLD*AR4,TSTB,*AR2+|MPY*AR3+,Abend:PSHMAR0MVDKsav_idx,AR0MAR*AR2+0MAR*AR3+0BANZDgroup,*AR1-POPMAR0MAR*AR3-LDsav_idx,ASUB#1,A,BSTLMB,AR6STLA,1,sav_idxLDsav_grp,ASTLA,ASM
9、,sav_grpLDsav_sin,ASTLA,ASM,sav_sinBANZDstage,*AR7-MVDKsav_sin,AR0STM#DATA+2,AR2STM#DATA+2*N-2,AR3STM#DATA+2*N+3,AR7STM#DATA+4*N-1,AR6STM#-2+N/2,BRCRPTBDp3end-1STM#3,AR0ADD*AR2,*AR3,ASUB *AR2,*AR3,BSTHA,ASM,*AR2+STHA,ASM,*AR3+STHB,ASM,*AR6-NEGBSTHB,ASM,*AR7-ADD*AR2,*AR3,ASUB*AR2,*AR3,BSTHA,ASM,*AR2+
10、STHA,ASM,*AR3-0STHB,ASM,*AR6-NEGBSTHB,ASM,*AR7+0p3end:ST#0,*AR6-ST#0,*AR6p3test:STM#DATA,AR2STM#DATA+1,AR4STM#DATA+2*N+1,AR5ADD*AR2,*AR4,ASUB*AR2,*AR4,BSTHA,ASM,*AR2+ST#0,*AR2MVDD*AR2+,*AR5-STHB,ASM,*AR5STM#DATA+4*N-1,AR3STM#TWI2+512/N,AR4STM#TWI1+512/N,AR5STM#N-2,BRCRPTBDp4end-1STM#512/N,AR0LD*AR2+
11、,16,AMACR*AR4,*AR2,AMASR*AR5,*AR3-,ALD*AR3+,16,BMASR*AR5+0%,*AR2-,BMASR*AR4+0%,*AR3,BSTHA,ASM,*AR2+STHB,ASM,*AR2+NEGBSTHB,ASM,*AR3-STHA,ASM,*AR3-p4end:power:STM #OUTPUT,AR3;AR3指向输出缓冲地址 STM #255,BRC;块循环计数器设置为255 RPTBD power_end-1;带延迟方式的重复执行指令 STM #DATA,AR2;AR2指向AR0 SQUR*AR2+,A;A := AR2 SQURA *AR2+,A;
12、A := AR2 + AI2 STH A,7,*AR3;将A中的数据存入输出缓冲中, ANDM#7FFFH,*AR3+;避免输出数据过大在虚拟示波器中显示错误power_end: Bpower_end .end命令链接文件: /*fft.cmd*/fft.obj-m fft.map-o fft.out MEMORY PAGE 0:ROM(RIX):origin=8000h,length=1000h ROM1 :origin=9000h,length=0200h PAGE 1:B2A(RW):origin=0060h,length=10h B2B(RW):origin=0070h,length=
13、10h INTRAM1(RW) :origin=0400h,length=0200h INTRAM2(RW) :origin=0800h,length=0200h INTRAM3(RW) :origin=1400h,length=0800h OTHER:origin=2000h,length=800hSECTIONS.text:ROMPAGE 0 INPUT : ROM1PAGE 0 .data:INTRAM3PAGE 1twiddle1: INTRAM1PAGE 1twiddle2: INTRAM2PAGE 1 tempv:B2APAGE 1 stack:B2BPAGE 1 OUTPUT:O
14、THERPAGE 1 .stack:OTHERPAGE 1三角因子:TWI1: .sect twiddle1 .int 0,201,402,603 .int 804,1005,1206,1407 .int 1607,1808,2009,2210 .int 2410,2611,2811,3011 .int 3211,3411,3611,3811 .int 4011,4210,4409,4609 .int 4808,5006,5205,5403 .int 5602,5800,5997,6195 .int 6392,6589,6786,6983 .int 7179,7375,7571,7766 .i
15、nt 7961,8156,8351,8545 .int 8739,8933,9126,9319 .int 9512,9704,9896,10087 .int 10278,10469,10659,10849 .int 11039,11228,11416,11605 .int 11793,11980,12167,12353 .int 12539,12725,12910,13094 .int 13278,13462,13645,13828 .int 14010,14191,14372,14552 .int 14732,14912,15090,15269 .int 15446,15623,15800,
16、15976 .int 16151,16325,16499,16673 .int 16846,17018,17189,17360 .int 17530,17700,17869,18037 .int 18204,18371,18537,18703 .int 18868,19032,19195,19358 .int 19519,19681,19841,20001 .int 20159,20318,20475,20631 .int 20787,20942,21097,21250 .int 21403,21555,21706,21856 .int 22005,22154,22301,22448 .int
17、 22594,22740,22884,23027 .int 23170,23312,23453,23593 .int 23732,23870,24007,24144 .int 24279,24414,24547,24680 .int 24812,24943,25073,25201 .int 25330,25457,25583,25708 .int 25832,25955,26077,26199 .int 26319,26438,26557,26674 .int 26790,26905,27020,27133 .int 27245,27356,27466,27576 .int 27684,277
18、91,27897,28002 .int 28106,28208,28310,28411 .int 28511,28609,28707,28803 .int 28898,28993,29086,29178 .int 29269,29359,29447,29535 .int 29621,29707,29791,29874 .int 29956,30037,30117,30196 .int 30273,30350,30425,30499 .int 30572,30644,30714,30784 .int 30852,30919,30985,31050 .int 31114,31176,31237,3
19、1298 .int 31357,31414,31471,31526 .int 31581,31634,31685,31736 .int 31785,31834,31881,31927 .int 31971,32015,32057,32098 .int 32138,32176,32214,32250 .int 32285,32319,32351,32383 .int 32413,32442,32469,32496 .int 32521,32545,32568,32589 .int 32610,32629,32647,32663 .int 32679,32693,32706,32718 .int
20、32728,32737,32745,32752 .int 32758,32762,32765,32767 .int 32767,32767,32765,32762 .int 32758,32752,32745,32737 .int 32728,32718,32706,32693 .int 32679,32663,32647,32629 .int 32610,32589,32568,32545 .int 32521,32496,32469,32442 .int 32413,32383,32351,32319 .int 32285,32250,32214,32176 .int 32138,3209
21、8,32057,32015 .int 31971,31927,31881,31834 .int 31785,31736,31685,31634 .int 31581,31526,31471,31414 .int 31357,31298,31237,31176 .int 31114,31050,30985,30919 .int 30852,30784,30714,30644 .int 30572,30499,30425,30350 .int 30273,30196,30117,30037 .int 29956,29874,29791,29707 .int 29621,29535,29447,29
22、359 .int 29269,29178,29086,28993 .int 28898,28803,28707,28609 .int 28511,28411,28310,28208 .int 28106,28002,27897,27791 .int 27684,27576,27466,27356 .int 27245,27133,27020,26905 .int 26790,26674,26557,26438 .int 26319,26199,26077,25955 .int 25832,25708,25583,25457 .int 25330,25201,25073,24943 .int 2
23、4812,24680,24547,24414 .int 24279,24144,24007,23870 .int 23732,23593,23453,23312 .int 23170,23027,22884,22740 .int 22594,22448,22301,22154 .int 22005,21856,21706,21555 .int 21403,21250,21097,20942 .int 20787,20631,20475,20318 .int 20159,20001,19841,19681 .int 19519,19358,19195,19032 .int 18868,18703
24、,18537,18371 .int 18204,18037,17869,17700 .int 17530,17360,17189,17018 .int 16846,16673,16499,16325 .int 16151,15976,15800,15623 .int 15446,15269,15090,14912 .int 14732,14552,14372,14191 .int 14010,13828,13645,13462 .int 13278,13094,12910,12725 .int 12539,12353,12167,11980 .int 11793,11605,11416,112
25、28 .int 11039,10849,10659,10469 .int 10278,10087,9896,9704 .int 9512,9319,9126,8933 .int 8739,8545,8351,8156 .int 7961,7766,7571,7375 .int 7179,6983,6786,6589 .int 6392,6195,5997,5800 .int 5602,5403,5205,5006 .int 4808,4609,4409,4210 .int 4011,3811,3611,3411 .int 3211,3011,2811,2611 .int 2410,2210,2
26、009,1808 .int 1607,1407,1206,1005 .int 804,603,402,201TWI2: .sect twiddle2 .int 32767,32767,32765,32762 .int 32758,32752,32745,32737 .int 32728,32718,32706,32693 .int 32679,32663,32647,32629 .int 32610,32589,32568,32545 .int 32521,32496,32469,32442 .int 32413,32383,32351,32319 .int 32285,32250,32214
27、,32176 .int 32138,32098,32057,32015 .int 31971,31927,31881,31834 .int 31785,31736,31685,31634 .int 31581,31526,31471,31414 .int 31357,31298,31237,31176 .int 31114,31050,30985,30919 .int 30852,30784,30714,30644 .int 30572,30499,30425,30350 .int 30273,30196,30117,30037 .int 29956,29874,29791,29707 .in
28、t 29621,29535,29447,29359 .int 29269,29178,29086,28993 .int 28898,28803,28707,28609 .int 28511,28411,28310,28208 .int 28106,28002,27897,27791 .int 27684,27576,27466,27356 .int 27245,27133,27020,26905 .int 26790,26674,26557,26438 .int 26319,26199,26077,25955 .int 25832,25708,25583,25457 .int 25330,25
29、201,25073,24943 .int 24812,24680,24547,24414 .int 24279,24144,24007,23870 .int 23732,23593,23453,23312 .int 23170,23027,22884,22740 .int 22594,22448,22301,22154 .int 22005,21856,21706,21555 .int 21403,21250,21097,20942 .int 20787,20631,20475,20318 .int 20159,20001,19841,19681 .int 19519,19358,19195,
30、19032 .int 18868,18703,18537,18371 .int 18204,18037,17869,17700 .int 17530,17360,17189,17018 .int 16846,16673,16499,16325 .int 16151,15976,15800,15623 .int 15446,15269,15090,14912 .int 14732,14552,14372,14191 .int 14010,13828,13645,13462 .int 13278,13094,12910,12725 .int 12539,12353,12167,11980 .int
31、 11793,11605,11416,11228 .int 11039,10849,10659,10469 .int 10278,10087,9896,9704 .int 9512,9319,9126,8933 .int 8739,8545,8351,8156 .int 7961,7766,7571,7375 .int 7179,6983,6786,6589 .int 6392,6195,5997,5800 .int 5602,5403,5205,5006 .int 4808,4609,4409,4210 .int 4011,3811,3611,3411 .int 3211,3011,2811
32、,2611 .int 2410,2210,2009,1808 .int 1607,1407,1206,1005 .int 804,603,402,201 .int 0,201,-402,-603 .int -804,-1005,-1206,-1407 .int -1607,-1808,-2009,-2210 .int -2410,-2611,-2811,-3011 .int -3211,-3411,-3611,-3811 .int -4011,-4210,-4409,-4609 .int -4808,-5006,-5205,-5403 .int -5602,-5800,-5997,-6195
33、.int -6392,-6589,-6786,-6983 .int -7179,-7375,-7571,-7766 .int -7961,-8156,-8351,-8545 .int -8739,-8933,-9126,-9319 .int -9512,-9704,-9896,-10087 .int -10278,-10469,-10659,-10849 .int -11039,-11228,-11416,-11605 .int -11793,-11980,-12167,-12353 .int -12539,-12725,-12910,-13094 .int -13278,-13462,-13
34、645,-13828 .int -14010,-14191,-14372,-14552 .int -14732,-14912,-15090,-15269 .int -15446,-15623,-15800,-15976 .int -16151,-16325,-16499,-16673 .int -16846,-17018,-17189,-17360 .int -17530,-17700,-17869,-18037 .int -18204,-18371,-18537,-18703 .int -18868,-19032,-19195,-19358 .int -19519,-19681,-19841
35、,-20001 .int -20159,-20318,-20475,-20631 .int -20787,-20942,-21097,-21250 .int -21403,-21555,-21706,-21856 .int -22005,-22154,-22301,-22448 .int -22594,-22740,-22884,-23027 .int -23170,-23312,-23453,-23593 .int -23732,-23870,-24007,-24144 .int -24279,-24414,-24547,-24680 .int -24812,-24943,-25073,-2
36、5201 .int -25330,-25457,-25583,-25708 .int -25832,-25955,-26077,-26199 .int -26319,-26438,-26557,-26674 .int -26790,-26905,-27020,-27133 .int -27245,-27356,-27466,-27576 .int -27684,-27791,-27897,-28002 .int -28106,-28208,-28310,-28411 .int -28511,-28609,-28707,-28803 .int -28898,-28993,-29086,-29178 .int -29269,-29359,-29447,-29535 .int -29621,-29707,-29791,-29874 .int -29956,-30037,-30117,-30196 .int -30273,-30350,-30425,-30499 .int -30572,-30644,-30714,-30784 .int -30852,-30919,-30985,-31050 .int -31114,-31176,-31237,-31298 .int -31357,-31414,-31471,-31526 .int -31581,-31634,-31685,-3173
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 专项幕墙安装2024协议范本版
- 组织行为分析与应用
- 专业舞台灯光购销协议一
- 专业维修服务协议样本2024版B版
- 2025年度场监督管理局委托执法事项责任书4篇
- 2025年度厂房设备租赁及维护管理合同范本4篇
- 2024版小区公共服务设施施工协议样本一
- 2024版特定企业融资咨询与服务协议版
- 2025年度户外广告场地租赁终止协议书4篇
- 专用肥料国内运输合同标准文本2024版版
- 2024年08月云南省农村信用社秋季校园招考750名工作人员笔试历年参考题库附带答案详解
- 防诈骗安全知识培训课件
- 心肺复苏课件2024
- 2024年股东股权继承转让协议3篇
- 2024-2025学年江苏省南京市高二上册期末数学检测试卷(含解析)
- 四川省名校2025届高三第二次模拟考试英语试卷含解析
- 《城镇燃气领域重大隐患判定指导手册》专题培训
- 湖南财政经济学院专升本管理学真题
- 考研有机化学重点
- 全国身份证前六位、区号、邮编-编码大全
- 《GPU体系结构》课件2
评论
0/150
提交评论