How accurate is a ripple counter (using D flip-flop) in measuring the frequency of a signal

counterfrequencyfrequency-measurementmeasurementripple-counter

I have two oscillating signals S1 and S2 whose periods are always different by a very tiny amount (~10-50ps). Can I use a D-flip-flop ripple-counter to measure S1 and S2 individually, and then subtract the 2 measurements to find out what is the delay difference between S1 and S2? If yes, how accurate would the computed delay difference be compared to the actual delay difference?

Best Answer

I think what you are looking for is a phase-frequency detector (PFD). These circuits are quite often used in phase-locked-loops (PLLs) for producing a "clean" reference signal that is locked-on to a fairly noisy (or modulated) input signal. The heart of the PFD can be shown in the logic diagram on the picture below (extract taken from here): -

enter image description here

The two outputs labelled "U" and "D" stand for up and down respectively and these two outputs can be combined with equal value resistors to produce an output voltage that represents the frequency/phase difference between two signals.

Wikipedia also provides some information about this type of circuit.

This Maxim article also shows how one can be implemented using D type flip-flops: -

enter image description here

How accurate would the computed delay difference be compared to the actual delay difference?

This is a difficult question to answer directly but I will say that PFD circuits, when used as the heart of a PLL, can achieve sub milli-hertz accuracy on locking an oscillator to an unknown input frequency of hundreds if not thousands of mega-hertz. Your two signals will begin in phase at some point and, due to the frequency difference between the two signals will drift to being completely out of phase - this will result in a cyclical output of the PFD which should be easily seen using an oscilloscope. Given that you then know how often the phases align, it is a trivial matter to compute what the average phase (or time delay) difference is per cycle.