align_timestamps

Align vectors of timestamps measured by two different clocks, using the Needleman-Wunsch algorithm.
140 Downloads
Updated 2 Sep 2015

View License

a and b are timestamps, a subset of which denote the same events measured by clocks A and B, not synchronized with each other, and may drift linearly with respect to each other. There can be spurious events or imprecise timestamping. The Needleman-Wunsch algorithm is applied on the difference of the timestamp vectors. If the difference vectors are within a specified threshold of each other, it is considered a match. Matching timestamps are fitted by a line to reveal the offset between the two clocks, and the clock drift. Timestamps from A can now be shifted to approximate timestamps in B as:
bTs = aTs + polyval(offset.p,aTs,offset.S,offset.mu);

Cite As

Manu Madhav (2024). align_timestamps (https://www.mathworks.com/matlabcentral/fileexchange/52819-align_timestamps), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Clocks and Timers in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0