Definition of the Fourier Series
A rigorous formulation for functions of arbitrary period
Basic (university years 2–3)
Introduction
In the introductory part we worked with functions of period $2\pi$, but real applications require functions of an arbitrary period. In this chapter we define the Fourier series of a function of period $2L$ in general.
Fourier Series for a General Period
The Fourier series of a function $f(x)$ of period $2L$ (that is, $f(x + 2L) = f(x)$) is:
$$f(x) = \dfrac{a_0}{2} + \displaystyle\sum_{n=1}^{\infty}\left(a_n\cos\dfrac{n\pi x}{L} + b_n\sin\dfrac{n\pi x}{L}\right)$$
Strictly speaking, the series on the right-hand side is defined to be the Fourier series of $f$. Whether it actually equals $f(x)$ itself (whether the equality holds) is a question of convergence, which holds under conditions such as $f$ being piecewise smooth (treated in a later chapter).
Here the fundamental angular frequency is $\omega = \dfrac{\pi}{L}$, and the angular frequency of the $n$-th term is $n\omega = \dfrac{n\pi}{L}$.
Relation to the period-$2\pi$ case
When $L = \pi$, we have $\dfrac{n\pi x}{L} = nx$, which agrees with the formula from the introductory part.
Why $L$ is taken as the "half-period": here $L$ is not the period itself but the half-period (half the width of the integration interval $[-L,L]$). With this choice, the period-$2\pi$ formulas from the introductory part generalize simply by "replacing $\pi$ with $L$," giving a very clean correspondence.
| Period $2\pi$ | General (period $2L$) | |
|---|---|---|
| Half-period | $\pi$ | $L$ |
| Interval | $[-\pi,\pi]$ | $[-L,L]$ |
| Basis | $\cos nx,\ \sin nx$ | $\cos\dfrac{n\pi x}{L},\ \sin\dfrac{n\pi x}{L}$ |
If instead you take "period $L$", the interval becomes $[-L/2,\,L/2]$ and the basis $\cos\dfrac{2\pi n x}{L}$, scattering factors of $2$ everywhere. In engineering and signal processing this period-$L$ convention (where the frequency $n/L$ appears directly) is also widely used. Both are correct; using $2L$ is merely a notational convention.
Formulas for the Fourier Coefficients
The Fourier coefficients are given by the following integrals:
$$a_0 = \dfrac{1}{L}\displaystyle\int_{-L}^{L}f(x)\,dx$$
$$a_n = \dfrac{1}{L}\displaystyle\int_{-L}^{L}f(x)\cos\dfrac{n\pi x}{L}\,dx \quad (n \geq 1)$$
$$b_n = \dfrac{1}{L}\displaystyle\int_{-L}^{L}f(x)\sin\dfrac{n\pi x}{L}\,dx \quad (n \geq 1)$$
On the interval of integration
The interval need not be $[-L, L]$; any interval of length $2L$ works. For example, $[0, 2L]$ gives the same result. Since the function is periodic, integrating over one period is enough.
Generalization of Orthogonality
For period $2L$, the orthogonality relations are:
$$\displaystyle\int_{-L}^{L}\cos\dfrac{m\pi x}{L}\cos\dfrac{n\pi x}{L}\,dx = \begin{cases} 0 & (m \neq n) \\ L & (m = n \neq 0) \\ 2L & (m = n = 0) \end{cases}$$
$$\displaystyle\int_{-L}^{L}\sin\dfrac{m\pi x}{L}\sin\dfrac{n\pi x}{L}\,dx = \begin{cases} 0 & (m \neq n) \\ L & (m = n) \end{cases}$$
$$\displaystyle\int_{-L}^{L}\cos\dfrac{m\pi x}{L}\sin\dfrac{n\pi x}{L}\,dx = 0 \quad (\text{all } m, n)$$
From these orthogonality relations, the formulas for the Fourier coefficients are derived.
Derivation of the Coefficient Formulas
Derivation of $a_n$
Multiply both sides of the Fourier series by $\cos\dfrac{n\pi x}{L}$ and integrate from $-L$ to $L$ (here we compute formally, assuming the sum and the integral may be interchanged):
$$\displaystyle\int_{-L}^{L}f(x)\cos\dfrac{n\pi x}{L}\,dx = \displaystyle\int_{-L}^{L}\dfrac{a_0}{2}\cos\dfrac{n\pi x}{L}\,dx + \displaystyle\sum_{m=1}^{\infty}\displaystyle\int_{-L}^{L}a_m\cos\dfrac{m\pi x}{L}\cos\dfrac{n\pi x}{L}\,dx + \cdots$$
By orthogonality, every term except the $m = n$ term vanishes:
$$\displaystyle\int_{-L}^{L}f(x)\cos\dfrac{n\pi x}{L}\,dx = a_n \cdot L$$
Therefore:
$$a_n = \dfrac{1}{L}\displaystyle\int_{-L}^{L}f(x)\cos\dfrac{n\pi x}{L}\,dx$$
$b_n$ is derived in the same way.
Physical Meaning of the Coefficients
$a_0/2$: the DC component
$$\dfrac{a_0}{2} = \dfrac{1}{2L}\displaystyle\int_{-L}^{L}f(x)\,dx$$
This is the average value of the function over one period. In an electrical signal it corresponds to the "DC component."
$a_n$, $b_n$: the strength of each frequency component
Amplitude: $c_n = \sqrt{a_n^2 + b_n^2}$
Phase: $\phi_n = \arctan\left(-\dfrac{b_n}{a_n}\right)$
(In practice, to handle the quadrant correctly, one usually uses $\operatorname{atan2}(-b_n,\,a_n)$ rather than $\arctan$.)
Using these:
$$a_n\cos\dfrac{n\pi x}{L} + b_n\sin\dfrac{n\pi x}{L} = c_n\cos\left(\dfrac{n\pi x}{L} + \phi_n\right)$$
Worked Example
A square wave of period $2$
$$f(x) = \begin{cases} 1 & (0 < x < 1) \\ -1 & (-1 < x < 0) \end{cases}$$
Since $L = 1$, we have $\dfrac{n\pi x}{L} = n\pi x$.
Since the function is odd, $a_n = 0$.
$$b_n = \displaystyle\int_{-1}^{1}f(x)\sin n\pi x\,dx = 2\displaystyle\int_0^1\sin n\pi x\,dx = \dfrac{2}{n\pi}(1 - \cos n\pi) = \dfrac{2}{n\pi}(1 - (-1)^n)$$
When $n$ is even, $b_n = 0$; when $n$ is odd, $b_n = \dfrac{4}{n\pi}$. That is, only the odd harmonics appear.
$$f(x) = \dfrac{4}{\pi}\left(\sin\pi x + \dfrac{\sin 3\pi x}{3} + \dfrac{\sin 5\pi x}{5} + \cdots\right)$$
Summary
- The Fourier series of a function of period $2L$ is expressed using $\cos\dfrac{n\pi x}{L}$ and $\sin\dfrac{n\pi x}{L}$
- The Fourier coefficients can be computed using orthogonality
- $a_0/2$ represents the average value of the function
- The amplitude $c_n = \sqrt{a_n^2 + b_n^2}$ represents the strength of each frequency component
Frequently Asked Questions
Q. What is a Fourier series?
It is an expansion that represents a periodic function as an infinite sum of trigonometric functions (sines and cosines). In the form f(x)=a₀/2 + Σ(aₙcos(nωx)+bₙsin(nωx)), it decomposes the original function into frequency components.
Q. How are the Fourier coefficients computed?
For a function f(x) of period T, the Fourier coefficients are computed by the integrals aₙ=(2/T)∫f(x)cos(2πnx/T)dx and bₙ=(2/T)∫f(x)sin(2πnx/T)dx. The orthogonality of the trigonometric functions is the key.
Q. When does a Fourier series converge?
For a piecewise-smooth function, the Fourier series converges at almost every point. At points of continuity it converges to f(x) itself, and at a jump discontinuity it converges to the average of the left and right limits, (f(x+)+f(x-))/2.