Skip to content
Oakfield Operator Calculus Function Reference Site

Fourier Series

Let ff be a 2π2\pi-periodic function integrable on [π,π][-\pi,\pi]. The Fourier series of ff is the trigonometric series

f(x)a02+n=1(ancos(nx)+bnsin(nx))f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} \bigl( a_n \cos(nx) + b_n \sin(nx) \bigr)

where the Fourier coefficients are defined by

an=1πππf(x)cos(nx)dx,bn=1πππf(x)sin(nx)dxa_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\cos(nx)\,dx, \qquad b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\sin(nx)\,dx

The symbol “\sim” denotes convergence in the appropriate sense.


The Fourier series construction applies to real- or complex-valued functions defined on a finite interval with periodic extension. The series represents a function on R\mathbb{R} with period 2π2\pi.


The trigonometric basis functions satisfy the orthogonality relations

ππcos(nx)cos(mx)dx=ππsin(nx)sin(mx)dx=πδnm\int_{-\pi}^{\pi} \cos(nx)\cos(mx)\,dx = \int_{-\pi}^{\pi} \sin(nx)\sin(mx)\,dx = \pi\,\delta_{nm}

and

ππsin(nx)cos(mx)dx=0\int_{-\pi}^{\pi} \sin(nx)\cos(mx)\,dx = 0

These identities underlie the coefficient formulas. Here n,m1n,m\ge 1; the constant mode satisfies ππ11dx=2π\int_{-\pi}^{\pi} 1\cdot 1\,dx = 2\pi.


Equivalently, the Fourier series may be written in complex-exponential form:

f(x)n=cneinxf(x) \sim \sum_{n=-\infty}^{\infty} c_n e^{inx}

with coefficients

cn=12πππf(x)einxdxc_n = \frac{1}{2\pi} \int_{-\pi}^{\pi} f(x)e^{-inx}\,dx

The Fourier series map is linear:

F(af+bg)=aF(f)+bF(g)\mathcal{F}(af + bg) = a\,\mathcal{F}(f) + b\,\mathcal{F}(g)

for scalars a,ba,b and admissible functions f,gf,g.


If ff is sufficiently smooth, termwise differentiation yields

ddxn=cneinx=n=(in)cneinx\frac{d}{dx} \sum_{n=-\infty}^{\infty} c_n e^{inx} = \sum_{n=-\infty}^{\infty} (in)c_n e^{inx}

Integration acts by division by inin for n0n \neq 0.


If ff is piecewise smooth, the Fourier series converges pointwise to

12(f(x+)+f(x))\frac{1}{2}\bigl(f(x^+) + f(x^-)\bigr)

at each point xx.

Discontinuities produce the Gibbs phenomenon.


If ff is even, all sine coefficients vanish:

bn=0b_n = 0

If ff is odd, all cosine coefficients vanish:

an=0a_n = 0

For integer k1k \ge 1,

cos(kx),sin(kx)\cos(kx), \sin(kx)

have Fourier series consisting of a single nonzero mode.


The Fourier series is the discrete-frequency analogue of the Fourier transform. Complex exponentials form an orthogonal basis for periodic function spaces. Connections extend to eigenfunction expansions of linear differential operators.


Oakfield uses “Fourier series” most directly in its stimulus operators (explicit sums of harmonics / Fourier features):

  • Spectral line synthesis: stimulus_spectral_lines generates sums of spatial harmonics with optional temporal oscillation (for real fields the implied spectrum is Hermitian-symmetric; complex fields can represent single-sided lines).
  • Random Fourier features: stimulus_random_fourier synthesizes structured fields as sums of random cosine features with configurable band limits and spectral slope.
  • Single-mode waveforms: the sinusoidal stimulus family is effectively a one-term Fourier series (single harmonic with phase/velocity controls).

For full spectral transforms and mode-by-mode operators, Oakfield relies on discrete FFTs (see the Fourier transform docs).


Joseph Fourier introduced trigonometric series to study heat conduction, asserting that arbitrary functions could be expanded in sines and cosines.

Dirichlet and others established precise convergence conditions, clarifying the mathematical foundations of Fourier analysis.

Fourier series are now understood as expansions in orthogonal bases of Hilbert spaces, forming a cornerstone of harmonic analysis, PDE theory, and numerical computation.


  • J. Fourier, Théorie analytique de la chaleur (1822)
  • Dirichlet, Sur la convergence des séries trigonométriques
  • NIST Digital Library of Mathematical Functions (DLMF), §1.4