# Can I input a square wave LO into a mixer?

I would like to downconvert a signal at 169.55MHz (10khz bandwidth) into an IF of 20.4MHz. For that purpose, I need a local oscillator of 149.15MHz or 189.95MHz.

But... of course, I cannot find a crystal at these frequencies (at least I think I don't have the budget for a custom Xtal. But I might be wrong on that point. I have no idea.) and I have to find another way.

I decided to try to generate one of my LO frequencies from a PLL. But most of the PLL have a CMOS or other kind of logic output, not sine waves. This is especially true when the output of the PLL IC is post scaled. This approach is convenient, because it's easy and low cost to design such a PLL with an integrated, high speed, VCO (such as the ADF4351). That VCO runs at frequencies around 1GHz, is divided and output using a logic driver (here differential at 0dBm).

My question is: can I inject the logic signal from the PLL at the input of my mixer? That signal has a lot of harmonics (only the odd harmonics, in theory.. right?) Or do I need to low pass filter that LO at the input of the mixer?

I have computed that none of the LO harmonics, mixed with the input signal (or harmonics of it) falls into my 20.4 IF band pass filter. But is it enough? Do I have to expect another issue related to this?

I would feel very confident to inject a "as clean as possible" sine into my mixer, but not a square wave...

• Most mixers work best with a square wave local oscillator. – Leon Heller Jan 22 '14 at 19:27
• The biggest issue is that the LO will contain harmonics, which the mixer will happily mix with the RF too. If you have done the frequency planning and none of those products cause problems, then you should be OK. However, why not just low pass filter the square wave from the LO a bit since that's cheap and easy to do. Mixers aren't always nice pure multipliers without side effects. I'd do the LPF unless there was a good reason not to. – Olin Lathrop Jan 22 '14 at 19:39
• Whether we filter the square wave or else, we still get all of these byproducts. youtu.be/Mm7WfVzr1ao?t=105. Would there be anyone who could comment on this? Thanks. – Denis Oct 1 '19 at 1:49

## 3 Answers

Yes, a square wave can be fine. When you mix, you get the sum and the difference of the frequency components from each input. The square wave consists of the fundamental and all the odd harmonics, so you need to do some filtering somewhere, of course.

The Softrock Ensamble RXTX is a simple direct conversion HF transceiver which makes a good example. There's a schematic on that page (a pretty bad one, but hey, you get what you pay for). U3 generates a square wave of a programmable frequency. U5 splits this into two quadrature clocks, QSD CLK 1 and 2. These find their way to U10, which is the mixer. It's not much more than a couple of analog switches. The output of the mixer goes to a couple of simple amplifiers and then to the audio input of a computer.

It's notable that this design wouldn't work with anything but square waves for the LO. U10 is an analog switch, with digital inputs to determine the state of the switches. It's not an ideal multiplier. If you fed it with a sine wave, the gain of the input transistors in U10 would make it a square wave anyway. This isn't true of all mixers, but here it is.

The filtering on this radio happens between the antenna and the mixer. The filters strip out all the harmonics above the band the kit was built for. Were this not done, then the LO frequency, plus all of its odd harmonics, would be aliased down to baseband. However, all those odd harmonics don't exist in the signal coming from the antenna after the filter, so there's no problem1.

You can also use this to your advantage. There's another kit in the same family, the Softrock RX Lite II, which when built for 20m or 30m, samples at a lower harmonic. That is, the LO is actually 1/3rd of what it would otherwise be, and it's the harmonic of that square wave input to the LO that actually mixes the signal down. Again, filtering removes out-of-band signals between the antenna and the mixer.

Given your difficulty in finding a suitable crystal, maybe this is good for you. If you can find one that is at 1/3rd of the desired frequency, you could make that work, with appropriate filtering.

1: provided, of course, that you don't have some really strong signal near one of these harmonics that can find its way in despite the filtering. It could be an issue if you lived right next to a broadcast station or you had to deploy this radio in a high-RF environment. It's an inexpensive hobbyist kit, not professional equipment.

• Am I right to say that whether we filter the square wave or else, we still get all of these byproducts. According to W2AEW, youtu.be/Mm7WfVzr1ao?t=105 even for a sine LO, products have lots of harmonics. Would there be anyone who could comment on this? Thanks. – Denis Oct 1 '19 at 1:50
• @Denis You'll get a better response if you ask a new question rather than ask in a comment. – Phil Frost Oct 1 '19 at 15:34

It's not hard to apply a little bit of low pass filtering so you ought to consider doing that. Also, it's not just your own signal you need to worry about - any signal picked up (from any source) that is 20.4MHz away from one of the low order harmonics might get swept through and ruin your signal.

• You are right and I have put a band pass filter between the LNA and the mixer to avoid that. – Blup1980 Jan 23 '14 at 6:22

A typical RF mixer does not multiply the RF signal with the LO (local oscillator) signal. Instead, the signal polarity of the output depends on whether the LO is negative or positive: when the LO is positive the output signal is the same as the input signal (up to some gain) and when the LO is negative, the output is the same as the input but with an opposite sign. Now, effectively, this is the same as multiplying the input signal with the LO signal, but this is the case only when the LO is a square wave.

This is why the LO in RF mixers is a square signal, because the mixer is designed to work with such a signal. The basic RF mixer consists of two swiches that pull the signal polarity one way or the other based on the LO.

Since the mixer effectively multiplies the RF signal with a square signal, and since a square signal is a sum of sinusiods, low-pass-filtering the output results in the RF signal multiplied by a sinusoid.

You may observer from this video that even when LO is a sinosoid, we still see all of the harmonics such as 2FLO -FRF and so on. The reason for this is because the LO is simply switching the diodes.

Should you need nice demonstration; https://www.youtube.com/watch?v=Mm7WfVzr1ao

https://www.youtube.com/watch?v=GvadQpkZ8l0