Although a radio signal is inherently a real thing---the electric field has a real magnitude and direction at a given point in space and time---the frequency shifting inherent in radio inherently introduces complex numbers, as we will see. So, to prepare, let's review some basic properties of complex numbers.
In general, a complex number has a real part and an imaginary part:
To add two complex numbers, just add the real parts and add the imaginary parts. For example, to add
- Look at a real cosine value. You should be able to add a complex conjugate of the cosine wave to the original cosine wave.
Remember that
\begin{equation}
(a + bi) + (a - bi) = 2a
\end{equation}
where a is the real part of the cosine wave. Remember that the constellation graph should only have real values; the dot should never move in the
$$i$$ direction. - Examine the other waveforms that are options in the sources. Specifically, look at a square, a triangle, and a sawtooth graph of cosine. Take note of harmonics in the frequency graph of these waveforms. Make sure you can identify which type of harmonics each of these waveforms make in the frequency graph.
- Generate two complex exponential frequencies, multiply them together, and plot the result. You should see that the frequency is the sum of the two frequencies. Mathematically, this is \begin{equation} e^{i2 π f_1 t} x e^{i2 π f_2 t} = e^{i2 π (f_1 + f_2) t} \end{equation} It should be easiest to see this effect when you make one of the frequencies quite small in comparison to the other.
- Multiply two real exponential frequencies, similar to what you did in Homework 3.
- Take a real cosine, and plot the following: \begin{equation} \cos(2 π f t) \end{equation} \begin{equation} \abs(\cos(2 π f t) \end{equation} \begin{equation} \arctan(\cos(2 π f t)) \end{equation} Some useful functions for this homework are "Multiply Const", "Transcendental", and "Abs". You can also change the number of inputs into the QT Gui Frequency Sink and the QT GUI Time Sink in order to display multiple graphs at the same time. For Homework 5, you should need 3 inputs in both the time sink and the frequency sink: one for each equation. To multiply by pi, use the "import" block. Import the math module the same way you would in Python, and you can then call math.pi.
A very useful way to visualize this process is to represent complex numbers with their real part along the
You can multiply two complex numbers just the way you would algebraic expressions (using FOIL, but I will change the order to FLOI for "firsts-lasts-outside-inside"):
\begin{equation}
(a+b)\times(c+d) = ac + bd + ad + bc
\end{equation}
Similarly,
\begin{equation}
(2+1i) \times (3+4i) = (2\times3) + (1i\times 4i) + (2\times4 i) + (1i\times 3)
\end{equation}
\begin{equation}
= (6-4) + (8+3)i = 2 + 11 i
\end{equation}
where we have used that
Do you see why I changed the order in "FOIL"?
Click to expand
The product of the lasts yields a real number, since
The polar form of a complex number uses the "length" of the number and its orientation angle with respect to the real axis to specify the number, rather than its real and imaginary components. To express the complex number
Using the Pythagorean theorem, we can compute the length of the hypotenuse, which is the magnitude
There is a most beautiful mathematical relationship known as Euler's identity that makes expressing complex numbers in polar form incredibly useful. It is
\begin{equation}
e^{i\phi} = \cos\phi + i \sin\phi
\end{equation}
If you have learned about Taylor series, you can probably show that this is true, but if you haven't, don't worry. We will just use Euler's identity to express the complex number
Why is this so great? Well, because when you multiply exponentials, you just add the exponents. So, if we have numbers
- The magnitude of the product of the two complex numbers is the product of their magnitudes
- The phase of the product of two complex numbers is the sum of their phases
Put another way, complex multiplication rotates and stretches complex numbers.
Exercise: If
Click to expand
What does a signal of the form
Note that the blue (real) part starts at 1 and is a cosine wave, whereas the red (imag) part starts at 0 and rises with increasing time. What is the frequency of this source?
Click to show the answer
The period of the wave is 1 ms, so the frequency is 1 kHz.
All GNURadio flowgraphs are at https://github.com/gallicchio/learnSDR