From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: how to analyze clock drift References: <87bno4gnuz.fsf@debian.uxu> <87k32s3ppt.fsf@debian.uxu> <87sihf32kr.fsf@adaheads.sparre-andersen.dk> <87fvdeet0q.fsf@debian.uxu> Date: Thu, 20 Nov 2014 10:27:34 -0600 Message-ID: <85a93lon0p.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) Cancel-Lock: sha1:cHBva3KnxEZVHGxctHP7dYV57Bs= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 11cc6546e1678e3fb833030464 X-Received-Bytes: 1831 X-Received-Body-CRC: 55400156 Xref: news.eternal-september.org comp.lang.ada:23570 Date: 2014-11-20T10:27:34-06:00 List-Id: Emanuel Berg writes: > Jacob Sparre Andersen writes: > >> Try to subtract a linear fit and plot the result. >> There may be a short-term systematic pattern, but >> over longer time, it looks like you have a slowly, >> randomly drifting function. > > You mean, I should make a figure (graph) and then > learn from it by inspecting it? > > By "subtract a linear fit", do you mean I should > broadly visualize this as a linear function by some > smoothing-out filter even though the data of course > isn't a straight line? Just use a standard "linear fit" algorithm (http://en.wikipedia.org/wiki/Linear_regression, http://stephe-leake.org/ada/sal.html sal-math_double-linear_fit.ads) to fit the data to y_fit = mx + b, then plot y - y_fit. That will show the short term sawtooth, plus any longer term drift. The short term sawtooth is probably due to the way the software is using a hardware clock; the clock period doesn't quite divide the desired software period. -- -- Stephe