# Problem with FFT and IFFT

Question asked by Lutrey on May 22, 2014
Latest reply on May 26, 2014 by JJoseph

Hallo,

I got a new problem. I would like to use the fft and ifft.

At first I want build an example to transform my Signal with the fft and transform it back with the ifft.

Later I want calculate the cross-power spectrum but this is not important for my question.

I use the fft an ifft from the trans.h.

I only use in this example the fft and the ifft to the left Signal.

void BPROCESS_Test (SSBlockAlgo* pBlkAlgoInfo)

{

int sample=0, blockSize=0;

blockSize = pBlkAlgoInfo->pInputs[0].pBlockProperties->nBlockSize;

float SignalL[blockSize], SignalR[blockSize];

float *pInputL, *pInputR, *pOutputL, *pOutputR;

pInputL = pBlkAlgoInfo->pInputs[0].pSamples;

pInputR = pBlkAlgoInfo->pInputs[1].pSamples;

pOutputL = pBlkAlgoInfo->pOutputs[0].pSamples;

pOutputR = pBlkAlgoInfo->pOutputs[1].pSamples;

float L_re_f[blockSize],L_im_f[blockSize], L_re[blockSize],L_im[blockSize];

for(sample = 0; sample < blockSize; sample++)

{

SignalL[sample] = pInputL[sample];

SignalR[sample] = pInputR[sample];

}

rfft64(SignalL, L_re_f, L_im_f);

ifft64(L_re_f, L_re_f, L_re, L_im);

for(sample = 0; sample < blockSize; sample++)

{

pOutputL[sample]=L_re[sample];

pOutputR[sample]=SignalR[sample];

}

}

If I run this in Sigma Studio, Signal R is ok (as expected). Signal L is very noisy.

I use the rfft64 an ifft64, because the blockSize is 64, too. Is this correct?

Is it correct, that L_re has this size, too?

Can I use the fft and ifft this way or am I totally wrong?

Based on this example I just want to understand, how I could use fft and  ifft correctly.

Best regards

Lukas

p.s. I work on an ADSP-21364 EZ-Kit