Hello,
I have some troubles with the FFT computation. I tried it with the TI fft library, but it didn´t work. When I´m activating the FFT the ADC reads only noise. But the windowing function and the FFT don´t work as well.
That´s my file:
#include "DSP2802x_Device.h" // Peripheral address definitions
#include "Test.h" // Main include file
#include "fft.h" // FFT include file
#pragma DATA_SECTION(AdcBufA,"AdcBufFileA");
#pragma DATA_SECTION(AdcBufB,"AdcBufFileB");
#pragma DATA_SECTION(ipcb,"FFTipcb");
#pragma DATA_SECTION(mag,"FFTmag");
//--- Global Variables
Uint16 SpeedChanged = 1;
Uint16 AckAdc=0;
Uint16 AdcBufA[N];
Uint16 AdcBufB[N];
int32 ipcb[N+2];
int32 mag[N/2+1];
//--- Define FFT
RFFT32 fft=RFFT32_128P_DEFAULTS;
//--- Global Constants
const long win[N/2]=HAMMING1024;
/**********************************************************************
* Function: main()
*
* Description: Main function for C28x workshop labs
**********************************************************************/
void main(void)
{
.........
......
//--- FFT initialization
fft.ipcbptr=ipcb; // FFT computation buffer
fft.magptr=mag; // Store mag. square in separate buffer
fft.winptr=(long *)win; // Window coefficient array
fft.init(&fft); // Twiddle factor pointer initialization
//--- Main Loop
while(1) // endless loop - wait for an interrupt
{
if(AckAdc==1)
{
// RFFT32_brev((long *)AdcBufA,(long *)ipcb,N); // geht ohne, ist wahrscheinlich in fft.init drin
//--- FFT Computation
fft.win(&fft); // Window the input data
fft.calc(&fft); // Perform 2Npoint complex FFT
fft.split(&fft); // Split function computation
fft.mag(&fft); // Obtain the magnitude square
AckAdc=0;
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
}
}
} //end of main()
Is there something wrong with the FFT declaration?
Maybe someone has a example file for me. Or is there another library with a FFT which I can use?
Thanks
Thomas