Situation: I try to synchronize the data streams of multiple sensors (ADXL372) of the same type but with different data output rates. The data sheet states all sensors should have the same sampling rate but in reality they differ with up to +- 10%.
My initial idea which is nearly completely implemented is the following:
- estimate the real sample rate for each sensor (by dividing the received number of samples by a specific timespan)
- get the batches of the aviable samples from the FIFOs of all sensors
- calculate/estimate the real timestamps for these data samples of the batches by using the system clock of the master and the sensor specific estimated real data output rates
- interpolate via sinc interpolation at the desired timestamps (dependent on the desired nominal sampling rate)
This approach brings because of the batch-wise data arrival some nasty and quite complicated case-based reasoning with it.
My Question: Is there are more elegant and straight forward way to tackle this problem without using a hardware based sensor synchronization via interrupts?