gratings

Contents

amplitude grating

w=3;
mu=0.5;
d = 0.25;

gfunc = @(x) 0.5*(1+mu*cos(2*pi*x/d)).*rect(x,2*w);

[oup x] = fourier1(gfunc);
% find peaks
[pmax locs] = findpeaks(oup,'sortstr','descend');
disp('      peak  location');
disp([pmax(1:3)' x(locs(1:3))']);
      peak  location
    1.0000         0
    0.0625   -4.0000
    0.0625    4.0000

phase grating

w=3;
mu=2.5;
d = 0.5;

gfunc = @(x) exp(j*mu*sin(2*pi*x/d)/2).*rect(x,2*w);

[oup x] = fourier1(gfunc);
nu = @(x) besselj(x,mu/2).^2;
nu0 = nu(0);
fprintf('nu0 = %g\n',nu0);

m = -12:12;
eff = nu(m);
tot = sum(eff);
fprintf('total energy %g\n',tot);

fprintf('%2s %10s %10s\n','q','nu_q','nu_q/nu_0');

for q = 0:2
    nuq = nu(q);
    fprintf('%2d %10.4f %10.4f\n',q,nuq,nuq/nu0);
end
nu0 = 0.417195
total energy 1
 q       nu_q  nu_q/nu_0
 0     0.4172     1.0000
 1     0.2607     0.6250
 2     0.0293     0.0702
% find peaks
[pmax locs] = findpeaks(oup,'sortstr','descend');
xlocs = x(locs(1:5));
disp('      peak  location    theory');
disp([pmax(1:5)' xlocs' nu(xlocs/2)'/nu0]);
      peak  location    theory
    1.0000         0    1.0000
    0.6250   -2.0000    0.6250
    0.6250    2.0000    0.6250
    0.0702   -4.0000    0.0702
    0.0702    4.0000    0.0702