# Frequency Ratio Circuit

I'm attempting to design a circuit that will determine the frequency ratio between a known reference frequency $$\f_\text{ref}\$$, and an unknown signal frequency $$\f_\text{sig}\$$. The signal frequency can vary dynamically between 1 GHz and 2 GHz. The goal is to use a reference frequency of about 100 MHz such that the frequency ratio can be easily represented with an eight bit counter.

My current thinking is to use a T-flip flop to create a gate signal from $$\f_\text{ref}\$$ such that the positive duration of the gate pulse equals the reference period. At that point there appear to be a couple of approaches that seem viable. The first is to AND the gate pulse derived from $$\f_\text{ref}\$$ with $$\f_\text{sig}\$$, then feed the output into a counter. This is a direct measure of the frequency ratio. The second option is to use the gate pulse as the enable signal into a counter. This is the approach I'm leaning towards. After determining the frequency ratio, I'd like to use this frequency ratio count to program the divider in a separate phase locked loop or direct digital synthesizer.

Ultimately I'm looking for help in finding a counter with the following capabilities. The first is the ability to accept a count enable that is driven by the gate pulse produced by the T-flip flop. Once the count is completed when the gate pulse goes low, I want to output the frequency count in the form of a binary output to program a separate divider before the gate pulse goes high again. It seem that a counter such as the 74HC590 with output registers would be a good candidate. But I'm also considering the benefits of using the timers of a microcontroller to compute the frequency ratio instead. It seems as using the microcontroller would make for a more efficient solution, as it could be used to compute the frequency ratio and then send the computed value to a PLL divider.

I hope my description of the problem is clear, and I would appreciate any insight on appropriate counters, or whether the microcontroller route is better.

• 74HC/74HCT is not going to operate at 1-2 GHz. You're going to need a prescaler specifically designed for that frequency range. And given that your gate signal is essentially asynchronous to the frequency being measured, you're going to have to think about synchronization issues (i.e., clock domain crossing). If it were me, I'd use a small FPGA for this. Oct 24, 2018 at 15:35
• I mostly agree with Dave, except I'd say that 2 GHz prescaling is definitely possible with off-the-shelf (P)ECL logic, not necessarily a part sold explicitly as a "prescaler". Oct 24, 2018 at 15:47
• I know this is not technically the question but I'd like to know what the parameters are for "vary dynamically between 1 GHz and 2 GHz". Are we talking a sweep, frequency hopping, power level etc. and how fast because this will impact the front end design as well as accuracy.
– isdi
Oct 24, 2018 at 15:57
• Thanks Dave, Photon, and Isdi. I'm primarily an RF/microwave and photonics guy with a solid DSP and circuits background, but I will admit that my practical FPGA knowledge is limited. I've had an interest in building up that background, so maybe this is a project that would provide the opportunity. Any example of the type of FPGA you'd recommend? Ultimately the design will be used in a radar system, so frequency sweeping and hopping are likely. Right now the parameters of the frequency dynamics, as well as the power levels, are still up in the air. Oct 24, 2018 at 16:43
• This will be much easier to build if you immediately go through a prescalar and chop down the frequency. If counting a divided input with a gate time produced from a reference divided to 10 MHz or 1 MHz would still give you frequent enough updates, that's going to be much easier to build than directly measuring the ratio between undivided signals. Also if prescaling you can consider using an MCU's built-in timer as your counter. Oct 24, 2018 at 20:08

Since you only want an integer multiple, as far as I can tell ("$$\12f_\text{ref} \le f_\text{sig}<13f_\text{ref}\,\rightarrow 12\$$"), what about simply using a cheap synthesizer IC that takes a reference oscillation, and produces multiples of that?

Use a microcontroller to program your synthesizer to generate 10, 11, 12, …, 19,20 × reference frequency.

Use that local oscillation to mix down your $$\f_\text{sig}\$$, and low-pass filter with a filter bandwidth of $$\\frac{f_\text{ref}}2\$$. If something passes through that filter, you know you've hit "close" to that local oscillator.

You can of course increase resolution by using smaller steps (synthesizers can also do things like 10.25545×$$\f_\text{ref}\$$), and narrower low-pass filtering.

By the way, what you're building with this is practically a spectrum analyzer :)

• Thanks for the feedback. This is actually an approach that I had considered also. So essentially what I would do here is vary the multiplier value until the mixed down frequency is close to zero then select that multiplier? What would be ideal is to essentially create a feedback loop similar to a PLL where the divider value is varied to create phase lock rather than the VCO frequency. Oct 24, 2018 at 20:01
• Pretty easy to do in digital domain with a microcontroller and modern synth IC – these take commands e.g. via SPI or I²C and have a pretty fine-grained raster of possible frequencies. You could do some kind of "narrowing down" by e.g. using a wide LPF to first find the 100 MHz swath in which your tone lies, then a more narrow filter to hunt down the actual frequency. Oct 24, 2018 at 20:06

How about converting to a square wave, detect the zero-crossing timings down to picosecond? using time-to-charge converter, digitize that using flash ADC with 1nS convert time to extract 8 bits, and do this for each of the zero crossings.

Then take the Fourier Transform.

• but that'd require a 100 MHz sampling rate, right? Not really microcontroller domain... Oct 24, 2018 at 17:57

If your circuit doesn't need to be integrated anywhere, the cheapest way to go is probably the SDR way these days:

just spend 10–20$on an RTL dongle, and 35$ on a raspberry pi, or use any other PC /laptop lying around.

Tune that (e.g. using GNU Radio) to 100 MHz and observe the frequency of your reference signal. Use the relative error to determine your RTL dongle's frequency standard's error. Then tune through e.g. 2 MHz wide steps from 1 GHz to 2 GHz, and use the same frequency detector logic to determine the $$\f_\text{sig}\$$. Correct that with the relative error measured at 100 MHz. Done.

• Most RTL-SDR modules do not cover the entire 1 - 2 GHz range. Technically it's an issue of the tuner chip not the SDR chip, but the readily available products use available tuners intended for consumer applications which tend to have limitations... Oct 24, 2018 at 19:55
• yep, that's true. Oct 24, 2018 at 20:04
• I hope to integrate it at some point. Oct 24, 2018 at 20:06

@analogsystemsrf's approach isn't bad at all:

convert to a square wave of known amplitude (i.e. amplify your $$\f_\text{sig}\$$ signal a lot and then clip).

Then filter with a known filter gain (e.g. a low pass with 10dB/frequency decade); measure power, and use that as frequency-proportional measure?

If your granularity is 100 MHz, this very coarse approach might work well enough, especially if you can calibrate.

• @analogsystemsrf: Is there an approach that would work using a frequency to voltage converter to convert both the measured signal and the reference signal into voltages and then compute the ratio from the voltage values? Oct 24, 2018 at 20:05
• well, yeah, what I describe is a frequency to voltage converter essentially, and certainly, it would work for both frequencies – but you'd want to use a larger V/Hz scale on the 100 MHz signal than on the 2 GHz signal, wouldn't you? So, you'd have some conversion factor for at least one of the voltages anyway, but that's just one more multiplication. Oct 24, 2018 at 20:09
• Examine the HP 5345 time-interval measurement unit. Handles 2 nanosecond time intervals leapsecond.com/hpan/an200-3.pdf If your frequency can be held constant, them simply!!! measure the duration of 10 cycles or 100 cycles. Oct 25, 2018 at 6:17