AnsweredAssumed Answered

cfftf_fr32 Ouput

Question asked by Tim on Sep 10, 2010
Latest reply on Oct 7, 2010 by Tim

In using the cfftf_fr32 function call I notice the output is not symmetrical about the Nyquist frequency.  Am I using the function correctly or is this a limitation of the fixed point math at low input.  I have attached example code an a figure for an example case.


#define FFT_SIZE 2048

// fft variables
complex_fract32 input[FFT_SIZE];
complex_fract32 output[FFT_SIZE];
complex_fract32 twid[(3*FFT_SIZE)/4];

double spect[FFT_SIZE];

int main( void )


float pi;
int i, fft_length = FFT_SIZE;
double tempd;
complex_double tempcd;


pi = acosf(-1);
twidfftf_fr32(twid, fft_length); 
    for(i = 0; i < fft_length; i++){
  input[i].re = (fract32) 0x400*sin(2*pi*0.065*i);
  input[i].im = (fract32) 0x400*sin(2*pi*0.065*i);
cfftf_fr32(input, output, twid,1, fft_length);


    for(i = 0; i < fft_length; i++){
 = (double) output[i].re; = (double) output[i].im;

  tempd = cabs(tempcd);
  tempd = tempd*tempd;
  if(tempd > 0)
   tempd = 10*log10(tempd);
   tempd = 0;  
  spect[i] = (double) tempd;    


  return 0;