0001 function Delta = make_Delta(delaymat_ms, fs, cv, sd)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
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;
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;
0035
0036 delaymat_ms1 = distmat / cv * 1e3;
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