Commit Graph

2 Commits (bbe634d790cff73d28046f1946cdd9a1481686f8)

Author SHA1 Message Date
Miroslav Lichvar 61de819d56 Include clock rate ratio in delay calculation.
With the new linreg servo the frequency offset and time offset are
controlled separately. The ratio between master's frequency and the
current frequency of the local clock is known and can be used when
calculating delay or peer delay to improve their accuracy.

This greatly improves the stability of the delay when the servo is
correcting a large offset.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2014-03-14 09:52:40 +01:00
Miroslav Lichvar a5890cbe98 Add an adaptive servo based on linear regression.
This servo uses linear regression to estimate current time and
frequency error. The number of points used in the regression is
variable (from 4 to 64 in powers of 2) and is selected by a long-term
statistic of the prediction error.

Future improvements could include tracking of sudden frequency changes
(e.g. due to temperature variations), better stability of the error
statistic when a large offset is corrected, options to set the speed of
the adaptation, minimum and maximum number of points, or an option to
prefer frequency accuracy over time accuracy.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
2014-03-14 09:52:40 +01:00