*L(1)));f21(j,1)=(i*k/q(j)*sinh(q(j)*L(1)));f22(j,1)=(cosh(q(j)*L(1))+i*delta(j)/q(j)*sinh(q(j)*L(1)));F1=[f11(j,1)f12(j,1);f21(j,1)f22(j,1)];end%-----------------------------------------------------第二段光栅----------------------------------------------------function[R]=Transmission_FBG2(Fai)n=1000;n_eff=1.458;lamda=1e-9*linspace(1540,1560,n);lamda_B=1550e-9;dn=2e-3;v=1;delta=2*n_eff*pi*(1./lamda-1./lamda_B);k=pi*dn/lamda_B;q=sqrt(k.^2-delta.^2);forj=1:nL(2)=300e-6;f11(j,2)=(cosh(q(j)*L(2))-i*delta(j)/q(j)*sinh(q(j)*L(2)));f12(j,2)=-(i*k/q(j)*sinh(q(j)*L(2)));f21(j,2)=(i*k/q(j)*sinh(q(j)*L(2)));f22(j,2)=(cosh(q(j)*L(2))+i*delta(j)/q(j)*sinh(q(j)*L(2)));phase=[exp(-i*Fai/2)0;0exp(i*Fai/2)];F2=[f11(j,2)f12(j,2);f21(j,2)f22(j,2)]*phase;F1=Transmission_FBG1(n,lamda,lamda_B,v,dn,n_eff,j);F2=F2*F1;