2

I have been working at educating myself on how SDR and GNU Radio works.

In order to demonstrate heterodyning, I set up a flow-graph consisting of 2 signal generators, a Multiply block, and QT GUI Frequency Sink. The generators are connected to the Multiply block inputs, and the Multiply block output is connect to the Freq Sink, in order to heterodyne the two generator signals.

The frequency of the generators are linked to a slider. One generator is slider_value, the other is slider_value + 2000. The generators are both outputting a cosine waveform.

When setting all the inputs to float, as I move the slider I get the results I would expect:

I see one peak always at 2000 Hz: slider_value - slider_value + 2000 = 2000. Ie, the difference signal.

I see another peak at the sum of the generator outputs: slider_value + slider_value + 2000 = (2 * slider_value) + 2000.

However, if I switch all the inputs and outputs to complex, I only see one peak which is at the sum of the values. I do not see a peak at the difference, ie, nothing at 2000 (except when slider_value = 0).

Can someone explain to me why I don't see the difference signal when multiplying complex signals?

rclocher3
  • 9,330
  • 3
  • 24
  • 52
KevinHJ
  • 215
  • 1
  • 5

1 Answers1

5

This is how the mathematics of complex signals work.

The proof begins with Euler's formula:

$$ e^{i\varphi} = \cos \varphi + i \sin \varphi \tag 1 $$

For signal processing, instead of $\varphi$, we are usually thinking about some sinusoidal oscillation at angular frequency $\omega$ that varies with time $t$, which we can write as:

$$ e^{i\omega t} \tag 2 $$

This is what the signal generator block outputs, when in sine mode and with a complex output. By (1) above you can see both the real and imaginary parts are sinusoids at angular frequency $\omega$, just offset 90 degrees in phase.

When you multiply two of these complex sinusoids together, at frequencies $\omega_1$ and $\omega_2$, you get:

$$ e^{i\omega_1 t} e^{i\omega_2 t} \tag 3 $$

which simplifies to

$$ e^{i (\omega_1 + \omega_2) t} \tag 4 $$

which, again by (1), is a single complex sinusoid at frequency $\omega_1 + \omega_2$. There is no difference term.

A consequence of this math is that $\omega$ can be negative. Which is why in GNU Radio if you have a complex stream at a sample rate of say 48 kHz, that can represent 96 kHz of bandwidth: from -48 kHz to 48 kHz.

The sum and difference terms when heterodyning real-valued functions comes about because a real function can not unambiguously represent positive and negative frequencies, but mathematically, they are still there.

How? Consider two complex sinusoids, at frequencies $\omega$ and $-\omega$, summed together:

$$ e^{i\omega t} + e^{-i\omega t} = \cos \omega t + i \sin \omega t + \cos -\omega t + i \sin -\omega t \tag 5 $$

Considering the trigonometric identities:

$$ \cos x = \cos −x \\ \sin x + \sin -x = 0 \tag 6 $$

Now (5) simplifies to:

$$ e^{i\omega t} + e^{-i\omega t} = 2\cos(\omega t) \tag 7 $$

Which means when you multiply two real sinusoids to heterodyne a signal:

$$ \cos \omega_1 t \times \cos \omega_2 t \tag 8 $$

Then by (7) and neglecting the factor of 2 (since it only changes the amplitude of the result, and that's not important), equivalently you're doing:

$$ (e^{i\omega_1 t} + e^{-i\omega_1 t}) (e^{i\omega_2 t} + e^{-i\omega_2 t}) \\ = (e^{-i(\omega_1-\omega_2)} + e^{i(\omega_1-\omega_2)}) + (e^{-i(\omega_1+\omega_2)} + e^{i(\omega_1+\omega_2)}) \tag 9 $$

Notice the difference of the frequencies on the left, and the sum on the right. Each group is comprised of positive and negative variations of the same frequency, which by (7) we know simplifies to just a real-valued sinusoid. So (9) further simplifies (again neglecting that factor of 2) to:

$$ \cos((\omega_1-\omega_2) t) + \cos((\omega_1+\omega_2) t) \tag {10} $$

And there you have your common real-valued function heterodyning equation.

Thus, any real-valued function has both positive and negative frequencies in it, but the negative frequencies are just a "mirror" of the positive ones. It's because of those negative frequencies that LSB demodulation can "flip" the spectrum, and it's the negative frequencies that cause the difference term when heterodyning real-valued functions.

Phil Frost - W8II
  • 52,635
  • 8
  • 91
  • 225