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.

What is the InBuffer of format in 28335 fft library ?



Hi,

I'm using the "C28x Floating Point Unit Library" from  sprc624.zip on my F28335.   I would like to know What is the InBuffer 's format in 28335 fft library .  

For example ,256 fft,I collected 256 data in same interval by ADC.Then I Stored these data in InBuffer and Call  RFFT_f32 function and RFFT_f32_mag  function to Calculate.But the result is wrong.Here is a right example,but i don't know how to do so that my data is appropriate.

for(i=0;i<FFT_SIZE;i++)

   {

           InBuffer[i] = a1 * sin(2 * PI * f1 * i / FFT_SIZE) + a2 * sin(2 * PI * f2 * i / FFT_SIZE)+a3 * sin(2 * PI * f3 * i / FFT_SIZE);

   }

  fft.InBuf = InBuffer;     /* Input data buffer      */

  fft.OutBuf = OutBuffer;    /* FFT output buffer      */

  fft.CosSinBuf = TwiddleBuffer;/* Twiddle factor buffer  */

  fft.FFTSize = FFT_SIZE;    /* FFT length             */

  fft.FFTStages = FFT_STAGES;    /* FFT Stages             */

  fft.MagBuf = MagBuffer;       /* Magnitude buffer      */   

  RFFT_f32_sincostable(&fft); /* Initialize twiddle buffer */

................

interrupt void cpu_timer0_isr(void)

{

   unsigned int i;

   CpuTimer0.InterruptCount++;

   for(i = 0; i < FFT_SIZE; i++)

   {

           InBuffer[i] = a1 * sin( 2 * PI * f1 * i / FFT_SIZE) + a2 * sin( 2 * PI * f2 * i / FFT_SIZE)+a3*sin(2*PI*f3*i/FFT_SIZE);

   }

   RFFT_f32(&fft);        /* Calculate output          */

   RFFT_f32s_mag(&fft);      /* Calculate magnitude       */

   // Acknowledge this interrupt to receive more interrupts from group 1

   PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

}

The above example is correct.How can I do?

Thank you for the help!   Any idea is well accepted.....