How to plot Fresnel Diffraction?
65 次查看(过去 30 天)
显示 更早的评论
Hi I am trying to plot 1D fresnel diffraction in MATLAB. Is there any way of it?
1 个评论
Image Analyst
2014-3-1
Yes. You need the equation giving the signal as a function of distance, then use plot().
回答(1 个)
Prasobhkumar P. P.
2020-3-4
编辑:Prasobhkumar P. P.
2020-3-4
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Optics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!