function U = fresnel_advance(U0, dx, dy, z, lambda)
% The function receives a field U0 at wavelength lambda
% and returns the field U after distance z, using the Fresnel
% approximation. dx, dy, are spatial resolution.
%If required, Please see below code's 2d version at
k=2*pi/lambda;
[~ nx] = size(U0);
Lx = dx * nx;
dfx = 1./Lx;
u = ones(nx,1)*((1:nx)-nx/2)*dfx;
O = fftshift(fft(U0));
H = exp(1i*k*z).*exp(-1i*pi*lambda*z*(u.^2));
U = ifft2(O.*H);
1 Comment
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/119646-how-to-plot-fresnel-diffraction#comment_199255
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/119646-how-to-plot-fresnel-diffraction#comment_199255
Sign in to comment.