[ntp:questions] NTP phase lock loop inputs and outputs?

Unruh unruh-spam at physics.ubc.ca
Tue May 27 22:49:36 UTC 2008


"David L. Mills" <mills at udel.edu> writes:

>Bill,

>NIST doesn't agree with you. Only the first and last are truly 
>significant. Reference: Levine, J. Time synchronization over the 
>Internet using an adaptive frequency locked loop. IEEE Trans. UFFC, 
>46(4), 888-896, 1999.

Well, they may be operating under different assumptions (eg that the noise
is not dominated by independent phase errors) but if that assumption is
correct then the results are simple and correct. IF the errors are
dominated by 1/f noise, other assumptions may well apply, but in any case
using more than just the first and last will always help knock down the
phase noise. For n large, if I take the first and last to calculate the
slope, and then take the first and last and then the second and
penultimate, those two pieces of data are almost equivalent as far as their
frequency estimate and 1/f estimates are concerned, but clearly the random
phase errors in the various points are knocked down by using the two
estimates. I will try to get ahold of that article. Do you have any
suggestions as to an easy way to do so (eg on the net)?

Note that that paper is NOT by NIST, but by Judah Levine who happens
to work at NIST. That I sometimes disagree with you should not be taken to
mean that the University of British Columbia disagrees with you. 



>Dave

>Unruh wrote:

>> "David L. Mills" <mills at udel.edu> writes:
>> 
>> 
>>>Bill,
>> 
>> 
>>>Ahem. The first point I made was that least-squares doesn't help the 
>>>frequency estimate. The next point you made is that least-squares 
>>>improves the phase estimate. The last point you made is that phase noise 
>> 
>> 
>> No. The point I tried to make was the least squares improved the FREQUENCY 
>> estimate by sqrt(n/6) for large n, where n is the number of points (assumed
>> equally spaced) at which the phase is measured. I am sorry that the way I
>> phrased it could have been misunderstood.
>> 
>> 
>> The phase is ALSO improved proportional to sqrt(n)
>> . 
>> This assumes uncorrelated phase errors dominate the error budget. 
>> 
>> 
>> 
>> 
>>>is not important. Our points have been made and further discussion would 
>>>be boring.
>> 
>> 
>> Except you misunderstood my point. It may still be boring to you. 
>> 
>> 
>> 
>>>Dave
>> 
>> 
>>>Unruh wrote:
>>>
>>>>"David L. Mills" <mills at udel.edu> writes:
>>>>
>>>>
>>>>
>>>>>Bill,
>>>>
>>>>
>>>>>If you need only the frequency, least-squares doesn't help a lot; all 
>>>>>you need are the first and last points during the measurement interval. 
>>>>
>>>>
>>>>Well, no. If you have random phase noise, a least squares fit will improve
>>>>the above estimate by roughly sqrt(n/4) where n is the number of points.
>>>>That can be significant. It is certainly true that the end points have the
>>>>most weight ( which is why the factor of 1/4). Ie, if you have 64 points,
>>>>you are better by about a factor of 4 which is not insignificant. 
>>>>
>>>>
>>>>
>>>>>The NIST LOCKCLOCK and nptd FLL disciplines compute the frequency 
>>>>>directly and exponentially average successive intervals. The NTP 
>>>>>discipline is in fact a hybrid PLL/FLL where the PLL dominates below the 
>>>>>Allan intercept and FLL above it and also when started without a 
>>>>>frequency file. The trick is to separate the phase component from the 
>>>>>frequency component, which requires some delicate computations. This 
>>>>>allows the frequency to be accurately computed as above, yet allows a 
>>>>>phase correction during the measurement interval.
>>>>
>>>>
>>>>He of course is not interested in phase corrections. 
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Dave
>>>>
>>>>
>>>>>Unruh wrote:
>>>>>
>>>>>
>>>>>>David Woolley <david at ex.djwhome.demon.co.uk.invalid> writes:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Unruh wrote:
>>>>>>
>>>>>>
>>>>>>>>I do not understand this. You seem to be measuring the offsets, not the
>>>>>>>>frequencies. The offset is irrelevant. What you want to do is to measure
>>>>>>
>>>>>>
>>>>>>>Measuring phase error to control frequency is pretty much THE standard 
>>>>>>>way of doing it in modern electronics.  It's called a phase locked loop 
>>>>>>
>>>>>>
>>>>>>Sure. In the case of ntp you want to have zero phase error. ntp reduces the
>>>>>>phase error slowly by changing the frequency. This has the advantage that
>>>>>>the frequency error also gets reduced (slowly). He wants to reduce the
>>>>>>frequency error only. He does not give a damn about the phase error
>>>>>>apparently. Thus you do NOT want to reduce the frequecy error by attacking
>>>>>>the phase error. That is a slow way of doing it. You want to estimate the
>>>>>>frequency error directly. Now in his case he is doing so by measuring the
>>>>>>phase, so you need at least two phase measurements to estimate the
>>>>>>frequency error. But you do NOT want to reduce the frequency error by
>>>>>>reducing the phase error-- far too slow. 
>>>>>>
>>>>>>One way of reducing the frequency error is to use the ntp procedure but
>>>>>>applied to the frequency. But you must feed in an estimate of the frequecy
>>>>>>error. Anothr way is the chrony technique. -- collect phase points, do a
>>>>>>least squares fit to find the frequency, and then use that information to
>>>>>>drive the frequecy to zero. To reuse past data, also correct the prior
>>>>>>phase measurements by the change in frequency.
>>>>>>(t_{i-j}-=(t_{i}-t_{i-j}) df
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>(PLL) and it is getting difficult to find any piece of electrnics that 
>>>>>>>doesn't include one these days.  E.g. the typical digitally tuned radio 
>>>>>>
>>>>>>
>>>>>>A PLL is a dirt simply thing to impliment electronically. A few resistors
>>>>>>and capacitors. It however is a very simply Markovian process. There is far
>>>>>>more information in the data than that, and digititally it is easy to
>>>>>>impliment far more complex feedback loops than that.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>or TV has a crystal oscillator, which is divided down to the channel 
>>>>>>>spacing or a sub-multiple, and a configurable divider on the local 
>>>>>>>oscillator divides that down to the same frequency.  The resulting two 
>>>>>>>signals are then phase locked, by measuring the phase error on each 
>>>>>>>cycle, low pass filtering it, and using it to control the local 
>>>>>>>oscillator frequency, resulting in their matching in frequency, and 
>>>>>>>having some constant phase error.
>>>>>>
>>>>>>
>>>>>>>>the offset twice, and ask if the difference is constant or not. Ie, th
>>>>>>>>eoffset does not correspond to being off by 5Hz. 
>>>>>>
>>>>>>
>>>>>>>ntpd only uses this method on a cold start, to get the initial coarse 
>>>>>>>calibration.  Typical electronic implementations don't use it at all, 
>>>>>>>but either do a frequency sweep or simply open up the low pass filter, 
>>>>>>>to get initial lock.
>>>>>>
>>>>>>
>>>>>>And? You are claiming that that is efficient or easy? I would claim the
>>>>>>latter. And his requirements are NOT ntp's requirements. He does not care
>>>>>>about the phase errors. He is onlyconcerned about the frequency errors.
>>>>>>driving the frequency errors to zero by driving the phase errors to zero is
>>>>>>not a very efficient technique-- unless of course you want the phase errors
>>>>>>to be zero( as ntp does, and he does not). 
>>>>>>
>>>>>>
>>>>>>
>>>>>>




More information about the questions mailing list