# Wave Walker DSP

## DSP Algorithms for RF Systems

DSP for Beginners: Simple Explanations for Complex Numbers! The second edition includes a new chapter on complex sinusoids.

Aliasing, Sampling and Spinning Car Tires
November 10, 2021

#### Introduction

You know how on car commercials sometimes it looks like the wheel is spinning backwards? How weird is that? The effect is called aliasing and it occurs when the wheel’s rotation rate is faster than twice the frame rate of the video camera. You can watch a video below that demonstrates aliasing on car tires as well as a video where it appears that a helicopter’s blades have stopped spinning due to a similar effect.

Aliasing is a form of distortion and your DSP systems can be effected by it if not designed appropriately. It might be worth while reviewing the post on frequency and negative frequency before continuing onto the the body of this post.

More blog posts on complex sinusoids:

#### Aliasing in Sinusoids

Let’s look at some sinusoids with different frequencies. Figure 1 displays the sinusoids

(1)  Figure 1: Sinusoids in the time-domain with frequencies f/fs = 0.125, 0.25, 0.5, 0.75, 0.875. Aliasing occurs in the sinusoids when f/fs > 0.5.

A strange effect happens when as larger frequencies appears as smaller frequencies. Compare against in Figure 1. Both sinusoids appear to have the same frequency of but are 180 degrees out of phase. The larger frequency sinusoid can be represented with a negative frequency ,

(2) Similarly looks to have the same frequency as , , and they are also 180 degrees out of phase. The larger frequency sinusoid can be represented with a negative frequency ,

(3) Finally, and maybe weirdest of all, for all n.

If you’ve seen this effect before you’ll know it’s due to aliasing as a result of the Nyquist sampling theorem. Before jumping into that let’s take a look at aliasing in the context of the unit circle.

#### Aliasing on the Unit Circle

Where Figure 1 only plotted the imaginary portion of a complex sinusoid in the time domain as in (1),

(4) Figure 2 to Figure 6 display both the real and imaginary parts of the complex sinusoid on the unit circle where the complex sinusoids are given by

(5) Figure 2 shows the complex sinusoid for n=0 to n=7. The angle of the complex sinusoid is plotted in red and shows the instantaneous phase on . The angle shows a perceived rotation in the counter-clockwise direction which is a positive frequency. The complex sinusoid takes 8 samples to go one full rotation around the unit circle therefore the perceived frequency is .

Figure 3 shows the complex sinusoid for n=0 to n=7. The angle shows a positive frequency the complex vector appears to be rotating in the counter-clockwise direction. The complex sinusoid takes 4 samples to go one full rotation around the unit circle therefore the perceived frequency is .

Figure 4 shows the complex sinusoid for n=0 to n=7. The angle is a special case in that it alternates between 0 and which can be considered rotation in the clockwise direction or counter-clockwise direction. The complex sinusoid takes 2 samples to go one full rotation around the unit circle therefore the perceived frequency is .

Figure 5 shows the complex sinusoid for n=0 to n=7. The angle is rotating in a clockwise direction and the complex sinusoid takes 4 samples to go one full rotation around the unit circle therefore the perceived frequency is although in reality it is . The aliased frequency can be represented by radians which is the perceived frequency seen in Figure 5. The complex vector appearing to rotate in the opposite direction is the exact same effect as the car tire rotating in the opposite direction as in the YouTube video above.

Figure 6 shows the complex sinusoid for n=0 to n=7. The angle is rotating in a clockwise direction and the complex sinusoid takes 8 samples to go one full rotation around the unit circle therefore the perceived frequency is although in reality it is . The aliased frequency can be represented by radians which is the perceived frequency seen in Figure 6. The complex vector seemingly rotating in a clockwise direction rather than the counter-clockwise direction is the exact same effect as the car tire appearing to rotate in the reverse direction as in the YouTube video above.

#### Nyquist Sampling Theorem

When the actual frequency matches the perceived frequency, as in Figure 2 and Figure 3, and the complex sinusoid rotates around the unit circle in a counter-clockwise direction. Figure 4 shows an interesting phenomenon: the direction of the rotation around the unit circle cannot be stated to be either clockwise or counter-clockwise when . When

(6) the perceived frequency appears to be negative and the complex vector is rotating in a clockwise direction.

The Nyquist sampling theorem states that a signal can be perfectly reconstructed if it is sampled with frequency which is greater than or equal to twice the largest frequency in the signal [Proakis2007, p.13]

(7) Another way to state the Nuyquist sampling theorem is that no aliasing distortion will occur if the ratio of the largest frequency in the signal to sampling frequency is less than or equal to 1/2,

(8) Note that the ratio in (8) is the boundary upon which aliasing occurs which can be seen in Figure 1 through Figure 6. When the actual frequency and perceived frequency are the same, however when the frequency is aliased or “folded” to frequency [Lyons2011, p.40].

#### Conclusion

Aliasing is a form of distortion and occurs when the Nyquist sampling rate is not satisfied. Aliasing causes actual frequencies to be folded into negative frequencies causing distortion of the underlying signal. Maintaining the proper ratio of sample rate to signal bandwidth in each operation in your DSP system will avoid aliasing.

More blog posts on complex sinusoids:

God, the Lord, is my strength; he makes my feet like the deer’s; he makes me tread on my high places. Habakkuk 3:19

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.