#Regulation

Understanding Fourier Series: From Trigonometric Expansions to Hilbert‑Space Orthogonality

Python Reporter
5 min read

A comprehensive walk‑through of Fourier series, covering coefficient derivation, convergence conditions, cosine/sine special cases, extensions for non‑periodic functions, a detailed triangular‑wave example, compact sinusoid form, complex‑exponential representation, and the linear‑algebraic view in Hilbert spaces.

Understanding Fourier Series: From Trigonometric Expansions to Hilbert‑Space Orthogonality

Fourier series let us write a periodic function as an infinite sum of sinusoids. The theory is elegant, the calculations are systematic, and the connection to linear algebra is striking. Below is a self‑contained guide that walks through the derivation of the coefficients, discusses when the series converges, shows how symmetry simplifies the expansion, and ties everything back to orthogonal bases in a Hilbert space.


1. Deriving the Trigonometric Coefficients

Assume a well‑behaved L‑periodic function (f(x)). We look for constants (a_0, a_n, b_n) such that

[ f(x) ;=; \frac{a_0}{2} + \sum_{n=1}^{\infty}\bigl(a_n\cos\tfrac{2\pi n}{L}x + b_n\sin\tfrac{2\pi n}{L}x\bigr). ]

The constant term is written as (a_0/2) because the average value of (f) over one period is

[ a_0 = \frac{2}{L}\int_{-L/2}^{L/2} f(x),dx. ]

Step‑by‑step coefficient extraction

  1. Integrate both sides over one period. All integrals of sines and cosines vanish (Appendix A), leaving the formula for (a_0).

  2. Multiply by (\cos\tfrac{2\pi m}{L}x) and integrate. Orthogonality of sines and cosines (Appendix B) kills every term except the one with (a_m), giving

    [ a_m = \frac{2}{L}\int_{-L/2}^{L/2} f(x)\cos\tfrac{2\pi m}{L}x,dx. ]

  3. Multiply by (\sin\tfrac{2\pi m}{L}x) and integrate. The same reasoning yields

    [ b_m = \frac{2}{L}\int_{-L/2}^{L/2} f(x)\sin\tfrac{2\pi m}{L}x,dx. ]

These three formulas give the full set of Fourier coefficients.


2. When Does the Series Converge?

The derivation assumes that (f) is square‑integrable ((f\in L^2[-L/2,L/2])) and piecewise smooth – each piece has continuous derivatives, and only finitely many jump discontinuities exist. Under these conditions:

  • At every point where (f) is continuous, the Fourier series converges to (f(x)).
  • At a jump, the series converges to the midpoint of the jump (the classic Gibbs phenomenon).

These are the standard Dirichlet conditions; they cover most functions used in engineering and physics.


3. Exploiting Symmetry: Cosine and Sine Series

If (f) is even ((f(-x)=f(x))), the sine coefficients vanish because the integrand becomes odd. The series reduces to a cosine series:

[ f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n\cos\tfrac{2\pi n}{L}x. ]

If (f) is odd ((f(-x)=-f(x))), the cosine coefficients disappear, leaving a sine series:

[ f(x) = \sum_{n=1}^{\infty} b_n\sin\tfrac{2\pi n}{L}x. ]

These reductions are useful because they halve the number of integrals you need to evaluate.


4. Extending Non‑Periodic Functions on a Finite Interval

Suppose we have a function defined only on ([0,,L]). To apply Fourier analysis we must create a periodic extension. Common choices are:

Extension type Definition on ([-L,0)) Resulting series
Direct periodic repetition (f(x+L)=f(x)) General Fourier series
Even extension (f(-x)=f(x)) Cosine series
Odd extension (f(-x)=-f(x)) Sine series

The series always converges to the periodic extension on the interior of ([0,,L]). The choice of extension determines which coefficients are zero.


5. Worked Example: Triangular Wave (Period 4)

Consider the odd triangular wave defined on ([-2,2]) by

[ f(x) = \begin{cases} x+2, & -2\le x < 0,\ 2-x, & 0\le x \le 2. \end{cases} ]

Because the function is odd, only sine terms survive. With (L=4) (so the fundamental frequency is (\pi/2)), the coefficient is

[ b_n = \frac{2}{4}\int_{-2}^{2} f(x)\sin\frac{\pi n}{2}x,dx. ]

The integrand is even, so we double the integral over ([0,2]). Splitting at the kink (x=1) and using integration by parts (Appendix C) yields

[ b_n = \frac{8}{\pi^2 n^2}\bigl[1-(-1)^n\bigr]. ]

Thus (b_n=0) for even (n) and for odd (n)

[ b_{2k+1}=\frac{16}{\pi^2 (2k+1)^2}. ]

The Fourier series becomes

[ f(x) = \sum_{k=0}^{\infty}\frac{16}{\pi^2 (2k+1)^2}\sin\bigl((2k+1)\tfrac{\pi}{2}x\bigr). ]

An interactive plot (see the original notes) shows rapid convergence as the number of terms grows.


6. Compact Phase‑Shifted Form

A pair of sine and cosine terms at the same frequency can be merged into a single sinusoid with amplitude (A_n) and phase (\phi_n):

[ a_n\cos\omega_n x + b_n\sin\omega_n x = A_n\sin(\omega_n x + \phi_n), ]

where

[ A_n = \sqrt{a_n^2 + b_n^2}, \qquad \phi_n = \operatorname{atan2}(a_n, b_n). ]

This representation is handy in signal‑processing contexts because it directly reveals the magnitude and phase of each harmonic.


7. Complex Exponential Form

Euler's formula (e^{i\theta}=\cos\theta+i\sin\theta) lets us rewrite the series as

[ f(x) = \sum_{n=-\infty}^{\infty} c_n e^{i\frac{2\pi n}{L}x}, ]

with coefficients

[ c_n = \frac{1}{L}\int_{-L/2}^{L/2} f(x) e^{-i\frac{2\pi n}{L}x},dx. ]

For real‑valued (f), the coefficients satisfy (c_{-n}=\overline{c_n}), guaranteeing that the sum is real. The complex form is often more convenient for algebraic manipulation and for connecting Fourier series to the continuous Fourier transform.


8. Fourier Series as an Orthogonal Basis in a Hilbert Space

The set

[ \bigl{1,;\cos\tfrac{2\pi n}{L}x,;\sin\tfrac{2\pi n}{L}x\bigr}_{n\ge 1} ]

forms an orthogonal basis of the Hilbert space (L^2[-L/2, L/2]) equipped with the inner product

[ \langle g, h \rangle = \int_{-L/2}^{L/2} g(x)h(x),dx. ]

Orthogonality follows from the integrals in Appendix B:

[ \langle \cos\tfrac{2\pi n}{L}x,; \cos\tfrac{2\pi m}{L}x \rangle = \begin{cases} L/2, & n=m\neq0,\ 0, & n\neq m,\end{cases} ]

and similarly for sines, while sine–cosine inner products are always zero. The Fourier coefficients are precisely the projections of (f) onto these basis vectors:

[ a_n = \frac{2}{L}\langle f,\cos\tfrac{2\pi n}{L}x\rangle, \qquad b_n = \frac{2}{L}\langle f,\sin\tfrac{2\pi n}{L}x\rangle. ]

Thus Fourier analysis is nothing more than expanding a vector in an infinite‑dimensional Euclidean space.


9. Appendices (Reference Formulas)

Appendix A – Integrals of single sinusoids

[ \int_{-L/2}^{L/2}!\cos\tfrac{2\pi n}{L}x,dx = 0, \quad \int_{-L/2}^{L/2}!\sin\tfrac{2\pi n}{L}x,dx = 0 \quad (n\neq0). ]

Appendix B – Orthogonality of sine and cosine products

[ \int_{-L/2}^{L/2}!\cos\tfrac{2\pi n}{L}x,\cos\tfrac{2\pi m}{L}x,dx = \begin{cases}\frac{L}{2}, & n=m\neq0,\ 0, & n\neq m,\end{cases} ]

(and analogous formulas for sine–sine and sine–cosine).

Appendix C – Useful integral

[ \int x\cos(ax),dx = \frac{x\sin(ax)}{a}+\frac{\cos(ax)}{a^2}+C. ]

Appendix D – Converting a phase‑shifted sinusoid

[ A\sin(\omega x+\phi) = A\cos\phi,\sin\omega x + A\sin\phi,\cos\omega x. ]


Further Reading

Feel free to reach out with questions or comments via the author's email address listed on the original site.

Comments

Loading comments...