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.

118 lines
2.7 KiB

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