MATLAB Answers

Why does ifft of a complex matrix gives me another complex matrix rather than a real one?

59 views (last 30 days)
Atharva Hans
Atharva Hans on 27 Jun 2017
Commented: Walter Roberson on 28 Jun 2017
Hello, I have two matrices (complex numbers) and tried to you ifft command on both of them. So one of them gave me a real output while other gives a complex one. Can someone please tell me why is that? Before doing that i though ifft of a complex matrix gives a real matrix.
Thank you.


Sign in to comment.

Answers (1)

Star Strider
Star Strider on 28 Jun 2017
My guess is that in the first matrix, that produced a real inverse Fourier transform results, the columns were symmetric complex conjugates of each other, as would be the result of the Fourier transform of a real vector.
The second matrix that returned complex inverse Fourier transform results either (1) did not have symmetric complex conjugates in the columns, or (2) that it did, and you are seeing the effects of floating point approximation errors, and that at least some of the imaginary values are on the order of eps, or about ±1E-16, and others are 0.

  1 Comment

Walter Roberson
Walter Roberson on 28 Jun 2017
For emphasis: it is only vectors that have the symmetric complex conjugate arrangement that will result in real vectors when you ifft.
Think of it from an information capacity. Consider a real vector of length L; that is L items of information.
The fft of it is length L as well, but each position has two items of information -- real part and imaginary part. If every position were important, then that would be 2*L pieces of information. Instead, the second half is the complex conjugate of the first, adding no new information, so the essential pieces of information are only L. Information is preserved.
Now suppose that the original vector was complex and length L. That is 2*L pieces of information, since there is a real and imaginary component for each. The fft of it is complex and length L, which is 2*L pieces of information. If hypothetically the fft had the symmetric complex conjugate structure like in the previous case, then there would only be L pieces of information in the fft, which would have to encode the 2*L pieces of information of the original. That isn't enough space to encode the information, so we see that the full L of the fft must be important.
From the above it follows that if you have an arbitrary complex vector that does not have the right symmetry property, then the ifft must be a complex vector of full length, to preserve the 2*L pieces of information of the vector.

Sign in to comment.

Sign in to answer this question.