-
Notifications
You must be signed in to change notification settings - Fork 0
/
Propagator.m
25 lines (22 loc) · 990 Bytes
/
Propagator.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% WAVEFRONT PROPAGATION BY ANGULAR SPECTRUM METHOD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Citation for this code/algorithm or any of its parts:
% Tatiana Latychevskaia and Hans-Werner Fink
% "Practical algorithms for simulation and reconstruction of digital in-line holograms",
% Appl. Optics 54, 2424 - 2434 (2015)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The code is written by Tatiana Latychevskaia, 2002
% The version of Matlab for this code is R2010b
function [p] = Propagator(N, lambda, area, z)
p = zeros(N,N);
for ii = 1:N
for jj = 1:N
alpha = lambda*(ii - N/2 -1)/area;
beta = lambda*(jj - N/2 -1)/area;
if ((alpha^2 + beta^2) <= 1)
p(ii,jj) = exp(-2*pi*1i*z*sqrt(1 - alpha^2 - beta^2)/lambda);
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%