This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C5535: 利用1024FFT库函数计算2048点FFT结果不对

Part Number: TMS320C5535

根据手册中提供的Greater Than 1024-point FFT代码计算2048点FFT,奇偶序列FFT后组合的结果不对,手册中没有提供

CPLX_Mul(twiddle[k], data_odd[k])。

CPLX_Add(data_even[k], twiddle_times_data_odd, SCALE_FLAG);,

CPLX_Subtract(data_even[k], twiddle_times_data_odd, SCALE_FLAG)

这三个函数的代码。请看一下编写的这三个函数有什么问题,CPLX_Mul这个函数中两个int16的数相乘再移位会造成符号位跟着右移,请问有没有正确的代码

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Int32 CPLX_Mul(Int32 op1, Int32 op2)
{
Int16 op1_r, op1_i, op2_r, op2_i;
Int32 op1_op2_r, op1_op2_i;
Int16 op1_op2_r16, op1_op2_i16;
Int32 cplx_prod;
// Mask data for real and imag data = (real:imag)
op1_r = op1 >> 16;
op1_i = op1 & 0x0000FFFF;
op2_r = op2 >> 16;
op2_i = op2 & 0x0000FFFF;
op1_op2_i = (Int32)op1_r*op2_i + (Int32)op1_i*op2_r;
op1_op2_r = (Int32)op1_r*op2_r - (Int32)op1_i*op2_i;
op1_op2_i16 = (Int16)(op1_op2_i >> 15);
op1_op2_r16 = (Int16)(op1_op2_r >> 15);
cplx_prod = (((Int32)op1_op2_r16 & 0x0000FFFF)<< 16);
cplx_prod = cplx_prod | ((Int32)op1_op2_i16 & 0x0000FFFF);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
请问一下有没有计算正确的这三个函数。

www.ti.com.cn/.../spruh87h.pdf

x 出现错误。请重试或与管理员联系。