Brain not working today - maths expert needed.
Brain not working today - maths expert needed.
Author
Discussion

C0ffin D0dger

Original Poster:

3,440 posts

175 months

Monday 8th October 2018
quotequote all
Five year old daughter decided to get up at 01:30, climbed into our bed and promptly went back to sleep, I was however wide awake, took me ages to go back off to sleep (now in her bed). Brain no function today headache

I've been writing some software to correct the drift in a clock by comparing it with an accurate signal coming from a satellite network. That bit is sorted but what we also wanted to do was add in a check to ensure the the drift being measured is within an expected tolerance and if it isn't to signal that there could be something wrong with the hardware.

The inaccurate clock is specified at +/- 30 ppm (parts per million).

I can calculate the ppm easily enough as I have how many milliseconds we've been monitoring it for and how many milliseconds it has drifted by

i.e.

Total time 141902903 msec
Drift 1500 msec

ppm = (1000000 / total) * drift
= (1000000 / 141902903) * 1500
= 10.57

What I need to add is a determination of when the result should be accurate i.e. if a millisecond or two of drift is recorded early on the the result will exceed 30ppm but sometime later it won't

e.g. total 20000, drift 1,

ppm = (1000000 / 20000) * 1 = 50

but after another 10 seconds it with no further drift it would be 33.3 ppm, another 10 seconds 25ppm.

Can't think how to do this at the moment. I have something about statistical confidences in my head!?!

Pericoloso

44,044 posts

193 months

Monday 8th October 2018
quotequote all
3

steveatesh

5,365 posts

194 months

Monday 8th October 2018
quotequote all
Isn’t there an app for that? smile

BMWBen

4,906 posts

231 months

Monday 8th October 2018
quotequote all
Your calculation is correct and by the spec you've given the outcome (deciding that the drift is outside of tolerance) is correct as well.

You could change things so that you only check the drift every 1000000 data points... That would give you the answer you think you want.


Howard-

4,964 posts

232 months

Tuesday 9th October 2018
quotequote all
No idea, sorry.

SlimRick

2,277 posts

195 months

Tuesday 9th October 2018
quotequote all
Can't you just look at the clock on your iPhone like everyone else?

Jim1064

457 posts

235 months

Wednesday 10th October 2018
quotequote all
There is jitter - very short term variations, wander - medium term variations, and drift - variations over long timescales.

The boundary between these is somewhat vague. Which one is the most relevant depends on the specific purpose of that particular clock.

Silverbullet767

11,309 posts

236 months

Wednesday 10th October 2018
quotequote all
What ever you do for work, I don't want to do that.

chucklebutty

352 posts

273 months

Wednesday 10th October 2018
quotequote all
MiFID?