Home > vbmeg > functions > tool_box > linear_connectome_dynamics_toolbox > make_Delta.m

make_Delta

PURPOSE ^

SYNOPSIS ^

function Delta = make_Delta(delaymat_ms, fs, cv, sd)

DESCRIPTION ^

 - Input
 delaymat_ms : delay mat in dmrifile (assume conduction velocity 6m/s and 27ms self
 delay)
 fs : sampling rate (Hz)
 - Optional Input
 cv : conduction velocity (m/s)
 sd : self delay (ms)

 - Output
 Delta : unit with time point  

 2015/10/13 O.Yamashita

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function Delta = make_Delta(delaymat_ms, fs, cv, sd)
0002 %
0003 % - Input
0004 % delaymat_ms : delay mat in dmrifile (assume conduction velocity 6m/s and 27ms self
0005 % delay)
0006 % fs : sampling rate (Hz)
0007 % - Optional Input
0008 % cv : conduction velocity (m/s)
0009 % sd : self delay (ms)
0010 %
0011 % - Output
0012 % Delta : unit with time point
0013 %
0014 % 2015/10/13 O.Yamashita
0015 
0016 sd0 = 27;
0017 cv0 = 6;  
0018 
0019 if nargin < 4
0020     sd = 27;
0021 end
0022 if nargin < 3
0023     cv = 6;
0024 end
0025 
0026 dt_ms = 1/fs * 1000; % ms
0027 
0028 if nargin < 3
0029     Delta = round(delaymat_ms / dt_ms);
0030 else
0031     
0032     ix = find(delaymat_ms ~= 0); 
0033     distmat = zeros(size(delaymat_ms));
0034     distmat(ix) = (delaymat_ms(ix) - sd0) * cv0*1e-3; % m
0035     
0036     delaymat_ms1 = distmat / cv * 1e3; % ms
0037     delaymat_ms1(ix) = delaymat_ms1(ix) + sd;
0038     Delta = round(delaymat_ms1 / dt_ms);  %
0039     Delta = sparse(Delta);
0040 
0041 end
0042 
0043 
0044     
0045     
0046 
0047 
0048 
0049

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005