AnsweredAssumed Answered

Audio processing, problem with the ifft function

Question asked by Luk_§_91 on Dec 15, 2014
Latest reply on Jan 19, 2015 by Jithul_Janardhanan

Good morning,
I'm trying to do some audio processing with my SHARC 21479 EZ-KIT Lite passing through the frequency domain.
But I have a problem.
When I simply do the fft and then the ifft (without any processing) I notice that the result of ifft function in a complex_float, while my input signal was float data.
The question is: Is this normal? how can I write the ifft result on the buffer? I tried to write only the real part but I hear distortion.

 

I'm working on the "21479 AD1939 C Block-Based Talkthru 48 or 96 kHz" example

 

#define NUM_SAMPLES     512

 

void Realmemcopy(complex_float *input, float *output, unsigned int number)

{

    int i;

   

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

    {

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

    }

}

 

void AudioProcessing()

{   

    complex_float FreqRx_L1[NUM_SAMPLES], FreqRx_R1[NUM_SAMPLES], Out_L1[NUM_SAMPLES], Out_R1[NUM_SAMPLES];

    int i;

  

    rfft512(Analog.Rx_L1, FreqRx_L1);

    rfft512(Analog.Rx_R1, FreqRx_R1);

   

    for(i = NUM_SAMPLES/2; i < NUM_SAMPLES; i++)

    {

        FreqRx_L1[i].re = 0;

        FreqRx_L1[i].im = 0;

        FreqRx_R1[i].re = 0;

        FreqRx_R1[i].im = 0;

    }

   

    ifft256(FreqRx_L1, Out_L1);

    ifft256(FreqRx_R1, Out_R1);

   

    Realmemcopy(Out_L1, Analog.Tx_L1, NUM_SAMPLES);

    Realmemcopy(Out_R1, Analog.Tx_R1, NUM_SAMPLES);

}

Outcomes