www.pudn.com > XPM.zip > XPM.m, change:2008-12-08,size:2717b


 
%PROGRAMA QUE SIMULA O EFEITO XPM PARA O SINAL E O BOMBEIO 
%BY J.M.S.FILHO 
 
%Pulsos UltraCurtos To<10ps  
pt=1024; 
npasso=1000; 
ja=100e-12; 
intera=1000; 
 
 
%define janela de tempo 
tmin=-ja/2; 
tmax=ja/2; 
dift=tmax-tmin; 
Ts=dift/(pt-1); 
xt=[0:(pt/2)-1]; %#ok<NBRAK> 
t1=Ts.*xt; 
yt=[-(pt/2):-1]; %#ok<NBRAK> 
t2=Ts.*yt; 
T=[t2 t1]; 
CompVect=length(T); 
% 
%define janela de frequencia 
Ws=(2*pi)/((pt-1)*Ts); 
xw=[0:(pt/2)-1]; %#ok<NBRAK> 
w1=Ws.*xw; 
yw=[-(pt/2):-1]; %#ok<NBRAK> 
w2=Ws.*yw; 
w=[w1 w2]; 
wt=[w2 w1]; 
ft=wt/(2*pi); 
CompVecwt=length(w); 
 
% 
 
To=10e-12; 
L=5; %#ok<NASGU> 
 
lambdas=630e-09; 
lambdap=530e-09; 
 
d=10e-12; 
 
Pp=100; 
Ps=Pp/2; 
 
beta2s=0; 
beta2p=0; 
 
Td=0; 
 
Lw=To/abs(d); 
%Ld=To.^2/beta2p; 
 
gamap=0.08; 
gamas=(1.2)*gamap; 
 
Lnl=1/(gamap*Pp); 
 
z=5*Lw; 
 
h=z/npasso; 
L=h*intera; 
 
% 
%Define pulso de entrada (secante hiperbólico ou gaussiano) 
Ep=(sqrt(Pp))*exp(-T.^2/(2*(To.^2))); 
Ms=(sqrt(Ps))*exp(-((T-Td).^2)/(2*(To.^2))); 
 
p=0; 
z=0; 
while p<intera 
%      
   %TERMOS BASICOS 
   %PUMP 
   Dp=((i/2)*beta2p)*(w.^2); 
   NpS=(i*gamap)*(abs(Ep).^2); 
   NpC=(2*i*gamap)*(abs(Ms).^2); 
   %NpG=(-gp/2)*(abs(Ms).^2); 
   % 
   %SIGNAL 
   Ds= -d*w*i + ((i/2)*beta2s)*(w.^2); 
   NsS=(i*gamas)*(abs(Ms).^2); 
   NsC=(2*i*gamas)*(abs(Ep).^2); 
   %NsG=(gs/2)*(abs(Ep).^2); 
   % 
   %EXPONENCIAIS PARA O SPLIT STEP 
   eDp=exp(h*Dp); 
   eDs=exp(h*Ds); 
   eNtp=((exp(h*NpS)).*(exp(h*NpC)));%.*(exp(h*NpG)); 
   eNts=((exp(h*NsS)).*(exp(h*NsC)));%.*(exp(h*NsG)); 
   % 
   aux1Ep=ifft(eDp.*fft(Ep,pt),pt); 
   aux1Ms=ifft(eDs.*fft(Ms,pt),pt); 
   % 
   aux2Ep=aux1Ep.*eNtp; 
   aux2Ms=aux1Ms.*eNts; 
   % 
   Ep=aux2Ep; 
   Ms=aux2Ms; 
   p=p+1; 
   z=p*h; 
   if mod(p,100)==0 
   p %#ok<NOPRT> 
  
   else 
   end 
end 
 
 
freq=-To*w/(2*pi); 
 
subplot(221); 
plot(freq,abs(fft(Ep,pt)).^2/max(abs(fft(Ep,pt))).^2,'r','LineWidth',2); 
xlim([-10 10]); 
ylim([0 1]); 
legend('pulso 1'); 
ylabel('INTENSIDADE'); 
xlabel('(v1-v2)T0'); 
 
 
subplot(222); 
plot(freq,abs(fft(Ms,pt)).^2/max(abs(fft(Ms,pt))).^2,'b','LineWidth',2); 
xlim([-10 10]); 
ylim([0 1]); 
legend('pulso 2',2); 
ylabel('INTENSIDADE'); 
xlabel('(v1-v2)T0'); 
 
CrossPhase=abs(fft(Ms,pt)).^2/max(abs(fft(Ms,pt))).^2; 
CrossPhase1=abs(fft(Ep,pt)).^2/max(abs(fft(Ep,pt))).^2; 
 
FreqChirp=-gradient(abs(Ms).^2); 
FreqChirp1=-gradient(abs(Ep).^2); 
 
subplot(223); 
plot(T/To,abs(Ms).^2,'--',T/To,FreqChirp); 
xlim([-5 5]); 
ylim([-2 2]); 
 
print -djpeg -r0 freq1.jpg 
 
fid1=fopen('XPM.dat','A'); 
for ii=1:pt, 
Mdado=[freq(ii) CrossPhase(ii) CrossPhase1(ii) T(ii)/To FreqChirp(ii) (abs(Ms(ii))).^2]; 
fprintf(fid1,'\n%e %e %e %e %e %e',Mdado); 
end 
fclose(fid1); 
 
clear all