# Incorrect result with both FFTW and MKL FFT

## Incorrect result with both FFTW and MKL FFT

Hello everyone,

I've noticed that both MKL FFT and FFTW is giving me a wrong result while calculating 2D complex-to-complex BACKWARD FFT. I am attaching the source codes that I used on this forum to discuss it with the experts.

While the input array is :

 1.0+0.0i  1.0+0.0i  1.0+0.0i
1.0+0.0i  1.0+0.0i  1.0+0.0i
1.0+0.0i  1.0+0.0i  1.0+0.0i

The forward transform should be:

 9.0+0.0i  0.0+0.0i  0.0+0.0i
0.0+0.0i  0.0+0.0i  0.0+0.0i
0.0+0.0i  0.0+0.0i  0.0+0.0i

And the backward transform should be again the initial array. However, it is:

 9.0+0.0i  9.0+0.0i  9.0+0.0i
9.0+0.0i  9.0+0.0i  9.0+0.0i
9.0+0.0i  9.0+0.0i  9.0+0.0i

I attached my test code here. Could you pls. let me know why this is happening?

AttachmentSize
5.56 KB
5.13 KB
3 posts / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.

I have noticed that there is a scale factor (\sigma) in the original formulation of Discrete Fast Fourier (DFT) approach as it is implemented in Intel MKL here:

https://software.intel.com/en-us/mkl-developer-reference-c-fourier-trans...

In the above example array, we need to divide the array to some scaling factor to obtain the exact initial array. How should we access to the value of the (\sigma) or the scaling factor?

Point 1: It seems that the scaling factor is "1" when it is the forward transform. However, it changes during the backward transform.

Point 2: The implemented FFT formulation in MATLAB does not include any scaling factor!