GB2365634A - Determining the offset between a local clock and a remote clock - Google Patents

Determining the offset between a local clock and a remote clock Download PDF

Info

Publication number
GB2365634A
GB2365634A GB0019239A GB0019239A GB2365634A GB 2365634 A GB2365634 A GB 2365634A GB 0019239 A GB0019239 A GB 0019239A GB 0019239 A GB0019239 A GB 0019239A GB 2365634 A GB2365634 A GB 2365634A
Authority
GB
United Kingdom
Prior art keywords
clock
offset
local
window
remote
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB0019239A
Other versions
GB0019239D0 (en
GB2365634B (en
Inventor
Jonathan Diggins
Christopher David Ridley
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Snell Advanced Media Ltd
Original Assignee
Snell and Wilcox Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Snell and Wilcox Ltd filed Critical Snell and Wilcox Ltd
Priority to GB0019239A priority Critical patent/GB2365634B/en
Publication of GB0019239D0 publication Critical patent/GB0019239D0/en
Priority to PCT/GB2001/003532 priority patent/WO2002013430A2/en
Priority to AU2001276520A priority patent/AU2001276520A1/en
Publication of GB2365634A publication Critical patent/GB2365634A/en
Application granted granted Critical
Publication of GB2365634B publication Critical patent/GB2365634B/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation

Abstract

In determining the offset between a local clock and a remote clock where remote clock values are received recurrently, a succession of pairs of local and remote clock values are used to construct a model of the relationship between the local and remote clock values. The model is typically constructed from a second (or greater) order polynomial of the clock values.

Description

2365634 CLOCK ANALYSIS This invention relates to the analysis of the
behaviour of two independent clocks and, in a particular aspect, to the measurement of the offset between them.
There are many known systems which employ counter clocks separated by a network. Typically time measurements made on a remote clock are passed to a local clock, as part of the information being transmitted over the network.
It is usually desirable in such situations to monitor the offset between the clocks, as a warning or diagnostic tool for networks in which clock error intolerance is an issue, or for use in clock synchronisation.
The traditional approach to synchronizing counter clocks separated by a network and sampled discretely is to employ a phase-locked loop (PILL). An instructive example is the synchronization of clocks used in an MPEG system. In a PLL the local or 'slave' clock is adjusted every time a sample of the remote or & master' clock is received, so that the local clock agrees with the remote one. On receipt of a sample, the error between the count of the local clock and the count of the remote clock gives a measure of the frequency offset between the two.
In the MPEG system, the samples or program-clock-reference (PCR) values carry the 27MHz pulse count of the remote clock, and are inserted into the transport stream at intervals which are usually quasi-periodic, or randomly spaced in time, subject to the minimum inter-sample spacing being very much greater than the period of either clock. The maximum separation between PCR samples allowed under the MPEG specification is 1 00ms although in practice, it is usual to encounter programs where the PCR values are separated by just under 40ms.
This sampling rate is extremely slow relative to the rate of the 27MHz (nominal) clock from which the samples are taken.
In addition to the irregular spacing, the samples of the remote clock pulse count may only be known to integer precision so that they contain quantisation noise. The samples may also include fluctuations over a range of frequencies arising from imperfections in both the remote clock itself and any network or link over which the samples have been transmitted.
When a sample of the remote clock arrives, the error between the count of the local clock and the count of the remote clock gives a measure of the frequency offset. This is however an instantaneous offset that contains contributions from the linear (or "d.c.") offset between the clocks caused by the disparity in sampling rates, and also from the low frequency wander, and high frequency jitter fluctuations, possibly together with aliased components. It is therefore not possible with a single PLL to determine directly and reliably the precise nature of the offset 5 between remote and local clocks.
It is hence an object of the present invention to provide a simple and reliable method of measuring the frequency offset between a local and a remote clock which addresses the problems outlined above, and which determines the offset faster and more accurately than known methods.
Accordingly, the present invention consists in one aspect in a method of determining the offset between a local clock and a remote clock where remote clock values are received recurrently, comprising using a succession of pairs of local and remote clock values to construct a model of the relationship between the local and remote clock values.
Suitably, the pairs of clock values comprise a remote clock value and the local clock value when the remote clock value is received.
Advantageously, the model is constructed from an at least second order polynomial of the clock values.
The invention will now be described by way of example, with reference to the accompanying figure which is a diagram illustrating an application of the invention to MPEG-2 encoding and decoding.
A specific use for this invention concerns the synchronisation of the encoderldecoder clocks at either end of an MPEG transport stream. In this situation, the encoder clock represents the remote clock and the decoder represents the local one. It is usual to synchronise the decoder clock with the encoder clock by means of a phase locked loop in which the feedback path is controlled by the PCR values decoded from the transport stream.
According to one embodiment, the local clock is extremely stable with a fundamental frequency of 27MHz and serves as a measurement reference. The pulse count of the remote clock however is only known at times when a PCR sample is received in the bitstream. The local clock is sampled every time a PCR sample arrives in the bitstream. This local PCR value, and the PCR value recovered from the bitstream constitute an x,y pair, and these pairs are recorded as time progresses.
The present invention provides methods for measuring both the linear and non-linear components of the offset. A particularly effective method for measuring the linear offset component, as will be described here, is to perform a 1east squares" fit to these samples. It will be recognised that, of course, other modelling 5 methods may be used.
To estimate the linear, or "d.c." offset between the two clocks a straight line fit to the samples is performed using a window width which is typically of the order of an hour. This provides a very reliable estimate of the true d.c. offset between the clocks, smoothing out "short- term" variations down to as low as a fraction of a milli-Hertz. Although the width of the measurement window used here is of this order, the algorithm provides the first estimate of the d.c. offset on receipt of the second PCR sample, with successive estimates for each new PCR arriving. A very good practical estimate of the d.c. offset is achieved within only a few seconds.
It should be noted that the time window widths suggested here are purely for demonstrative purposes and the methods are in no way restricted to the values stated.
Straightforward linear regression yields the 'best fit' straight line parameters m and c where Y + c. The d.c. offset between the two clocks is related to the gradient m by, Fd, 1) x F,, (1) where FO is the fundamental frequency of the local reference clock. The general expression for calculating the gradient is, M4i - AjAJ M 4 2 1 (2) MA j - (A j 3 Where M is the number of sample pairs in the window over which the fit is made, and the Al are given by, A i=j+M i - Xj A j = i=j+M 2 1 (X 3 Y (Xi - Xj) i=j+1 i=j+1 i=j+M i=j+M AJ Aj = (x j - x 2 1 Gi - Yj) 4 jxyi Yj) i=j+1 i=j+1 (3) Components xj and yj are subtracted from each element in these accumulators such that the origin of the curve fit is shifted to the coordinate (xjyj).
This does not affect the calculation of gradient, m, but is important from a practical viewpoint because it reduces the bit width required to hold the accumulators. Using a typical window width of an hour these accumulators require a bit width in excess of 100 bits - even with the shift of origin - and the accumulation is preferably performed in 128 bit arithmetic. Note that a new value of m is obtained 10 for every new data point.
As the window rolls forward, new data pairs are included in the window, and old data pairs drop out of the trailing edge. For efficient real time operation the summations are not re-calculated every time a PCR value arrives. Instead, points can be added and removed (together with the required shift in origin) in the 15 following way. Adding a new point requires the operations:
AJ + = (xnew - Xj A' +=(xnew - X 2 1 3 j) A' + = (Yn - Yj) A' + = (x XiXYn - Yj) 2 4 new then (4) M+=1 Where the index, j, indicates that the origin of the window is at data pointjj. 20 To subtract the oldest point from the window, _ M(Xj+1 _Xj)2 _.2(Xj+1 _Xj)AJA M(x.+1 -X,) A3j 1 M(Yj+1 -yj) Al+1 1 4 - MXj+1 -XiXyi+1 -yj) - (Xj+1 -xi),+ - (Yj+1 -yj),c then M-1 (5) Where the index, j + 1, indicates that the origin of the window has been shifted forward to the data pointj + 1. On receipt of a PCR sample, the Ai are calculated. From these the value of m can be determined from equation (2) and thus the value of Fjc can be calculated from equation(l).
It should be noted that it is of course possible to employ the method by recalculating the summations for every PCR value received, though greater resources may be required here.
Figure 1 shows an example of the output of the algorithm when fed with PC1Rs from a clock with a d.c. offset of 100Hz, and indicates the rapid convergence of the algorithm.
In estimating the non-linear, or "a.c." offset, an effective modelling technique is to fit a quadratic curve to the points using a window of around 30 seconds. This picks out local low frequency variations in the sampled data where such harmonics have a quadratic form over the measurement window. This method is extremely effective at identifying low frequency drift. However, other methods of modelling are of course possible.
Fitting a second order polynomial to a set of sample pairs involves determining the coefficients ao, a,, and a2 of the curve, y=ao +alx+a2 (X_Xj)2 (6) where xj is the value of the smallest x coordinate in the window, spanned by the fit. Once the coefficients ai are known, the Instantaneous Frequency Offset (IFO) can be found from, IFO = (-1 + a, + 2a21X - xj 1) x F.
(7) The ai are, 5 (MC j -(B j) 2 XP iF J. - D J. C j)+ (B iE.1. - (Ci.) 2 IA iB j - MD j) a2 (B iE j _ (C j)2 XC iB j ME j)+ (B iG j - E jC j MC j (B j) 2 MD A 1 B -1 + a2 (C B (MC j (B j 2 ao =_1 (Ai - a,Bi a2 C j m (8) where M is the number of sample pairs in the window over which the fit is made,and 10 Ai = i=j+ E j = j=j+M -xj llyi - Yj) y (xi j=j+1 i=j+1 Bi = i=j+ - Xj Fi = i=j+M - Xj Iixi 1 (xi (Yi Yj) i=j+1 i=j+1 C j = i=j+M i -Xj G j = i=j+m - Xj 1 (X y (X i=j+1 i=j+1 Di = i= j+ Xj IIX Yj) i=j+1 (9) As with the linear offset example above, components xj and yj are subtracted from each element in these accumulators such that the origin of the curve fit is shifted to the coordinate (xjy) in order to reduce the bit width required to hold the accumulators. For this quadratic curve fitting the measurement window is smaller than that discussed regarding the d.c. offset, but the cubic and quartic terms required in the above accumulators again mean that use of 128 bit arithmetic is preferable Adding a new point requires the operations: 5 Ai + = Gnew - Yj Ei + = (Xnew xj Bi + = (Xnew xi F j + = (Xnew xi (Ynew - Yj Cj+=(Xnew -X j)2 Gi + = (XneWxj Di + = (Xnew - Xj XYnew Yj) then M+ = 1 (10) Subtracting the oldest point from the window requires the operations: 10 Aj+1 = Ai M(yj+1 - yj) Bj+1 = Bj M(xj,, - xj) Cj+1 = Cj M(Xj'I _Xj)2 - 2(xj,l - xj)Bj+1 Di+' = Di M(xj+1 Xj)(yj+I - yj) - (xj+1 - xj)Aj+1 - (yj+1 - yj)Bj+1 Ej+1 = Ei M(xj+1 xj)' 3(xj,l _ Xj)2 Bi+' - 3(xj+1 -xj)Cj+' Fi+' = Fi (Xj, _Xj)2 (M(yj+1 -yj)+Ai+') - (yj+i -YjCj+1 +2(xj+1 -xj)Bj+1) -2(xj+1 -xj)Ej+1 Gi+' = Gi M(Xj+1 _ Xj)4 - 4(xj+1 _ Xj)3 Bi+' - 6(xj+1 _ Xj)2 Cj+1 - 4(xj+ 1 -xj)Ej+1 then On receipt of a PCR sample, Aj toGj are calculated by the addition and (if appropriate) the removal of sample points as described above. The polynomial coefficients coefficients ao, a,, and a2 are determined from equations (6) and thus the value of the IFO at any given point within the window of the fit can be calculated from equation(7). This means that - if desirable - the IFO can be resampled at regular intervals as the measurement window rolls forwards.
The width of the measurement window can be controlled in several ways.
The two most preferable here are performing a fit over either the N most recent sample pairs (fixed sample pair number), or over all sample pairs occurring in the previous M seconds (fixed window width). At the start of the measurement process, the width of the measurement window in the latter case is less than M seconds wide and until sufficient time has elapsed, all recorded data pairs are used to determine the fit. With the former case, all data pairs are used until N sample pairs have been accumulated after which the oldest one is dropped every time a new pair occur. In either case, the window over which the fit is performed 4 rolls'forward with time.
Tracking a window of the N most recent sample pairs is relatively straightforward. Sample pairs are simply stored in an array where the most recent data index wraps around continuously. Tracking a window of all sample pairs occurring in the previous M seconds is more difficult since there is not a fixed index difference between the first and fast entries. The method overcomes this problem in the following way.
A fixed length array is used to store the N most recent PCR samples. The value of N is made sufficiently large that the samples contained in it correspond to a time width which is likely to be greater than the desired window width in all but the most extreme of circumstances. An index counter is used to keep track of where the most recent data entry is, and this is incremented every time a new data point is saved to the array. This index loops modulo N so that each new point overwrites the oldest point in the array. Indices are then required that point to the next newest entry, the oldest entry within the desired window width, and the second oldest entry within the desired window width.
11k+7 Yk.7 Xk,a Yk's <- next newest entry Xk+9 Yk+9 <- newest entry Xk YA <- oldest entry Xk11 Yk+1 Xk+2 Yk2 Xk+3 Yk.) <- oldest entry in window Xk.' Yk.4 <- next oldest entry in window Xk.5 Yk.5 X,,' Yk+6 In the simplified example above, the window extends from entry (Xk+3,Yk+3) to (xk+9,yk+9). The most recent two sample pairs are staightforward to locate. Tracking the oldest two sample pairs in the window is done in the following way. On receipt of the first sample pair, an index counter, x, for tracking the location of the oldest sample pair in the array is assigned the value 0 (1't entry in the array). At this point, the width of the window is zero, and this is saved in a variable, w, say. On receipt of the subsequent sample pairs, the window width is updated as -lo- w += (LatestlocaIPCR - Previous local PCR) and the accumulators Al above are added to according to equations (3). Until w exceeds a specified 'goal', index n is not changed. When w does exceed the specified goal, a point is subtracted from the accumulators Al above according to equations (4), and index n is incremented (subsequent increments in n are of course performed modulo N). The actual window width is reduced as w (local PCR at n = 0 local PCR at n = 1) This shifts the origin of the window forward in time by one sample pair. If the value of w still exceeds the specified goal further points are removed using the above steps until the value is below the goal. In this way, the width of the window is always less than but close to the specified goal.
The particular embodiment described has many important advantages.
These include that:
the measurement of d.c and a.c. offset are not significantly affected by irregularities in the sampling interval and are robust against quantisation noise; the measurement of d.c and a.c. offset are robust against the presence of timing jitter; the determination of the d.c. part of the offset is not affected by the presence of low frequency drift between the two clocks; the determination of the a.c. part of the offset is not affected by the presence of a d.c. offset between the two clocks; the settling time of the algorithms is significantly faster than alternative approaches; and that the method helps to reduce the effect of aliasing of high frequency jitter components (arising from PCR under sampling) on frequency offset estimation.
It will be appreciated by those skilled in the art that the specific arrangements have been described by way of example only and a wide variety of alternative approaches can be adopted. For example, the invention has been described in relation to the MPEG-2 video standard, though the invention is equally applicable to other standards, and to other forms of information transfer.

Claims (3)

1. A method for determining the offset between a local clock and a remote clock where remote clock values are received recurrently, comprising using a succession of pairs of local and remote clock values to construct a model of the relationship between the local and remote clock values.
2. A method according to Claim 1, wherein the pairs of clock values comprise a remote clock value and the local clock value when the remote clock value is received.
3. A method according to Claim 1 or Claim 2, wherein the model is constructed from an at least second order polynomial of the clock values.
GB0019239A 2000-08-04 2000-08-04 Clock analysis Expired - Fee Related GB2365634B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
GB0019239A GB2365634B (en) 2000-08-04 2000-08-04 Clock analysis
PCT/GB2001/003532 WO2002013430A2 (en) 2000-08-04 2001-08-06 Clock analysis
AU2001276520A AU2001276520A1 (en) 2000-08-04 2001-08-06 Clock analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB0019239A GB2365634B (en) 2000-08-04 2000-08-04 Clock analysis

Publications (3)

Publication Number Publication Date
GB0019239D0 GB0019239D0 (en) 2000-09-27
GB2365634A true GB2365634A (en) 2002-02-20
GB2365634B GB2365634B (en) 2004-09-22

Family

ID=9897040

Family Applications (1)

Application Number Title Priority Date Filing Date
GB0019239A Expired - Fee Related GB2365634B (en) 2000-08-04 2000-08-04 Clock analysis

Country Status (3)

Country Link
AU (1) AU2001276520A1 (en)
GB (1) GB2365634B (en)
WO (1) WO2002013430A2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0229648D0 (en) * 2002-12-19 2003-01-22 Zarlink Semiconductor Ltd Method of and apparatus for recovering a reference clock
WO2007120089A1 (en) * 2006-04-13 2007-10-25 Telefonaktiebolaget Lm Ericsson (Publ) Network synchronisation supervision
EP2034642B1 (en) * 2007-09-07 2011-10-26 Siemens Aktiengesellschaft Method for transmitting synchronisation messages in a communications network
GB2454936B (en) 2007-11-23 2012-09-19 Ubiquisys Ltd Oscillator calibration
CN114845377B (en) * 2022-05-05 2024-02-23 中南大学 UWB-based high-precision wireless clock synchronization method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2128824A (en) * 1982-10-06 1984-05-02 Standard Telephones Cables Ltd Clock pulse generation circuit
GB2255480A (en) * 1991-04-23 1992-11-04 Motorola Israel Ltd A data demodulator
EP0624892A1 (en) * 1993-05-10 1994-11-17 Schneider Electric Sa Remote control interrupter equipped with a delayed switching system
US5521927A (en) * 1994-12-13 1996-05-28 Electronics And Telecommunications Research Institute Elementary stream packetizing unit for MPEG-2 system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0697774A1 (en) * 1994-08-15 1996-02-21 Hewlett-Packard Company Clock offset estimation
US5883924A (en) * 1996-04-12 1999-03-16 Hewlett Packard Company Method and apparatus for PCR jitter measurement in an MPEG-2 transport stream using sliding window
US6175604B1 (en) * 1998-07-27 2001-01-16 Raffaele Noro Clock synchronization over data transmission networks
JP4698107B2 (en) * 1999-11-26 2011-06-08 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Improved Bayes-Kalman time estimation apparatus and method
FI108489B (en) * 1999-12-30 2002-01-31 Nokia Corp Synchronization in a packet-switched communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2128824A (en) * 1982-10-06 1984-05-02 Standard Telephones Cables Ltd Clock pulse generation circuit
GB2255480A (en) * 1991-04-23 1992-11-04 Motorola Israel Ltd A data demodulator
EP0624892A1 (en) * 1993-05-10 1994-11-17 Schneider Electric Sa Remote control interrupter equipped with a delayed switching system
US5521927A (en) * 1994-12-13 1996-05-28 Electronics And Telecommunications Research Institute Elementary stream packetizing unit for MPEG-2 system

Also Published As

Publication number Publication date
GB0019239D0 (en) 2000-09-27
AU2001276520A1 (en) 2002-02-18
GB2365634B (en) 2004-09-22
WO2002013430A2 (en) 2002-02-14
WO2002013430A3 (en) 2002-08-29

Similar Documents

Publication Publication Date Title
EP1175109B1 (en) MPEG PCR jitter, frequency offset and drift rate measurements
US8483244B2 (en) Timing recovery over packet networks
US8644348B2 (en) Method for generating a robust timing correction in timing transfer systems
US7876791B2 (en) Synchronizing apparatus and method in packet network
US5844891A (en) Cell-based clock recovery device
US8599986B2 (en) Phase locked loop with optimal state feedback controller
US6208643B1 (en) Apparatus and method for analyzing bitstreams
EP2342850B1 (en) A method for synchronizing clocks in a communication network
RU2433559C2 (en) Using transmission time as means of increasing accuracy of simple network time protocol
KR101323956B1 (en) Methods and apparatus for unidirectional timing message transport over packet networks
CN101675614A (en) Method for synchronizing a clock of a network component with a clock of further network component and network component therefor
US7778173B2 (en) Clock recovery algorithm for remultiplexing MPEG-2 SPTSs and/or MPTSs in the presence of network jitter
US9395697B2 (en) Method and apparatus for calculating transmission delay across a network
US20180145863A1 (en) Methods and systems for determining optimal packets
JP2000131474A (en) Time synchronization system, satellite system and ground system applied thereto, time synchronization method and medium with recorded program for execution of method on computer
GB2365634A (en) Determining the offset between a local clock and a remote clock
US6148049A (en) Method for synchronization of a clock signal, which can be generated in a data receiving station, with a clock signal which is used in a data transmission station
CA2744253A1 (en) An apparatus and method for generating a timing signal
EP1330071B1 (en) System for network or sevice management for determining the synchronisation between two packet streams
US7176928B1 (en) Recovery of a serial bitstream clock at a receiver in serial-over-packet transport
US8089951B2 (en) Method of transferring timing information over packet network
US7684413B2 (en) System and method for rate agile adaptive clocking in a packet-based network
JPH11308203A (en) Clock reproduction system
US7738498B1 (en) Sharing a digital phase-locked loop across multiple packet streams
US20210328629A1 (en) Transmission apparatus, transmission time fluctuation compensation method, and non-transitory computer readable medium storing transmission time fluctuation compensation program

Legal Events

Date Code Title Description
732E Amendments to the register in respect of changes of name or changes affecting rights (sect. 32/1977)

Free format text: REGISTERED BETWEEN 20090903 AND 20090909

PCNP Patent ceased through non-payment of renewal fee

Effective date: 20110804