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:

  1. estimate the real sample rate for each sensor (by dividing the received number of samples by a specific timespan)
  2. get the batches of the aviable samples from the FIFOs of all sensors
  3. 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
  4. 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?

  • $\begingroup$ Hm, that's an interesting question. So, yes, such systems are often already synchronized (or at least, their rate error is estimated) by hardware. Can I ask how (which link/format/system/...) you get the sensor samples into your system, and what that system is (a PC, a microcontroller, an FPGA, ASIC)? $\endgroup$ – Marcus Müller Sep 9 '17 at 9:08
  • $\begingroup$ The sensors cummunicate via SPI. The currently used system is a Raspberry PI 3. $\endgroup$ – Dominik K. Sep 11 '17 at 7:00
  • $\begingroup$ So the sensors are spi masters? Trying to figure it how you get sample rate estimates in the first place! $\endgroup$ – Marcus Müller Sep 11 '17 at 17:54
  • $\begingroup$ Sorry for the late replay, I was on a conference the last days. The Sensors are SPI slaves.If one sensor deliveres 1500 samples per second we simply estimate the real data output rate of the sensor to be 1500 Hz. So simply number of samples devided by time. $\endgroup$ – Dominik K. Sep 15 '17 at 14:06
  • $\begingroup$ I'm at a conference's last day myself – which conference have you been? So, the sensor's sampling clocks are independent from the SPI transactions? Can you link me to sensor datasheets? $\endgroup$ – Marcus Müller Sep 15 '17 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.