Skip to content

Commit

Permalink
screw around with sigma
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Dec 5, 2020
1 parent 2663566 commit 5802c61
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mlat/server/clocksync.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def __init__(self, base, peer):
self.i_relative_freq = base.clock.freq / peer.clock.freq
self.drift_max = base.clock.max_freq_error + peer.clock.max_freq_error
self.drift_max_delta = self.drift_max / 10.0
self.sigma = 3.5
self.outlier_threshold = self.sigma * math.sqrt(peer.clock.jitter ** 2 + base.clock.jitter ** 2)
self.outlier_threshold = 5 * math.sqrt(peer.clock.jitter ** 2 + base.clock.jitter ** 2) # 5 sigma

now = time.monotonic()
self.expiry = now + 90.0
Expand Down Expand Up @@ -143,7 +142,7 @@ def update(self, address, base_ts, peer_ts, base_interval, peer_interval, now):
prediction = self.predict_peer(base_ts)
prediction_error = (prediction - peer_ts) / self.peer_clock.freq

if abs(prediction_error) > self.outlier_threshold and abs(prediction_error) > self.error * self.sigma:
if abs(prediction_error) > self.outlier_threshold and abs(prediction_error) > self.error * 2.5 : # 2.5 sigma
self.outliers += 1
if self.outliers < 5:
# don't accept this one
Expand Down

0 comments on commit 5802c61

Please sign in to comment.