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.

RFFT_f32u() on F28069 Experimenters kit

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Hi,

I am trying to get the RFFT_f32u() (v1.20) to work with my F28069 Experimenters kit. I have tried with the following code:

#include "DSP28x_Project.h"
#include "CLAShared.h" 
#include "FPU.h"
#include "math.h"
#include "float.h"


#define nrSamples 128    //Number of samples/time window

#define FFT_STAGES 7

float32 tempSamples[nrSamples];    //Samples to calculate on
float32 OutBuffer[nrSamples];    //FFT output
float32 TwiddleBuffer[nrSamples];    //Twiddle factors buffer
float32 MagBuffer[nrSamples/2+1];    //FFT magnitude output
RFFT_F32_STRUCT fft;

float32    RadStep = 0.1963495408494f;
float32    Rad = 0.0f;

void main()
{
    Uint16 channel,sample,i;

    init();    //All initiations
            
                
            for(i=0; i < nrSamples; i++)
            {
                tempSamples[i]   = sin(Rad) + cos(Rad*2.3567); //Real input signal    
                Rad = Rad + RadStep;
            }
            
            //FFT
            fft.InBuf = tempSamples; /* Input data buffer */
            fft.OutBuf = OutBuffer; /* FFT output buffer */
            fft.CosSinBuf = TwiddleBuffer; /* Twiddle factor buffer */
            fft.FFTSize = nrSamples; /* FFT length */
            fft.FFTStages = FFT_STAGES; /* FFT Stages */
            fft.MagBuf = MagBuffer; /* Magnitude buffer */
    
            RFFT_f32_sincostable(&fft); /* Initialize Twiddle Buffer */
            
            for (i=0; i < nrSamples; i++)
                  OutBuffer[i] = 0;                //Clean up output buffer
        
            for (i=0; i < nrSamples/2; i++)
                 MagBuffer[i] = 0;        //Clean up magnitude buffer
        
            RFFT_f32u(&fft);                    //Calculate real FFT
            RFFT_f32_mag(&fft);
            while(1){}    //Test the FFT

}

The result is very high positive and negative values in all places in the the OutBuffer, and almost all values in the MagBuffer is 1.#INF.

I have tried with different number of samples and also test align the inbuffer and use RFFT_f32() but with the same result.

 

Thanks in advance