# Timenuttery for Beginners, Part 3

## It started with a radio clock

For no particular reason except to my own entertainment, I built yet another radio clock: ## But how accurate is it?

One can do frequency difference measurements using a few components and common lab equipment: Part 1

One can do frequency difference measurements using a small homebrew device: Part 2

Now that I've done a rather complex way to add an offset frequency and multiply the input frequencies using PLL circuits and I/Q mixers, which was quite interesting, what about a simple and rather straightforward way?

### Another device to measure frequency difference

Consider mixing the input frequencies directly, no multiplication or offset frequencies involved. I'd have to deal directly with small differences in the frequencies that would result in small changes in the direct mixer output voltages. So DC offsets and ADC resolution would be a concern. If the diagram doesn't show up, try this link.

I didn't use the double balanced mixers, simple XOR gates can do the same for you. It's an "all digital I/Q mixer" design. The input signals enter through a simple HC14 (Schmitt Trigger) gate to a quadrature output divider by 4. It's just two D-Flip-Flop connected in a clever way, so they output a zero degrees and a ninety degrees signal at the same frequency. For each input, these I and Q signals get mixed with the R input signal. It's called reference, but just consider it as a third input of the same significance as input 1 and 2. All three input signals must be the same nominal value, no offset involved.

The XOR gates act as mixers. They can output "1" or "0" only, rather a square wave than a sine wave. So at the output of the low pass filters one gets a triangle wave, not a sine wave. Having I and Q mixers, there's two triangle waves, phase shifted by 90 degrees. The amplitude of the triangle waves is just "full scale" of the supply voltage - so using the common supply voltage as the reference voltage for the ADCs, one gets a ratiometric result, ranging from (analog) zero ("0") to analog full scale ("1") at the digital side.

Just chose one of the triangle waves (they're badly non-linear at the range ends, but nice in the middle), feed it to a derivative function and there's the frequency difference result. No mangling with DC offsets required, the derivative function eliminates this. No adjustment of full scale required, as this is "0" and "1" by the ratiometric measurement. Just use a good low noise and high resolution ADC - AD7793.

Finally, the device measures and logs the difference of Input 1 to Input R, and Input 2 to Input R. So I can do two difference measurements in one run. It works, and its performance is somewhat better than device #1, from Part 2.

### The DMTD way

Dual Mixer Time Difference - that's what you'll probably find if you go searching for precision reference frequency stability measurements.

So I went down this way, too.

### XOR mixer DMTD

This is what made its way from the DMTD excursion into my second frequency difference measurement device: If the diagram doesn't show up, try this link.

I've simply added the few components to the board, and some additional firmware.

The microcontroller does the frequency and time difference measurements, a rather easy job for a recent micro. Anyway, this device still requires an offset reference frequency at Input R. So one has to set up an external oscillator, which is kind of inconvenient.

### Add OCXO, PPS input and DDS

Basically, this integrates a GPSDO into the device to self-supply the 10MHz and (10MHz + 100Hz) reference frequencies required for the difference measurements. If the diagram doesn't show up, try this link.

More components and stuff was added to the board to make it complete:
Back 