Fourier series

A Fourier series is an expansion of a periodic function into a sum of trigonometric functions. The Fourier series is an example of a trigonometric series, but not all trigonometric series are Fourier series. By expressing a function as a sum of sines and cosines, many problems involving the function become easier to analyze because trigonometric functions are well understood. For example, Fourier series were first used by Joseph Fourier to find solutions to the heat equation. This application is possible because the derivatives of trigonometric functions fall into simple patterns. Fourier series cannot be used to approximate arbitrary functions, because most functions have infinitely many terms in their Fourier series, and the series do not always converge. Well-behaved functions, for example smooth functions, have Fourier series that converge to the original function. The coefficients of the Fourier series are determined by integrals of the function multiplied by trigonometric functions, described in Common forms of the Fourier series below.

The study of the convergence of Fourier series focus on the behaviors of the partial sums, which means studying the behavior of the sum as more and more terms from the series are summed. The figures below illustrate some partial Fourier series results for the components of a square wave.

Fourier series are closely related to the Fourier transform, which can be used to find the frequency information for functions that are not periodic. Periodic functions can be identified with functions on a circle; for this reason Fourier series are the subject of Fourier analysis on a circle, usually denoted as $$\mathbb{T}$$ or $$S_1$$. The Fourier transform is also part of Fourier analysis, but is defined for functions on $$\mathbb{R}^n$$.

Since Fourier's time, many different approaches to defining and understanding the concept of Fourier series have been discovered, all of which are consistent with one another, but each of which emphasizes different aspects of the topic. Some of the more powerful and elegant approaches are based on mathematical ideas and tools that were not available in Fourier's time. Fourier originally defined the Fourier series for real-valued functions of real arguments, and used the sine and cosine functions in the decomposition. Many other Fourier-related transforms have since been defined, extending his initial idea to many applications and birthing an area of mathematics called Fourier analysis.

Common forms of the Fourier series
A Fourier series is a continuous, periodic function created by a summation of harmonically related sinusoidal functions. It has several different, but equivalent, forms, shown here as partial sums. But in theory $$N \rightarrow \infty.$$ The subscripted symbols, called coefficients, and the period, $$P,$$ determine the function $$s_{\scriptscriptstyle N}(x)$$ as follows:

$$

$$

$$

The harmonics are indexed by an integer, $$n,$$ which is also the number of cycles the corresponding sinusoids make in interval $$ P$$. Therefore, the sinusoids have:


 * a wavelength equal to $$\tfrac{P}{n}$$ in the same units as $$x$$.
 * a frequency equal to $$\tfrac{n}{P}$$ in the reciprocal units of $$x$$.

Clearly these series can represent functions that are just a sum of one or more of the harmonic frequencies. The remarkable thing is that it can also represent the intermediate frequencies and/or non-sinusoidal functions because of the infinite number of terms. The amplitude-phase form is particularly useful for its insight into the rationale for the series coefficients. (see ) The exponential form is most easily generalized for complex-valued functions. (see )

The equivalence of these forms requires certain relationships among the coefficients. For instance, the trigonometric identity: $$ means that:

$$

Therefore $$A_n$$ and $$B_n$$ are the rectangular coordinates of a vector with polar coordinates $$D_n$$ and $$\varphi_n.$$

The coefficients can be given/assumed, such as a music synthesizer or time samples of a waveform. In the latter case, the exponential form of Fourier series synthesizes a discrete-time Fourier transform where variable $$x$$ represents frequency instead of time.

But typically the coefficients are determined by frequency/harmonic analysis of a given real-valued function $$s(x),$$ and $$x$$ represents time: $$

The objective is for $$ s_{\scriptstyle{\infty}}$$ to converge to $$s(x)$$ at most or all values of $$x$$ in an interval of length $$P.$$   For the well-behaved functions typical of physical processes, equality is customarily assumed, and the Dirichlet conditions provide sufficient conditions.

The notation$$\int_P$$ represents integration over the chosen interval. Typical choices are $$[-P/2, P/2]$$ and $$[0, P]$$.  Some authors define $$P \triangleq 2 \pi$$ because it simplifies the arguments of the sinusoid functions, at the expense of generality. And some authors assume that $$s(x)$$ is also $$P$$-periodic, in which case $$ s_{\scriptstyle{\infty}}$$ approximates the entire function. The $$\tfrac{2}{P}$$ scaling factor is explained by taking a simple case: $$s(x) = \cos \left( 2\pi \tfrac{k}{P} x \right).$$ Only the $$n=k$$ term of $$ is needed for convergence, with $$A_k =1$$ and $$B_k = 0.$$  Accordingly $$ provides:


 * $$A_k = \frac{2}{P} \underbrace{\int_P \cos^2 \left( 2\pi \tfrac{k}{P} x \right) \,dx}_{P/2} = 1,$$         as required.

Exponential form coefficients
Another applicable identity is Euler's formula:



\begin{align} \cos\left(2\pi \tfrac{n}{P} x - \varphi_n \right) &{}\equiv \tfrac{1}{2} e^{ i \left(2\pi \tfrac{n}{P}x - \varphi_n \right)} + \tfrac{1}{2} e^{-i \left(2\pi \tfrac{n}{P}x - \varphi_n \right)} \\[6pt] & = \left(\tfrac{1}{2} e^{-i \varphi_n}\right) \cdot e^{i 2\pi \tfrac{+n}{P}x} +\left(\tfrac{1}{2} e^{-i \varphi_n}\right)^* \cdot e^{i 2\pi \tfrac{-n}{P}x} \end{align} $$

(Note: the ∗ denotes complex conjugation.)

Substituting this into $$ and comparison with $$ ultimately reveals:

$$

Conversely: $$

Substituting $$ into $$ also reveals: $$

Complex-valued functions
$$ and $$ also apply when $$s(x)$$ is a complex-valued function. This follows by expressing $$\operatorname{Re}(s_N (x))$$ and $$\operatorname{Im}(s_N(x))$$ as separate real-valued Fourier series, and $$s_N(x) = \operatorname{Re}(s_N(x)) + i\ \operatorname{Im}(s_N(x)).$$

Derivation
The coefficients $$D_n$$ and $$\varphi_n$$ can be understood and derived in terms of the cross-correlation between $$s(x)$$ and a sinusoid at frequency $$\tfrac{n}{P}$$. For a general frequency $$f,$$ and an analysis interval $$[x_0,x_0+P],$$ the cross-correlation function:

is essentially a matched filter, with template $$\cos(2\pi f x)$$.

The maximum of $$\Chi_f(\tau)$$ is a measure of the amplitude $$(D)$$ of frequency $$f$$ in the function $$s(x)$$, and the value of $$\tau$$ at the maximum determines the phase $$(\varphi)$$ of that frequency. Figure 2 is an example, where $$s(x)$$ is a square wave (not shown), and frequency $$f$$ is the $$4^{\text{th}}$$ harmonic. It is also an example of deriving the maximum from just two samples, instead of searching the entire function. Combining $$ with $$ gives:
 * $$\begin{align}

\Chi_n(\varphi) &= \tfrac{2}{P} \int_P s(x) \cdot \cos\left(2\pi \tfrac{n}{P} x-\varphi \right)\, dx &=\cos(\varphi)\cdot \underbrace{\tfrac{2}{P}\int_P s(x) \cdot \cos\left(2\pi \tfrac{n}{P} x\right)\, dx}_{A} +\sin(\varphi)\cdot \underbrace{\tfrac{2}{P}\int_P s(x) \cdot \sin\left(2\pi \tfrac{n}{P} x\right)\, dx}_{B}\\ &=\cos(\varphi)\cdot A + \sin(\varphi)\cdot B \end{align}$$
 * \quad \varphi \in [0, 2\pi]\\

The derivative of $$\Chi_n(\varphi)$$ is zero at the phase of maximum correlation.


 * $$\Chi'_n(\varphi)=\sin(\varphi)\cdot A - \cos(\varphi)\cdot B = 0

\quad \longrightarrow\quad \tan(\varphi) = \frac{B}{A} \quad \longrightarrow\quad \varphi = \arctan(B, A)$$

Therefore, computing $$A_n$$ and $$B_n$$ according to $$ creates the component's phase $$\varphi_n$$ of maximum correlation. And the component's amplitude is:

\begin{align} D_n \triangleq \Chi_n(\varphi_n)\ &= \cos(\varphi_n)\cdot A_n + \sin(\varphi_n)\cdot B_n \\ &=\frac{A_n}{\sqrt{A_n^2+B_n^2}}\cdot A_n + \frac{B _n}{\sqrt{A_n^2+B_n^2}}\cdot B_n =\frac{A_n^2+B_n^2}{\sqrt{A_n^2+B_n^2}} &= \sqrt{A_n^2+B_n^2}. \end{align} $$

Other common notations
The notation $$C_n$$ is inadequate for discussing the Fourier coefficients of several different functions. Therefore, it is customarily replaced by a modified form of the function ($s,$ in this case), such as $$\widehat{s}(n)$$ or $$S[n]$$, and functional notation often replaces subscripting:


 * $$\begin{align}

s(x) &= \sum_{n=-\infty}^\infty \widehat{s}(n)\cdot e^{i 2\pi \tfrac{n}{P} x} && \scriptstyle \text{common mathematics notation} \\ &= \sum_{n=-\infty}^\infty S[n]\cdot e^{i 2\pi \tfrac{n}{P} x} && \scriptstyle \text{common engineering notation} \end{align}$$

In engineering, particularly when the variable $$x$$ represents time, the coefficient sequence is called a frequency domain representation. Square brackets are often used to emphasize that the domain of this function is a discrete set of frequencies.

Another commonly used frequency domain representation uses the Fourier series coefficients to modulate a Dirac comb:
 * $$S(f) \ \triangleq \ \sum_{n=-\infty}^\infty S[n]\cdot \delta \left(f-\frac{n}{P}\right),$$

where $$f$$ represents a continuous frequency domain. When variable $$x$$ has units of seconds, $$f$$ has units of hertz. The "teeth" of the comb are spaced at multiples (i.e. harmonics) of $$\tfrac{1}{P}$$, which is called the fundamental frequency. $$s_{\infty}(x)$$ can be recovered from this representation by an inverse Fourier transform:


 * $$\begin{align}

\mathcal{F}^{-1}\{S(f)\} &= \int_{-\infty}^\infty \left( \sum_{n=-\infty}^\infty S[n]\cdot \delta \left(f-\frac{n}{P}\right)\right) e^{i 2 \pi f x}\,df, \\[6pt] &= \sum_{n=-\infty}^\infty S[n]\cdot \int_{-\infty}^\infty \delta\left(f-\frac{n}{P}\right) e^{i 2 \pi f x}\,df, \\[6pt] &= \sum_{n=-\infty}^\infty S[n]\cdot e^{i 2\pi \tfrac{n}{P} x} \ \ \triangleq \ s_\infty(x). \end{align}$$

The constructed function $$S(f)$$ is therefore commonly referred to as a Fourier transform, even though the Fourier integral of a periodic function is not convergent at the harmonic frequencies.

Analysis example
]



Consider a sawtooth function:
 * $$s(x) = \frac{x}{\pi}, \quad \mathrm{for } -\pi < x < \pi,$$
 * $$s(x + 2\pi k) = s(x), \quad \mathrm{for } -\pi < x < \pi \text{ and } k \in \mathbb{Z}.$$

In this case, the Fourier coefficients are given by
 * $$\begin{align}

A_n & = \frac{1}{\pi}\int_{-\pi}^{\pi}s(x) \cos(nx)\,dx = 0, \quad n \ge 0. \\[4pt] B_n & = \frac{1}{\pi}\int_{-\pi}^{\pi}s(x) \sin(nx)\, dx\\[4pt] &= -\frac{2}{\pi n}\cos(n\pi) + \frac{2}{\pi^2 n^2}\sin(n\pi)\\[4pt] &= \frac{2\,(-1)^{n+1}}{\pi n}, \quad n \ge 1.\end{align}$$ It can be shown that the Fourier series converges to $$s(x)$$ at every point $$x$$ where $$s$$ is differentiable, and therefore:

When $$x=\pi$$, the Fourier series converges to 0, which is the half-sum of the left- and right-limit of s at $$x=\pi$$. This is a particular instance of the Dirichlet theorem for Fourier series.

This example leads to a solution of the Basel problem.

Convergence
A proof that a Fourier series is a valid representation of any periodic function (that satisfies the Dirichlet conditions) is overviewed in.

In engineering applications, the Fourier series is generally assumed to converge except at jump discontinuities since the functions encountered in engineering are better-behaved than functions encountered in other disciplines. In particular, if $$s$$ is continuous and the derivative of $$s(x)$$ (which may not exist everywhere) is square integrable, then the Fourier series of $$s$$ converges absolutely and uniformly to $$s(x)$$. If a function is square-integrable on the interval $$[x_0,x_0+P]$$, then the Fourier series converges to the function at almost everywhere. It is possible to define Fourier coefficients for more general functions or distributions, in which case point wise convergence often fails, and convergence in norm or weak convergence is usually studied.

History
The Fourier series is named in honor of Jean-Baptiste Joseph Fourier (1768–1830), who made important contributions to the study of trigonometric series, after preliminary investigations by Leonhard Euler, Jean le Rond d'Alembert, and Daniel Bernoulli. Fourier introduced the series for the purpose of solving the heat equation in a metal plate, publishing his initial results in his 1807 Mémoire sur la propagation de la chaleur dans les corps solides (Treatise on the propagation of heat in solid bodies), and publishing his Théorie analytique de la chaleur (Analytical theory of heat) in 1822. The Mémoire introduced Fourier analysis, specifically Fourier series. Through Fourier's research the fact was established that an arbitrary (at first, continuous and later generalized to any piecewise-smooth ) function can be represented by a trigonometric series. The first announcement of this great discovery was made by Fourier in 1807, before the French Academy. Early ideas of decomposing a periodic function into the sum of simple oscillating functions date back to the 3rd century BC, when ancient astronomers proposed an empiric model of planetary motions, based on deferents and epicycles.

The heat equation is a partial differential equation. Prior to Fourier's work, no solution to the heat equation was known in the general case, although particular solutions were known if the heat source behaved in a simple way, in particular, if the heat source was a sine or cosine wave. These simple solutions are now sometimes called eigensolutions. Fourier's idea was to model a complicated heat source as a superposition (or linear combination) of simple sine and cosine waves, and to write the solution as a superposition of the corresponding eigensolutions. This superposition or linear combination is called the Fourier series.

From a modern point of view, Fourier's results are somewhat informal, due to the lack of a precise notion of function and integral in the early nineteenth century. Later, Peter Gustav Lejeune Dirichlet and Bernhard Riemann  expressed Fourier's results with greater precision and formality.

Although the original motivation was to solve the heat equation, it later became obvious that the same techniques could be applied to a wide array of mathematical and physical problems, and especially those involving linear differential equations with constant coefficients, for which the eigensolutions are sinusoids. The Fourier series has many such applications in electrical engineering, vibration analysis, acoustics, optics, signal processing, image processing, quantum mechanics, econometrics, shell theory, etc.

Beginnings
Joseph Fourier wrote:

"$\varphi(y)=a_0\cos\frac{\pi y}{2}+a_1\cos 3\frac{\pi y}{2}+a_2\cos5\frac{\pi y}{2}+\cdots.$

Multiplying both sides by $\cos(2k+1)\frac{\pi y}{2}$, and then integrating from $y=-1$ to $y=+1$ yields:

$a_k=\int_{-1}^1\varphi(y)\cos(2k+1)\frac{\pi y}{2}\,dy.$"

This immediately gives any coefficient ak of the trigonometrical series for φ(y) for any function which has such an expansion. It works because if φ has such an expansion, then (under suitable convergence assumptions) the integral $$\begin{align} a_k&=\int_{-1}^1\varphi(y)\cos(2k+1)\frac{\pi y}{2}\,dy \\ &= \int_{-1}^1\left(a\cos\frac{\pi y}{2}\cos(2k+1)\frac{\pi y}{2}+a'\cos 3\frac{\pi y}{2}\cos(2k+1)\frac{\pi y}{2}+\cdots\right)\,dy \end{align}$$ can be carried out term-by-term. But all terms involving $$\cos(2j+1)\frac{\pi y}{2} \cos(2k+1)\frac{\pi y}{2}$$ for j &ne; k vanish when integrated from −1 to 1, leaving only the $$k^{\text{th}}$$ term.

In these few lines, which are close to the modern formalism used in Fourier series, Fourier revolutionized both mathematics and physics. Although similar trigonometric series were previously used by Euler, d'Alembert, Daniel Bernoulli and Gauss, Fourier believed that such trigonometric series could represent any arbitrary function. In what sense that is actually true is a somewhat subtle issue and the attempts over many years to clarify this idea have led to important discoveries in the theories of convergence, function spaces, and harmonic analysis.

When Fourier submitted a later competition essay in 1811, the committee (which included Lagrange, Laplace, Malus and Legendre, among others) concluded: ...the manner in which the author arrives at these equations is not exempt of difficulties and...his analysis to integrate them still leaves something to be desired on the score of generality and even rigour.

Fourier's motivation
The Fourier series expansion of the sawtooth function (above) looks more complicated than the simple formula $$s(x)=\tfrac{x}{\pi}$$, so it is not immediately apparent why one would need the Fourier series. While there are many applications, Fourier's motivation was in solving the heat equation. For example, consider a metal plate in the shape of a square whose sides measure $$\pi$$ meters, with coordinates $$(x,y) \in [0,\pi] \times [0,\pi]$$. If there is no heat source within the plate, and if three of the four sides are held at 0 degrees Celsius, while the fourth side, given by $$y=\pi$$, is maintained at the temperature gradient $$T(x,\pi)=x$$ degrees Celsius, for $$x$$ in $$(0,\pi)$$, then one can show that the stationary heat distribution (or the heat distribution after a long period of time has elapsed) is given by
 * $$T(x,y) = 2\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n} \sin(nx) {\sinh(ny) \over \sinh(n\pi)}.$$

Here, sinh is the hyperbolic sine function. This solution of the heat equation is obtained by multiplying each term of $$ by $$\sinh(ny)/\sinh(n\pi)$$. While our example function $$s(x)$$ seems to have a needlessly complicated Fourier series, the heat distribution $$T(x,y)$$ is nontrivial. The function $$T$$ cannot be written as a closed-form expression. This method of solving the heat problem was made possible by Fourier's work.

Other applications
Another application is to solve the Basel problem by using Parseval's theorem. The example generalizes and one may compute ζ(2n), for any positive integer n.

Table of common Fourier series
Some common pairs of periodic functions and their Fourier series coefficients are shown in the table below.


 * $$s(x)$$ designates a periodic function with period $$P$$.
 * $$A_0, A_n, B_n$$ designate the Fourier series coefficients (sine-cosine form) of the periodic function $$s(x)$$.

Table of basic properties
This table shows some mathematical operations in the time domain and the corresponding effect in the Fourier series coefficients. Notation:
 * Complex conjugation is denoted by an asterisk.
 * $$s(x),r(x)$$ designate $$P$$-periodic functions or functions defined only for $$x \in [0,P]. $$
 * $$S[n], R[n]$$ designate the Fourier series coefficients (exponential form) of $$s$$ and $$r.$$

Symmetry properties
When the real and imaginary parts of a complex function are decomposed into their even and odd parts, there are four components, denoted below by the subscripts RE, RO, IE, and IO. And there is a one-to-one mapping between the four components of a complex time function and the four components of its complex frequency transform:



\begin{array}{rccccccccc} \text{Time domain} & s & = & s_{_{\text{RE}}} & + & s_{_{\text{RO}}} & + & i s_{_{\text{IE}}} & + & \underbrace{i\ s_{_{\text{IO}}}} \\ &\Bigg\Updownarrow\mathcal{F} & &\Bigg\Updownarrow\mathcal{F} & &\ \ \Bigg\Updownarrow\mathcal{F} & &\ \ \Bigg\Updownarrow\mathcal{F} & &\ \ \Bigg\Updownarrow\mathcal{F}\\ \text{Frequency domain} & S & = & S_\text{RE} & + & \overbrace{\,i\ S_\text{IO}\,} & + & i S_\text{IE} & + & S_\text{RO} \end{array} $$

From this, various relationships are apparent, for example:
 * The transform of a real-valued function ($sRE + sRO$) is the even symmetric function $SRE + i SIO$. Conversely, an even-symmetric transform implies a real-valued time-domain.
 * The transform of an imaginary-valued function ($i sIE + i sIO$) is the odd symmetric function $SRO + i SIE$, and the converse is true.
 * The transform of an even-symmetric function ($sRE + i sIO$) is the real-valued function $SRE + SRO$, and the converse is true.
 * The transform of an odd-symmetric function ($sRO + i sIE$) is the imaginary-valued function $i SIE + i SIO$, and the converse is true.

Riemann–Lebesgue lemma
If $$S$$ is integrable, $\lim_{|n| \to \infty} S[n]=0$, $\lim_{n \to +\infty} a_n=0$ and $ \lim_{n \to +\infty} b_n=0.$  This result is known as the Riemann–Lebesgue lemma.

Parseval's theorem
If $$s$$ belongs to $$L^2(P)$$ (periodic over an interval of length $$P$$) then: $\frac{1}{P}\int_{P} |s(x)|^2 \, dx = \sum_{n=-\infty}^\infty \Bigl|S[n]\Bigr|^2.$

Plancherel's theorem
If $$c_0,\, c_{\pm 1},\, c_{\pm 2}, \ldots$$ are coefficients and $\sum_{n=-\infty}^\infty |c_n|^2 < \infty$ then there is a unique function $$s\in L^2(P)$$ such that $$S[n] = c_n$$ for every $$n$$.

Convolution theorems
Given $$P$$-periodic functions, $$s_{_P}$$ and $$r_{_P}$$ with Fourier series coefficients $$S[n]$$ and $$R[n],$$ $$n \in \mathbb{Z},$$


 * The pointwise product: $$h_{_P}(x) \triangleq s_{_P}(x)\cdot r_{_P}(x)$$ is also $$P$$-periodic, and its Fourier series coefficients are given by the discrete convolution of the $$S$$ and $$R$$ sequences: $$H[n] = \{S*R\}[n].$$
 * The periodic convolution: $$h_{_P}(x) \triangleq \int_{P} s_{_P}(\tau)\cdot r_{_P}(x-\tau)\, d\tau$$ is also $$P$$-periodic, with Fourier series coefficients: $$H[n] = P \cdot S[n]\cdot R[n].$$
 * A doubly infinite sequence $$\left \{c_n \right \}_{n \in Z}$$ in $$c_0(\mathbb{Z})$$ is the sequence of Fourier coefficients of a function in $$L^1([0,2\pi])$$ if and only if it is a convolution of two sequences in $$\ell^2(\mathbb{Z})$$. See

Derivative property
We say that $$s$$ belongs to $$C^k(\mathbb{T})$$ if $$s$$ is a 2$\pi$-periodic function on $$\mathbb{R}$$ which is $$k$$ times differentiable, and its $$k^{\text{th}}$$ derivative is continuous.
 * If $$s \in C^1(\mathbb{T})$$, then the Fourier coefficients $$\widehat{s'}[n]$$ of the derivative $$s'$$ can be expressed in terms of the Fourier coefficients $$\widehat{s}[n]$$ of the function $$s$$, via the formula $$\widehat{s'}[n] = in \widehat{s}[n]$$.
 * If $$s \in C^k(\mathbb{T})$$, then $$\widehat{s^{(k)}}[n] = (in)^k \widehat{s}[n]$$. In particular, since for a fixed $$k\geq 1$$ we have $$\widehat{s^{(k)}}[n]\to 0$$ as $$n\to\infty$$, it follows that $$|n|^k\widehat{s}[n]$$ tends to zero, which means that the Fourier coefficients converge to zero faster than the kth power of n for any $$k\geq 1$$.

Compact groups
One of the interesting properties of the Fourier transform which we have mentioned, is that it carries convolutions to pointwise products. If that is the property which we seek to preserve, one can produce Fourier series on any compact group. Typical examples include those classical groups that are compact. This generalizes the Fourier transform to all spaces of the form L2(G), where G is a compact group, in such a way that the Fourier transform carries convolutions to pointwise products. The Fourier series exists and converges in similar ways to the $$ case.

An alternative extension to compact groups is the Peter–Weyl theorem, which proves results about representations of compact groups analogous to those about finite groups.



Riemannian manifolds
If the domain is not a group, then there is no intrinsically defined convolution. However, if $$X$$ is a compact Riemannian manifold, it has a Laplace–Beltrami operator. The Laplace–Beltrami operator is the differential operator that corresponds to Laplace operator for the Riemannian manifold $$X$$. Then, by analogy, one can consider heat equations on $$X$$. Since Fourier arrived at his basis by attempting to solve the heat equation, the natural generalization is to use the eigensolutions of the Laplace–Beltrami operator as a basis. This generalizes Fourier series to spaces of the type $$L^2(X)$$, where $$X$$ is a Riemannian manifold. The Fourier series converges in ways similar to the $$[-\pi,\pi]$$ case. A typical example is to take $$X$$ to be the sphere with the usual metric, in which case the Fourier basis consists of spherical harmonics.

Locally compact Abelian groups
The generalization to compact groups discussed above does not generalize to noncompact, nonabelian groups. However, there is a straightforward generalization to Locally Compact Abelian (LCA) groups.

This generalizes the Fourier transform to $$L^1(G)$$ or $$L^2(G)$$, where $$G$$ is an LCA group. If $$G$$ is compact, one also obtains a Fourier series, which converges similarly to the $$[-\pi,\pi]$$ case, but if $$G$$ is noncompact, one obtains instead a Fourier integral. This generalization yields the usual Fourier transform when the underlying locally compact Abelian group is $$\mathbb{R}$$.

Fourier series on a square
We can also define the Fourier series for functions of two variables $$x$$ and $$y$$ in the square $$[-\pi,\pi]\times[-\pi,\pi]$$: $$\begin{align} f(x,y) & = \sum_{j,k \in \Z} c_{j,k}e^{ijx}e^{iky},\\[5pt] c_{j,k} & = \frac{1}{4 \pi^2} \int_{-\pi}^\pi \int_{-\pi}^\pi f(x,y) e^{-ijx}e^{-iky}\, dx \, dy. \end{align}$$

Aside from being useful for solving partial differential equations such as the heat equation, one notable application of Fourier series on the square is in image compression. In particular, the JPEG image compression standard uses the two-dimensional discrete cosine transform, a discrete form of the Fourier cosine transform, which uses only cosine as the basis function.

For two-dimensional arrays with a staggered appearance, half of the Fourier series coefficients disappear, due to additional symmetry.

Fourier series of Bravais-lattice-periodic-function
A three-dimensional Bravais lattice is defined as the set of vectors of the form: $$\mathbf{R} = n_1\mathbf{a}_1 + n_2\mathbf{a}_2 + n_3\mathbf{a}_3$$ where $$n_i$$ are integers and $$\mathbf{a}_i$$ are three linearly independent vectors. Assuming we have some function, $$f(\mathbf{r})$$, such that it obeys the condition of periodicity for any Bravais lattice vector $$\mathbf{R}$$, $$f(\mathbf{r}) = f(\mathbf{R}+\mathbf{r})$$, we could make a Fourier series of it. This kind of function can be, for example, the effective potential that one electron "feels" inside a periodic crystal. It is useful to make the Fourier series of the potential when applying Bloch's theorem. First, we may write any arbitrary position vector $$\mathbf{r}$$ in the coordinate-system of the lattice: $$\mathbf{r} = x_1\frac{\mathbf{a}_{1}}{a_1}+ x_2\frac{\mathbf{a}_{2}}{a_2}+ x_3\frac{\mathbf{a}_{3}}{a_3},$$ where $$a_i \triangleq |\mathbf{a}_i|,$$ meaning that $$a_i$$ is defined to be the magnitude of $$\mathbf{a}_i$$, so $$\hat{\mathbf{a}_{i}} = \frac {\mathbf{a}_{i}}{a_i}$$ is the unit vector directed along $$\mathbf{a}_i$$.

Thus we can define a new function, $$g(x_1,x_2,x_3) \triangleq f(\mathbf{r}) = f \left (x_1\frac{\mathbf{a}_{1}}{a_1}+x_2\frac{\mathbf{a}_{2}}{a_2}+x_3\frac{\mathbf{a}_{3}}{a_3} \right ).$$

This new function, $$g(x_1,x_2,x_3)$$, is now a function of three-variables, each of which has periodicity $$a_1$$, $$a_2$$, and $$a_3$$ respectively: $$g(x_1,x_2,x_3) = g(x_1+a_1,x_2,x_3) = g(x_1,x_2+a_2,x_3) = g(x_1,x_2,x_3+a_3).$$

This enables us to build up a set of Fourier coefficients, each being indexed by three independent integers $$m_1,m_2,m_3$$. In what follows, we use function notation to denote these coefficients, where previously we used subscripts. If we write a series for $$g$$ on the interval $$\left [ 0, a_1\right ]$$ for $$x_1$$, we can define the following: $$h^\mathrm{one}(m_1, x_2, x_3) \triangleq \frac{1}{a_1}\int_0^{a_1} g(x_1, x_2, x_3)\cdot e^{-i 2\pi \tfrac{m_1}{a_1} x_1}\, dx_1$$

And then we can write: $$g(x_1, x_2, x_3)=\sum_{m_1=-\infty}^\infty h^\mathrm{one}(m_1, x_2, x_3) \cdot e^{i 2\pi \tfrac{m_1}{a_1} x_1}$$

Further defining: $$\begin{align} h^\mathrm{two}(m_1, m_2, x_3) & \triangleq \frac{1}{a_2}\int_0^{a_2} h^\mathrm{one}(m_1, x_2, x_3)\cdot e^{-i 2\pi \tfrac{m_2}{a_2} x_2}\, dx_2 \\[12pt] & = \frac{1}{a_2}\int_0^{a_2} dx_2 \frac{1}{a_1}\int_0^{a_1} dx_1 g(x_1, x_2, x_3)\cdot e^{-i 2\pi \left(\tfrac{m_1}{a_1} x_1+\tfrac{m_2}{a_2} x_2\right)} \end{align}$$

We can write $$g$$ once again as: $$g(x_1, x_2, x_3)=\sum_{m_1=-\infty}^\infty \sum_{m_2=-\infty}^\infty h^\mathrm{two}(m_1, m_2, x_3) \cdot e^{i 2\pi \tfrac{m_1}{a_1} x_1} \cdot e^{i 2\pi \tfrac{m_2}{a_2} x_2}$$

Finally applying the same for the third coordinate, we define: $$\begin{align} h^\mathrm{three}(m_1, m_2, m_3) & \triangleq \frac{1}{a_3}\int_0^{a_3} h^\mathrm{two}(m_1, m_2, x_3)\cdot e^{-i 2\pi \tfrac{m_3}{a_3} x_3}\, dx_3 \\[12pt] & = \frac{1}{a_3}\int_0^{a_3} dx_3 \frac{1}{a_2}\int_0^{a_2} dx_2 \frac{1}{a_1}\int_0^{a_1} dx_1 g(x_1, x_2, x_3)\cdot e^{-i 2\pi \left(\tfrac{m_1}{a_1} x_1+\tfrac{m_2}{a_2} x_2 + \tfrac{m_3}{a_3} x_3\right)} \end{align}$$

We write $$g$$ as: $$g(x_1, x_2, x_3)=\sum_{m_1=-\infty}^\infty \sum_{m_2=-\infty}^\infty \sum_{m_3=-\infty}^\infty h^\mathrm{three}(m_1, m_2, m_3) \cdot e^{i 2\pi \tfrac{m_1}{a_1} x_1} \cdot e^{i 2\pi \tfrac{m_2}{a_2} x_2}\cdot e^{i 2\pi \tfrac{m_3}{a_3} x_3}$$

Re-arranging: $$g(x_1, x_2, x_3)=\sum_{m_1, m_2, m_3 \in \Z } h^\mathrm{three}(m_1, m_2, m_3) \cdot e^{i 2\pi \left( \tfrac{m_1}{a_1} x_1+ \tfrac{m_2}{a_2} x_2 + \tfrac{m_3}{a_3} x_3\right)}. $$

Now, every reciprocal lattice vector can be written (but does not mean that it is the only way of writing) as $$\mathbf{G} = m_1\mathbf{g}_1 + m_2\mathbf{g}_2 + m_3\mathbf{g}_3$$, where $$m_i$$ are integers and $$\mathbf{g}_i$$ are reciprocal lattice vectors to satisfy $$\mathbf{g_i} \cdot \mathbf{a_j}=2\pi\delta_{ij}$$ ($$\delta_{ij} = 1$$ for $$i = j$$, and $$\delta_{ij} = 0$$ for $$i \neq j$$). Then for any arbitrary reciprocal lattice vector $$\mathbf{G}$$ and arbitrary position vector $$\mathbf{r}$$ in the original Bravais lattice space, their scalar product is: $$\mathbf{G} \cdot \mathbf{r} = \left ( m_1\mathbf{g}_1 + m_2\mathbf{g}_2 + m_3\mathbf{g}_3 \right ) \cdot \left (x_1\frac{\mathbf{a}_1}{a_1}+ x_2\frac{\mathbf{a}_2}{a_2} +x_3\frac{\mathbf{a}_3}{a_3} \right ) = 2\pi \left( x_1\frac{m_1}{a_1}+x_2\frac{m_2}{a_2}+x_3\frac{m_3}{a_3} \right ).$$

So it is clear that in our expansion of $$g(x_1,x_2,x_3) = f(\mathbf{r})$$, the sum is actually over reciprocal lattice vectors: $$f(\mathbf{r})=\sum_{\mathbf{G}} h(\mathbf{G}) \cdot e^{i \mathbf{G} \cdot \mathbf{r}}, $$

where $$h(\mathbf{G}) = \frac{1}{a_3} \int_0^{a_3} dx_3 \, \frac{1}{a_2}\int_0^{a_2} dx_2 \, \frac{1}{a_1}\int_0^{a_1} dx_1 \, f\left(x_1\frac{\mathbf{a}_1}{a_1} + x_2\frac{\mathbf{a}_2}{a_2} + x_3\frac{\mathbf{a}_3}{a_3} \right)\cdot e^{-i \mathbf{G} \cdot \mathbf{r}}. $$

Assuming $$\mathbf{r} = (x,y,z) = x_1\frac{\mathbf{a}_1}{a_1}+x_2\frac{\mathbf{a}_2}{a_2}+x_3\frac{\mathbf{a}_3}{a_3},$$ we can solve this system of three linear equations for $$x$$, $$y$$, and $$z$$ in terms of $$x_1$$, $$x_2$$ and $$x_3$$ in order to calculate the volume element in the original rectangular coordinate system. Once we have $$x$$, $$y$$, and $$z$$ in terms of $$x_1$$, $$x_2$$ and $$x_3$$, we can calculate the Jacobian determinant: $$\begin{vmatrix} \dfrac{\partial x_1}{\partial x} & \dfrac{\partial x_1}{\partial y} & \dfrac{\partial x_1}{\partial z} \\[12pt] \dfrac{\partial x_2}{\partial x} & \dfrac{\partial x_2}{\partial y} & \dfrac{\partial x_2}{\partial z} \\[12pt] \dfrac{\partial x_3}{\partial x} & \dfrac{\partial x_3}{\partial y} & \dfrac{\partial x_3}{\partial z} \end{vmatrix}$$ which after some calculation and applying some non-trivial cross-product identities can be shown to be equal to: $$\frac{a_1 a_2 a_3}{\mathbf{a}_1\cdot(\mathbf{a}_2 \times \mathbf{a}_3)}$$

(it may be advantageous for the sake of simplifying calculations, to work in such a rectangular coordinate system, in which it just so happens that $$\mathbf{a}_1$$ is parallel to the x axis, $$\mathbf{a}_2$$ lies in the xy-plane, and $$\mathbf{a}_3$$ has components of all three axes). The denominator is exactly the volume of the primitive unit cell which is enclosed by the three primitive-vectors $$\mathbf{a}_1$$, $$\mathbf{a}_2$$ and $$\mathbf{a}_3$$. In particular, we now know that $$dx_1 \, dx_2 \, dx_3 = \frac{a_1 a_2 a_3}{\mathbf{a}_1\cdot(\mathbf{a}_2 \times \mathbf{a}_3)} \cdot dx \, dy \, dz. $$

We can write now $$h(\mathbf{G})$$ as an integral with the traditional coordinate system over the volume of the primitive cell, instead of with the $$x_1$$, $$x_2$$ and $$x_3$$ variables: $$h(\mathbf{G}) = \frac{1}{\mathbf{a}_1\cdot(\mathbf{a}_2 \times \mathbf{a}_3)}\int_{C} d\mathbf{r} f(\mathbf{r})\cdot e^{-i \mathbf{G} \cdot \mathbf{r}} $$ writing $$d\mathbf{r}$$ for the volume element $$dx \, dy \, dz$$; and where $$C$$ is the primitive unit cell, thus, $$\mathbf{a}_1\cdot(\mathbf{a}_2 \times \mathbf{a}_3)$$ is the volume of the primitive unit cell.

Hilbert space interpretation
In the language of Hilbert spaces, the set of functions $$\left\{e_n=e^{inx}: n \in \Z\right\}$$ is an orthonormal basis for the space $$L^2([-\pi,\pi])$$ of square-integrable functions on $$[-\pi,\pi]$$. This space is actually a Hilbert space with an inner product given for any two elements $$f$$ and $$g$$ by:
 * $$\langle f,\, g \rangle \;\triangleq \; \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)g^*(x)\,dx,$$ where $$g^{*}(x)$$ is the complex conjugate of $$g(x).$$

The basic Fourier series result for Hilbert spaces can be written as
 * $$f=\sum_{n=-\infty}^\infty \langle f,e_n \rangle \, e_n.$$

This corresponds exactly to the complex exponential formulation given above. The version with sines and cosines is also justified with the Hilbert space interpretation. Indeed, the sines and cosines form an orthogonal set: $$\int_{-\pi}^{\pi} \cos(mx)\, \cos(nx)\, dx = \frac{1}{2}\int_{-\pi}^{\pi} \cos((n-m)x)+\cos((n+m)x)\, dx = \pi \delta_{mn}, \quad m, n \ge 1, $$ $$\int_{-\pi}^{\pi} \sin(mx)\, \sin(nx)\, dx = \frac{1}{2}\int_{-\pi}^{\pi} \cos((n-m)x)-\cos((n+m)x)\, dx = \pi \delta_{mn}, \quad m, n \ge 1$$ (where δmn is the Kronecker delta), and $$\int_{-\pi}^{\pi} \cos(mx)\, \sin(nx)\, dx = \frac{1}{2}\int_{-\pi}^{\pi} \sin((n+m)x)+\sin((n-m)x)\, dx = 0;$$ furthermore, the sines and cosines are orthogonal to the constant function $$1$$. An orthonormal basis for $$L^2([-\pi,\pi])$$ consisting of real functions is formed by the functions $$1$$ and $$\sqrt{2} \cos (nx)$$, $$\sqrt{2} \sin (nx)$$ with n= 1,2,.... The density of their span is a consequence of the Stone–Weierstrass theorem, but follows also from the properties of classical kernels like the Fejér kernel.

Fourier theorem proving convergence of Fourier series
These theorems, and informal variations of them that don't specify the convergence conditions, are sometimes referred to generically as Fourier's theorem or the Fourier theorem.

The earlier $$:
 * $$s_{_N}(x) = \sum_{n=-N}^N S[n]\ e^{i 2\pi\tfrac{n}{P} x},$$

is a trigonometric polynomial of degree $$N$$ that can be generally expressed as:
 * $$p_{_N}(x)=\sum_{n=-N}^N p[n]\ e^{i 2\pi\tfrac{n}{P}x}.$$

Least squares property
Parseval's theorem implies that:

$[−π,π]$

Convergence theorems
Because of the least squares property, and because of the completeness of the Fourier basis, we obtain an elementary convergence result.

$$

We have already mentioned that if $$s$$ is continuously differentiable, then $$(i\cdot n) S[n]$$ is the $$n^{\text{th}}$$ Fourier coefficient of the derivative $$s'$$. It follows, essentially from the Cauchy–Schwarz inequality, that $$s_{\infty}$$ is absolutely summable. The sum of this series is a continuous function, equal to $$s$$, since the Fourier series converges in the mean to $$s$$:

$$

This result can be proven easily if $$s$$ is further assumed to be $$C^2$$, since in that case $$n^2S[n]$$ tends to zero as $$n \rightarrow \infty$$. More generally, the Fourier series is absolutely summable, thus converges uniformly to $$s$$, provided that $$s$$ satisfies a Hölder condition of order $$\alpha > 1/2$$. In the absolutely summable case, the inequality:
 * $$\sup_x |s(x) - s_{_N}(x)| \le \sum_{|n| > N} |S[n]|$$

proves uniform convergence.

Many other results concerning the convergence of Fourier series are known, ranging from the moderately simple result that the series converges at $$x$$ if $$s$$ is differentiable at $$x$$, to Lennart Carleson's much more sophisticated result that the Fourier series of an $$L^2$$ function actually converges almost everywhere.

Divergence
Since Fourier series have such good convergence properties, many are often surprised by some of the negative results. For example, the Fourier series of a continuous T-periodic function need not converge pointwise. The uniform boundedness principle yields a simple non-constructive proof of this fact.

In 1922, Andrey Kolmogorov published an article titled Une série de Fourier-Lebesgue divergente presque partout in which he gave an example of a Lebesgue-integrable function whose Fourier series diverges almost everywhere. He later constructed an example of an integrable function whose Fourier series diverges everywhere.