0

You I have cell with an 8x8 complex matrix, which holds some secret data, and I converted it back to spatial domain using ifft2 as follows:

F2{i1,j1}=complex(re,Img);

ff{i1,j1}=ifft2(F2{i1,j1});

But ff still complex (it should be double). Why is that?

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
Naseem
  • 39
  • 6
  • 1
    Is the imaginary part very small compared with the real part? If so, that's caused by numerical precision issues and it's normal; see [here](https://stackoverflow.com/questions/686439/why-is-24-0000-not-equal-to-24-0000-in-matlab). Otherwise, please post a minimal example that we can run – Luis Mendo Mar 25 '19 at 09:47
  • 1
    Unless the matrix has conjugate symmetry, there is no reason to expect a real output. – Cris Luengo Mar 25 '19 at 13:06
  • 1
    If F2{i1,j1} has conjugate symmetry, `ff = ifft2(...,'symmetric')` will make sure the result is real (and possibly slightly speed-up the calculation). – Brice Mar 25 '19 at 13:44

0 Answers0