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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
% light wavelength
lambda=795e-9; % Rb D1 line
% set up mask (source image)
Nx_s=301;
Ny_s=301;
img_source=zeros(Ny_s,Nx_s);
src_size = 1.0*12.5e-3;
xpos_s=linspace( -src_size, src_size, Nx_s);
ypos_s=linspace( -src_size, src_size, Ny_s);
[xmesh,ymesh]=meshgrid(xpos_s,ypos_s);
w=0.0014*3/2;
R=1;
z_before_mask=LaguerreGaussianE([0,0,q_(w,R,lambda),lambda],xmesh,ymesh,'cart');
% disk mask
mask_R = (w*0.33);
mask = mask_transparency(xmesh,ymesh, mask_R);
% resulting field after mask
img_source= z_before_mask .* mask;
%img_source= z_before_mask;
% set up target image
Nx_t=101;
Ny_t=101;
img_t=zeros(Ny_t,Nx_t);
tgt_size = 2*12.5e-3;
xpos_t=linspace( -tgt_size, tgt_size, Nx_t);
ypos_t=linspace( -tgt_size, tgt_size, Ny_t);
z_t=10;
% generating image of the mask accounting the diffraction
tic; % start timer
img_t=diffracted_image_at_target(img_source, xpos_s, ypos_s, img_t, xpos_t, ypos_t, z_t, lambda);
toc % show evaluation time
% plot source and target images
show_diffraction(img_source, xpos_s, ypos_s, img_t, xpos_t, ypos_t);
|