www.pudn.com > FBG.zip > CFBG.m, change:2009-11-01,size:1049b


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=50; 
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);%每一section是均匀的,对应一个lamda. 
        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; 
    R(j)=abs(Y(2,1)/Y(1,1))^2; 
end 
 
plot(wavelength,R); 
axis([1.54800e-6 1.5520e-6 0 1]); 
title('反射率'); 
xlabel('wavelength'); 
ylabel('Reflectivity'); 
grid on;