网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 61IC中国电子在线 >> DSP >> 代码示例 >> TI DSP代码示例 >> C2000 >> 文章正文
  利用汇编语言和TMS320F2812芯片实现FFT的算法         ★★★ 【字体:
利用汇编语言和TMS320F2812芯片实现FFT的算法
作者:61IC    文章来源:本站原创    点击数:    更新时间:2007-1-17    

利用汇编语言和TMS320F2812芯片实现FFT的算法,该算法对128点和256点很有效,使用过程中要考虑信号值不能太小.

 

#include "DSP28_Device.h"       /*DSP28xx Headerfile Include File*/
#include "DSP281x_Examples.h"     /* DSP28xx Examples Include File*/
#include "fft.h"
#include "math.h"

#define FFTN256 128
#define f 10
#define pi 3.1415926
#pragma DATA_SECTION(ipcb, "FFTipcb");

#pragma DATA_SECTION(mag, "FFTmag");/* Prototype statements for functions found within this file.
                                  Global variables used in this example*/
RFFT32 fft=RFFT32_128P_DEFAULTS;
long ipcb[FFTN256+2];                      /*in place computation buffer*/
long mag[FFTN256/2+1];                     /*magnitude buffer*/
const long win[FFTN256/2]=HANNING128;      /*window coefficent array*/
int m=0;
long n;
long p, q;
unsigned int mod[256];

main()
{
  Uint16 i;
  for(i=0;i<FFTN256;i++)
  {
   ipcb[i]= (long)(10000000*sin((2*pi*i)/12));
 
  }

   /*initialize FFT module */
   fft.ipcbptr=ipcb;                       /* FFT computation buffer pointer*/
   fft.magptr=ipcb;                       /*store back the mag.square in*/
   fft.winptr=(long *)win;                 /* window coefficient array*/
   fft.init(&fft);                         /*copy twiddle factor*/

   RFFT32_brev(ipcb,ipcb,FFTN256);
   fft.win(&fft);                          /*window the input data*/
   fft.calc(&fft);                         /*zero the imaginary part*/
   fft.split(&fft);                        /*compute the FFT*/
   fft.mag(&fft);                          /*obtain the magnitude square*/
   m=0;
   for(i=0;i<256;i+=2)
   {
    p=ipcb[i];
    q=ipcb[i+1];
    n=p*p+q*q;
    n=sqrt(n);
    mod[m]=n;
    m++;
   }
}

               欢迎点击进入:TI德州中文网   (国内唯一针对TI应用的中文技术网站)    文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    TMS320F2812的SPWM原程序
    基于LabVIEW和TMS320F2812的…
    TMS320F2812的CAN调试成功经…
    基于TMS320F2812和μC/OS II…
    TMS320F2812 全局汇编函数
    TMS320F2812 CMD 文件各段含…
    基于TMS320F2812集中供电系统…
    TMS320F2812的CMD文件配置详…
    基于TMS320F2812的多轴伺服控…
    利用TMS320F2812 DSP&DRV592…
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61IC 湘ICP备05002478号