Hi

I decided to implement Fast Fourier Transform in TMS320LF2407A DSP. I download the FFT library (sprc069) and tried to used the c-callable module as it has been describe in the related document. For testing my code, I tried to apply the FFT on a specific signal (one period of sinusoidal or square wave) and compare the result with the MATLAB. The result is completely different!! (I know the input of the FFT lib is in Q15 format and output is in Q14 format).

my code is the same as what is mentioned in the FFT lib document::

#pragma DATA_SECTION(aiDataLog1_g, "data_log");

int aiDataLog1_g[DATA_LOG_LEN];

#pragma DATA_SECTION(aiDataLog2_g, "data_log");

int aiDataLog2_g[DATA_LOG_LEN];

#pragma DATA_SECTION(fft_test, "int_ram");

FFT128R fft_test=FFT128R_DEFAULTS;

// Creating a specific signal as input

//  getSin() output is in Q15

for (iTemp=0; iTemp<128; iTemp++) {

aiDataLog1_g[iTemp] = 0.5*getSin(258*iTemp);

}

// FFT calculation

/* FFT initialization */

fft_test.ipcbptr = aiDataLog1_g; /* FFT computation buffer */

fft_test.magptr = aiDataLog2_g; /* Store back the mag. square */

//fft.winptr=win; /* Window coefficient array */

fft_test.init(); /* Copy Twiddle factor */

/* Acquire samples in bit reversed order or

Bit-reverse the in-order data using bit-rev utility */

FFTC_brev1(fft_test.ipcbptr, fft_test.ipcbptr, 128);

/* FFT Computation */

//fft_test.win(&fft_test); /* Window the input data */

fft_test.izero(&fft_test); /* Zero the imaginary part */

fft_test.calc(&fft_test); /* Compute the FFT */

fft_test.mag(&fft_test); /* Obtain the magnitude square */

According to the document of the FFT library (sprc069), everything is correct, but the result is wrong.  

I would greatly appreciate any help you can give me.

Thanks