effects of ifft2(x, 'symmetric') while x is not conjugate symmetric
88 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Justin
el 23 de Nov. de 2025 a las 1:13
Comentada: Matt J
hace alrededor de 4 horas
Hi all,
I understand that 'symmetric' in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
- with 'symmetric', will only half of the data be used or still the whole matrix is used, but just output real values?
- if x is not conjugate symmetric but I still pass in 'symmetric', what will happen?
Thanks in advance.
0 comentarios
Respuesta aceptada
Matt J
el 23 de Nov. de 2025 a las 1:44
Editada: Matt J
el 23 de Nov. de 2025 a las 1:45
When you specify "symmetric", the upper half of the fft input array is ignored, e.g.
x=ones(1,7);
ifft(x)
x(5:end)=rand(1,3); %write random junk into the upper half of x
ifft(x)
ifft(x,'symmetric')
4 comentarios
Paul
el 23 de Nov. de 2025 a las 2:55
I don't think that's true for the rows that aren't in the first column.
X = ifft2(rand(10));
x1 = ifft2(X,'symmetric');
X(end,3) = 0;
x2 = ifft2(X,'symmetric');
isequal(x1,x2)
Matt J
el 23 de Nov. de 2025 a las 14:19
Editada: Matt J
el 23 de Nov. de 2025 a las 14:37
Yep, my bad. In higher dimensions, conjugate symmetry means the image is symmetric across the origin. So, if you view the array after fftshift(), the cells it would be using are the right half, minus half of one of the DC axes. In other words, it needs cells from two quadrants to cover the whole array by symmetry, and also only the non-negative DC axes are needed.

If you re-organize this in terms of the original ordering of X(i,j) it means the cells that can be discarded are the light-shaded ones below, which is consistent with what @Paul found in his tests:

Más respuestas (1)
Paul
el 23 de Nov. de 2025 a las 2:24
Editada: Paul
el 23 de Nov. de 2025 a las 16:44
It appears that only portions of the input matrix are used when 'symmetric' is specified on input to ifft2 and the input is 2D
rng(100);
X = rand(10,12) + 1j*rand(10,12); % non-symmetric input
x1 = ifft2(X,'symmetric');
X(:,8:12) = 0; % zero out the entire right side
X(7:10,1) = 0; % zero out the top half of the first column
x2 = ifft2(X,'symmetric');
isequal(x1,x2)
10 comentarios
Paul
hace alrededor de 7 horas
"Clearly they didn't assume that when ismatrix(X)=true. In that case, even large breaks in conjugate symmetry are not felt in the result."
I think that is basically a bonus. In other words, the developers' (hypothesized) intent is to use 'symmetric' when the input is not symmetric only due to numerical trash. The fact that the ifft2 happens to yield the expected result with symflag 'symmetric' when ismatrix(X) = true even when X is far from symmetric is not in conflict with the (hypothesized) intent.
In any case, will be ineresting hear their reponse to your bug report.
Matt J
hace alrededor de 4 horas
I don't have a response from the yet, probably due to Thanksgiving.
Regardless of developer intent, though, the documentation says we are supposed to get the same result from ifft2(X) as we would from ifft2nLoop(X), when X is n-D. So, at the very least, I think it has to be a documentation bug.
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!