AnsweredAssumed Answered

complex_float (TS201)

Question asked by Griff241 on Feb 2, 2012
Latest reply on Feb 14, 2012 by Griff241

I am using the TS201 and wanted to extract only the real values from a complex_float.  complex_float is defined as:

 

typedef struct

{

    float re;       /*{ Real      }*/

    float im;       /*{ Imaginary }*/

} _complex_float;   

 

In my program, I have the following variables defined:

 

complex_float input[8192];    //Input data into ifft

complex_float temp[8192];    //Working buffer

complex_float output[8192];    //Output data

static complex_float twidtab[8192*3/4];  //Twiddle Table

 

The program fills input with data and populates the twiddle table.  Next, I perform an ifft:

 

ifft (input, temp, output, twidtab, 1, 8192);

 

The ifft returns the the result to output.  I am only interested in the real portion of the output.  What is the best way to extract only the real portion?  I can obviously do it with a loop but that is not very efficient. Example:

 

float real_data[8192];

 

for(i=0; i< 8192;i++)

{

real_data[i] = output[i].re;

}

 

Is there a better way to do this like a built in function that I am missing?  Thanks!

Outcomes