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.
|
| [x_max y_max A]=crit_interp_p(y,x)
|
function [x_max y_max A]=crit_interp_p(y,x)
%[x_max y_max A]=crit_interp_p(y,x)
%fits a parabola to three points: y=[y(x(1)) y(x(2)) y(x(3))].
%Returns the position (x_max) and value (y_max) of the
%interpolated critical point (peak or trough).
%If x is omitted, it is assumed to be [-1 0 1]
%y=A(1)*x.^2+A(2)*x+A(3)
% Copyright Travis Wiens 2009 travis.mlfx@nutaksas.com
if nargin<2
x=[-1 0 1];
end
a = (x(3) * (y(2) - y(1)) + x(2) * (y(1) - y(3)) + x(1) * (y(3) - y(2)));
b = (x(3)*x(3) * (y(1) - y(2)) + x(2)*x(2) * (y(3) - y(1)) + x(1)*x(1) * (y(2) - y(3)));
x_max=-b/(2*a);%critical point position
if nargout>1
d = (x(1) - x(2)) * (x(1) - x(3)) * (x(2) - x(3));%denominator
c = (x(2) * x(3) * (x(2) - x(3)) * y(1) + x(3) * x(1) * (x(3) - x(1)) * y(2) + x(1) * x(2) * (x(1) - x(2)) * y(3));
y_max=c/d-b^2/(4*a*d);%critical point value
end
if nargout>2
A=[a b c]./d;%parabola coefficients
end
|
|
Contact us at files@mathworks.com