An Introduction to Numerical Methods in C++, Revised Edition

In this last chapter we return to the subject of chapter 17, in which we omitted to discuss the most common of all orthogonal functions, namely the trigonometric functions. This will lead us to introduce Fourier series, which are used to describe many physical phenomena, especially those which are periodic in time or space and may therefore be described in terms of a spectrum of frequencies or wavenumbers. Finally, we offer a rather compact treatment of the Fast Fourier Transform in terms of lists.
Following the work of chapter 17, we may say that for each positive integer n the 2 n functions { ? 0, ? 1, , ? 2 n ?1} form an orthonormal set, where:

The interval is [ ??, + ?], and the weighting function is w( x) ? 1. The orthogonality properties follow from considering integrals of the kind
and
from which it is clear that only terms with h = k can be non-zero.
The linear combination

may be called a trigonometric polynomial of degree not more than n. We may choose the coefficients a k in any way we like. Here we shall choose them so that T n( x) is the least-squares approximation to a function f( x) over the interval [ ??, + ?], namely:
Of course, we could change to an arbitrary interval...