MATLAB: Problem with ifftn and ifftshift?

fftnfftshiftifftnifftshift

Hi there I was wondering if someone could help me. I am using the fftn fftshift functions as part of my alogrithm;
tmp = fftn(MAT); Adash = fftshift(tmp);
Adashup=ifftshift(Adash);
Adashup2new = ifftn(Adashup);
However, When I took everything else out and left these in as a tester I noticed that instead of the above taking me back to the original MAT, it alters the numbers quite a lot. What am I doing wrong?? Example original file MAT has a min of 0 and a max of 1.0856, however the file Adashup2new has a min of -6.792 and a max of 1.0856

Best Answer

Sounds like Imaginary components are there due to round off errors, try extracting the real part
f = real(ifft2(F));
Related Question