[time-nuts] Re: Timestamping counter techniques : phase computation question

Bob kb8tq kb8tq at n1k.org
Mon Jan 31 16:04:36 UTC 2022


HI

> On Jan 31, 2022, at 10:23 AM, Erik Kaashoek <erik at kaashoek.com> wrote:
> 
> There was a small error in my previous post
> 
> Here are the complete and corrected numbers
> Below table shows:
> 
> Event counter(Y) : The exact count of events since the start of the counter captured at the time of the event.
> Clock Counter(X) : The clock cycles since the start of the counter captured at the time of the event
> Calculated clock count: Calculated Y at time of event using the outcome of a linear regression using 20 captured (X,Y) pairs starting from the time of the event
> Wrapped event phase: as the Clock runs at a frequency different from the events the calculated clock count is converted to the event frequency and wrapped between 0 and 1 to see the variation in the phase
> 
> The event and clock periods where constant. As the event period is a factor 20 longer than the clock period the phase resolution without regression would have been 0.05. With the interpolation over 20 captures it is at least a factor 2 better, consistent with the calculated accuracy improvement using a regression.
> In the actual implementation the regression can run on up to 100000 captures per second measurement time
> 
> Any feedback?

Mostly a lot of questions:

What is the overall objective? What does the system do, what does it need to do?

Are the two clocks independent from each other or do they share a common source?
I’m guessing they are independent. 

What are the stability / noise characteristics of the clocks (and the events)? 

Any math you do needs to consider the characteristics of the clocks. If you don’t 
do that, you can easily head down this or that rabbit hole. 

One example: 

If you simply dump a few hundred samples and only look at wide spaced points, 
you do improve resolution. It may well be that the stability of the clocks at some 
wide spacing actually does not support anything more exotic than this. 

Bob


> 
> 
> Event Counter(Y)    Clock Counter(X)    Calculated clock count Wrapped event phase
> 280687207    1693025665    1693025665.303    0.061080
> 280688207    1693046999    1693046998.727    0.065341
> 280689207    1693068332    1693068331.970    0.061080
> 280690207    1693089665    1693089665.303    0.061080
> 280691207    1693110999    1693110998.727    0.065341
> 280692207    1693132332    1693132331.970    0.061080
> 280693207    1693153665    1693153665.303    0.061080
> 280694207    1693174999    1693174998.700    0.064056
> 280695207    1693196332    1693196331.947    0.059997
> 280696207    1693217665    1693217665.339    0.062770
> 280697207    1693238999    1693238998.732    0.065544
> 280698207    1693260332    1693260332.029    0.063852
> 280699207    1693281665    1693281665.326    0.062161
> 280700207    1693302999    1693302998.719    0.064935
> 280701207    1693324332    1693324332.016    0.063244
> 280702207    1693345665    1693345665.313    0.061553
> 280703207    1693366999    1693366998.706    0.064326
> 280704207    1693388332    1693388332.003    0.062635
> 280705207    1693409665    1693409665.382    0.064800
> 280706207    1693430999    1693430998.762    0.066964
> 280707207    1693452332    1693452332.046    0.064664
> 280708207    1693473665    1693473665.330    0.062364
> 280709207    1693494999    1693494998.710    0.064529
> 280710207    1693516332    1693516331.994    0.062229
> 280711207    1693537665    1693537665.278    0.059929
> 280712207    1693558999    1693558998.658    0.062094
> 280713207    1693580332    1693580331.942    0.059794
> 280714206    1693601644    1693601643.893    0.057494
> 280715207    1693622999    1693622998.543    0.056683
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com -- To unsubscribe send an email to time-nuts-leave at lists.febo.com
> To unsubscribe, go to and follow the instructions there.




More information about the Time-nuts_lists.febo.com mailing list