Overview
This page will discuss an efficient arbitrary precision fractional time synchronization technique. The algorithm computes the fractional offset between two similar discrete real waveforms via post-processing.
Setup
Suppose that we have two discrete real waveforms and
, which represent two separate noisy samplings of the same source waveform. Assume that there exists a fractional offset (sampling time offset smaller than the sampling interval) between
and
.
Algorithm
The first step involves continuously interpolating the waveforms and
such that
and
. One possible choice for the interpolator is the cubic spline interpolator, which connects the discrete sample points smoothly with a sequence of piecewise cubic polynomials. The corresponding set of piecewise cubic polynomial coefficients can be efficiently computed via the tridiagonal matrix algorithm (also known as Thomas algorithm) in linear time with respect to the length of the waveforms
. The values of the interpolators
and
will be defined to be
if
or
.
Next, pick a sufficiently large window size and consider the windowed cross-correlation:
The maximizer of the windowed cross-correlation corresponds to the fractional offset. In other words, the fractional offset can be retrieved by computing:
The value of can be numerically approximated via summation combined with Horner’s method for faster polynomial evaluation:
There is a slightly more complicated, but more efficient, way of evaluating that also eliminates the approximation error. Note that
and
are chains of 3rd order polynomials, which imply that
is a chain of 6th order polynomial. Therefore,
can be viewed as a chain of 7th order polynomial evaluations, which can be efficiently computed individually via Horner’s method and summed to give the exact value of the integral.
The key observation to make is that should exhibit a symmetric convex-like behavior around the optimum amenable to the log-time optimization algorithm such as binary search. For improved stability, the search method could be replaced with an “N-ary” search, such that each iterative step involves the evaluation of N candidate interim optimum. Either method will allow the optimum to be searched in logarithmic time with respect to the precision.
Leave a comment