Fourier Series and Transform
Fourier Series
A Fourier Series is an expansion of trigonometric functions to model periodic functions. This method proves useful in the study of harmonic systems as the analysis in a more familiar domain is much simpler than in its original domain. It has a variety of applications ranging from signal processing to quantum mechanics. The Fourier Series is defined as:
[math]\displaystyle{ f(x)=\sum_{n=1}^{\infty}{a_n\cos{(\frac{n\pi x}{L}})}+\sum_{n=1}^{\infty}{b_n\sin{(\frac{n\pi x}{L}})} }[/math]
for [math]\displaystyle{ x\in[-L,L] }[/math]
Intuition
Many physical systems can be modeled by square waves. Consider systems with on-off behavior, similar to an on-and-off switch. A sine wave and square wave looks like this respectively:
As the diagram hints, we can use the Fourier Series to get from the sine wave to the square wave. Consider this progression of solely sine functions. We know what [math]\displaystyle{ f(x)=\sin(x) }[/math] looks like. If we keep adding a term in the partial sum for all odd integers of [math]\displaystyle{ f(x)=\frac{\sin(nx)}{n} }[/math], the development of the square wave is noticeable as n increases:
The darker function is [math]\displaystyle{ f(x)=\sin(x) }[/math] and the lighter function is the partial sum of the series to the fifth term. As you can see, the series function is beginning to look more like a square wave as [math]\displaystyle{ n \to \infty }[/math]. In using a summation of sines (and\or cosines), we can eventually reach the square wave.
Finding Coefficients
If we take the formula for a general Fourier Series, we can manipulate it to derive the formulas for [math]\displaystyle{ a_1, a_n, }[/math] and [math]\displaystyle{ b_n }[/math]
We have [math]\displaystyle{ f(x)=\sum_{n=1}^{\infty}{a_n\cos{(\frac{n\pi x}{L}})}+\sum_{n=1}^{\infty}{b_n\sin{(\frac{n\pi x}{L}})} }[/math]
for [math]\displaystyle{ x\in[-L,L] }[/math]
Multiply both sides by [math]\displaystyle{ \cos{(\frac{m\pi x}{L})} }[/math] and integrate for [math]\displaystyle{ x\in[-L,L] }[/math]:
[math]\displaystyle{ \int_{-L}^{L}{f(x)\cos{(\frac{m\pi x}{L})}}dx=\sum_{n=1}^{\infty}{a_n\int_{-L}^{L}{\cos{(\frac{n\pi x}{L}})\cos{(\frac{m\pi x}{L}})}}dx+\sum_{n=1}^{\infty}{b_n\int_{-L}^{L}{\sin{(\frac{n\pi x}{L}})\cos{(\frac{m\pi x}{L})}}}dx }[/math]
The integral in the first series is always zero if [math]\displaystyle{ n\neq m }[/math] and the integral in the second series is always zero due to the mutual orthogonality of sines and cosines.
Hence we have the reduced system:
[math]\displaystyle{ \int_{-L}^{L}{f(x)\cos{(\frac{m\pi x}{L})}}dx=\left\{
\begin{array}{lr}
a_m \cdot (2L), & \text{if } m=n=0\\
a_m \cdot (L), & \text{if } m=n\neq0
\end{array}
\right\} }[/math]
In noting the case that [math]\displaystyle{ m=n=0 }[/math], recall that [math]\displaystyle{ \cos(0)=1 }[/math] which yields the following when solving for [math]\displaystyle{ a_0 }[/math]:
[math]\displaystyle{ a_0=\frac{1}{2L}\int_{-L}^{L}{f(x)dx} }[/math]
And in the case where [math]\displaystyle{ m=n\neq0 }[/math], we cannot eliminate the cosine term. Solving for [math]\displaystyle{ A_m }[/math] yields:
[math]\displaystyle{ a_n=\frac{1}{L}\int_{-L}^{L}{f(x)\cos{(\frac{m\pi x}{L})dx}} }[/math]
For [math]\displaystyle{ a_n }[/math], we can repeat the process except for his time we multiply both sides of the Fourier Series equation by [math]\displaystyle{ \sin{(\frac{n\pi x}{L})} }[/math]:
[math]\displaystyle{ \int_{-L}^{L}{f(x)\sin{(\frac{m\pi x}{L})}}dx=\sum_{n=1}^{\infty}{a_n\int_{-L}^{L}{\cos{(\frac{n\pi x}{L}})\sin{(\frac{m\pi x}{L}})}}dx+\sum_{n=1}^{\infty}{b_n\int_{-L}^{L}{\sin{(\frac{n\pi x}{L}})\sin{(\frac{m\pi x}{L})}}}dx }[/math]
For the same reason as before, the first series is always equal to zero and the other series is always equal to zero if [math]\displaystyle{ m\neq m }[/math]
Hence the equality simplifies to:
[math]\displaystyle{ \int_{-L}^{L}{f(x)\sin{(\frac{m\pi x}{L})}dx}=L\cdot b_m }[/math]
Which yields: [math]\displaystyle{ b_m=\frac{1}{L}\int_{-L}^L{f(x)\sin{(\frac{m\pi x}{L})}dx} }[/math]
Example
Below is an example of finding the Fourier series of a given function:
Find the Fourier Series for [math]\displaystyle{ f(x)=x }[/math].
This is simply a matter of using the derived equations to evaluate the coefficients:
[math]\displaystyle{ a_0=\frac{1}{2L}\int_{-L}^{L}{f(x)dx} }[/math]
[math]\displaystyle{ a_0=\frac{1}{2L}\int_{-L}^{L}{(x)dx}=\frac{1}{2L}(Lx-\frac{x^2}{2})\bigg|^L_{-L} }[/math]
[math]\displaystyle{ a_0=0
}[/math]
For [math]\displaystyle{ a_n }[/math]:
[math]\displaystyle{ a_n=\frac{1}{L}\int_{-L}^{L}{f(x)\cos{(\frac{m\pi x}{L})dx}} }[/math]
[math]\displaystyle{ a_n=\frac{1}{L}\int_{-L}^{L}{(x)\cos{(\frac{m\pi x}{L})dx}} }[/math]
[math]\displaystyle{ a_n=0 }[/math] (via the opposite bounds of integration over an odd function)
For [math]\displaystyle{ b_n }[/math]:
[math]\displaystyle{ b_n=\frac{1}{L}\int_{-L}^L{f(x)\sin{(\frac{m\pi x}{L})}dx} }[/math]
[math]\displaystyle{ b_n=\frac{1}{L}\int_{-L}^L{x\sin{(\frac{m\pi x}{L})}dx} }[/math]
[math]\displaystyle{ b_n=\frac{-Lx}{\pi n}\cos(\frac{n\pi x}{L})\bigg|^L_{-L}+\int_{-L}^{L}{\frac{L}{\pi n}\cos(\frac{n\pi x}{L})dx} }[/math] (via integration by parts)
[math]\displaystyle{ b_n=\bigg(-\frac{Lx}{n\pi}\cos(\frac{n\pi x}{L})+\frac{L^2}{\pi^2n^2}\sin(\frac{n\pi x}L{})\bigg)\bigg|^L_{-L} }[/math]
Solving for the boundaries gives:
[math]\displaystyle{ \lim_{x\to-L^+}{\bigg(-\frac{Lx}{n\pi}\cos(\frac{n\pi x}{L})+\frac{L^2}{\pi^2n^2}\sin(\frac{n\pi x}L{})\bigg)}=\frac{(-1)^nL^2}{\pi n} }[/math]
[math]\displaystyle{ \lim_{x\to L^-}{\bigg(-\frac{Lx}{n\pi}\cos(\frac{n\pi x}{L})+\frac{L^2}{\pi^2n^2}\sin(\frac{n\pi x}{L})\bigg)}=-\frac{(-1)^nL^2}{\pi n} }[/math]
[math]\displaystyle{ b_n=-\frac{(-1)^nL^2}{\pi n}-\frac{(-1)^nL^2}{\pi n} }[/math]
[math]\displaystyle{ b_n=-2\frac{(-1)^nL^2}{\pi n} }[/math]
Now we have all the information we need to construct the Fourier Series:
[math]\displaystyle{ F(x)=\frac{1}{2L}\cdot0 + \sum_{n=1}^{\infty}{\frac{1}{L}(-2\frac{(-1)^nL^2}{\pi n})\sin(\frac{n\pi x}{L})} }[/math]
[math]\displaystyle{ F(x)=\sum_{n=1}^{\infty}{(-2\frac{(-1)^nL}{\pi n})\sin(\frac{n\pi x}{L})} }[/math]