www.pudn.com > FBG.zip > UFBG.m, change:2009-10-31,size:917b


clc 
clear; 
% for np=[0.524:1e-3:0.534]*1e-6;    %光栅周期基本不变的,1530-1560,对应0.524-0.534; 
np=0.531e-6;  
% L=4000*np;        %光栅长度2mm通常1-2mm 
n1=1.46;          %纤芯原始折射率 
v=1;              %边缘可见度 
DeltaN=8e-4;      %一般在1e-5~1e-3 
Neff=n1; 
wl_D=2*Neff*np; 
wl_max=(1+DeltaN/Neff)*wl_D; 
wavelength=[1520:0.01:1570]*1e-9;      % 初始化输入波长区间% 
 
wavelength=[1545.6:0.01:1557.12]*1e-9; 
N=length(wavelength); 
k=pi*v*DeltaN./wavelength; 
Beta=2*pi*Neff./wavelength; 
delta=2*pi*DeltaN./wavelength+Beta-pi/np; 
g=sqrt(k.^2-delta.^2); 
x=zeros(1,N); 
for L=(1000:1000:10000)*np;%光栅长度2mm通常1-2mm 
    R=sinh(g*L).^2./(cosh(g*L).^2-(delta./k).^2); 
    for i=1:N 
        x(i)=L/np; 
        i=i+1; 
    end  
plot3(x,wavelength/wl_max,R); 
title('反射率'); 
xlabel('total number of grating periods(N)'); 
ylabel('normalized wavelength') 
zlabel('Reflectivity(R)'); 
hold on 
end