diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-09-06 16:50:32 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-09-06 16:50:32 -0400 |
commit | 1f2007bb3ce4a7afb2ad5f9aaea8ed0ea3435e9d (patch) | |
tree | 745d308dac0a0978cc0bb4b779443aaee528545b | |
parent | b0a11943ef4e44dd6fd1dd6d5972af900d94799e (diff) | |
download | Nresonances-1f2007bb3ce4a7afb2ad5f9aaea8ed0ea3435e9d.tar.gz Nresonances-1f2007bb3ce4a7afb2ad5f9aaea8ed0ea3435e9d.zip |
Added delay time calculation based on the peak position
Also time label shows uS
-rw-r--r-- | xmds2/Shahriar_system/pp.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmds2/Shahriar_system/pp.m b/xmds2/Shahriar_system/pp.m index 9dce990..38857cd 100644 --- a/xmds2/Shahriar_system/pp.m +++ b/xmds2/Shahriar_system/pp.m @@ -24,6 +24,10 @@ I1_out_after=I1_out_1(:,end); I1_out_after_filtered=filtfilt(b,a,I1_out_after); ampl=max(I1_out_1(:,1)); +[m,max_pos_before]=max(I1_out_1(:,1) ); [m,max_pos_after]=max(I1_out_after_filtered ); +delay_time=t_1(max_pos_after)-t_1(max_pos_before); +printf('delay time = %f uS\n',delay_time); + figure(2) subplot(1,2,1); plot( ... @@ -31,7 +35,7 @@ plot( ... % ,t_1,I1_out_1(:,end)/ampl, '-;after;' ... ,t_1,I1_out_after_filtered/ampl, '-;after smothed;' ... ) -xlabel('t') +xlabel('t (uS)') ylabel('I_1') title('I_1 propagation') subplot(1,2,2); @@ -39,7 +43,7 @@ plot( ... t_1,If_out_1(:,1),'-;before;', ... t_1,If_out_1(:,end), '-;after;' ... ) -xlabel('t') +xlabel('t (uS)') ylabel('I_f') title('I_f propagation') |