# GNU Radio sinusoid multiplication does not produce perfect results

I created a simple sketch in GNU Radio that multiples two signals. One is a sine and the other is cosine. I paste a screenshot of it and its results below.

I have heard that in DSP, we can do almost perfect signal processing. Hence, I assume phenomena such as LO leakage and doubly balanced mixers are not applicable when already digitized signals are multiplied such as in the presented case.

However, after multiplying the following two consine signals in GNU Radio, I expect to see the sum & difference frequencies; nothing else.

To my surprise, I am seeing a big peak at the sum frequency followed by a series of multiple peaks on the FFT. I'm curious to know what I am missing here.

• I've answered as if you set one of your signal sources to "sine", but in reality, it's set to cosine in your screenshot. That's not a problem – the math is the same, but for small phase shift. – Marcus Müller Jun 10 '18 at 11:53

I expect to see the sum & difference frequencies.

You're multiplying two complex sinusoids, not a $\sin$ and a $\cos$, but

$$e^{j2\pi f_1t}\cdot e^{j\left(2\pi f_2t-\frac\pi2\right)}= e^{j2\pi(f_1+f_2)-j\frac\pi2}$$

So, only the sum frequency, as it should.

I am seeing a big peak at sum frequency followed by a series of multiple peaks on the FFT. I'm curious to know what I am missing here.

First of all, don't forget that unless your signal's period perfectly fits in the FFT length, you'll see leakage, i.e. the effect of convolution with a sinc. Your signal has a period of $\frac4{15}$. You'll find that you can't divide 1024 by that and get an integer. So, from a pure mathematical point of view, you must see leakage here.

Then, look at the scale of things: your theoretic peak is more than 120 dB above all your other side peaks. That's OK. That's a factor of $10^{12}$, and around the numerical accuracy of the floating point numbers used in this software. I can't think of a case where that becomes a problem

• Thanks for your quick answer! I now understand that a complex generator produces TWO waveforms. One I waveform and another Q waveform. Excellent mathematical simpliciation! I also learnt that by using "hamming" the peaks disappeared. Still need to work on that. – Denis Jun 10 '18 at 12:01
• I take "GNU Radio is smart" as a compliment to my favourite framework, but really, this is not GNU Radio-specific. This is the very basics of complex signal theory :) (Oh, and Hamming windowing, or appropriate windowing in general, is the standard way to deal with spectral leakage. It reduces sidelobes in frequency domain at the expense of precision. No free lunch.) – Marcus Müller Jun 10 '18 at 12:03
• I think greatscottgadgets.com/sdr will be a good resource for you to go through, because it explains a lot of these concepts very easily. – Marcus Müller Jun 10 '18 at 12:04
• Agreed, the mathematics is always great. But the people who created GNU Radio has taken the trouble to 1. well understand the principles 2. Integrate such principles into the framework. So I felt that GNU Radio is smart and experimenting with it will "lead" me to much more. Okay, time for me to get back to GreatScott Gadgets. – Denis Jun 10 '18 at 12:11