source: ETALON/reconstruction/c123/together.m @ 751

Last change on this file since 751 was 260, checked in by hodnevuc, 9 years ago

scripts for c2 and matlab comparison

File size: 1.7 KB
Line 
1close all
2clear all
3
4Np=3
5
6[Profile,~]=PR_func(Np, 1,1);
7aFT=abs(fft(Profile));
8samp=[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];
11SFr=sort(samp);
12SP=unique(round(2100.*SFr./max(25.6459)));%ACHTUNG!!! remove same points
13SS=aFT(SP);
14
15[RSP,ISP]=SRf(SP,SS);
16rho=ISP(1:2000)';
17angl2=(imag(hilbert(log(abs([rho; flip(rho)])))));
18% angl2=-KK_phase(rho')';
19angl=angl2(1:end/2);
20t0=-0.2;
21step=0.005;
22profH=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]));
23prof2=2*sum(profH);
24lm=prof2>=0;
25% plot((t0+step*(0:999)),prof2./sum(prof2(lm)),'linew',2)
26plot((t0+step*(0:999)),prof2./max(prof2(lm)),'linew',2)
27
28fileID = fopen(['../data/profile' num2str(Np) '.txt'],'r');
29A=fscanf(fileID,'%f %f');
30fclose(fileID);
31prof=A(2:2:end);
32hold on
33lm=prof>=0;
34plot((t0+step*(0:999)),prof./max(prof(lm)),'r','linew',2)
35set(gca,'fontsize',14)
36title('Profile')
37xlabel('Time, [ps]')
38legend('matlab','cauchy2')
39grid on
40ylabel('Intensity')
41RPH=fliplr(real((ifft([rho; flip(rho)].*exp(1i.*(-angl2))))));
42RPHIn=RPH(1:1000);
43lm=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
Note: See TracBrowser for help on using the repository browser.