www.pudn.com > Slab.rar > grating.m, change:2005-04-06,size:644b


lamda=1.50:0.0001:1.60; 
i=0; 
dim=length(lamda); 
r=ones(1,dim);     
%k1=ones(1,dim); 
%k2=ones(1,dim); 
lamdaB=1.55;     
Kapa=0.01; 
Neff=3.21; 
dataN12=Kapa*lamdaB/2; 
gl=300; 
gratingp=lamdaB/Neff/4; 
t=gl/gratingp*2; 
 
for lam=1.50:0.0001:1.60; 
i=i+1;         
 
 
n1=Neff+dataN12/2; 
n2=Neff-dataN12/2; 
k1=(2*pi*(Neff+dataN12/2)/lam)+j*0.001; 
k2=(2*pi*(Neff-dataN12/2)/lam)+j*0.001; 
Tgrating1=1/n1*[Neff,dataN12;dataN12,Neff]*[exp(j*k1*gratingp),0;0,exp(-j*k1*gratingp)]*1/n2*[Neff,-dataN12;-dataN12,Neff]*[exp(j*k2*gratingp),0;0,exp(-j*k2*gratingp)]; 
Tgrating=Tgrating1^t; 
r(i)=Tgrating(2)/Tgrating(4); 
end 
plot(lamda,abs(r));