### Clock Models

A clock can be modeled by the following equation:

Where

*C*(

*t*) is the local time shown by the clock at time instant

*t*,

*f* is the instantaneous frequency of the clock’s time base and

is the nominal time-base frequency. A clock is called accurate if

*C*(

*t*)=

*t*. The difference between the clock value and the real time

*C*(

*t*)−

*t* is called clock offset.

Digital clocks use hardware (usually quartz) oscillators as time bases, and digital counters to approximate the integrator. Ideally, the counter *c*(*t*) is incremented by one in every second, so the local time of a digital clock is

where

*c*(

*t*_{0})=0.

The frequency of the clock is , which should ideally be exactly one, while the real time-base frequency is , which ideally should be equal to . The frequency of real clocks somewhat differs from the nominal frequency. This phenomenon is called drift and defined as

or in terms of the time-base frequency

If the drift value is -1 then the clock is stopped, for values smaller than -1 the clock is going backwards. Thus a reasonable assumption for real clocks is

for all

*t*.

If the drift is known to be bounded by

then bounds for measured time differences can be calculated. If two events occur at

*t*_{a} and

*t*_{b}, and the corresponding measured local time instants are

*C*(

*t*_{a}) and

*C*(

*t*_{b}), respectively, where

*t*_{a} <

*t*_{b} then, taking into account the drift of the clock, the following bound can be calculated for the time difference:

Since digital clocks change their values at discrete time instants, an important property called time resolution must be introduced. Time resolution is the smallest time difference the clock can represent, which is obviously . Thus, a higher clock frequency provides higher resolution.

Drift in clocks using quartz oscillators results from several sources, the most important ones being manufacturing inaccuracies, temperature changes and ageing. The drift of commonly used, inexpensive quartz oscillators is around 10-100 ppm (parts per million). This means that in case of a 10ppm crystal, the clock will drift 1 second in 100.000 seconds, i.e. almost 28 hours. The time resolution of a clock using a 32 kHz crystal is 30.5 microseconds, while if a 4MHz crystal is used then the resolution is 0.25 microseconds.