DSPRelated.com
Forums

FFT calculation.

Started by Girish December 22, 2003
hello sir,
I have doubt with FFT. ADSP-2181 supports FFT
libraray.
I performed 8-point FFT on a series i am not getting
the exact results.plz any body suggest me.
Here is the code

#include<stdio.h>
#include <ffts.h>
#include<stdio.h>
#define C 8
void main(void)
{
int Ireal[8]={0,1,2,3,4,5,6,7},
Iimag[8]={0,0,0,0,0,0,0,0}, Oreal[8],Oimag[8];
int k;

for (k = 0; k < C; k++)
{
Oreal[k]=Oimag[k]=0;
}
fft8(Ireal, Iimag, Oreal, Oimag);
printf("Real output") ;
for(k=0;k<=C-1;k++)
{
printf("%5d",Oreal[k]);
}
printf("\n");
printf("imag output");
for(k=0;k<=C-1;k++)
{
printf("%5d",Oimag[k]);
}
asm("idle;");
}

The results i am getting are
Real output 12 -4 0 -4 12 -4 -8 -4
imag output 16 10 0 -10 -16 -2 0 2

But the actual results i should get is

28.0000,
-4.0000 + 9.6569i,
-4.0000 + 4.0000i,
-4.0000 + 1.6569i,
-4.0000,
-4.0000 - 1.6569i,
-4.0000 - 4.0000i,
-4.0000 - 9.6569i

Regards and Thanks
Girish

________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk