delay_estim

Accurate fractionnal delay estimation between two signals

Calling sequence

dt = delay_estim(x0, x1)

Parameters

x0:

first signal

x1:

second signal

dt:

fractionnal delay, in samples

Description

This function will try to estimate accurately the delay between two signals (sub-sample accuracy). The method consists in (see detail in the reference below): (1) standard coarse delay estimation (based on the correlation of the two signals), (2) line fitting of the residual phase (in the frequency domain) after coarse alignment of the 2 signals.

Example

// Test function
function x=f(t)
x = sin(2*%pi*t*10);
endfunction
;
fs  = 1000;         // Sampling rate
delay = 0.4;        // Delay between the 2 signals, in samples
t = (0:(1/fs):1)';  // Time vector
x1 = f(t);          // Signal n░=1
x2 = f(t-delay/fs); // Signal n░=2, delayed by 0.4 sample
;
// Test delay estimation
d = delay_estim(x1,x2);
printf("True delay = %f, detected delay = %f.\nError = %e.\n", delay, d, d - delay);


See also

Bibliography

Subsample time delay estimations based on weighted straight line fitting to cross-spectrum phase, Y. BAI, 2010, http://www.tech-ex.com/article_images3/7/484637/34.pdf