傅里叶光学(四)衍射与干涉

optics5

Contents

  • cylinder
  • shifted cylinder
  • phase-shifted cylinder
  • interference of two apertures
  • moving apertures closer together
  • effect of aperture shape
  • interference of three apertures
  • interference of five apertures

cylinder

try for w = 0.5, 1, 2

% diameter w
w = 1;
func = @(x,y) cyl(x,y,w);
str = sprintf('diameter %g',w);

[out in] = fourier2(func);
傅里叶光学(四)衍射与干涉_第1张图片
subplot(1,1,1);
rgb = cat(3,in,in,in);
imagesc([-4 4],[4 -4],rgb);
axis equal
axis square
axis([-4 4 -4 4]);
傅里叶光学(四)衍射与干涉_第2张图片
close all
g = logim(out,3);
rgb = cat(3,g,g,g);
image([-4 4],[4 -4],rgb);
title(str);
axis equal
axis square
axis([-4 4 -4 4]);
傅里叶光学(四)衍射与干涉_第3张图片
close all
sz = size(out);
N = sz(1);
k = -N/2:N/2-1;
width = 8;
x = width*k/N;
idy = find(x==0);
y = out(:,idy);
idx  = find(abs(x)<2);
yt = somb(w*x).^2;
subplot(2,1,1);
plot(x,y,x,yt);
title(str);
subplot(2,1,2);
semilogy(x,y,x,yt);
xlabel('cross-section x');
傅里叶光学(四)衍射与干涉_第4张图片

shifted cylinder

w = 0.5;
xs = 2;

fprintf('shift %g',-xs);
func = @(x,y) cyl(x+xs,y,w);
fourier2(func);
shift -2
傅里叶光学(四)衍射与干涉_第5张图片

phase-shifted cylinder

w = 2;
xi = 2;
func = @(x,y) cyl(x,y,w).*exp(j*2*pi*xi*x);
fourier2(func);
傅里叶光学(四)衍射与干涉_第6张图片

interference of two apertures

w = 0.5;
xs = 1;

func = @(x,y) cyl(x+xs,y,w)+cyl(x-xs,y,w);
out = fourier2(func);
imshow(out);
傅里叶光学(四)衍射与干涉_第7张图片

moving apertures closer together

w = 0.5;
xs = 0.5;

func = @(x,y) cyl(x+xs,y,w)+cyl(x-xs,y,w);
out = fourier2(func);
imshow(out);
傅里叶光学(四)衍射与干涉_第8张图片

effect of aperture shape

w = 0.5;
xs = 1.0;

func1 = @(x,y) cyl(x+xs,y,w)+cyl(x-xs,y,w);
func2 = @(x,y) rect(x+xs,w).*rect(y,w)+rect(x-xs,w).*rect(y,w);
[out1 in1] = fourier2(func1);
[out2 in2] = fourier2(func2);
subplot(2,3,1); imshow(in1);
subplot(2,3,2); imshow(out1);
subplot(2,3,3); imshow(logim(out1,3));
subplot(2,3,4); imshow(in2);
subplot(2,3,5); imshow(out2);
subplot(2,3,6); imshow(logim(out2,3));
傅里叶光学(四)衍射与干涉_第9张图片

interference of three apertures

global n;
n = 1;
fourier(@func3);
傅里叶光学(四)衍射与干涉_第10张图片

interference of five apertures

n = 2;
fourier(@func3);

原文地址:http://www.johnloomis.org/eop513/notes/optics5/script5.html

傅里叶光学(四)衍射与干涉_第11张图片傅里叶光学(四)衍射与干涉_第12张图片

下面这两张是我计算的加了个colormap(hot)  顿时赶脚高大上了

你可能感兴趣的:(matlab,傅里叶光学)