北郵信號(hào)與信息處理DSP實(shí)驗(yàn)二_第1頁
北郵信號(hào)與信息處理DSP實(shí)驗(yàn)二_第2頁
北郵信號(hào)與信息處理DSP實(shí)驗(yàn)二_第3頁
北郵信號(hào)與信息處理DSP實(shí)驗(yàn)二_第4頁
北郵信號(hào)與信息處理DSP實(shí)驗(yàn)二_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

信號(hào)與信息綜合處理實(shí)驗(yàn)報(bào)告學(xué)院: 班級(jí): 姓名: 學(xué)號(hào):實(shí)驗(yàn)二FFT實(shí)現(xiàn)實(shí)驗(yàn)?zāi)康倪M(jìn)一步熟悉CCSv5的開發(fā)環(huán)境,掌握調(diào)試的要素,并理解FFT的過程。實(shí)驗(yàn)原理FFT變換FFT算法:X,蝶形運(yùn)算圖:

實(shí)現(xiàn)函數(shù):DSP_fft(w,N,x,y)。IFFT變換算法實(shí)現(xiàn):x實(shí)現(xiàn)流程: -14,0,-57,0,-125,0,-217,0,-326,0,-449,0,-578,0,-707,0,-829,0,-938,0,-1027,0, -1090,0,-1122,0,-1119,0,-1079,0,-1000,0,-883,0,-729,0,-541,0,-324,0,-84,0, 173,0,439,0,707,0,968,0,1214,0,1437,0,1631,0,1788,0,1904,0,1976,0 };shortx1[2*N]={0};shortx2[2*N]={0};//存儲(chǔ)FFT之后的結(jié)果shorty[2*N]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };#include<stdio.h>#include<csl.h>#include<csl_irq.h>#include<csl_chip.h>#include<csl_emifa.h>#include"dsk6416.h"#include"dsk6416_led.h"staticEMIFA_ConfigMyEmifaConfig={ EMIFA_GBLCTL_RMK ( EMIFA_GBLCTL_EK2RATE_FULLCLK, //1XEMIFinputclock EMIFA_GBLCTL_EK2HZ_CLK, //eclkout2continueoutputduringhold EMIFA_GBLCTL_EK2EN_ENABLE, //eclkout2enableoutput EMIFA_GBLCTL_BRMODE_MRSTATUS, //busrequestismemoryaccessorrefreshpending/inprogress EMIFA_GBLCTL_NOHOLD_DISABLE, EMIFA_GBLCTL_EK1HZ_CLK, //eclkout1continueoutputduringhold EMIFA_GBLCTL_EK1EN_ENABLE, //eclkout1enableoutput EMIFA_GBLCTL_CLK4EN_ENABLE, //clkout4outputenable EMIFA_GBLCTL_CLK6EN_ENABLE //clkout6outputenable ), 0xffffffd3, //64BITSDRAM// 0xffffff33, //32BITSDRAM// 0xffffff93, //16bitSDRAM// 0xffffff83, //8bitSDRAM 0xffffffe3, 0x22a28a 0x22a28a EMIFA_SDCTL_RMK ( EMIFA_SDCTL_SDBSZ_4BANKS, //SDRAMbanksize4banks EMIFA_SDCTL_SDRSZ_11ROW, //rownumber=11 EMIFA_SDCTL_SDCSZ_8COL, //columnnumber=8 EMIFA_SDCTL_RFEN_ENABLE, //SDRAMrefreshenable //EMIFA_SDCTL_INIT_NO, //SDRAM配置完每個(gè)CE空間后,不初始化 EMIFA_SDCTL_INIT_YES, //SDRAM配置完每個(gè)CE空間后,初始化 EMIFA_SDCTL_TRCD_OF(2), //TRCD=(Trcd/Tcyc)-1 EMIFA_SDCTL_TRP_OF(2), //TRP=(Trp/Tcyc)-1,3個(gè) EMIFA_SDCTL_TRC_OF(8), EMIFA_SDCTL_SLFRFR_DISABLE //selfrefreshmodedisable ), EMIFA_SDTIM_RMK ( EMIFA_SDTIM_XRFR_DEFAULT, //EXTTIMERdefault EMIFA_SDTIM_PERIOD_OF(2083) //refreshperiod,clockout1=10ns ), EMIFA_SDEXT_RMK ( EMIFA_SDEXT_WR2RD_OF(0), //cyclesbetweenwritetoreadcommand=1,subtract1is0 EMIFA_SDEXT_WR2DEAC_OF(1), //cyclesbetweenwritetoprecharge=2 EMIFA_SDEXT_WR2WR_OF(1), //cyclesbetweenwritetowrite=2 EMIFA_SDEXT_R2WDQM_OF(1), //cyclesbetweenreadtobex=2 EMIFA_SDEXT_RD2WR_OF(0), //cyclesbetweenreadtowrite=1 EMIFA_SDEXT_RD2DEAC_OF(1), // EMIFA_SDEXT_RD2RD_OF(0), // EMIFA_SDEXT_THZP_OF(2), //Troh=3cycle EMIFA_SDEXT_TWR_OF(1), //Twr=1clock+6ns EMIFA_SDEXT_TRRD_OF(0), //Trrd=12ns EMIFA_SDEXT_TRAS_OF(5), //Tras=42ns EMIFA_SDEXT_TCL_OF(1) //caslatency=3clock ), 0x00000002, 0x00000002, 0x00000002, 0x00000002};#pragmaDATA_SECTION(sdram_data,".off_ram");unsignedintsdram_data[0x400000];voidmain(){ inti,m[N]; Uint32good_flag; good_flag=0; DSK6416_init();DSK6416_LED_init();//初始化CSL CSL_init(); //配置EMIFA EMIFA_config(&MyEmifaConfig);for(i=0;i<0x400000;i++){ sdram_data[i]=0;}//FFT會(huì)改變x[i]的值,故先將其存入SDRAMprintf("x[i]:");for(i=0;i<2*N;i++){ sdram_data[i]=x[i]; printf("%d",x[i]);}printf("\n"); //FFT DSP_fft(w,N,x,y); //FFT結(jié)果y[i]的值,存入SDRAM printf("y[i]:");for(i=0;i<2*N;i++){ sdram_data[i+2*N]=y[i]; printf("%d",y[i]);}printf("\n");//FFT結(jié)果y[i]的模值平方printf("m[i]:"); for(i=0;i<N;i++) { m[i]=y[2*i]*y[2*i]+y[2*i+1]*y[2*i+1]; printf("%d",m[i]); } printf("\n"); //IFFT將y[i]共軛除以增益系數(shù)N(即FFT點(diǎn)數(shù)) for(i=0;i<2*N;i++) { if(i%2==1)y[i]=-y[i]; y[i]=y[i]/N; } //IFFT利用FFT進(jìn)行IFFT DSP_fft(w,N,y,x2); //IFFTFFT會(huì)修改y[i]重新把y[i]從SDRAM中讀出 printf("y[i]fromSDRAM:");for(i=0;i<2*N;i++){ y[i]=sdram_data[i+2*N]; printf("%d",y[i]);} printf("\n"); //IFFT將FFT的結(jié)果共軛即為IFFT結(jié)果printf("x2[i]:"); for(i=0;i<2*N;i++) { if(i%2==1)x2[i]=-x2[i]; printf("%d",x2[i]); } printf("\n"); //FFT將x[i]的值從SDRAM中讀出賦給x1[i] printf("x1[i]:"); for(i=0;i<2*N;i++) { x1[i]=sdram_data[i]; printf("%d",x1[i]); } printf("\n"); //將IFFT的結(jié)果x2[i]與FFT前的數(shù)據(jù)x1[i]進(jìn)行比較 for(i=0;i<2*N;i++) { if(abs(x2[i]-x1[i])>10) { good_flag=0; break; } good_flag=1; } if(good_flag==1) { DSK6416_LED_on(0); DSK6416_LED_on(1); DSK6416_LED_on(2); DSK6416_LED_off(3); printf("IFFTRESULTISOK!\n"); } else { DSK6416_LED_on(0); DSK6416_LED_off(1); DSK6416_LED_off(2); DSK6416_LED_off(3); printf("IFFTRESULTISFAILED!\n"); }流程圖SDRAM配置流程圖SDRAM配置流程圖組內(nèi)分工功能測(cè)試軟件平臺(tái)查看變量:通過View->Variables可以查看各個(gè)變量的值。圖形顯示工具:CCSv5中提供了一個(gè)高級(jí)圖形和圖像可視化工具。它可通過圖形形式顯示數(shù)組,并且可采用多種格式。查看m序列中的數(shù)值,即觀測(cè)FFT變換后各點(diǎn)模值的平方。Console控制臺(tái)顯示:x[i]:初始序列,即需要進(jìn)行FFT變換的64點(diǎn)的實(shí)部、虛部按序排列;y[i]:FFT的結(jié)果,即變換后64點(diǎn)的實(shí)部、虛部按序排列;m[i]:FFT變換所得各點(diǎn)模值平方;x2[i]:IFFT變換結(jié)果,即反變換后64點(diǎn)實(shí)部、虛部按序排列;x1[i]:從SDRAM讀出的x[i]原始序列;結(jié)論:“IFFTRESULTISOK!”代表變換前后數(shù)據(jù)一致,否則顯示“IFFTRESULTISFAILED!”。代碼優(yōu)化:如果沒有進(jìn)行軟件流水,程序運(yùn)行結(jié)束時(shí),clock顯示為:17736121,即程序共需要17736121個(gè)時(shí)鐘周期。優(yōu)化后,程序運(yùn)行結(jié)束時(shí),clock顯示為:52753,即程序共需要52753個(gè)時(shí)鐘周期。DSP執(zhí)行程序后,LED測(cè)試效果為L(zhǎng)ED0~2均被點(diǎn)亮,即變換前后一致。重點(diǎn)、難點(diǎn)斷點(diǎn)調(diào)試問題在不同行設(shè)置斷點(diǎn),運(yùn)行結(jié)果不同。在本次實(shí)驗(yàn)的調(diào)試過程中,應(yīng)注意將斷點(diǎn)設(shè)置在最后一行以上,以免出現(xiàn)灰斷點(diǎn),保證單次運(yùn)行的正常進(jìn)行。此外,通過View->Variables查看各個(gè)變量的值,有時(shí)會(huì)出現(xiàn)原程序執(zhí)行時(shí)不能顯示出變量對(duì)應(yīng)值的情況。經(jīng)過嘗試,發(fā)現(xiàn)在只需加入單次運(yùn)行的斷點(diǎn)即可解決這一問題。IFFT及其驗(yàn)證在進(jìn)行IFFT拓展功能時(shí),考慮使用現(xiàn)有函數(shù)實(shí)現(xiàn)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論