Strange grid pattern in 2D Fourier transform

조회 수: 9 (최근 30일)
Morgan Facchin
Morgan Facchin 2021년 1월 14일
답변: Hrishikesh Borate 2021년 2월 4일
Hi everyone,
I want to plot the phase of the 2D Fourier transform of a random phase mask with the following code:
size_mask=10; mag=5;
mask=exp(1i*2*pi*rand(size_mask));
mask_pad=padarray(mask,[mag*size_mask mag*size_mask],0,'both');
phase=angle(fft2(mask_pad));
imagesc(phase)
Which gives this:
It has the expected global pattern, but there is an additional grid pattern on top of it.
Can anyone help me understand the origin of this and how to eliminate it?
Many thanks

채택된 답변

Hrishikesh Borate
Hrishikesh Borate 2021년 2월 4일
Hi,
I understand that you are displaying phase spectrum of FFT of a mask. In the output image there is global grid pattern formed, which you are trying to remove.
One reason for this grid pattern is that mask_pad is not centered about zero, which results in a phase shift of the FFT output. The phase shift is essentially negating every other element (odd samples) of the output of the FFT which causes the high frequency oscillation you're observing (as explained here).
This can be corrected as follows :-
phase = angle(fftshift(fftshift((fft2(fftshift((mask_pad)))))));
For more information, refer to fftshift, fft2.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by