Altera_Forum
Honored Contributor
8 years agoFFT / IFFT Example Inconsistency
Hi!
I was looking at using the 2D FFT / IFFT examples in an application however I was coming across incorrect values for the IFFT result. I'm using MATLAB to compare results and for verification. It appears that the 2D-FFT matches perfectly against matlab's fft2() function, however it differs from the ifft2() function when using the 2D-IFFT example. I've made a quick test case using the 2D FFT / IFFT example as a proof of concept of this inconsistency I'm seeing. In the original example, a new set of data is generated for each FFT / IFFT test. I changed this so that it generates one set of data and thus, by performing the FFT followed by an IFFT, I should see the same data out that I originally sent in. From here the only major change should be caused from floating-point error. From just looking at the first 10 values, I'm getting significantly different values than I expected. Also in the C host code, "golden truth" values are computed at each FFT / IFFT test which are used to compare for SNR error in dB. The C code matches the results with the OpenCL kernels and so the same inconsistency applies to the "golden truth" values as well, where the FFT is correct and the IFFT appears to be incorrect. All of my tests have been done with the emulator, but I would expect the same thing to show up when doing a full compile. Am I missing something here or making a mistake somewhere? I've attached the quick test case described above (I removed all the SVM stuff). Also, another thing to note is that I've only made changes to the host file, everything else is the same from the altera examples since ideally the only thing to switch between FFT and IFFT is switching the boolean value.