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.

Question over the function of C6accel_DSP_fft32*32 in C6Accel

Other Parts Discussed in Thread: OMAP3530

Hi, dear friends, I have a favor to ask of you, and I am waiting for your answer.

When I operate C6Accel (c6accel_1_00_00_04)testing program on omap3530, the output is all passed after the test.

 

However, I do have some doubts on the testing result in the function of C6accel_DSP_fft32*32. when I open the file of my testing result  fft_32*32_64K_sine_wave_64KHz_sampling_ref.dat  in Matlab,  the amplitude spectrum is as follows:

but as I use Matlab to calculate the input data (input_64k_source2_combined_sine_wave_64kHz_sampling_ref.data), the amplitude spectrum via inherent function fft results as follows:

Questions then arise:

1.       why there is so much difference between the results( with different amplitude and different shape)

2.       why does the testing result in the function of C6accel_DSP_fft32*32 I have got is not symmetrical?

3.       which of the realization method of FFT is carried out in C6accel_DSP_fft32*32 (is it radix -2, -4, or the other)

  •  

    when I open the file of my testing result  fft_32*32_64K_sine_wave_64KHz_sampling_ref.dat  in Matlab,  the amplitude spectrum is as follows:

    but as I use Matlab to calculate the input data (input_64k_source2_combined_sine_wave_64kHz_sampling_ref.data), the amplitude spectrum via inherent function fft results as follows

  • For implementation of the FFT in C6Accel please refer the Pdf attached4762.sprueb8b.pdf. The input as well as the output from the FFT function complex.

     The routine uses log4(nx) − 1 stages of radix-4 transform and performs either a radix-2 or radix-4 transform on the last stage depending on nx. If nx is a power of 4, then this last stage is also a radix-4 transform, otherwise it is a radix-2 transform

     The code used to generate the input is as given below

    This is the code used to generate the input in C6Accel test application

    Void generateInput (Int32 numSinWaves, float *x_ref_float, Int32 n) {
        Int32 i, j;
        float sinWaveIncFreq, sinWaveMag;
        /*
            Based on numSinWave information, create the input data. The
            input data is first created using floating point dataType. The
            floating point data type is then converted to the appropriate
            fixed point notation
        */
        /* Clear the input floating point array */
        for (i = 0; i < n; i++) {
            x_ref_float[2*i] = (float)0.0;
            x_ref_float[2*i + 1] = (float)0.0;
        }

        /* Calculate the incremental freq for each sin wave */
        sinWaveIncFreq = ((float)3.142)/(numSinWaves*(float)1.0);
        /* Calculate the magnitude for each sin wave */
        sinWaveMag = (float)1.0/(numSinWaves * (float)1.0*n);
        /* Create the input array as sum of the various sin wave data */
        for (j = 0; j < numSinWaves; j++) {
            for (i = 0; i < n; i++) {
                x_ref_float[2*i] += sinWaveMag * (float)cos(sinWaveIncFreq*j*i);
                x_ref_float[2*i + 1] = (float) 0.0;
            }
        }
      }

    /* Generate N bytes of 16 bit raw sine wave for use in tests and store to file 
        ( Reuse pWorkingBuf2_16bpp for this) */
        pFlSineWave = (float *)pWorkingBuf2_16bpp;
        generateInput (4, pFlSineWave, n);   //n is number of points
        for (i=0;i<n;i++){
            inputArray32[2*i]     = (int)(pFlSineWave[2*i] * 2147483648UL) >> 16;
            inputArray32[2*i + 1] = (int)(pFlSineWave[2*i + 1] * 2147483648UL) >> 16;
        }

       /*********inputArray32 is stored to file *************\

    A simple way to test the FFT function is to pass it a uniform input and see if you get a frequency spectrum on frquency bin corresponding to zero.