# 1.7: Fourier Analysis

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$

( \newcommand{\kernel}{\mathrm{null}\,}\) $$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\id}{\mathrm{id}}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\kernel}{\mathrm{null}\,}$$

$$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$

$$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$

$$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\avec}{\mathbf a}$$ $$\newcommand{\bvec}{\mathbf b}$$ $$\newcommand{\cvec}{\mathbf c}$$ $$\newcommand{\dvec}{\mathbf d}$$ $$\newcommand{\dtil}{\widetilde{\mathbf d}}$$ $$\newcommand{\evec}{\mathbf e}$$ $$\newcommand{\fvec}{\mathbf f}$$ $$\newcommand{\nvec}{\mathbf n}$$ $$\newcommand{\pvec}{\mathbf p}$$ $$\newcommand{\qvec}{\mathbf q}$$ $$\newcommand{\svec}{\mathbf s}$$ $$\newcommand{\tvec}{\mathbf t}$$ $$\newcommand{\uvec}{\mathbf u}$$ $$\newcommand{\vvec}{\mathbf v}$$ $$\newcommand{\wvec}{\mathbf w}$$ $$\newcommand{\xvec}{\mathbf x}$$ $$\newcommand{\yvec}{\mathbf y}$$ $$\newcommand{\zvec}{\mathbf z}$$ $$\newcommand{\rvec}{\mathbf r}$$ $$\newcommand{\mvec}{\mathbf m}$$ $$\newcommand{\zerovec}{\mathbf 0}$$ $$\newcommand{\onevec}{\mathbf 1}$$ $$\newcommand{\real}{\mathbb R}$$ $$\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}$$ $$\newcommand{\laspan}[1]{\text{Span}\{#1\}}$$ $$\newcommand{\bcal}{\cal B}$$ $$\newcommand{\ccal}{\cal C}$$ $$\newcommand{\scal}{\cal S}$$ $$\newcommand{\wcal}{\cal W}$$ $$\newcommand{\ecal}{\cal E}$$ $$\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}$$ $$\newcommand{\gray}[1]{\color{gray}{#1}}$$ $$\newcommand{\lgray}[1]{\color{lightgray}{#1}}$$ $$\newcommand{\rank}{\operatorname{rank}}$$ $$\newcommand{\row}{\text{Row}}$$ $$\newcommand{\col}{\text{Col}}$$ $$\renewcommand{\row}{\text{Row}}$$ $$\newcommand{\nul}{\text{Nul}}$$ $$\newcommand{\var}{\text{Var}}$$ $$\newcommand{\corr}{\text{corr}}$$ $$\newcommand{\len}[1]{\left|#1\right|}$$ $$\newcommand{\bbar}{\overline{\bvec}}$$ $$\newcommand{\bhat}{\widehat{\bvec}}$$ $$\newcommand{\bperp}{\bvec^\perp}$$ $$\newcommand{\xhat}{\widehat{\xvec}}$$ $$\newcommand{\vhat}{\widehat{\vvec}}$$ $$\newcommand{\uhat}{\widehat{\uvec}}$$ $$\newcommand{\what}{\widehat{\wvec}}$$ $$\newcommand{\Sighat}{\widehat{\Sigma}}$$ $$\newcommand{\lt}{<}$$ $$\newcommand{\gt}{>}$$ $$\newcommand{\amp}{&}$$ $$\definecolor{fillinmathshade}{gray}{0.9}$$

## Fourier Series

Continuing with the idea in the previous section that functions can be treated as vectors, we note that we can construct an arbitrary vector from a linear combination of the full set of orthogonal unit vectors. It turns out that we can construct a certain family of functions from a linear combination of harmonically-linked cosines and sines (which we saw in the previous section are mutually orthogonal).  Of course, as there are an infinite number of these "orthogonal" vectors, the linear combination could be an infinite sum.  The family of functions that can be constructed in this way happen to be those that are periodic.  We will assert without formal proof that any periodic function can be written as a linear combination of cosines and sines.  Showing the specific form of this linear combination requires rewriting Equation 1.6.6 in a more general form – one that accommodates periodic functions of arbitrary wavelengths. Changing the angle $$\theta$$, measured, in radians into a form that depends upon position in space gives:

$\theta = \frac{2\pi}{\lambda}x$

The limits of integration in Equation 1.6.6 are for the variable $$\theta$$, so for $$x$$ these limits are $$\pm\frac{\lambda}{2}$$.  With these alterations, Equation 1.6.6 becomes:

$\int\limits_0^{\lambda}\cos\left(\frac{2\pi m}{\lambda}x\right)\cos\left(\frac{2\pi n}{\lambda}x\right)dx=\int\limits_0^{\lambda}\sin\left(\frac{2\pi m}{\lambda}x\right)\sin\left(\frac{2\pi n}{\lambda}x\right)dx=\left\{\begin{array}{l} \frac{\lambda}{2} && m=n \\ 0&&m\ne n\end{array}\right.~~~~~~~~m,~n\text{ are integers}$

The linear combination of this infinite set of orthogonal functions can then construct any function that is periodic with a wavelength equal to $$\lambda$$. Defining the coefficients of the cosines and sines separately, and summing over all integers, we have:

$f\left(x\right)=\sum\limits_{n=-\infty}^{n=\infty}\left[a_n\cos\left(\frac{2\pi n}{\lambda}x\right)+b_n\sin\left(\frac{2\pi n}{\lambda}x\right)\right]$

The sum over the negative integers is redundant with the sum over the positive integers, and clearly the parities of cosine and sine require that $$a_{-n}=a_{n}$$ and $$b_{-n}=b_{n}$$, meaning we can change this sum over all the integers into twice the sum over the positive integers (plus $$n=0$$). The constant $$b_o$$ is pointless, since what it multiplies is identically zero.  And the constant $$a_o$$ multiplies 1, so we can rewrite this expansion as:

$f\left(x\right)=a_o+\sum\limits_{n=1}^{n=\infty}\left[2a_n\cos\left(\frac{2\pi n}{\lambda}x\right)+2b_n\sin\left(\frac{2\pi n}{\lambda}x\right)\right]$

It is customary not to carry around the factors of 2, choosing instead to redefine the constants as half of those given above.  This gives us our final expression of what is called the Fourier series expansion of the periodic function $$f\left(x\right)$$:

$f\left(x\right)=\frac{a_o}{2}+\sum\limits_{n=1}^{n=\infty}\left[a_n\cos\left(\frac{2\pi n}{\lambda}x\right)+b_n\sin\left(\frac{2\pi n}{\lambda}x\right)\right]$

One can look at this as a sum of harmonic functions with wavelengths equal to or shorter than the wavelength of the periodic wave.  To be exact, the wavelength of the $$n^{th}$$ harmonic wave in the sum is $$\frac{\lambda}{n}$$, so the wavelengths of the harmonic functions are integer fractions of the periodic wave's wavelength. Just to drive home the point that this expansion requires that the function is periodic, we can check this directly:

$f\left(x+\lambda\right)=\frac{a_o}{2}+\sum\limits_{n=1}^{n=\infty}\left[a_n\cos\left(\frac{2\pi n}{\lambda}\left(x+\lambda\right)\right)+b_n\sin\left(\frac{2\pi n}{\lambda}\left(x+\lambda\right)\right)\right]=\frac{a_o}{2}+\sum\limits_{n=1}^{n=\infty}\left[a_n\cos\left(\frac{2\pi n}{\lambda}x+2\pi n\right)+b_n\sin\left(\frac{2\pi n}{\lambda}x+2\pi n\right)\right]$

Of course, for any integer $$n$$, $$\cos\left(\theta+2\pi n\right)=\cos\theta$$ and $$\sin\left(\theta+2\pi n\right)=\sin\theta$$, so this comes back to the original series, confirming that $$f\left(x+\lambda\right)=f\left(x\right)$$.

What good is this series if we don't have a way to figure out what the coefficients are? Well, it turns out that we do have a way! As a hint for how to do this, we can once again turn to what we know about vectors.  If the cosine and sine functions are the equivalent of unit vectors, then the $$a_n$$ and $$b_n$$ coefficients are the components of the vector, and we know a way to find the components of a vector. For example:

$v_x=\hat i\cdot \vec v$

Using our identification of these functions as vectors, we should be able to use an integral (the function version of a dot product) to get the constants. Well, the reason that the dot product with the unit vector works is that the dot product vanishes with every unit vector accept the one being used in th edot product.  The orthogonal functions do the same thing!  Taking this "integral dot product":

$\int\limits_0^{\lambda}f\left(x\right)\cos\left(\frac{2\pi m}{\lambda}x\right)dx=\int\limits_0^{\lambda}\left(\frac{a_o}{2}+\sum\limits_{n=1}^{n=\infty}\left[a_n\cos\left(\frac{2\pi n}{\lambda}x\right)+b_n\sin\left(\frac{2\pi n}{\lambda}x\right)\right]\right)\cos\left(\frac{2\pi m}{\lambda}x\right)dx$

Every integral in this expression involves orthogonal functions except for the integral of the two cosines where $$n=m$$. Using Equation 1.7.2 gives:

$\int\limits_0^{\lambda}f\left(x\right)\cos\left(\frac{2\pi m}{\lambda}x\right)dx=a_n\int\limits_0^{\lambda}\cos\left(\frac{2\pi m}{\lambda}x\right)\cos\left(\frac{2\pi n}{\lambda}x\right)dx~~~\Rightarrow~~~a_n=\frac{2}{\lambda}\int\limits_0^{\lambda}f\left(x\right)\cos\left(\frac{2\pi m}{\lambda}x\right)dx$

We can compute the $$b_n$$ coefficients the same way:

$b_n=\frac{2}{\lambda}\int\limits_0^{\lambda}f\left(x\right)\sin\left(\frac{2\pi m}{\lambda}x\right)dx$

What we effectively have here is a means of writing down the "recipe" of any periodic wave as a collection of numbers, $$a_n$$ and $$b_n$$.  This collection may be infinite in number, or possibly not, but even if it is infinite, it may be possible in some cases to just keep the most important terms in the series as an approximation.  This "recipe" is sometimes referred to as the spectral content of the wave. This is because it tells us the contribution of each harmonic wave that comprises it, with the harmonic waves differing from each other by an integer fraction of the wavelength of the periodic wave. In a later chapter, we will see how this concept can be generalized to non-periodic waves as well, and we will find that this requires that the spectral content take into account all wavelengths, not just integer fractions.  That is, while the "spectrum" for the periodic wave consists of discrete choices of harmonic wavelengths, the spectrum of a non-periodic wave (like a wave pulse) requires the whole continuum of possible harmonic wavelengths.

## Application to Standing Waves

It's easy to get lost in all the math above and forget what all of it means, so let's take a step back and take a look at the big picture.  One place where this math becomes very useful is with standing waves.  Consider a string that is fixed at both ends. We found that it can vibrate in an infinite number of harmonics, defined by the number of half-wavelengths that fit between the two fixed ends.  We also found that the solutions to the wave equation that describe standing waves are separable, with the frequency of vibration uniquely defined for each harmonic.  But what if the wave is not one of these nice sinusoids?

We know standing waves occur because two identical waves moving in opposite directions interfere with each other.  We also know that these two opposite-moving waves are arranged so that the boundary conditions hold (in the case we are considering, these are fixed endpoints).  We've seen a model for this when we first discussed wave reflection, in Figure 1.5.6a.  In that case, we considered only two transient wave pulses, but with both ends fixed, this dance repeats over and over, as the wave bounces back and forth.  So rather than just one imaginary wave pulse to interact with the actual wave, we have two infinitely-long periodic waves that continuously interact with each other, as we see in Figure 1.5.7, but with an arbitrary function rather than a sinusoid:

Figure 1.7.1 – Opposing Wave Model of a General Standing Wave

We know that the opposite-moving waves must superpose perfectly to continually result in total cancellation at the fixed endpoints, so this gives us the shape of the combination of those waves outside the endpoints. Just like the case of the wave pulse, these "imaginary" sections have to be reflections of what is between the fixed points. The amazing upshot here is that this means that the infinitely-long standing wave (extended beyond the endpoints) is periodic in space, with a wavelength equal to twice the distance separating the two endpoints.

Now that we know that a standing wave of any shape is equivalent to a half-wavelength segment of a full periodic wave (such that the boundary conditions are met at the endpoints), we can employ the power of Fourier series to standing waves. Defining the left fixed end as the origin $$x=0$$, and insisting that the other end remain fixed (the ends are separated by a distance $$L$$), we find that the possible harmonic standing wave waveforms (the first three of which are depicted in Figure 1.5.10) have the form:

$g_n\left(x\right)=A\sin\left(\frac{n\pi}{L}x\right)~,$

where $$n$$ is the number of antinodes present.  We know that a full arbitrary waveform with wavelength equal to $$2L$$ can be expressed in terms of a Fourier series, according to Equation 1.7.5.  This waveform must remain zero at all times at $$x=0$$ and $$x=L=\frac{\lambda}{2}$$, and plugging this into the series gives us that all of the $$a$$ coefficients vanish, leaving only:

$f\left(x\right)=\sum\limits_{n=1}^{n=\infty}b_n\sin\left(\frac{2\pi n}{\lambda}x\right)=\sum\limits_{n=1}^{n=\infty}b_n\sin\left(\frac{\pi n}{L}x\right)$

So an arbitrary standing wave waveform can be written in terms of a sum of harmonic wave functions. What is more, we can determine exactly the recipe for this sum. Noting that $$\lambda=2L$$, we get:

$b_n=\frac{2}{\lambda}\int\limits_0^{\lambda}f\left(x\right)\sin\left(\frac{2\pi n}{\lambda}x\right)dx=\frac{1}{L}\int\limits_0^{2L}f\left(x\right)\sin\left(\frac{\pi n}{L}x\right)dx$

This can be simplified still further.  The wave in the region from $$x=L$$ to $$x=2L$$ is the same as in the region from $$x=0$$ to $$x=L$$, except that it is reflected both horizontally and vertically.  But the same is true of every sine function in the series!  This means that the integral that computes $$b_n$$ is the same from $$x=L$$ to $$x=2L$$ as it is from $$x=0$$ to $$x=L$$.  This allows us to change the limits of integration from $$0\rightarrow 2L$$ to $$0\rightarrow L$$, if we just multiply the integral by 2.  This gives:

$b_n=\frac{2}{L}\int\limits_0^{L}f\left(x\right)\sin\left(\frac{\pi n}{L}x\right)dx$

We have focused entirely on the waveform of the standing wave, but it is also evolving in time.  How do we handle that?  We found in our application of separation of variables to standing waves that every harmonic has associated with it a unique frequency.  This is also evident from the fact that the speed of every wave in the medium is the same, and $$v=\lambda f$$, so there is a different frequency associated with every wavelength. The total standing wave is a linear combination of all the harmonic traveling waves, each of those being separable according to Equation 1.2.18:

$f\left(x,t\right)=\sum\limits_{n=1}^{n=\infty}f_n\left(x,t\right)=\sum\limits_{n=1}^{n=\infty}\big[\left(a_n\cos k_nx+b_n\sin k_nx\right)\left(c_n\cos \omega_nt+d_n\sin \omega_nt\right)\big]$

If we define our $$t=0$$ time as the time when we see the function $$f\left(x\right)$$ on the string (i.e. $$f\left(x\right)=f\left(x,0\right)$$), and we include our boundary conditions so that the $$x$$ portion of the wave is the Fourier series, then we have:

$f\left(x,0\right)=f\left(x\right)=\sum\limits_{n=1}^{n=\infty}\big[\left(0+b_n\sin\left(\frac{n\pi}{L}x\right)\right)\left(c_n\cos 0+d_n\sin 0\right)\big]~~~\Rightarrow~~~c_n=1 \\ \Rightarrow~~~f\left(x,t\right)=\sum\limits_{n=1}^{n=\infty}b_n\sin\left(\frac{n\pi}{L}x\right)\left(\cos\omega_nt+d_n\sin \omega_nt\right)$

The only free parameters remaining are the $$d_n$$'s (the $$\omega_n$$'s are obtained from $$k_n=\frac{n\pi}{L}$$, as we preseumably know the speed of the wave on the string), and these can only be determined by some additional time condition.  They provide the relative phases of the individual harmonic waves.  That is, we know how all of the harmonic waves are aligned at the moment in time $$t=0$$, and we know the frequency of oscillation of each of these waves, but we don't know how their phases compare, so we need one more piece of information to know precisely how the standing wave will evolve.  For example, we don't know if the standing wave at $$t=0$$ is stationary or moving. Quite often, we are interested in cases where the string is distorted and released from rest, and asked how the standing wave evolves.  In this case, we do have a definitive answer.  In this case, the first derivative of the function with respect to time is zero, which means:

$0=\left[\frac{\partial}{\partial t}f\right]_{t=0}=\sum\limits_{n=1}^{n=\infty}b_n\sin\left(\frac{n\pi}{L}x\right)\left[-\omega_n\sin\omega_nt+d_n\omega_n\cos \omega_nt\right]_{t=0}~~~\Rightarrow~~~d_n=0$

And we get the simple final result:

$f\left(x,t\right)=\sum\limits_{n=1}^{n=\infty}b_n\sin\left(\frac{n\pi}{L}x\right)\cos\omega_nt~,~~~\text{where:}~~b_n=\frac{2}{L}\int\limits_0^{L}f\left(x\right)\sin\left(\frac{\pi n}{L}x\right)dx~, ~~\text{and}~~\omega_n = \frac{\pi nv}{L}$

To summarize, in words...

If we are given an arbitrary starting configuration of a string between two fixed points separated by $$L$$ (or in general, any standing wave with known boundary conditions), we can use the Fourier series to decompose that configuration into a sum of many (perhaps an infinite number) of harmonic functions with wavelengths that are integer fractions of $$2L$$. We can compute the coefficients that multiply each harmonic function (the "recipe" of the starting configuration) using the overlap integral of the the starting function with each harmonic function.  Then, with some information about the starting motion of the string (e.g. it is stationary), we can construct the full final solution by multiplying each harmonic function in $$x$$ by a harmonic function in $$t$$ with the correct frequency, where $$\omega_n=k_nv$$ and $$v$$ is the speed of a traveling wave on that string.

This page titled 1.7: Fourier Analysis is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Tom Weideman.