MIT 6.300 — Lecture 1

Fourier Series

§ Lecture: Pitch vs. Timbre

Consider the following graphs of air pressure over time detected by a microphone listening to different musical instruments.

Notice how each graph has the same period of 1262\frac{1}{262} seconds. Consequently, each instrument's sound has the same pitch: 262 Hz to be precise (or approximately C4). However, each instrument's sound has a different timbre. This is because the “shape” of each graph across a single period differs greatly.

Signal processing, spiritually, is the study of looking beyond just the pitch of a signal. How can we quantitatively describe the “shape” of a signal across one of its periods?

§ Lecture: Fourier Series

Here's the driving mathematical fact behind Fourier series.

Theorem. (Fourier Analysis) Any (sufficiently well-behaved) signal f(t)f(t) with period TT can be expressed as a sum of sinusoids.

f(t)=k=0(ckcos(kω0t)+dksin(kω0t))f(t) = \sum_{k = 0}^{\infty} (c_k \cos (k \omega_0 t) + d_k \sin (k \omega_0 t))

In the above, ω0:=2πT\omega_0 := \frac{2\pi}{T} is the fundamental frequency, and the coefficients {ck}k=0\{c_k\}_{k = 0}^{\infty} and {dk}k=0\{d_k\}_{k = 0}^{\infty} are the following.

c0=1T0Tf(t)dt      c=2T0Tf(t)cos(ω0t)dt      d=2T0Tf(t)sin(ω0t)dt.c_0 = \dfrac{1}{T} \int_0^T f(t) \, \mathrm{d}t ~~~ \parallel ~~~ c_{\ell} = \dfrac{2}{T} \int_0^T f(t) \cos(\ell \omega_0 t) \, \mathrm{d}t ~~~ \parallel ~~~ d_{\ell} = \dfrac{2}{T} \int_0^T f(t) \sin( \ell \omega_0 t) \, \mathrm{d} t.

Proof: Handwaving: assume that f(t)f(t) can be expressed as a sum of sinusoids, then derive the formulas for {ck}k=0\{c_k\}_{k = 0}^{\infty} and {dk}k=0\{d_k\}_{k = 0}^{\infty}.

The c0c_0 coefficient is obvious. For the others, recall for any A,BZ+A, B \in \mathbb{Z}^+ that:

0Tcos(Aω0t)cos(Bω0t)dt=0T12cos((AB)ω0t)+12cos((A+B)ω0t)dt={T/2 if A=B.0 otherwise. \int_0^T \cos(A \omega_0 t) \cos(B \omega_0 t) \, \mathrm{d}t = \int_0^T \dfrac{1}{2} \cos((A - B)\omega_0 t) + \dfrac{1}{2} \cos((A + B)\omega_0 t) \, \mathrm{d}t = \begin{cases} T/2 & \text{ if } A = B. \\ 0 & \text{ otherwise. } \end{cases} 0Tsin(Aω0t)cos(Bω0t)dt=0T12sin((AB)ω0t)+12sin((A+B)ω0t)dt=0.\int_0^T \sin(A \omega_0 t) \cos(B \omega_0 t) \, \mathrm{d}t = \int_0^T \dfrac{1}{2} \sin((A - B) \omega_0 t) + \dfrac{1}{2} \sin((A + B) \omega_0 t) \, \mathrm{d}t = 0. 0Tsin(Aω0t)sin(Bω0t)dt=0T12cos((AB)ω0t)12cos((A+B)ω0t)dt={T/2 if A=B.0 otherwise. \int_0^T \sin(A \omega_0 t) \sin(B \omega_0 t) \, \mathrm{d}t = \int_0^T \dfrac{1}{2} \cos((A - B) \omega_0 t) - \dfrac{1}{2} \cos((A + B) \omega_0 t) \, \mathrm{d}t = \begin{cases} T/2 & \text{ if } A = B. \\ 0 & \text{ otherwise. } \end{cases}

These imply the formulas. In some sense, there's a sort of orthogonal basis here or whatever.   \blacksquare

Remark. The relationship ω0=2πT\omega_0 = \frac{2\pi}{T} must not be broken! For example, if a signal has fundamental frequency ω0=10π\omega_0 = 10\pi, then we must have T=0.2T = 0.2, so its Fourier coefficients must be computed by integrating over an interval of length 0.20.2.

The fundamental frequency of a signal captures its pitch, but the coefficients {ck}k=0\{c_k\}_{k = 0}^{\infty} and {dk}k=0\{d_k\}_{k = 0}^{\infty} capture its timbre. So we might visualize the harmonic structure of a signal by plotting mk:=ck2+dk2m_k := \sqrt{c_k^2 + d_k^2} against the harmonic number kk.

This tells us that the second harmonic of this signal is about twice as strong as its first harmonic (or fundamental).

Remark. The choice of plotting mk:=ck2+dk2m_k := \sqrt{c_k^2 + d_k^2} comes from the following rewrite.

f(t)= k=0(ckcos(kω0t)+dksin(kω0t))= k=0mkcos(kω0tϕk) where mk:=ck2+dk2 and ϕk:=tan1(dkck).\begin{align*}f(t) = \ & \sum_{k = 0}^{\infty} (c_k \cos (k \omega_0 t) + d_k \sin (k \omega_0 t)) \\ = \ & \sum_{k = 0}^{\infty} m_k \cos(k \omega_0 t - \phi_k) \text{ where } m_k := \sqrt{c_k^2 + d_k^2} \text{ and } \phi_k := \tan^{-1}\left(\dfrac{d_k}{c_k}\right).\end{align*}

So the measurement mkm_k captures the strength of the part of the signal with frequency kω0k \omega_0.

Thus, there are two ways we can look at a signal:

§ Recitation: Computing Fourier Series

Recall that cos(t)\cos(t) is even and sin(t)\sin(t) is odd. Therefore,

Thus, if a signal is known to be even or odd, its Fourier series can be computed in half the usual number of steps.

Problem. Determine the Fourier coefficients of f(t)=sin(t)f(t) = |\sin(t)|.

Solution: This is even with period T=πT = \pi and fundamental frequency ω0=2\omega_0 = 2. Thus, dk=0d_k = 0 and:

ck=2π0πsin(t)cos(2kt)dt=1π0πsin((1+2k)t)+sin((12k)t)dt=1π[21+2k+212k]=4π(4k21).c_k = \dfrac{2}{\pi} \int_{0}^{\pi} \sin(t) \cos(2kt) \, \mathrm{d}t = \dfrac{1}{\pi} \int_0^{\pi} \sin((1 + 2k)t) + \sin((1 - 2k)t) \, \mathrm{d}t = \dfrac{1}{\pi} \left[ \dfrac{2}{1 + 2k} + \dfrac{2}{1 - 2k} \right] = \dfrac{-4}{\pi(4k^2 - 1)}.

Separately, we compute c0=2πc_0 = \frac{2}{\pi} as well.