#### Table of Contents

#### Introduction

Sines and cosines are the foundation for representing signals and the affects of filters and therefore understanding their mathematics is one of the foundational tools for signal processing. Euler’s formula is a mathematically compact and useful representation used for representing complex sinusoids.

More posts on complex sinusoids:

For more information check out my book Fundamentals of Digital Signal Processing: Complex Numbers, available on Amazon now!

#### Sine and Cosine

Sine and cosine refer to the opposite and adjacent lengths of a triangle with angle as shown in Figure 1.

Sine, referenced as , is a perfectly periodic function in x where

(1)

for any x. The lengths of the triangle in Figure 1 will continually repeat as cycles from 0 to , then to , and so on.

Sine and cosine are just phase shifts of one another, such that

(2)

(3)

Figure 2 gives an example of and . Notice that sine and cosine are linked together as travels around the unit circle, the only difference being that cosine lags sine by .

#### Sine Wave

Where the terms *sine* and *cosine* refer to a single angle, a *sine wave* or *sinusoid* refers to and which vary over multiple values of x. To be useful as a mathematical tool a sine wave will have three parameters which describe it completely: amplitude A, frequency and phase ,

(4)

where t is time. Figure 3 gives examples of how a sine wave is effected by different values of A, and .

The amplitude A changes the vertical scale of the sinusoid and is related to the energy of the sine wave.

The phase relates to the position the sinusoid starts. For example, refers to the angle of the triangle as if it was a clock hand pointing at 3 o’clock. The phase also can appear as a time delay as larger values seem to time-shift the sinusoid.

The frequency refers to the speed and direction at which the triangle’s angle is rotating from 0 to . A positive frequency means the angle will cycle through the unit circle in a counter-clockwise direction where as a negative frequency will have the angle cycle through the unit circle in a clockwise direction. A larger frequency means the angle will cycle through the unit circle faster than a small frequency in the same measure of time.

#### Euler's Formula

Leonhard Euler (pronounced *oiler*) created the formula which relates sine and cosine through a complex exponential according to

(5)

where . The complex sinusoid can be described more generically as of the form in (4) by

(6)

with amplitude A, frequency and phase .

Euler’s formula is a mathematically compact tool for representing sinusoids. A complex sinusoid simultaneously represents both the real and imaginary portion. The real portion can be obtained by using the real operator and the imaginary portion can be selected by using the imaginary operator such that

(7)

(8)

#### Additional Relationships

Two other mathematical properties are useful which relate and individually to complex exponentials are

(9)

(10)

Equation (9) can be derived from (5) by adding ,

(11)

Dividing both sides of (11) by 2 gives the final relationship,

(12)

Similarly (10) can be derived from (5) by subtracting ,

(13)

Dividing both sides of (13) by 2j gives the final relationship,

(14)

#### Takeaway

Sines and cosines are a foundational tool in DSP. Understanding the phase relationships between sine and cosine, as well as Euler’s formula (5) and its representations (9) and (10) are foundational to understanding before building more sophisticated DSP algorithms.

Don’t forget to check out these blogs on complex sinusoids:

## One Response