1

I synchronized two sensors regarding this method. Afterwards I logged the raw data and checked the peaks. The synchronization seems to work at the beginning but it starts to drift rapidly by time. I tried 13 Hz, 26 Hz and 25Hz. The drift gets worser when asking for higher sample rates. Also I checked the timestamps and estimated the sample rates. For one sensor the sample rate is not constant (e.g. for 52Hz it varies between 50 and 51 Hz). One sensor is always "faster" than the other one.

Is there a method to synchronize them?

Thank you in advance

riethmue
  • 73
  • 7

1 Answers1

1

The link in the question you linked contains the following:

Since especially the IMU unit (Acc/Gyro/Magn) sampling is timed by the LSM6DSL's internal RC oscillator, the diff of timestamps can vary and the real samplerate is +-10% of the nominal given in the subscription parameter. The ECG samples are accurate since that chip uses the clock signal from the stable oscillator

So the samples will drift due to the limitation of the IMU sensor hardware.

To mitigate that the measurement API's include the crystal stabilized timestamps which enable the synchronization of the data streams from different sensors:

  • At simplest it could be so that you'd skip a sample from the stream that is behind the other by more than a sample length. This method causes timing jitter of the samples but is simple to implement.
  • A more complex way is to re-sample both streams and picking the samples using the interpolated values based on timestamps.

Full disclosure: I work for the Movesense team

PetriL
  • 1,211
  • 1
  • 7
  • 11
  • Hi, thank you for your prompt reply. I will check what is suitable for me. Unfortunatly I got another issue with synchronizing timestamps: I'm using the xamarin for movesense wrapper for synchronizing two sensors. I implemented this like: 1] SetTimeAsync() on every sensor 2] GetTimeDetailled() and calculate time of last sensor reset in utc like: deviceStartUtcTimeMs = deviceUtcTime / 1000 - relativeTime 3] for every imu data update calculate timestamp based on utc start time of sensor and current relative timestamp 4] match timestamps of both sensors. – riethmue Jan 07 '20 at 09:43
  • But this does not work everytime. One sensor is 20-30 samples ahead depending on the sample rate. Is there something I'm doing wrong? – riethmue Jan 07 '20 at 09:45
  • 1
    When doing requests to the sensor after the firmware has been updated, the first time takes considerably longer than the next ones due to fetching of request metadata. It is a good idea to make more than one PUT if you need the smallest possible error in timing as well as try to estimate the roundtrip time by GET:ing the /Time/Detailed and comparing to the phone UTC time. – PetriL Mar 04 '20 at 11:37