# Wave Walker DSP

## Trending

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)

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:

For everything there is a season, and a time for every matter under heaven. A time to cast away stones, and a time to gather stones together. A time to embrace, and a time to refrain from embracing. Ecclesiastes 3:1,5
The earth was without form and void, and darkness was over the face of the deep. And the Spirit of God was hovering over the face of the waters. Genesis 1:2
Behold, I am toward God as you are; I too was pinched off from a piece of clay. Job 33:6
Enter His gates with thanksgiving, and His courts with praise! Give thanks to Him; bless His name! Psalm 100:4
Lift up your hands to the holy place and bless the Lord! Psalm 134:2
Blessed is the man who trusts in the Lord, whose trust is the Lord. He is like a tree planted by water, that sends out its roots by the stream, and does not fear when heat comes, for its leaves remain green, and is not anxious in the year of drought, for it does not cease to bear fruit. Jeremiah 17:7-8
He said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind. This is the great and first commandment. And a second is like it: You shall love your neighbor as yourself. On these two commandments depend all the Law and the Prophets.” Matthew 22:37-39
Then He said to me, “Prophesy over these bones, and say to them, O dry bones, hear the word of the Lord. Thus says the Lord God to these bones: Behold, I will cause breath to enter you, and you shall live." Ezekiel 37:4-5
Riches do not profit in the day of wrath, but righteousness delivers from death. Proverbs 11:4
The angel of the Lord appeared to him in a flame of fire out of the midst of a bush. He looked, and behold, the bush was burning, yet it was not consumed. And Moses said, “I will turn aside to see this great sight, why the bush is not burned.” When the Lord saw that he turned aside to see, God called to him out of the bush, “Moses, Moses!” And he said, “Here I am.” Exodus 3:2-3
Daniel answered and said: “Blessed be the name of God forever and ever, to whom belong wisdom and might. He changes times and seasons; He removes kings and sets up kings; He gives wisdom to the wise and knowledge to those who have understanding." Daniel 2:20-21
Now the Lord is the Spirit, and where the Spirit of the Lord is, there is freedom. 2 Corinthians 3:17

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}