add_observation


Description:

public bool add_observation (ClockTime slave, ClockTime master, out double r_squared)

The time observation_external of the external or master clock and the time observation_internal of the internal or slave clock are added to the list of observations.

If enough observations are available, a linear regression algorithm is run on the observations and this is recalibrated.

If this functions returns true, r_squared will contain the correlation coefficient of the interpolation. A value of 1.0 means a perfect regression was performed. This value can be used to control the sampling frequency of the master and slave clocks.

Parameters:

this

a Clock

r_squared

a pointer to hold the result

observation_external

a time on the external clock

observation_internal

a time on the internal clock

Returns:

true if enough observations were added to run the regression algorithm.