You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.0 KiB

9 years ago
  1. clear all
  2. file='spettrolaserG3';
  3. str=['load ' file '.txt'];eval(str);
  4. str=['Ls=1e-3*' file '(:,1);'];eval(str);
  5. str=['spec=' file '(:,2);'];eval(str);
  6. file='ca2f_maggio10_1725';
  7. str=['load ' file '.dat'];eval(str);
  8. str=['SHGx=' file '(:,1);'];eval(str);
  9. str=['SHGy=' file '(:,2);'];eval(str);
  10. t=(-1000:0.1:1000);% fs
  11. Dt=13; % fs
  12. Dw=0.441/Dt*2*pi;
  13. c=0.3; %micron/fs
  14. lambda0=0.795; %lunghezza d'onda centrale in micron
  15. w0=2*pi*c/lambda0;%pulsazione centrale in fs^-1
  16. kk=1;
  17. w=(w0-w0/kk:1e-4*2*pi:w0+w0/kk);% fs^-1
  18. nn=find(Ls<0.6);spec=spec-mean(spec(nn));spec=spec/max(spec);
  19. specI=interp1(c./Ls*2*pi,spec,w,'linear',0);
  20. specI2=exp(-4*log(2)*(w-w0).^2/Dw^2);
  21. figure(1)
  22. plot(w,specI,'.',w,specI2,'.')
  23. L=0; %micron
  24. % %silica
  25. n0=1.453;%indice di rifrazione
  26. d1nl=-0.01728;%derivata prima di n in lambda micron^-1
  27. d2nl=0.03988; %derivata seconda di n in lambda micron^-2
  28. d3nl=-0.2388; %derivata terza di n in lambda micron^-3
  29. % % BK7
  30. % n0=1.511;%indice di rifrazione
  31. % d1nl=-0.01456;%derivata prima di n in lambda micron^-1
  32. % d2nl=0.05589; %derivata seconda di n in lambda micron^-2
  33. % d3nl=-0.2877; %derivata terza di n in lambda micron^-3
  34. % % CaF2
  35. % n0=1.4306;
  36. % d1nl=-0.0104;
  37. % d2nl=0.0304;
  38. % d3nl=-0.1662;
  39. % % Calcite ordinario
  40. % n0=1.6488;
  41. % d1nl=-0.031048300320746;
  42. % d2nl=0.081657209660690;
  43. % d3nl=-0.476683581496218;
  44. % % Calcite straordinario
  45. % n0=1.481916136599520;
  46. % d1nl=-0.012620442731315;
  47. % d2nl=0.044786681918652;
  48. % d3nl=-0.232969865621158;
  49. %
  50. % % Benzene
  51. % n0=1.485267310086479;
  52. % d1nl=-0.029582350419277;
  53. % d2nl=0.115024263003249;
  54. % d3nl=-0.609046368893473;
  55. d1nw=-lambda0^2/2/pi/c*d1nl; %derivata prima indice di rifrazione in funzione di w fs^-1
  56. d2nw=lambda0^3/4/pi^2/c^2*(2*d1nl+lambda0*d2nl); %derivata seconta indice di rifrazione in funzione di w fs^-2
  57. d3nw=-lambda0^4/8/pi^3/c^3*(6*d1nl+6*lambda0*d2nl+lambda0^2*d3nl); %derivata terza indice di rifrazione in funzione di w fs^-3
  58. phi0=n0*w0*L/c;
  59. phi1=L/c*(n0+w0*d1nw);
  60. phi2=L/c*(2*d1nw+w0*d2nw);
  61. phi3=L/c*(3*d2nw+w0*d3nw);
  62. dim=length(w);
  63. A=sqrt(specI);
  64. y1=t*0;
  65. AA=w*0;
  66. phi=w*0;
  67. tic
  68. for i=1:1:dim
  69. phi(i)=0*phi0+0*phi1*(w(i)-w0)+phi2*(w(i)-w0).^2/2+phi3*(w(i)-w0).^3/6;
  70. y1=A(i)*cos(w(i)*t-phi(i))+y1;
  71. AA(i)=A(i);
  72. i
  73. end
  74. toc
  75. if 0
  76. pp=find(t>-300 & t<300);ss=y1(pp);
  77. nn=find(diff(ss)<=0);ss(nn)=0;
  78. mm=find(diff(ss)>0);ss(mm)=1;
  79. gg=find(diff(ss)>0);jj=diff(t(gg));
  80. plot(jj*2)
  81. end
  82. figure(2)
  83. plot(t,y1)
  84. shg1=4*xcorr(y1.^2,y1.^2)+1*(4*xcorr(y1.^3,y1)+4*xcorr(y1,y1.^3));
  85. dimt=length(t)-1;
  86. SHG1=shg1(dimt/2:dimt*3/2);
  87. % figure(2)
  88. % plot(t,SHG1/max(SHG1),t,exp(-4*log(2)*t.^2/(2^0.5*Dt)^2))
  89. % filtro
  90. A=fft(SHG1);
  91. cut=400;
  92. A(cut:end-cut)=SHG1(cut:end-cut)*0;
  93. SHG1filter=real(ifft(A));
  94. figure(3)
  95. % plot(t,SHG1/max(SHG1),t,SHG1filter/max(SHG1filter),SHGx,SHGy)
  96. % plot(t,SHG1/max(SHG1)*4.5,t,SHG1filter/max(SHG1filter),'k',SHGx-0.1,SHGy,'r');xlim([-400 400])
  97. plot(t,SHG1filter/max(SHG1filter),'k',SHGx,SHGy,'r');xlim([-400 400])