AnsweredAssumed Answered

type cast; conversion; complex_fract16 - int

Question asked by martin0082 on Jan 30, 2012
Latest reply on Feb 3, 2012 by CraigG

hello,

 

i'm using the Audio Codec Talkthrough - TDM (C) example (for BF561) to make a FFT of the incoming signal.

 

i want to save the data in a array from type complex_fract16 like this:

in1[n]= iChannel1LeftIn;

       

        i++;

        n++;

    if(n==FFT_SIZE1)

    {

        n=0;

    }

 

and make the FFT with  "rfft_fr16(in1, out1,twiddle, 1,FFT_SIZE1, &block_exponent1, 1);"

it seems like that there is a problem with data(type) conversion, because rfft_16 need a complex_fract16 and the type of iChannel1LeftIn is an integer.

 

compiler error:

".\Process_data.c", line 26: cc0513:  error: a value of type "int" cannot be

          assigned to an entity of type "complex_fract16"

  in1[n] = iChannel1LeftIn;

         ^

 

i was searching for a RTL function to convert the data types, but I could not found it.

How should I fix this problem ?

 

thanks

martin

Outcomes