c语言中使用fft函数,DSP TMS320C6678中FFT函数的调用与具体使用方法(CCS中操作)...

首先明确一点,C6678中FFT的函数形式为:

833d4460cdceb0bd3806d618959eb0cc.png

N : length of FFT in complex samples

ptr_x : pointer to complex data input

ptr_w : pointer to complex twiddle factor

ptr_y : pointer to complex output data

brev : pointer to bit reverse table containing 64 entries

n_min : should be 4 if N can be represented as Power of 4 else, n_min should be 2

offset : index in complex samples of sub-fft from start of main fft

n_max : size of main fft in complex samples(可令n_max=N)

其中,64位bit反位表brev为:

unsigned char brev[64] =

{

0x00, 0x20, 0x10, 0x30, 0x08, 0x28, 0x18, 0x38,

0x04, 0x24, 0x14, 0x34, 0x0c, 0x2c, 0x1c, 0x3c,

0x02, 0x22, 0x12, 0x32, 0x0a, 0x2a, 0x1a, 0x3a,

0x06, 0x26, 0x16, 0x36, 0x0e, 0x2e, 0x1e, 0x3e,

0x01, 0x21, 0x11, 0x31, 0x09, 0x29, 0x19, 0x39,

0x05, 0x25, 0x15, 0x35, 0x0d, 0x2d, 0x1d, 0x3d,

0x03, 0x23, 0x13, 0x33, 0x0b, 0x2b, 0x1b, 0x3b,

0x07, 0x27, 0x17, 0x37, 0x0f, 0x2f, 0x1f, 0x3f

};

旋转矩阵(旋转因子)ptr_w为:

void tw_fft_gen (float *w, int n)

{

int i, j, k;

for (j = 1, k = 0; j <= n >> 2; j = j << 2)

{

for (i = 0; i < n >> 2; i += j)

{

#ifdef _LITTLE_ENDIAN

w[k] = (float) sin (2 * PI * i / n);

w[k + 1] = (float) cos (2 * PI * i / n);

w[k + 2] = (float) sin (4 * PI * i / n);

w[k + 3] = (float) cos (4 * PI * i / n);

w[k + 4] = (float) sin (6 * PI * i / n);

w[k + 5] = (float) cos (6 * PI * i / n);

#else

w[k] = (float) cos (2 * PI * i / n);

w[k + 1] = (float) -sin (2 * PI * i / n);

w[k + 2] = (float) cos (4 * PI * i / n);

w[k + 3] = (float) -sin (4 * PI * i / n);

w[k + 4] = (float) cos (6 * PI * i / n);

w[k + 5] = (float) -sin (6 * PI * i / n);

#endif

k += 6;

}

}

}

DSPF_sp_fftSPxSP函数的调用方式为:

1.下载库

781fb8e7c6052ccb5c44920a455cf3fa.png

将下载好的库“dsplib_c66x_3_1_0_0”复制到CCS的安装路径下

2.添加头文件

右键点击工程–>Properties–>Build–>c6000 Compiler–>Include Options

4d077e75abe8bddb32746bdc31ed05a1.png

3.添加库文件和库文件路径

右键点击工程–>Properties–>Build–>C6000 Linker–>File Search Path添加库文件和库文件路径

247b3598b6c4d0f6752b45e248624e14.png

完成以上的准备工作后便可进行DSPF_sp_fftSPxSP函数的调用了。

参考博文:http://bbs.elecfans.com/jishu_1602988_1_1.html

文章中部分内容来自网络,如有侵权,请联系作者,立即删除!!!

  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值