Timenuttery for Beginners, Part 1

How to measure the accuracy of your clock


It started with a radio clock

For no particular reason except my own entertainment, I built yet another radio clock:

But how accurate is it?

Frequency Standards

The radio clock has a 10MHz reference frequency output. This is more or less directly derived from its internal 10MHz TCXO, there's a PLL that locks this oscillator to the 77.5kHz carrier frequency. One wants to compare this frequency to some other 10MHz reference. 10MHz Frequency Standards are available in different flavours, for example:

GPSDO (GPS disciplined oscillator):
Circuit Valley GPSDO

Rubidium frequency standard ("Atomic Clock"):

Use a frequency counter

Luckily, this frequency counter has an external reference input. So you connect the GPSDO to the external reference and the radio clock to its input.


Surprise ... even with 10s gate time, this counter just shows 10.000000MHz bang on, no difference visible except some spurious flickers to 9.999999MHz. The frequency difference is less than the resolution of this counter, so nothing gained here. At least I'm assured the frequency counter works correctly with the external reference applied.

But how to see if the frequencies are different?

Watch it drifting on your oscilloscope

This is a rather simple setup: Connect the two 10MHz references you want to compare to two channels of an oscilloscope. Set the trigger to one of the both and watch the other one drifting. Using a stopwatch, one can determine how fast it moves, and do the math to find the frequency difference. Works for a limited range of frequency difference, it's either moving too fast or boring to watch.

Here's an example of using an analog storage scope in persistence mode:


So I can see it drifting over time as the frequencies are not equal. Quite as to be expected.

More visualization and increasing the resolution

So it's the frequency difference I want to see? And a Frequency Mixer does what? Its about time to involve some heavy TE and a smallish component:

The general idea is:

Feed the reference frequency into that signal generator and set its output to an integer multiple of this reference, e.g. 100MHz or 1GHz. As the signal generator is synchronized to its reference input, the ouput frequency will exactly follow the reference, multiplied by a factor of 10 or 100. Not only the reference frequency will be multiplied, but the small deviations from the nominal value, too. So if your 10MHz reference is off by 0.001Hz, the signal generator output will be off by 0.01Hz or 0.1Hz (for 100MHz or 1GHz output, respectively).

Now use a second signal generator to multiply the other reference frequency by the same factor. This results in two frequencies of 100MHz or 1GHz that carry the difference frequency of the references to compare, multiplied by a factor of 10 or 100.

Feed these two signals into a frequency mixer: The mixer will do its job and output the difference (f1 - f2) and the sum (f1 + f2) of these frequencies. I'm not interested in the addition of the two frequencies, it'll be 200MHz or 2Ghz, but rather in the difference. As the frequencies differ by a small amount, this will be a low frequency, near DC. It's quite simple to filter this very low frequency from the very high sum frequency.

So, assuming the nominal reference frequency as "f", and the small deviations from its nominal value as "d1" and "d2", while the signal generators are set to 1GHz output (times 100 multiplication), one can do the math:

  • Reference 1 outputs "f+d1"
  • Reference 2 outputs "f+d2"
  • Signal generator 1 outputs "(f+d1)*100"
  • Signal generator 2 outputs "(f+d2)*100"
  • The frequency mixer outputs (low pass filtered) "(f+d1)*100 - (f+d2)*100", which can be reduced to "(d1-d2)*100"
  • So the final result at the frequency mixer output is 100 times the difference frequency of the references.

    I've built this small contraption, basically a double balanced frequency mixer (aka diode ring mixer), a low pass filter, an amplifier and a comparator. The amplifier outputs the analog difference frequency, while the comparator can be used to feed a frequency counter.

    Set the signal generators to 1GHz with their reference inputs fed from the GPSDO and the radio clock.

    Feed their output in said mixer contraption and watch the result using an oscilloscope:

    The output signal has a frequency of 0.52Hz, which is 100 times the difference frequency of the references. So by a simple calculation, I do know for that particular moment the radio clock is 0.0052Hz off the GPSDO.

    One can do this the other way round, too: Use the fine frequency setting of the signal generators to produce a "line" (kind of) on the oscilloscope screen, and read the frequency difference from the signal generators setting.

    One more moment in time that the deviation of the radio clock to the GPSDO is known: 0.0035Hz.

    Still a bit inconvenient, isn't it? So one might want to have a direct readout of the difference frequency. Not a big deal, just do the frequency mixer math again: Use an additional offset frequency "o" (e.g. 100Hz), added to the setting of one signal generator.

  • Reference 1 outputs "f+d1"
  • Reference 2 outputs "f+d2"
  • Signal generator 1 outputs "(f+d1+o)*100"
  • Signal generator 2 outputs "(f+d2)*100"
  • The frequency mixer outputs (low pass filtered) "(f+d1+o)*100 - (f+d2)*100", which can be reduced to "(d1-d2+o)*100"
  • Feeding this frequency into the counter, it'll read the difference frequency multiplied by 100 plus the offset frequency of 100Hz. As the counter is a reciprocal counter (random link to explain the concept of a reciprocal counter), it'll show the 100Hz measurement on 8 digits, leaving enough significant digits to read out the frequency difference result.

    So the result is:

  • Subtract 100 from the counter reading: 0.19422
  • Divide by 100: 0.0019422Hz
  • So with some boat anchors, a frequency mixer and a simple calculation a boring 8 digit frequency counter can be turned into a high resolution frequency difference measurement unit.

    Advanced visualization

    What about this device: Two way quadrature power splitter?

    Using one of these and two mixers, I can mix the frequency difference down to DC and have two signals that are 90 degrees shifted in phase. Using an oscilloscope in X-Y mode, this draws nice circles.

    Depending on the amount of difference, the dot runs around in circles faster or slower, and changes direction if the frequency difference is negative or positive. For zero difference, there's just a dot visible, the postion on the circle depends on the phase difference of the references.

    This I/Q (in-phase / quadrature) frequency mixing stuff looks interesting? Yes, finally that got me to design this Frequency Difference Measurement contraption:

    Back ... und ein Zaehlpixel hab ich auch :-)