Skip to content
Electrical Measurements

Frequency and time measurement: counters, timebase and Allan variance

Direct counting and period counting, the plus or minus one count error, crossover frequency proved, reciprocal counters, timebase error, reference oscillators, Allan deviation, trigger error.

Frequency and time are the quantities measured with the highest accuracy of all: an atomic clock is off by less than a second in millions of years, and a laboratory counter reads ten or twelve significant digits. The reason is that counting is easy, and counting well is only a matter of having a good reference. In this lesson we look at the frequency counter and the period counter with their counting errors, the crossover between the two with its proof, the timebase error, reference oscillators and the Allan variance.

The direct-counting frequency meter

The principle is elementary: a gate is opened for an accurately known time T_g and the edges of the signal passing through are counted. If the signal has frequency f, the count is about N = f\,T_g, and the instrument displays N/T_g. The gate time is derived from an internal reference oscillator, by dividing its frequency.

Counting window of a frequency counter and two signals with the same period but different phase
The gate g stays open for the time T_g. Two signals with the same frequency but edges at different positions relative to the opening give 7 and 8 counts: this is the plus or minus one count error.

The gate is not synchronised with the signal, so depending on where the edges fall relative to the opening one edge more or one fewer is counted: this is the ±1 count error, and the relative error is

    \[ \frac{\Delta f}{f} = \pm\frac{1}{N} = \pm\frac{1}{f\,T_g} \]

Example. With T_g = 1 s, a 10 MHz signal is read with a resolution of 1 Hz, i.e. 10^{-7}; a 1 kHz signal with a resolution of 1 Hz, i.e. 0.1 %. Direct counting is excellent for high frequencies and poor for low ones.

The period counter

For low frequencies the scheme is reversed: the signal opens the gate for one period T = 1/f, and the pulses of the reference clock, of frequency f_c, are counted. The count is N = f_c\,T and the ±1 count error is now

    \[ \frac{\Delta T}{T} = \pm\frac{1}{f_c\,T} = \pm\frac{f}{f_c} \]

This time the error grows with frequency. With f_c = 10 MHz, a 1 kHz signal is measured with an error of 10^{-4}, a hundred times better than direct counting with a 1 s gate.

Theorem. Direct counting with gate T_g and the period counter with clock f_c have the same error at the frequency

    \[ f^* = \sqrt{\frac{f_c}{T_g}} \]

Below f^* the period counter is better, above it direct counting.

Proof. Equate the relative errors: 1/(f\,T_g) = f/f_c, i.e. f^2 = f_c/T_g. The first error decreases with f, the second increases, so to the left of the crossing point the second is smaller and to the right the first. ∎

With f_c = 10 MHz and T_g = 1 s, f^* \approx 3.2 kHz, where both are off by about 3\cdot 10^{-4}. Modern reciprocal counters remove the problem: they open the gate in sync with an edge of the signal, count the signal periods and the clock periods together, and compute the ratio. The resolution then depends only on the clock and on the measurement time, not on the frequency; with interpolation of the time between edges, resolutions of tens of picoseconds per measurement are reached.

The timebase error

The count is perfect to within one unit, but the gate time comes from the internal oscillator, which has its own error.

Theorem. If the reference frequency has a relative error \varepsilon, the measured frequency has the same relative error \varepsilon.

Proof. The gate time is obtained by counting M periods of the reference: T_g = M/f_{ref}. If the reference is f_{ref}(1 + \varepsilon), the gate lasts T_g/(1 + \varepsilon), N = f\,T_g/(1 + \varepsilon) edges are counted, and the instrument, which divides by the nominal T_g, displays f/(1 + \varepsilon) \approx f(1 - \varepsilon). The relative error has magnitude \varepsilon. The same holds for the period counter, where f_{ref} appears directly. ∎

So the timebase sets a limit that no gate time can beat. Typical choices are:

  • plain crystal (XO): 10^{-5}, varies a lot with temperature;
  • temperature-compensated crystal (TCXO): 10^{-6}, the one in many inexpensive instruments and in phones;
  • oven-controlled crystal (OCXO): 10^{-8} per year, with excellent short-term stability;
  • rubidium: 10^{-10} per year, a compact atomic clock;
  • GPS-disciplined oscillator (GPSDO): an OCXO or a rubidium continuously corrected by the satellite signals, which carry the time of caesium clocks, with an average error below 10^{-12}.

Laboratories distribute a common 10 MHz reference to all instruments, which have a dedicated input: in this way all the frequency measurements on the bench share the same accuracy.

Stability and the Allan variance

Accuracy says how far the mean frequency is from the nominal one; stability says how much the frequency fluctuates over time. To describe it the ordinary standard deviation is not used: oscillator noise contains low-frequency components (flicker noise and random walk) for which the standard deviation keeps growing with the measurement duration and does not converge. The Allan deviation is used instead: the mean relative frequencies \bar{y}_k are measured over consecutive intervals of duration \tau, and one computes

    \[ \sigma_y(\tau) = \sqrt{\frac{1}{2}\left\langle(\bar{y}_{k+1} - \bar{y}_k)^2\right\rangle} \]

i.e. only the difference between adjacent measurements is considered, which is insensitive to slow drifts. The plot of \sigma_y against \tau tells for which averaging time an oscillator is most stable: an OCXO reaches 10^{-12} around one second, then gets worse because of ageing; a hydrogen maser goes down to 10^{-15} in a day.

Time-interval measurements

A counter also measures the time between two events: an edge on one channel starts the count, an edge on the other stops it. Besides the quantisation error there is the trigger error: noise shifts the instant at which the signal crosses the threshold. Linearising the edge around the threshold, noise of RMS value \sigma_v on an edge with slope dv/dt produces a timing error

    \[ \sigma_t = \frac{\sigma_v}{dv/dt} \]

That is why the trigger is set at the steepest point of the edge and signals with fast edges are used: 1 mV of noise on a 1 V/ns edge shifts the instant by 1 ps, on a 1 V/µs edge by 1 ns. It is the same mechanism that produces jitter in digital systems and converters.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x