# Wave Walker DSP

## Trending

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

Phase, Frequency and Negative Frequency in Complex Sinusoids
October 19, 2021

#### Introduction

A prior post described how sinusoids came to be used in DSP and RF due to physical properties of the universe. A follow up gave some mathematical rules about complex sinusoids on how sine, cosine and all related to one another in terms of Euler’s triangle. This blog will continue by including time in complex sinusoids, describe how phase and frequency relate to one another, how a negative frequency arises and demonstrates the concepts using the unit circle. It may be useful to review some complex math before jumping into this post.

Additional blog posts on complex numbers:

#### Instantaneous Phase

Euler’s formula

(1)

is used to describe the position of a vector on the unit circle in the complex plane as shown in Figure 1.

Similarly Euler’s formula can be given as

(2)

which describes a complex sinusoid rotating around the unit circle with time n. An example of a complex sinusoid is given in Figure 2. The complex sinusoid can be created in Python by

import numpy as npn = np.arange(0,8)complexSinusoid = np.exp(2j*np.pi*n/8)

The instantaneous phase of a complex sinusoid is the angle from 0 radians in the complex plane at some time n. For

(3)

the instantaneous phase is given by

(4)

As the complex sinusoid rotates through the unit circle the instantaneous phase will change with time n. From the example in Figure 2 the complex sinusoid is such that the instantaneous phase is

(5)

From (5), the instantaneous phase is

(6)

which can be seen in Figure 2.

#### Instantaneous Frequency

Where the instantaneous phase is the phase of a complex sinusoid at time n the instantaneous frequency is the velocity at which the complex sinusoid is rotating through the unit circle at time n.

From the example complex sinusoid in Figure 2 the instantaneous phase moves by for each time n. The frequency in this case is therefore because it describes the velocity at which the complex sinusoid is rotating through the unit circle.

It can also be stated that the instantaneous frequency is the time-derivative of the instantaneous phase

(7)

or the instantaneous phase is the integral of the instantaneous frequency

(8)

Figure 3 gives an example of the instantaneous phase for . The unwrapped phase is (8) which has unbounded phase values and the wrapped phase applies the modulo operator to keep all values within . Note that the instantaneous frequency is the derivative of the unwrapped phase which is in this case. The instantaneous phase can be calculated from the sinusoid by

instPhase = np.angle(complexSinusoid)

and wrapping the phase by

instPhaseUnwrap = np.unwrap(instPhase)

Figure 4 is the time-domain plot for .

#### Negative Frequency

The trap in thinking about frequency is that it represents how often something happens, which is tricky because it is partially true. An incomplete definition of frequency would be how quickly a complex sinusoid rotates through the unit circle. The correct way to think about frequency it is is the speed and direction a complex sinusoid is rotating around the unit circle.

The complex sinusoid has an instantaneous frequency of which is the speed of the rotation around the unit circle in a counter-clockwise direction as in Figure 2. The complex sinusoid has an instantaneous frequency of which is the speed of rotation the unit circle in a clockwise direction as in Figure 5.

Figure 6 is a plot of the instantaneous phase for which shows a negative slope of the unwrapped phase, , because the frequency is negative. Compare against the positive slope in Figure 3.

Figure 7 gives a time-domain plot for which shows that a negative frequency changes the phase relationship between the and elements as compared to Figure 4. Where the real element leads the imaginary element for a positive frequency complex sinusoid, the reverse is true for a negative frequency complex sinusoid.

#### Phase Offset

It’s important to draw the distinction between instantaneous phase and phase offset since the two are related but differ. For a complex vector

(9)

the instantaneous phase is the angle at time n,

(10)

where the phase offset is . The phase offset can be summarized as the instantaneous phase at time n=0.

#### Conclusion

The instantaneous phase and frequency of a complex sinusoid are directly related to one another and understanding the relationship is important before moving onto more sophisticated DSP algorithms. The relationship can be summarized as the instantaneous phase is the integral of the instantaneous frequency and the instantaneous frequency is the derivative of the instantaneous phase.

A complex sinusoid can have a positive or negative frequency. A positive frequency is rotation around the unit circle in a counter-clockwise direction where as a negative frequency is rotation in a clockwise direction. Additionally, a positive frequency complex sinusoid will have the real element lead the imaginary element in the time domain, but the reverse is true for a negative frequency complex sinusoid.

Don’t forget to check out these other blog posts on complex numbers!

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.