Part 5 - Fourier series

Introduction

In this part we’ll try to understand the concept and power with Fourier series.

Let’s firstly define the what, why and how with Fourier series.

Definition 1 (Fourier series)

Fourier series, is an expansion of a perodic function, into a sum of trigonometric functions.

So the power is really, given a complex perodic function, we can easily represent it as a sum of simple trigonometric functions!

However, before we mathematically define the Fourier series, let’s take a different approach to this.

Signal representation by orthogonal signal set

We can see that, if we only use c1x1c_1 x_1 and c2x2c_2 x_2, we get something similar for ff.

We can say that:

fc1x1+c2x2f \sim c_1 x_1 + c_2 x_2

Let’s call our error, ee.

e=f(c1x1+c2x2)e = f - (c_1 x_1 + c_2 x_2)

Therefore:

fc1x1+c2x2+e=c1x1+c2x2+c3x3  in this casef \sim c_1 x_1 + c_2 x_2 + e = c_1 x_1 + c_2 x_2 + c_3 x_3 \ | \ \text{in this case}

From linear algebra we know that basis vectors are orthogonal, this means:

ci=fxixixi=1xi2fxic_i = \dfrac{f \cdot x_i}{x_i \cdot x_i} = \dfrac{1}{|x_i|^2} f \cdot x_i

This is really useful, so, from what we know, we can say that.

Given a set of orthogonal real signals, x1(t),x2(t),,xN(t)x_1(t), x_2(t), \ldots, x_N(t) over the interval, [t1,t2][t_1, t_2]:

t1t2xm(t)xn(t) dt={0mnEnm=n\int_{t1}^{t2} x_m(t)x_n(t)\ dt = \begin{cases} 0 & m \neq n \newline E_n & m = n \end{cases}

We can approximate, f(t)f(t) over the interval, [t1,t2][t_1, t_2] as:

f(t)c1x1(t)+c2x2(t)+ cNxN(t)=n=1Ncnxn(t)f(t) \sim c_1 x_1(t) + c_2 x_2(t) + \ldots \ c_N x_N(t) = \sum_{n = 1}^N c_n x_n(t)

For any cnc_n we can express it as an integral:

cn=t1t2f(t)xn(t) dtt1t2xn2(t) dt=1Ent1t2f(t)xn(t) dtc_n = \dfrac{\int_{t_1}^{t_2} f(t) x_n(t)\ dt}{\int_{t_1}^{t_2} x_{n}^2 (t)\ dt} = \dfrac{1}{E_n} \int_{t_1}^{t_2} f(t) x_n(t)\ dt

As before, we will have an error, e(t)e(t) as well:

e(t)=f(t)n=1Ncnxn(t)e(t) = f(t) - \sum_{n = 1}^N c_n x_n(t)

We’ll also have an error in the energy, defined as:

Ee=t1t2f2(t) dtn=1Ncn2EnE_e = \int_{t_1}^{t_2} f^2(t)\ dt - \sum_{n = 1}^N c_n^2 E_n

As, NN \to \infty, we hope that both of these go to zero.

This is the generalized Fourier series!

Let’s define it properly

Definition 2 (Generalized Fourier series)f(t)=c1x1(t)+c2x2(t)+ cNxN(t)=n=1Ncnxn(t)f(t) = c_1 x_1(t) + c_2 x_2(t) + \ldots \ c_N x_N(t) = \sum_{n = 1}^N c_n x_n(t)

If, Ee0E_e \to 0 as NN \to \infty, the set {xn(t)}\{x_n(t)\} is a complete set on the interval [t1,t2][t_1, t_2], for that class of f(t)f(t).

{xn(t)}\{x_n(t)\} are called basis functions or basis signals.

Theorem 1 (Parseval’s Theorem)

The error energy can approach zero even though e(t)e(t) is non-zero at some isolated instants.

t1t2f2(t) dt=c12E1+c22E2+=n=1cn2En\int_{t_1}^{t^2} f^2 (t)\ dt = c_1^2 E_1 + c_2^2 E_2 + \ldots = \sum_{n = 1}^{\infty} c_n^2 E_n

Generalization to complex signals

In the most general case, signals are considered to be complex function.

Therefore, let’s generalize further to the complex world.

t1t2xm(t)xn\*(t) dt={0mnEnm=n\int_{t1}^{t2} x_m(t)x_n^{\*}(t)\ dt = \begin{cases} 0 & m \neq n \newline E_n & m = n \end{cases}

Where, xn\*(t)x_n^{\*}(t) is the complex conjugate of, xn(t)x_n(t). All equations are the same essentially:

f(t)=c1x1(t)+c2x2++cixi(t)+f(t) = c_1 x_1(t) + c_2 x_2 + \ldots + c_i x_i(t) + \ldots cn=1Ent1t2f(t)xn\*(t) dtc_n = \dfrac{1}{E_n} \int_{t_1}^{t_2} f(t) x_n^{\*}(t)\ dt

Trigonometric Fourier series

If the set, is the following: {1,cosω0t,cos2ω0t,,cosnω0t,;sinω0t,sin2ω0t,,sinnω0t,}\{1, cos \omega_0 t, cos 2\omega_0 t, \ldots, cos n\omega_0 t, \ldots ; sin \omega_0 t, sin 2\omega_0 t, \ldots, sin n\omega_0 t, \ldots \}

This is the orthogonal complete, trigonometric set.

ω0\omega_0 is called the fundamental frequency

nω0n \omega_0 is called the nnth harmonic.

We can call the fundamental period for, T0T_0:

T0=2πω0T_0 = \dfrac{2\pi}{\omega_0}

Note that T0T_0 is the fundamental period, meaning it can be at any time instant, as long as it’s a period.

T0cosnω0t cosmω0t={0nmT02m=n0\int_{T_0} cos n\omega_0 t \ cos m\omega_0 t = \begin{cases} 0 & n \neq m \newline \dfrac{T_0}{2} & m = n \neq 0 \end{cases} T0sinnω0t sinmω0t={0nmT02m=n0\int_{T_0} sin n\omega_0 t \ sin m\omega_0 t = \begin{cases} 0 & n \neq m \newline \dfrac{T_0}{2} & m = n \neq 0 \end{cases} T0sinnω0t sinmω0t=0 for all n and m\int_{T_0} sin n\omega_0 t \ sin m\omega_0 t = 0 \text{ for all n and m}

So:

f(t)=a0+a1cosω0t+a2cos2ω0t+b1sinω0t+b2sin2ω0t+f(t) = a_0 + a_1 cos \omega_0 t + a_2 cos 2\omega_0 t + b_1 sin \omega_0 t + b_2 sin 2\omega_0 t + \ldots

So:

f(t)=a0+n=1ancosnω0t+bnsinnω0tf(t) = a_0 + \sum_{n = 1}^{\infty} a_n cos n\omega_0 t + b_n sin n\omega_0 t an=t1t1+T0f(t) cosnω0t dtt1t1+T0cos2nω0t dta_n = \dfrac{\int_{t_1}^{t_1 + T_0} f(t)\ cos n\omega_0 t\ dt}{\int_{t_1}^{t_1 + T_0} cos^2 n\omega_0 t\ dt} a0=1T0t1t1+T0f(t) dta_0 = \dfrac{1}{T_0} \int_{t_1}^{t_1 + T_0} f(t)\ dt an=2T0t1t1+T0f(t) cosnω0t dta_n = \dfrac{2}{T_0} \int_{t_1}^{t_1 + T_0} f(t)\ cos n\omega_0 t\ dt bn=2T0t1t1+T0f(t) sinnω0t dtb_n = \dfrac{2}{T_0} \int_{t_1}^{t_1 + T_0} f(t)\ sin n\omega_0 t\ dt

We can write this more compactly.

ancosnω0t+bnsinnω0t=Cncos(nω0t+θn)a_n cos n\omega_0 t + b_n sin n\omega_0 t = C_n cos(n\omega_0 t + \theta_n)

Where:

Cn=an2+bn2C_n = \sqrt{a_n^2 + b_n^2} θn=tan1(bnan)\theta_n = tan^{-1} \left(\dfrac{-b_n}{a_n}\right)

So:

f(t)=C0+n=1Cncos(nω0t+θn)f(t) = C_0 + \sum_{n = 1}^{\infty} C_n cos(n\omega_0 t + \theta_n)

Exponential Fourier series

Given the set: {ejnω0t}\{e^{jn\omega_0 t}\}, with, n=0,±1,±2,n = 0, \pm 1, \pm 2, \ldots, this is complete, orthogonal set.

Note that, jj here is complex.

T0ejmω0t(ejnω0t)\* dt=T0ej(mn)ω0t dt={0mnT0m=n\int_{T_0} e^{jm \omega_0 t} (e^{jn\omega_0 t})^{\*}\ dt = \int_{T_0} e^{j(m - n)\omega_0 t}\ dt = \begin{cases} 0 & m \neq n \newline T_0 & m = n \end{cases} f(t)=Dnejnω0tf(t) = \sum_{-\infty}^{\infty} D_n e^{jn\omega_0 t} Dn=1T0T0f(t)ejnω0t dtD_n = \dfrac{1}{T_0} \int_{T_0} f(t) e^{-jn\omega_0 t}\ dt

Using Euler’s formula, we can switch between trigonometric and exponential series.

Cncos(nω0t+θn)=Cn2(ej(nω0t+θn)+ej(nω0t+θn))C_n cos(n\omega_0 t + \theta_n) = \dfrac{C_n}{2} \left(e^{j(n\omega_0 t + \theta_n)} + e^{-j(n\omega_0 t + \theta_n)}\right) (Cn2ejθn)ejnω0t+(Cn2ejθn)ejnω0t\left(\dfrac{C_n}{2} e^{j\theta_n}\right) e^{jn\omega_0 t} + \left(\dfrac{C_n}{2} e^{-j\theta_n}\right) e^{-jn\omega_0 t}

Let’s introduce, DnD_n:

Dn=12CnejθnD_n = \dfrac{1}{2} C_n e^{j\theta_n} Dn=12CnejθnD_{-n} = \dfrac{1}{2} C_n e^{-j\theta_n} f(t)=D0+n=1Dnejnω0t+Dnejnω0tf(t) = D_0 + \sum_{n = 1}^{\infty} D_n e^{jn\omega_0 t} + D_{-n} e^{-jn\omega_0 t}

In an even more compact form:

f(t)=Dnejnω0tf(t) = \sum_{-\infty}^{\infty} D_n e^{jn\omega_0 t}