← Positive and negative frequencies
We add opposite rotations
In the previous lesson, we compared the two directions of rotation. Now we add two conjugate vectors and see how they give a usual real cosine.
For one angle :
To add complex numbers, we add each coordinate separately:
The vertical coordinates cancel each other. The horizontal coordinates add, so we get two times the cosine value. To get the cosine itself, we divide the sum by 2:
At , this is especially easy to check:
Half of the sum is , the same as .
To add vectors geometrically, we move the start of the second vector to the end of the first vector. The dashed copy of on the diagram shows this move. The end of the copy gives the sum ; a darker purple line shows half of the sum.
If you only draw the horizontal projections of the two initial vectors on top of each other, they are the same. To add the coordinates, you need two horizontal steps, one after the other. This is why the sum of the projections in the example is , although each projection is .
Why each rotation has half of the amplitude
You can divide the sum by 2 at the end, or you can start with two vectors of half length:
If increases with time, these are two opposite rotations with amplitudes . Their sum always stays on the horizontal axis and oscillates from to .
This is a mathematical representation of the signal. It will be useful for frequency shift and for spectrum analysis. In the next lesson, we will see that a cosine with amplitude 1 gives two components of 0.5 each in the two-sided spectrum.
We shift the tuning frequency to zero
Let us go back to the receiver tuned to 7.100 MHz. The wanted signal occupies only a few kHz around this frequency. If we shift it to zero, this narrow band sets the processing requirements; after filtering, we can decrease the sample rate.
The reference oscillator LO (local oscillator) sets the tuning frequency. We are interested in the difference:
Here is the frequency of the input radio signal. For MHz:
| Input frequency | Frequency relative to LO |
|---|---|
| 7.099 MHz | −1 kHz |
| 7.100 MHz | 0 Hz |
| 7.101 MHz | +1 kHz |
This table gives a frequency plan. It does not mean direct sampling of a MHz signal at a low . In our experiments, we use frequencies that are valid for the selected sample rate.
How a digital mixer works
A digital mixer multiplies the input samples by the samples of a reference signal. To subtract the LO frequency, we select a reference complex rotation with a negative sign:
When you multiply, the exponents add. The minus sign of the reference signal is what gives the frequency difference. Multiplication by a positive rotation, on the other hand, would add the LO frequency.
This expression describes the shift of one complex component. A usual real cosine has two components: both move by , and then a filter selects the necessary band near zero. We will build the full mixer and filter diagram later.
What complex baseband means
Baseband is the band near zero frequency. In our receiver, we get it after the frequency shift and after a filter selects the necessary band. For example, instead of the band around 7.100 MHz, we work with the range from to kHz.
If both coordinates represent the signal in this band, we call it complex baseband. We can write a sample as
Here the letter only identifies the signal after the frequency shift. The magnitude shows its current amplitude, and the angle shows its phase relative to the reference oscillator. The amplitude scale depends on the gains selected in the chain.
For one tone with constant amplitude:
| Vector behavior after the frequency shift | Meaning |
|---|---|
| The angle is constant | the tone frequency is equal to the LO frequency |
| The angle increases at a constant rate | the tone is above the LO |
| The angle decreases at a constant rate | the tone is below the LO |
For a modulated signal, the length and the angle can change in more complex ways: these changes contain the message. One instantaneous angle cannot tell you the frequencies of all the components in a mixture.
Lab: we check the sum of rotations
The script checks the first part of the lesson: the decomposition of the cosine. It does not yet model the shift of a radio signal to zero.
uv run labs/02/03-real-cosine-rotations.py --show

Change the amplitude and initial phase:
uv run labs/02/03-real-cosine-rotations.py --amplitude 2 --phase-deg 30 --show --output-dir /tmp/dsp-cosine-pair
The script compares the sum of the two rotations with the initial cosine. The maximum difference must be near zero; a small remainder comes from rounding in the calculations.
Self-check
For , find , and half of their sum .
points up (), points down (). Their sum is zero, and this agrees with : half of the sum of conjugate vectors is always the cosine of the angle.
When you add the conjugate numbers and , which coordinates cancel and which coordinates add?
, . The sum is always a real number. This is why the sum of two opposite rotations stays on the horizontal axis and gives a real cosine.
A cosine has amplitude . What is the length of each of the two rotating vectors in its decomposition?
When both vectors point to the right, their lengths add and give the maximum of the cosine. To get , each vector must have length .
After the shift to zero, the magnitude of one sample became two times larger, and the angle stayed the same. How do , , the magnitude and the phase change? The initial and are not zero.
The vector was stretched two times along the same direction. , stays the same, and and double.