本文基于光学原理,用Matlab实现正弦光栅的衍射传输特性仿真。
正弦光栅分类:
- 振幅型:光栅的透过率函数符合一个正弦sin函数的分布。
- 相位型:光栅对相位的调制符合一个正弦sin函数的分布。
Project Code
% 作者:ZQJ
% 日期:2021.11.18 星期四
%**********************正弦光栅的衍射传输特性(包括振幅型和相位型)****************************
%% 振幅型正弦光栅 ********
clear,clc,close all;
Light_transmissions = f_Lightfield_transmission;
% 系统参数设置************************
lamda = 1550e-9; % 波长
w0 = 4e-4; % 束腰半径
z0 = 0;
light_length = 6e-3; % 光场边长
N = 1024; % 矩阵像素
D = 2e-4; % 正弦光栅的周期
[X,~] = meshgrid(linspace(-light_length/2,light_length/2,N));
gaussian_I = f_Gaussian_beams(w0,z0,lamda,light_length,light_length,N,N);
A_sinGrating = abs(sin(2*pi*X/D));
figure,subplot(1,2,1),imagesc(gaussian_I),colormap(subplot(1,2,1),hot),axis off;axis square;
subplot(1,2,2),imagesc(A_sinGrating),colormap(subplot(1,2,2),gray),axis off;axis square;
E0 = gaussian_I .* A_sinGrating;
E1 = Light_transmissions.FFT_(lamda,E0,light_length,light_length,0.1);
figure,imagesc(abs(E1)),colormap hot;axis square;axis off;
%% 相位型正弦光栅 ********
clear,clc,close all;
Light_transmissions = f_Lightfield_transmission;
% 系统参数设置************************
lamda = 1550e-9; % 波长
w0 = 4e-4; % 束腰半径
z0 = 0;
light_length = 6e-3; % 光场边长
N = 1024; % 矩阵像素
D = 2e-4; % 正弦光栅的周期
[X,~] = meshgrid(linspace(-light_length/2,light_length/2,N));
gaussian_I = f_Gaussian_beams(w0,z0,lamda,light_length,light_length,N,N);
A_sinGrating = exp(1i*(2*pi*abs(sin(2*pi*X/D))));
figure,subplot(1,2,1),imagesc(gaussian_I),colormap(subplot(1,2,1),hot),axis off;axis square;
subplot(1,2,2),imagesc(angle(A_sinGrating)),colormap(subplot(1,2,2),gray),axis off;axis square;
E0 = gaussian_I .* A_sinGrating;
E1 = Light_transmissions.FFT_(lamda,E0,light_length,light_length,0.13);
figure,imagesc(abs(E1)),colormap hot;axis square;axis off;
Appendix Code
- 高斯光产生函数,参看Matlab:实现高斯光束产生
- 光场传输函数:参看Matlab:实现光场传输函数
仿真结果图:
- 振幅型:
- 相位型:
专栏内容供作者本人或大家学习使用,多多指教 ~