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.

求助: 6678下DSP_fft调用出错?



试用了以下2个函数 DSP_fft16x16 , DSP_fft16x32发现当输入数据幅度较大时计算结果会出错(看起来像内部溢出了)。

我的程序采用c:\ti\dsplib_c66x_3_1_0_0\examples\FFT_Example_66_LE_COFF例程,只把输入信号变为单频。

数据产生部分代码如下,当sinWaveMag为1.0时计算结果出错,为1.0/1000结果正确。DSPLIB FFT文档中并没提到输入数据范围要求?

   sinWaveMag = (float)1.0/1000;

    for (i = 0; i < N; i++) {
        x_ref_float[2*i] = sinWaveMag * (float)cos(2*3.142*1000/16000*i);
        x_ref_float[2*i + 1] = (float) 0.0;
    }

    /* Convert the floating point data to reference fixed point data */
    for (i = 0; i < N; i++) {
        x_ref[2*i] = x_ref_float[2*i] * 2147483648;
        x_ref[2*i + 1] = x_ref_float[2*i + 1] * 2147483648;
    }

    /* Copy the reference input data to the various input arrays */
    for (i = 0; i < N; i++) {
        x_16x16[2*i] = (x_ref[2*i] >> 16);
        x_16x16[2*i + 1] = (x_ref[2*i + 1] >> 16);

        x_16x32[2*i] = x_ref[2*i] >> SCALE;
        x_16x32[2*i + 1] = x_ref[2*i + 1] >> SCALE;

        x_32x32[2*i] = x_ref[2*i] >> SCALE;
        x_32x32[2*i + 1] = x_ref[2*i + 1] >> SCALE;
    }