ifft2 with "symmetric option"

19 views (last 30 days)
MementoMori
MementoMori on 23 May 2022
Commented: Walter Roberson on 23 May 2022
Hi, I am looking at "ifft2" in matlab ( https://it.mathworks.com/help/matlab/ref/ifft2.html#bvjz37f-symflag ) and it introduces a "symmetric" option, that treats the matrix as a conjugate symmetric.
What does it mean " treats the matrix as a conjugate symmetric"?
If my matrix is not, what does it do?
Thanks

Answers (1)

Chunru
Chunru on 23 May 2022
Edited: Chunru on 23 May 2022
Let F(u, v) be the forward FFT2 of f(x, y). For real function f(x,y), FT exhibits conjugate symmetry, i.e. F(u, v) = F*(-u, -v). Therefore if the input to IFFT2 is conjugate symmetric, the output will be the real. It is also possible to save some computations in this case comapreing general complex IFFT2.
In practical situation, the input to IFFT2(F), i.e. F, can be non-symetric conjugate even for real f due to rounding error. Therefore a flag 'symmetric' will treat input F as conjugate symmetric and allows faster IFFT2 and ensure the output to be real.
  4 Comments
Chunru
Chunru on 23 May 2022
When you want to test if conj(x) == y, which is equivelant to rea(x)==real(y) && imag(x)==-imag(y), any small rounding error may break down this test (I am not sure how matlab internally tests this condition).
However, if you treat them as symmetric, you can always ensure F(u, v) = F*(-u, -v) by using only the positive (or first half) frequency data and not using the other half directly. You can also use some type of average of the two numbers at the supposingly symmetric points. Again, I am not sure how matlab exactly implment this.
Walter Roberson
Walter Roberson on 23 May 2022
iift2() invokes ifftn() or invokes ifft() twice, passing the symmetry flag each time.
In my test with ifft() and the 'symmetric' option, the output was bit for bit identical when I used ifft('symmetric') on complex data, versus when I manually took the complex data and formed the complex conjugate in the expected form and ifft2('symmetric') that. For data of length 10 (which is even length), that looked like
[F(1), F(2:5), real(F(6)), conj(fliplr(F(2:5)))]
If it had been the second half of the input signal that was being used for 'symmetric', the output would have been different instead of identical.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!