Matlab:厄米-高斯光束合成拉盖尔-高斯光束

代码:

clc
clear all
close all
%%
N = 300;            %采样点数
lambda = 632e-9;    %波长632nm
k = 2*pi/lambda;    %波数
w0 = 3e-3;          %束腰半径3mm
Z_R = pi*w0^2/lambda;      %瑞利长度
row = linspace(-3*w0,3*w0,N);   col = row;
[x,y] = meshgrid(row,col);
[theta,r] = cart2pol(x,y);
z = 0;          
w_z = w0*sqrt(1+(z/Z_R)^2);%光束在z位置的半径
p = 0;      l = 1;
E_01 = Hermite(p,sqrt(2)*x/w_z).*Hermite(l,sqrt(2)*x/w_z).*exp(-1i*(p+l+1)*atan(z/Z_R)).*exp(1i*k*r.^2/2/(z-1i*Z_R));
I_01 = E_01.*conj(E_01);      I_01 = I_01/max(max(I_01));

figure;
subplot(2,3,1)
h_01 = pcolor(x,y,I_01);
set(h_01,'edgecolor','none','facecolor','interp');
title('HG_0_1');
axis square;

subplot(2,3,4)
E_01_phase = angle(E_01);
h_01_phase = pcolor(x,y,E_01_phase);
set(h_01_phase,'edgecolor','none','facecolor','interp');
title('HG_0_1  phase');
axis square;

p = 1;      l = 0;
E_10 = Hermite(p,sqrt(2)*y/w_z).*Hermite(l,sqrt(2)*y/w_z).*exp(-1i*(p+l+1)*atan(z/Z_R)).*exp(1i*k*r.^2/2/(z-1i*Z_R));
I_10 = E_10.*conj(E_10);      I_10 = I_10/max(max(I_10));

subplot(2,3,2)
h_10 = pcolor(x,y,I_10);
set(h_10,'edgecolor','none','facecolor','interp');
title('HG_1_0');
axis square;

subplot(2,3,5)
E_10_phase = angle(E_10);
h_10_phase = pcolor(x,y,E_10_phase);
set(h_10_phase,'edgecolor','none','facecolor','interp');
title('HG_1_0  phase');
axis square;

E = E_01+1i*E_10;
I = E.*conj(E);     I = I/max(max(I));
subplot(2,3,3)
h = pcolor(x,y,I);
set(h,'edgecolor','none','facecolor','interp');
title('LG_0_1');
axis square;

subplot(2,3,6)
E_phase = angle(E);
h_phase = pcolor(x,y,E_phase);
set(h_phase,'edgecolor','none','facecolor','interp');
title('LG_0_1  phase');
axis square;
%% 厄米特多项式
function result = Hermite(n,x)
if n <= 0
    result = 1;
elseif n == 1
    result = 2*x;
else
    result = 2*x*Hermite(n-1,x)-2*(n-1)*Hermite(n-2,x);
end
end

运行结果:
Matlab:厄米-高斯光束合成拉盖尔-高斯光束_第1张图片

涡旋光透镜聚焦

%% 涡旋光透镜聚焦
function main()
clear
close all
clc
%% 参数设置
%   /* 基本参数 */
Nxy = 100;          %x,y方向采样点数
lambda = 632e-9;    %波长为632nm
k = 2*pi/lambda;    %波数
w = 3e-3;           %光束尺寸 3mm
%   /* 坐标设置 */
[x,y] = meshgrid(linspace(-3*w,3*w,Nxy));       %初始光场直角坐标
[theta,r] = cart2pol(x,y);                      %初始光场极坐标
Z_R = pi*w^2/lambda;      %瑞利长度
z = 0;
w_z = w*sqrt(1+(z/Z_R)^2);%光束在z位置的半径
p = 2;      %p = 0, 1, 2...;
l = 1;      %拓扑电荷数
E1 = sqrt(2*factorial(p)/pi/(p+factorial(abs(l))))*(1/w_z)*(sqrt(2)*r/w_z).^abs(l)...
    .*exp(-r.^2/w_z^2).*laguerre(p,abs(l),2*r.^2/w_z^2).*exp(-1i*l*theta).*exp(-1i*k*z)...
    .*exp(-1i*k*r.^2*z/2/(z^2+Z_R^2))*exp(-1i*(2*p+abs(l)+1)*atan(z/Z_R));
I1 = E1.*conj(E1);  I1 = I1/max(max(I1));
figure(1);subplot(1,2,1)
mesh(x*1e3,y*1e3,I1);
set(gca,'fontname','times new roman','fontsize',16);
title(['拉盖尔高斯光束:l = ',num2str(l),'   p = ',num2str(p)],'fontname','华文中宋','fontsize',16);
xlabel('x/mm','fontname','times new roman','fontsize',16);
ylabel('y/mm','fontname','times new roman','fontsize',16);
zlabel('归一化强度','fontname','华文中宋','fontsize',16);
%% 透镜聚焦
f = 500e-3;    %透镜焦距 0.5m
A = 0;  B = f;  C = -1/f;   D = 0;  %collins公式 ABCD矩阵 
L = 2*f;    %从透镜前焦面到透镜后焦面的距离
[xf,yf] = meshgrid(linspace(-w/30,w/30,Nxy));       %远场坐标
for a = 1:Nxy
    for b = 1:Nxy
        E2(a,b) = (-1i/lambda/B)*exp(1i*k*L)*sum(sum(E1.*exp(1i*k/2/B*(A*(x.^2+y.^2)+D*(xf(a,b)^2+yf(a,b)^2)-2*(x*xf(a,b)+y*yf(a,b))))));
    end
    a
end
I2 = E2.*conj(E2);  I2 = I2/max(max(I2));
figure(1);subplot(1,2,2)
mesh(xf*1e3,yf*1e3,I2);
set(gca,'fontname','times new roman','fontsize',16);
title('透镜聚焦后的光场','fontname','华文中宋','fontsize',16);
xlabel('x/mm','fontname','times new roman','fontsize',16);
ylabel('y/mm','fontname','times new roman','fontsize',16);
zlabel('归一化强度','fontname','华文中宋','fontsize',16);
end
%% 拉盖尔多项式(通过递归定义)
function result = laguerre(p,l,x)
result = 0;
if p == 0
    result = 1;
elseif p == 1
    result = 1+abs(l)-x;
else
    result = (1/p)*((2*p+l-1-x).*laguerre(p-1,abs(l),x)-(p+l-1)*laguerre(p-2,abs(l),x));
end
end

Matlab:厄米-高斯光束合成拉盖尔-高斯光束_第2张图片

参考文献:
[1]葛甜. 利用光纤产生涡旋光束的理论与实验研究[D].
[2]Yao A M , Padgett M J . Orbital angular momentum: origins, behavior and applications[J]. Advances in Optics and Photonics, 2011, 3(2):161-204.

你可能感兴趣的:(matlab)