Line | |
---|
1 | figure(13) |
---|
2 | clf |
---|
3 | %%% Parameters |
---|
4 | for iprofile=[1 5 6] |
---|
5 | if (iprofile==1) |
---|
6 | pulse_len_ps=5 |
---|
7 | epsl=1 |
---|
8 | offset_gaussian=0 |
---|
9 | amplitude_correction=1 |
---|
10 | sigma_factor=1 |
---|
11 | elseif (iprofile==2) |
---|
12 | pulse_len_ps=2.9 |
---|
13 | epsl=1 |
---|
14 | offset_gaussian=-0.0029 |
---|
15 | amplitude_correction=0.6 |
---|
16 | sigma_factor=1.2 |
---|
17 | elseif (iprofile==3) |
---|
18 | pulse_len_ps=2 |
---|
19 | epsl=1 |
---|
20 | offset_gaussian=-0.004 |
---|
21 | amplitude_correction=0.8 |
---|
22 | sigma_factor=0.8 |
---|
23 | elseif (iprofile==4) |
---|
24 | pulse_len_ps=3.2 |
---|
25 | epsl=1 |
---|
26 | offset_gaussian=-0.00245 |
---|
27 | amplitude_correction=0.98 |
---|
28 | sigma_factor=1. |
---|
29 | elseif (iprofile==5) |
---|
30 | pulse_len_ps=2.6 |
---|
31 | epsl=1 |
---|
32 | offset_gaussian=-0.0027 |
---|
33 | amplitude_correction=0.8 |
---|
34 | sigma_factor=1. |
---|
35 | elseif (iprofile==6) |
---|
36 | pulse_len_ps=2. |
---|
37 | epsl=1 |
---|
38 | offset_gaussian=-0.0032 |
---|
39 | amplitude_correction=0.8 |
---|
40 | sigma_factor=1. |
---|
41 | end |
---|
42 | |
---|
43 | %%% Calcs |
---|
44 | sigma_t= pulse_len_ps/(sqrt(2*log(2))*(1+epsl))*1e-3; %The sigma of the leading edge ns |
---|
45 | sigma_D=sigma_t*sigma_factor |
---|
46 | nu=(1:1e+10:3e+16).*1e-9;%Ghz |
---|
47 | |
---|
48 | sigma_L= sigma_t*epsl; |
---|
49 | sigma_H= sigma_t; |
---|
50 | time=(1:(length(nu)*2))*(1/(length(nu)*2*(nu(2)-nu(1)))); |
---|
51 | xc=mean(time); |
---|
52 | G1=exp(-(time-xc).^2./(2*sigma_L^2)); |
---|
53 | G2=exp(-(time-xc).^2./(2*sigma_H^2)); |
---|
54 | G3=amplitude_correction*exp(-(time-xc+offset_gaussian).^2./(2*sigma_D^2)); |
---|
55 | G1nz=G1; |
---|
56 | G2nz=G2; |
---|
57 | G1(time>xc)=0; |
---|
58 | G2(time<xc)=0; |
---|
59 | |
---|
60 | %%% Dist |
---|
61 | ProfileG=(G1+G2)./sum(G1+G2); |
---|
62 | ProfileGG=(G1+G2+G3)./sum(G1+G2+G3); |
---|
63 | ProfileLN=(1./(time)).*exp(-(log(time-xc).^2)./(2*sigma_L^2)); |
---|
64 | timeL=time-xc; |
---|
65 | xl=-0.045; |
---|
66 | ProfileL=(1./(sigma_t)).*(sigma_t.^2)*(1./((timeL-xl).^2+sigma_t^2)); |
---|
67 | %ProfileLN=(1./((time*10+0.5))).*exp(-(log(((time*10+0.5))).^2)./(2*sigma_L^2)); |
---|
68 | figure(1) |
---|
69 | clf |
---|
70 | hold on |
---|
71 | plot(time,ProfileG,'r') |
---|
72 | plot(time,ProfileGG,'m') |
---|
73 | %plot(time,ProfileL,'g') |
---|
74 | %plot(time,ProfileLN,'g') |
---|
75 | |
---|
76 | figure(11) |
---|
77 | clf |
---|
78 | hold on |
---|
79 | plot(time,G1nz./sum(G1+G2),':r') |
---|
80 | plot(time,G2nz./sum(G1+G2),'--r') |
---|
81 | plot(time,ProfileG,'r') |
---|
82 | figure(111) |
---|
83 | clf |
---|
84 | plot(time,ProfileG,'r') |
---|
85 | %figure(12) |
---|
86 | %clf |
---|
87 | %plot(time,ProfileL,'g') |
---|
88 | figure(13) |
---|
89 | hold on |
---|
90 | if (iprofile==1) |
---|
91 | plot(time,ProfileGG,'g') |
---|
92 | else |
---|
93 | plot(time,ProfileGG,'r') |
---|
94 | end |
---|
95 | |
---|
96 | %FWHM |
---|
97 | FWHMG=time(find(ProfileG>(max(ProfileG)/2),1,'last'))-time(find(ProfileG>(max(ProfileG)/2),1,'first')) |
---|
98 | FWHMGG=time(find(ProfileGG>(max(ProfileGG)/2),1,'last'))-time(find(ProfileGG>(max(ProfileGG)/2),1,'first')) |
---|
99 | end %for |
---|
Note: See
TracBrowser
for help on using the repository browser.