We address accurate timestamping of sensor data when no external clock input is available. We first empirically model the sampling frequency of an inertial measurement unit (ICM-42688-P) as a function of temperature. Using linear regression, we obtain a linear model with a very high R^2. Pure model-based timestamping reduces local noise but accumulates drift over time. To overcome this, we implement a one-dimensional linear Kalman filter that fuses the model prediction with reference clock measurements. The resulting procedure drastically reduces local noise (the standard deviation of consecutive timestamp differences drops by roughly three orders of magnitude) while keeping the long-term deviation from the reference clock bounded. The approach generalizes to other sensors lacking an external time reference.
|