%% 一维情况下 《傅里叶光学》 吕乃光 p104
func1=@(x) convn(rect(x),comb_o(x/2),'same').*rect(x/4);
x=linspace(-4,4,801);
y=func1(x);
[out,xx]=fourier1(func1);
figure,plot(x,y);
%% 二维情况下 《傅里叶光学》 吕乃光 P105-106
L=1;
d=2;
func2=@(x,y) convn(rect(x/L),comb_o(x/2),'same').*rect(x/4).*rect(y/4);
fourier2(func2,'1');
上图为一维光栅形状
一维光栅形状和一维夫琅禾费衍射
二维光栅
二维光栅夫琅禾费衍射
二维夫琅禾费衍射3D图
function y=comb_o(x,d)
% comb function
% 抽样函数