When removing jitter from a signal that's accurate over the long term,
we can do better than just averaging. By letting a counter run (e.g.
from the oscillator we're trying to discipline) and latching it with the
1 PPS signal, we get the number of oscillations that have occurred from
one second to the next. One approach would be to simply average up a
bunch of these and say that's the best answer. But if we don't clear
the counter after each 1PPS latching signal - if we just let the counter
continue running upwards, then we can use least squares to solve for the
*slope* of the line. Over any given time period that least squares slope
solution will give a significantly better result than averaging alone.
Try it if you don't believe it.