1 | close all
|
---|
2 | clear all
|
---|
3 |
|
---|
4 | Np=3
|
---|
5 |
|
---|
6 | [Profile,~]=PR_func(Np, 1,1);
|
---|
7 | aFT=abs(fft(Profile));
|
---|
8 | samp=[25.6459, 16.7967, 12.0000, 9.1188, 7.2608, 6.0000, 5.1123, 4.4709, 4.0000, 3.6523, 0.6795,...
|
---|
9 | 3.3974, 5.1292, 3.3593, 2.4000, 1.8238, 1.4522, 1.2000, 1.0225, 0.8942, 0.8000, 0.7305,...
|
---|
10 | 0.8549, 0.5599, 0.4000, 0.3040, 0.2420, 0.2000, 0.1704, 0.1490, 0.1333, 0.1217, 0.1132];
|
---|
11 | SFr=sort(samp);
|
---|
12 | SP=unique(round(2100.*SFr./max(25.6459)));%ACHTUNG!!! remove same points
|
---|
13 | SS=aFT(SP);
|
---|
14 |
|
---|
15 | [RSP,ISP]=SRf(SP,SS);
|
---|
16 | rho=ISP(1:2000)';
|
---|
17 | angl2=(imag(hilbert(log(abs([rho; flip(rho)])))));
|
---|
18 | % angl2=-KK_phase(rho')';
|
---|
19 | angl=angl2(1:end/2);
|
---|
20 | t0=-0.2;
|
---|
21 | step=0.005;
|
---|
22 | profH=repmat(rho,[1,1000]).*cos(2*pi*repmat((1:2000)'*(25.6459/2100),[1,1000]).*repmat((t0+step*(0:999)),[length(rho),1])-repmat(angl,[1,1000]));
|
---|
23 | prof2=2*sum(profH);
|
---|
24 | lm=prof2>=0;
|
---|
25 | % plot((t0+step*(0:999)),prof2./sum(prof2(lm)),'linew',2)
|
---|
26 | plot((t0+step*(0:999)),prof2./max(prof2(lm)),'linew',2)
|
---|
27 |
|
---|
28 | fileID = fopen(['../data/profile' num2str(Np) '.txt'],'r');
|
---|
29 | A=fscanf(fileID,'%f %f');
|
---|
30 | fclose(fileID);
|
---|
31 | prof=A(2:2:end);
|
---|
32 | hold on
|
---|
33 | lm=prof>=0;
|
---|
34 | plot((t0+step*(0:999)),prof./max(prof(lm)),'r','linew',2)
|
---|
35 | set(gca,'fontsize',14)
|
---|
36 | title('Profile')
|
---|
37 | xlabel('Time, [ps]')
|
---|
38 | legend('matlab','cauchy2')
|
---|
39 | grid on
|
---|
40 | ylabel('Intensity')
|
---|
41 | RPH=fliplr(real((ifft([rho; flip(rho)].*exp(1i.*(-angl2))))));
|
---|
42 | RPHIn=RPH(1:1000);
|
---|
43 | lm=RPHIn>=0;
|
---|
44 | % plot((t0+step*(0:999)),circshift(RPHIn./sum(RPHIn(lm)),[1 40]),'g','linew',2)
|
---|
45 | % plot((t0+step*(0:999)),circshift(RPHIn./max(RPHIn(lm)),[1 1]),'g','linew',2)
|
---|
46 | % plot(t0+step*(0:999),RPHIn,'g','linew',2)
|
---|
47 | % figure(123)
|
---|
48 | % plot(RPH)
|
---|
49 |
|
---|