"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:

>I'm doing NTP exchanges to determine my clock offset. I use this to
>adjust my clock frequency, but there's a lot of lag so I overshoot by

What do you mean "a lot of lag"?

>too much and it oscillates around the reference frequency. This is an

The time constants of the reference ntp are essentially a second order
critically damped system. Yours seems to be underdamped.

Why don't you just use the reference implimentation.

>audio clock so I have to do my own NTP stuff. I think I want to use a

Why do you have to do your own ntp stuff?

>phase lock loop as described in the NTP literature, but I'm confused
>by the terminology (and possibly the math) so I'm not sure what the
>inputs or outputs should be.

>If my reference clock is running at ~44100 Hz and through my NTP

I have no idea what you are describing here. What is your clock? A CD
spinning? Those frequencies are nowhere near PPM accuracy. 

>exchanges, I get an instantaneous offset of -20 Hz, I want to adjust

What in the world does this mean? 

>my clock to 44080 Hz, but no more than 5 Hz/sec (so it's not audible)
>and that instantaneous offset will likely change as it narrows in on
>the true frequency. The formula I've seen for NTP's PLL is:

>       y = (Vs*u) / (64Tc)^2

>I do NTP packet exchanges every 2 seconds so I think that resolves to:

>       y = (2*Vs) / 16384

>Is Vs the actual reference frequency estimate (44080 Hz in this case)?
>I'm not sure how I use the result of the equation to adjust the clock.

>I guess my question is that if I think my frequency is 44100 Hz and
>via an NTP exchange, I calculate I'm off by -20 Hz, how should I
>calculate what I should set my frequency to, to slowly sync to the
>reference frequency (no more than 5 Hz/sec) while also factoring in
>the previous clock offset estimate?

>The current scheme I'm using to simply set my clock to 44100-5 Hz
>(capping the -20 Hz offset to 5) every 2 seconds doesn't work very
>well because it's too slow to realize that the direction of the offset
>has changed because the absolute clock offset is still negative (e.g.
>went from -20 to -5, but it's still negative so it thinks it still
>needs to reduce the clock frequency when it should probably increase
>it or leave it the same).

I think maybe you need to be clearer in what it is that you are trying to
do.
ntp does not exchange frequencies. ntp exchanges time stamps. How do you
generate your time stamps? What is that "reference frequency"?


_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.org/mailman/listinfo/questions

Reply via email to