www.pudn.com > FBG.zip > CFBG_delay.asv, change:2009-10-10,size:1138b


clc 
clear; 
np=0.5308e-6;       %光栅周期% 
L=80000*np;        %光栅长度2mm% 
n1=1.46;          %纤芯原始折射率% 
v=1;              %边缘可见度% 
DeltaN=1e-4; 
Neff=n1; 
wl_D=2*Neff*np 
 
h=5; 
SectionN=2*h+1; 
 
Ch=1e-9; 
z=L/(2*h+1); 
 
a=pi/4; 
T=[exp(-i*a),0;0,exp(i*a)];       %相移参数 
 
X=[1;0]; 
 
wavelength=[1545:0.01:1554.99]*1e-9;      % 初始化输入波长区间% 
 
 
for j=1:1000 
    F=zeros(2,2); 
    M=[1,0;0,1];                           %初始化矩阵 
    k=pi*v*DeltaN/wavelength(j);     
    for n=-h:h 
    Lamda=(wl_D+Ch*n/SectionN); 
    delta=2*pi*DeltaN/wavelength(j)+2*pi*Neff*(1/wavelength(j)-1/Lamda); 
    g=sqrt(k^2-delta^2); 
    A=cosh(g*z)-i*delta*sinh(g*z)/g; 
    B=-i*k*sinh(g*z)/g; 
    C=cosh(g*z)+i*delta*sinh(g*z)/g; 
    F=[A,B;-B,C]; 
    M=F*M; 
    end 
    Y=M*X; 
    ta=Y(2,1)/Y(1,1); 
    ph(j)=atan(imag(ta)/real(ta)); 
    R(j)=abs(ta)^2; 
%     R2(j)=sinh(g*L)^2/(cosh(g*L)^2-(delta/k)^2); 
end 
Dt=diff(ph)./diff(omega)*1e+12; 
plot(wavelength,n,'.',wavelength(2:1000),Dt); 
axis([1.54800e-6 1.5520e-6 0 1]); 
title('反射率'); 
xlabel('wavelength'); 
ylabel('Reflectivity'); 
grid on;