Question about fft2(2D Fourier Transform) of a Gaussian function
Show older comments
Hello,
I have a question about fft2 of a Gaussian fuction. The following is my code:
zr = pi*12.5^2/0.85;
w = 12.5*sqrt(1+(10/zr)^2);
R = 10+zr^2/10;
N0 = 622;
n0 = linspace(-250,250,N0);
[x0,y0] = meshgrid(n0,n0);
r0 = sqrt(x0.^2+y0.^2);
Gau0 = exp(-1*r0.^2/w^2).*exp(1i*2*pi/0.85*10).*exp(-1i*((r0.^2)/2*R));
% figure,imagesc(n0,n0,abs(Gau0)),axis square,colormap hot
Fm = fftshift(fft2(Gau0));
figure,imagesc(n0,n0,abs(Fm).^2),axis square,colormap hot
figure,imagesc(n0,n0,angle(Fm)),axis square,colormap hot
Q: The problem is that the FT(Fourier transform) of a Gaussian function should be another Gaussian function. But if I change the sample number (N0 in the code), the amplitude of the FT is strange, a kind of periodic function sometimes. That is to say, the FT of a Gaussian function is related to the sampling number? It is very hard for me to understand such things. Maybe it is because it is undersampling in my code?
Thank you very much for your help (I hope my question is clear), and any help will be much appreciated.
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Fourier and Cosine Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!