Approximating function by trigonometric polynomials

In the previous slide we have introduced the trigonometric polynomials. Now we introduce a formal definition. The function:

$$ \phi_{N}(x)=\sum_{j=0}^{N-1}c_{j}\exp\left(\mathrm{i}\frac{2\pi j}{L}x\right)$$

is called a trigonometric polynomial of the \(N-1\)-th order. The \(N-\)dimensional space of complex trigonometric polynomials is denoted by \(\mathbf{T}_ {N}^C \).

Let us now assume that we want to approximate some periodic function by a trigonometric polynomial of a degree \(N-1\). The problem consists in calculating the values of the expansion coefficients \(c_{j}\) that minimize the deviation between the two functions within a single period. In order to do this we have to define the distance between the two functions!

The metric in the function space is introduced in analogy to the distance between two vectors with discrete components and can be defined as:

$$d(f,g)=|\langle f-g|f-g\rangle|^{2}=\int_{0}^{L}\mathrm{d}x\ (f-g)^{ * }(f-g)$$

or

$$d(f,g)=|\langle f|f\rangle|^{2}+|\langle g|g\rangle|^{2}-\langle f|g\rangle-\langle g|f\rangle$$

Now, if we want to approximate the function \(f(x)\) by a trigonometric polynomials \(\phi_{N}(x)\) we have to minimize the distance between these two functions with respect to the coefficients of the trigonometric polynomial. The distance is given by:

$$d(f,\phi_{N})=|\langle f|f\rangle|^{2}+|\langle \phi_{N}|\phi_{N}\rangle|^{2}-\langle f|\phi_{N}\rangle-\langle \phi_{N}|f\rangle$$

The norm of the trigonometric polynom \(\langle \phi_{N}|\phi_{N}\rangle|^{2}\) can be calculated as:

$$ \langle\phi_{N}|\phi_{N}\rangle=\sum_{k=0}^{N-1}\sum_{j=0}^{N-1}c_{k}^{\ast}c_{j}\langle\varphi_{k}|\varphi_{j}\rangle=\sum_{k=0}^{N-1}\sum_{j=0}^{N-1}c_{k}^{\ast}c_{j}\delta_{kj}L $$

$$ \langle\phi_{N}|\phi_{N}\rangle=\sum_{j=0}^{N-1}c_{j}^{ * } c_{j}L = \sum_{j=0}^{N-1}|c_{j}|^2L $$

The remaining two scalar products can be expanded into:

$$\langle f|\phi_{N}\rangle=\sum_{j=0}^{N-1}c_{j}\langle f|\varphi_{n}\rangle$$

$$\langle\phi_{N}|f\rangle=\sum_{j=0}^{N-1}c_{j}^{ * }\langle\varphi_{n}|f\rangle$$

After inserting into the distance expression the latter turns into a multivariable function \(d(c_{1},\cdots,c_{N}) \):

$$ d(f,\phi_{N})\rightarrow d(c_{1},\cdots,c_{N})=|\langle f|f\rangle|^{2}+\left[\sum_{j=0}^{N-1}c_{j}^{\ast}c_{j}L-c_{j}\langle f|\varphi_{n}\rangle-c_{j}^{\ast}\langle\varphi_{n}|f\rangle\right] $$

This function is dependent on \(c_{j}\) and its complex conjugate \(c_{j}^{ * }\), which can be considered as two independent variables (equivalently we could treat their real and imaginary parts as independent variables!).

In order to minimize the distance we need to calculate the partial derivatives with respect to \(c_{j}\) and \(c_{j}^{ * }\) and set them to zero:

$$\frac{\partial d}{\partial c_{k}}=0\quad\mathrm{{and}}\quad\frac{\partial d}{\partial c_{k}^{ * }}=0,\qquad k=0,\cdots,N-1$$

This leads to the values of the expansion Fourier coefficients that provide the best approximation of a given function:

$$ c_{k} L - \langle \varphi_{k}|f \rangle=0 \rightarrow c_{k} = \frac{1}{L} \langle \varphi_{k} | f \rangle $$

$$ c_{k}^{\ast} L - \langle f | \varphi_{k} \rangle = 0 \rightarrow c_{k}^{\ast} = \frac{1}{L} \langle f | \varphi_{k} \rangle $$

Written out explicitly the Fourier coefficient reads:

$$c_{k}=\frac{1}{L}\langle\varphi_{k}|f\rangle=\frac{1}{L}\int_{0}^{L}\mathrm{d}x\ \varphi_{k}^{ * }(x)f(x)$$

$$ \require{color} \fcolorbox{red}{#f2d5d3}{ $c_{k}=\frac{1}{L}\int_{0}^{L}\mathrm{d}x\ f(x)\exp\left(-\mathrm{i}\frac{2\pi k}{L}x\right)$ } $$