# unexpected difference between offline and real-time processing using SHARC's FFTA/IFFTA

hi guys,

rn my implementation is quite simple, using SHARC's FFTA then IFFTA to see the result fits the theory or not, so we are able to design more things based on this implementation.

offline implementation

1. N = 512, V = 32, H = 16
2. Using SHARC's accelerator to process FFT then IFFT.
3. Input data came from ADSP's example(inputcomplx512.dat)
5. IFFT using the twiddles generated by Python, also confirmed with ADI's twiddles and data sheet, which is correct.
6. The output of IFFT which is in packed data format, so I use a simple equation( sqrt(Re[n]^2+Im[n+1]^2), n denotes the index of IFFT output vector ) to retrieve information back to time domain then stored in the DMA. (inputcomplx512.dat vs ifft_result.dat)

with above's conclusion, now I'm migrating my design from offline to real-time processing.

real-time implementation

1. Same configuration as above, N = 512, V = 32, H = 16
2. NUMSAMPLES(buffer size) is 512.
3. Using SHARC's accelerator to process FFT then IFFT.
4. Input from codec ADC, output to codec DAC.
5. In real-time processing, a chirp tone(20Hz to 22000Hz) was feeding into the input of codec.
6. if i'm using the equation( sqrt(Re[n]^2+Im[n+1]^2) to reconstruct information in time domain the result contains a lot of harmonics, and fundamental frequency was disappeared. If i only take the Real part of the IFFT's product, the result seems correct. (Check first screenshot in below!)
7. To double confirm the result from 6,7, I prepared a sine function wave data ("sine.dat") stored in the DMA and bypass the input data from codec ADC, and repeat the same procedure as 6. And the result is still disappointing, if I'm using sqrt( Re[n]^2+Im[n+1]^2 ) to reconstruct waveform there's bunch of harmonics, if I'm only using the Real part of the IFFT product, the result fits theory again!(Check second screenshot in below!) (chirp tone result; chirp tone vs chirp tone IFFT(sqrt( Re[n]^2+Im[n+1]^2 )) vs chirp tone IFFT(REAL parts only)) (sine tone result; sine tone vs sine tone IFFT(sqrt( Re[n]^2+Im[n+1]^2 )) vs sine tone IFFT(REAL parts only))