commonlib
softsyncalgorithm.h File Reference

SoftSync algorithm is a tool for software synchronization between two independent clock sources. More...

#include <mutex>
#include "synchronization.h"
#include "softsyncbase.h"

Go to the source code of this file.

Classes

class  SoftSyncAlgorithm
 

Detailed Description

SoftSync algorithm is a tool for software synchronization between two independent clock sources.

Author
David Zobavnik
Date
01/03/2018
Version
1.0

DESCRIPTION

Independent clock sources can have different starting time and count time at slightly different rates. This causes clock drift after some amount of time. In measurement we need to have all data points in same time domain. This means that we need transformation, which can calculate slave clock into time domain of master clock. That can be done through SoftSync algorithm by taking time periodically from both sources (master and slave clock) and calling function setDeviceTime(). This will calculate needed parameters for the transformation, which is done by calling readSystemTimeD(). Accuracy is around 10ms (depends on quality of clocks).

For best use, it is recommended that slave times are preprocessed, so that:

  • time of first slave sample starts with 0 (removing offset)
  • slave clock times should be a monotonic function, t(n+1) >= t(n)