Code covered by the BSD License
-
[e f_e G P]=zzb(s,n1,n2, f_s,...
calculates the modified Ziv-Zakai lower bound for time delay estimation.
-
[x_max y_max A]=crit_interp_p...
-
delay=delayest_3point(u2,u1,m...
delay=delayest_3point(u2,u1,method,estimator,parameter);
-
delay=delayest_fft(y,u);
delay=delayest_fft(y,u);
-
delayest_iterative(u2,u1,N_i_...
-
x=rand_white(N);
-
y=fft_circshift(u,d)
y=fft_circshift(u,d)
-
y=fourier_series(Y,t);
-
compare_delay_methods_6_03.m
-
simple_example.m
-
View all files
from
Subsample Delay Estimation
by Travis Wiens
Demonstrates a number of methods of estimating the delay between two signals to subsample accuracy.
|
| delay=delayest_fft(y,u); |
function delay=delayest_fft(y,u);
%delay=delayest_fft(y,u);
%Estimates the delay between row vectors y and u.
%Assumes periodic signals and an even fft size
Y=fft(y);
U=fft(u);
XC=Y.*conj(U);%periodic cross correlation
xc=ifft(XC);
[xc_max idx]=max(xc);%find peak of xcorr
d_int=idx-1;%delay (integer)
N_p=numel(y);%number of points
N_2=N_p/2-1;%number of valid points
phi_shift_int=-d_int*pi*2/N_p*(1:(N_2));
W=abs(XC(2:(N_p/2)));%weight
%phi=unwrap(angle(XC(2:(N_p/2))))-phi_shift_int;
phi=mod(angle(XC(2:(N_p/2)))-phi_shift_int+pi,2*pi)-pi;%alternate method (faster)
d_frac=-(sum((1:(N_2)).*phi.*W.^2)/sum(((1:(N_2)).*W).^2))*(N_p/2)/pi;%fractional delay
delay=d_int+d_frac;
|
|
Contact us at files@mathworks.com