summaryrefslogtreecommitdiff
path: root/xmds2/Nlevels_with_doppler_with_z_4wm/pp_I2.m
blob: 45d49130dce896ee1c9cfcaf7b05afd953b60349 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Nlevels_no_dopler_with_z_4wm

%% field propagation
z_1=z_1*100; % z in cm
t_1=t_1*1e6; % time now measured in uS
figure(1)
%set(gca,'fontsize',20); 
imagesc(z_1, t_1, I2_out_1); colorbar
tmin=-0.4;
tmax= 0.4;
ylim([tmin,tmax],'manual');	
xlabel('z (cm)')
ylabel('t (uS)')
zlabel('I_2')
title('I_2')

xskip=1;
yskip=10;
%map2dat('I2.dat',z_1,t_1, I2_out_1, xskip, yskip);



print('-color','-depsc2', '-tight', '-S200,120', 'fields_propagation_I2.eps')



%% fields before and after the cell
figure(2)
%set(gca,'fontsize',30); 
plot( ...
	t_1,I2_out_1(:,1),'.-;before;', "linewidth", 4,  ...
	t_1,I2_out_1(:,end), '-;after;', "linewidth", 4 ...
	)
xlabel('t (uS)')
ylabel('I_2 (1/s)^2')
title('I_2 before and after cell')
legend('location', 'southwest');

[b, a]=butter(3, 0.05);
I2_out_after=I2_out_1(:,end);
I2_out_after_filtered=filtfilt(b,a,I2_out_after);
settling_time=0.8; %uS
t_good_indx=t_1> min(t_1 + settling_time);
[m,max_pos_before]=max(I2_out_1(t_good_indx,1) ); [m,max_pos_after]=max(I2_out_after_filtered(t_good_indx));
delay_time=t_1(max_pos_after)-t_1(max_pos_before);
printf('Second field delay time  = %f uS\n',delay_time);

%set(gca,'fontsize',40); 
%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts
print('-color','-depsc2', '-tight','-S200,120', 'fields_before_after_cell_I2.eps')

figure(4)
I2_max_in=max(I2_out_1(t_good_indx,1));
I2_max_out=max(I2_out_1(t_good_indx,end));
I2_in_norm=(I2_out_1(:,1))/I2_max_in;
I2_out_norm=(I2_out_1(:,end))/I2_max_out;
tmin=-0.05;
tmax=0.05;
indx=(t_1>=tmin & t_1<=tmax);  % soom in in time to this region
plot( ...
	t_1(indx),I2_in_norm(indx),'.-;before;', "linewidth", 4,  ...
	t_1(indx),I2_out_norm(indx), '-;after;', "linewidth", 4 ...
	)
legend('location', 'southeast');
xlim([tmin,tmax],'manual');	
xlabel('t (uS)')
ylabel('I_2')
title('I_2 before and after cell normalized')
%set (gcf,'paperposition',[0.5 0 2.5,1.5]); % IMPORTANT to shrink eps size for readable fonts
print('-color','-depsc2', '-tight','-S200,120', 'probe_before_after_cell_I2_normalized.eps')