Skip to main content

Section 3.3 Sums of sinusoids

Subsection 3.3.1 Sums of complex exponentials

We're going to start by considering functions that consist of finite sums of trigonometric functions. Consider a function defined by a sum of the form

\begin{equation*} f(t) = \frac{a_0}{2} + \sum_{n=1}^N (a_n cos 2\pi nt + b_n \sin 2\pi n t). \end{equation*}

The phase in a particular frequency is determined by the coefficients of the cosine and sine of that frequency. The term \(\sin 2 \pi n t\) has frequency \(n\text{,}\) and so you can think about \(f\) as a composite of pure sinusoids of frequencies \(1, \ldots, N\text{.}\) The other mysterious quantity is \(a_0/2\text{.}\) It seems odd to write an arbitrary constant this way, but it falls out of a general forumla that we're building to. (In the context of electrical circuits, the term \(a_0/2\) is called the direct current, and the sum of sinusoids is the alternating current.)

Now we can use (3.2.2) to rewrite our sum as a series of complex exponentials (for the ease of computation).

\begin{align*} \amp \frac{a_0}{2} + \sum_{n=1}^N (a_n \cos 2\pi nt + b_n \sin 2\pi n t)\\ \amp = \frac{a_0}{2} + \sum_{n=1}^N \left[a_n \frac{e^{2\pi i n t} + e^{- 2\pi i n t}}{2} + b_n \frac{e^{2\pi i n t} - e^{- 2\pi i n t}}{2i}\right]\\ \amp = \frac{a_0}{2} + \sum_{n=1}^N \left[\frac{1}{2}(a_n - ib_n) e^{2\pi i n t} + \frac{1}{2}(a_n + ib_n) e^{- 2 \pi i n t} \right]\\ \amp = \frac{a_0}{2} + \sum_{n = 1}^N \frac{1}{2}(a_n - i b_n) e^{2 \pi i n t} + \sum_{n = 1}^N \frac{1}{2} (a_n + i b_n)e^{-2 \pi i n t} \end{align*}

The first sum contains the positive powers and the second sum the negative. We'd like to write the series as one sum over all the powers from \(-N\) to \(N\text{.}\) So we can make the definition

\begin{equation*} c_n = \frac{1}{2}(a_n - i b_n), \,\,\, c_{-n} = \frac{1}{2}(a_n + b_n), \,\,\, n = 1, \ldots, N \end{equation*}

and furthermore, notice that when \(n = 0\text{,}\) the formulas above give \(c_0 = \frac{a_0}{2}\text{,}\) which explains the fraction. Then we can write

\begin{equation*} \sum_{n=1}^N (a_n \cos 2 \pi n t + b_n \sin 2 \pi n t) = \sum_{n=-N}^N c_n e^{2 \pi i n t}. \end{equation*}

First, note that the \(c_n\) are complex numbers. If the signal \(f\) is real-valued, then it must be the case that for all \(n\text{,}\) \(c_n = \cc{c_{-n}}\text{,}\) which implies that

\begin{equation*} \abs{c_n} = \abs{c_{-n}} \end{equation*}

for all \(n\text{.}\) (This does not need to be the case when \(f\) takes on complex values.)

Suppose that we have a periodic function \(f\text{,}\) and assume (for now) that \(f\) has a representation in terms of complex exponentials

\begin{equation*} f(t) = \sum_{n=-N}^N e^{2 \pi i n t}. \end{equation*}

Is it possible to compute the \(c_i\text{?}\) Since they are complex numbers, whatever we are going to do is going to involve dealing with that fact (which isn't really any more difficult that real calculus). There are many approaches to the next step, most involving serious algebra and calculus to arrive at the formula for computing \(c_i\text{.}\) We're going to move straight to the linear algebra perspective, which while more abstract is much more clear about why the formulas turn out the way that they do. First, we'll define perhaps the single most important vector space in mathematics.

Subsection 3.3.2 Computing \(c_n\) using linear algebra

Definition 3.3.1.

\(L^2(0,1)\) is the complex vector space of functions with the property that

\begin{equation*} \int_0^1 f(x)^2 \, dx \lt \infty. \end{equation*}

\(L^2\) is an inner product space when equipped with the dot product

\begin{equation*} \ip{f}{g} = \int_0^1 f(x) \cc{g(x)} \, dx. \end{equation*}

Functions in \(L^2\) are called square-integrable and they show up in a huge number of applications. Perhaps most importantantly, some of our favorite functions turn out to be orthogonal in \(L^2\text{.}\)

Suppose that \(n \neq m\text{.}\) Then

\begin{align*} \ip{e^{2 \pi i m t}}{e^{2 \pi i n t}} \amp = \int_0^1 e^{2 \pi i m t} \cc{e^{2 \pi i n t}} \, dt\\ \amp= \int_0^1 e^{ 2 \pi i m t} e^{- 2 \pi i n t} \, dt\\ \amp = \int_0^1 e^{2 \pi i (m -n) t} \, dt\\ \amp = \frac{1}{2 \pi i (m - n)} e^{2 \pi i (m -n) t} \rvert_0^1\\ \amp = \frac{1}{2 \pi i (m - n)} (e^{2 \pi i (m -n)} - 1)\\ \amp = 0. \end{align*}

We've used the fact that \(e^{2 \pi i k} = 1\) for any integer \(k \neq 0\text{.}\) Thus, in \(L^2\text{,}\) we have \(e^{2 \pi i n t} \perp e^{2 \pi i m t}\) when \(m \neq n\text{.}\)

We can also see that

\begin{align*} \ip{e^{2 \pi i n t}}{e^{2 \pi i n t}} = \int_0^1 e^{2 \pi i n t} \cc{ e^{2 \pi i n t}} \, dt\\ \amp = \int_0^1 e^{ 2 \pi i n t}e^{-2 \pi i n t}\\ \amp = \int_0^1 1 \, dt = 1 \end{align*}

and so \(\norm{e^{2 \pi i n t}} = \sqrt{1} = 1\text{.}\)

We're going to use the theorem from linear algebra that lets us project onto the span of a set of orthogonal vectors.

So let's write the projection of a function \(f\) onto the span of the orthogonal vectors \(e^{2 \pi i n t}\text{,}\) \(n = -N, \ldots, N\text{.}\) Let \(S\) be the space of linear combinations of the \(e^{2 \pi i n t}\text{.}\)

\begin{equation*} \proj_S f = \sum_{n = -N}^n c_n e^{2 \pi i n t}, \end{equation*}

where

\begin{equation*} c_n = \frac{\ip{f}{e^{2 \pi i n t}}}{\norm{e^{2 \pi i n t}}^2}. \end{equation*}

But these are precisely the \(c_n\) that we need a formula to compute! Assuming that \(f\) can be written as a sum of complex exponentials is the same as assuming that \(f\) is in the space spanned by the orthogonal set. Thus, if \(f\) can be written

\begin{equation*} f = \sum_{n = -N}^N c_n e^{2 \pi i n t}, \end{equation*}

then the \(c_n\) can be computed via

\begin{equation*} c_n = \frac{\ip{f}{e^{2 \pi i n t}}}{\norm{e^{2 \pi i n t}}^2} = \int_0^1 e^{- 2 \pi i n t} f(t) \, dt. \end{equation*}

The \(c_n\) are called Fourier coefficients.

We have one major leap left to go - we've shown that if a periodic function \(f\) has representation as a finite sum of complex exponentials that we can produce the coefficients via an integral. We do not know yet if all periodic \(f\) can be expressed this way.

Subsection 3.3.3 Fourier coefficients as a function

One of the major themes of our course is the idea of transforms, which change a function in some setting to another function in a different setting. The Fourier coefficients can be thought of as the outputs of a function \(\hat{f}\) that takes an integer \(n\) as an input and produces \(c_n\text{.}\)