What are Fourier basis functions? And how do I prove that Fourier basis functions are orthonormal?
-
1See http://en.wikipedia.org/wiki/Basis_function#Fourier_basis – lhf Apr 12 '11 at 23:56
-
I did. But I am looking for proof of the fact too. – Brahadeesh Apr 13 '11 at 00:01
-
You have to compute the integrals that define the inner products. See http://en.wikipedia.org/wiki/Orthonormality#Fourier_series – lhf Apr 13 '11 at 00:03
-
could you give me a link with the proof done. – Brahadeesh Apr 13 '11 at 00:14
-
3@Brahadeesh: I think you're missing what stackexchange is about. We're here to enhance each other's understanding of mathematics, not to do what is likely other people's homework for them. – Alex Becker Apr 13 '11 at 00:33
-
1@Alex I am sorry if I gave that impression. The question was not my homework. But I encountered it when I was studying Digital Image reconstruction. As I did not know where else to go, I asked in the Math forum. I was looking for someone to provide an insight that I can use for understanding this topic. – Brahadeesh Apr 13 '11 at 00:39
2 Answers
An orthonormal basis for $L^2([0,1],\mathbb{R})$ (the space of real valued square integrable functions on the interval $[0,1]$) is $1, \sqrt{2}\cos(2\pi nx), \sqrt{2}\sin(2\pi nx)$ for $n=1,2,3,...$. These functions can be written as (convergence in $L^2$, many details omitted): $$ f(x)=a_0+\sum_{n=1}^{\infty}a_n\cos(2\pi nx)+b_n\sin(2\pi nx) $$ where $a_0=\int_{[0,1]}f(x)\,dx$, and for $n\geq 1$ $$ a_n=2\int_{[0,1]}f(x)\cos(2\pi nx)dx, \quad b_n=2\int_{[0,1]}f(x)\sin(2\pi nx)dx. $$ The orthonormality of the basis functions is established by showing that $$ \int_{[0,1]}\cos(2\pi nx)\sin(2\pi mx)dx=0, $$ $$ \int_{[0,1]}\cos(2\pi nx)\cos(2\pi mx)dx= \left\{ \begin{array}{cc} 1/2&\text{ if } n=m\\ 0&\text{ if } n\neq m\\ \end{array} \right., $$ $$ \int_{[0,1]}\sin(2\pi nx)\sin(2\pi mx)dx= \left\{ \begin{array}{cc} 1/2&\text{ if } n=m\\ 0&\text{ if } n\neq m\\ \end{array} \right., $$ so they are orthonormal with respect to the inner product $$ \langle f,g\rangle=\int_{[0,1]}f(x)g(x)dx. $$ You can learn a lot more by finding a good reference. Most differential equations books cover Fourier series to some extent to provide solutions to the heat/wave/Laplace equations (e.g. Boyce and DiPrima). Here is something random from google showing the orthogonality relations (don't know if its good).
EDIT: Since the link is broken (although any other random google search will bring up something), here is a sample derivation of one of the orthogonality relations using integration by parts twice ($m\neq n$ both non-zero): \begin{align*} &\int_0^1\sin(2\pi nx)\cos(2\pi mx)dx\\ &=\frac{1}{2\pi m}\sin(2\pi nx)\sin(2\pi mx)\Bigg|_0^1-\int_0^1\frac{2\pi n}{2\pi m}\cos(2\pi nx)\sin(2\pi m x)dx\\ &=-\frac{n}{m}\int_0^1\cos(2\pi nx)\sin(2\pi m x)dx\\ &=\frac{n^2}{m^2}\int_0^1\sin(2\pi nx)\cos(2\pi m x)dx \end{align*} Since $n^2/m^2\neq1$, the integral(s) must be zero (i.e. $x=\lambda x\Rightarrow x=0$ for $\lambda\neq1$).
The others are left as an exercise (which might be why you looked for this answer in the first place).
A more compact way of seeing the orthogonality relations is to use complex exponentials. We have \begin{align*} \int_0^{1}e^{2\pi inx}e^{2\pi imx}dx&=\int_0^1e^{2\pi i(n+m)x}dx\\ &=\left\{ \begin{array}{cc} 1&n+m=0\\ \frac{e^{2\pi i(n+m)}-1}{2\pi i(n+m)}&\text{else}\\ \end{array} \right.\\ &=\left\{ \begin{array}{cc} 1&n+m=0\\ 0&\text{else}\\ \end{array} \right. \end{align*}
- 9,943
-
I read the link you posted, it seems good to me. The proofs involve a fair bit of work! – kathleen Jul 24 '16 at 19:15
-
-
Thanks for adding the sample derivations. Unfortunately, I think your integration by parts derivation has a flaw. The last equality, where you do the second integration by parts, is not very friendly to the reader since you don't indicate what you are doing. Indeed, had you indicated that you are doing the same thing with n and m reversed, you would have noticed that the multiplicative factor is -m/n and not -m/n a second time. This leads you back to the expression with which you started. – all feedback welcome Jul 25 '22 at 16:28
-
The situation might be similar for your complex exponentials derivation. You don't explain how the integral you compute relates to the integral we care about. Using Euler's formula we can decompose your integral into four integrals, one of which (with a factor of $i$) is the one we care about. But the imaginary part of your integral is not necessarily equal to our integral since there's a second version of it with n and m switched that also has a factor of $i$. Lastly, I think the computation has a small mistake: The $-1$ should not be in the exponent and therefore the result not equal to $0$. – all feedback welcome Jul 25 '22 at 16:44
-
Would appreciate any effort on your part to either correct your solution or point out any mistakes of my own! – all feedback welcome Jul 25 '22 at 16:45
-
@allfeedbackwelcome The -1 in the exponent was a typo. I leave the relation of the two versions to the reader. The second integration by parts is correct; you don't want to "undo" the previous integration by parts. I leave it to the reader to work it out. – yoyo Jul 26 '22 at 13:54
-
Thanks for your reply. I believe to have understood in the meantime what you meant with the second integration by parts and have made an edit to your post that I think makes it clearer to the reader. You have undone my edit and I kindly ask you to explain why you did so. – all feedback welcome Jul 27 '22 at 18:53
-
Regarding the complex exponentials: It was a mistake of mine to think that the result would not be equal to zero. Yet I still don't think your approach proofs what we want. You show that your integral, and in particular it's imaginary part, evaluates to zero under all relevant circumstances. Yet it's imaginary part is $\int_0^1\cos(2\pi nx)\sin(2\pi m x)dx + \int_0^1\sin(2\pi nx)\cos(2\pi m x)dx$ so all you show is $\int_0^1\sin(2\pi nx)\cos(2\pi m x)dx = -\int_0^1\cos(2\pi nx)\sin(2\pi m x)dx$. – all feedback welcome Jul 27 '22 at 18:57
-
@allfeedbackwelcome My answer isn't meant to be a complete and detailed calculation, and I don't want it edited to provide more detail. Feel free to write your own answer if that is something you think would be appreciated. These calculations are a common (and good) exercise; the only reason I have a calculation at all is because the link I gave once upon a time is broken. The complex exponential discussion is more to point the way towards more general harmonic analysis, again not meant to be a detailed derivation of the orthogonality relations. – yoyo Jul 27 '22 at 19:21
-
Well, I don't think it makes for a good exercise to put a non-obvious step into your equation chain without even indicating that the step is meant as an exercise. So I might take up the idea of posting my own answer. I mostly like your answer and would largely adopt and adapt it. – all feedback welcome Jul 27 '22 at 20:00
-
Regarding complex exponentials: Maybe you just want to point at a more elegant way of viewing things. Instead, I think, you make the reader think that your equation chain somehow shows the orthogonality relations. Which I don't think it does, as I pointed out, even with details filled in. Or do you think something is wrong with my above argument that all you show is $\int_0^1\sin(2\pi nx)\cos(2\pi m x)dx = -\int_0^1\cos(2\pi nx)\sin(2\pi m x)dx$ (I think something must be wrong somewhere since that result contradicts the intermediary result in the integration-by parts with factor $\frac nm$)? – all feedback welcome Jul 27 '22 at 20:14
As stated in the fourier series definition, any T-periodic function can be writen as a linear combination of the set $B = \{1, \cos{(\frac{2\pi}{T}x)}, \sin{(\frac{2\pi}{T}x)}, \cos{(\frac{4\pi}{T}x)}, \sin{(\frac{4k\pi}{T}x)}, ... \cos{(\frac{2n\pi}{T}x)}, \sin{(\frac{2n\pi}{T}x)}\}$. So $B$ span the T-periodic functions vector space, so $B$ is basis. I don't know yet if this basis is orthonormal.
We define $gc_k = \cos{(\frac{2k\pi}{T}x)}$ and $gs_k = \sin{(\frac{2k\pi}{T}x)}$ , so $B = \{1, gc_1, gs_1, gc_2, gs_2, ..., gc_n, gs_n \}$.
Ok, let's now define the T-periodic functions vector space dot product:
For any T-periodic functions $f(x)$ and $g(x)$: $f\bullet g = \int_{-T/2}^{T/2} f(x)g(x)dx $
This is very similar to the regular vector dot product: You get a summation of the product of their related coordinates...
OK, now we have a basis and a dot product. But we have to check that our basis is an orthonormal basis(Remember that we need unit vectors in order to compute the projection via the dot product ). Thanks to our new dot product, we can check if 2 vectors are orthogonals and we can compute the norm of a vector.
Orthonormal basis
Let's compute now the dot product between every function(vector) of the basis $B = \{1, gc_1, gs_1, gc_2, gs_2, ..., gc_n, gs_n \}$:
$$\int_{-T/2}^{T/2}\cos{(\frac{2k\pi}{T}x)}cos{(\frac{2m\pi}{T}x)}dx = \begin{cases} 0, \text{ if } k \neq m \\ \frac{T}{2} \text{ if } k = m\end{cases}$$
$$\int_{-T/2}^{T/2}\sin{(\frac{2k\pi}{T}x)}sin{(\frac{2m\pi}{T}x)}dx = \begin{cases} 0, \text{ if } k \neq m \\ \frac{T}{2} \text{ if } k = m\end{cases}$$
$$\int_{-T/2}^{T/2}\cos{(\frac{2k\pi}{T}x)}sin{(\frac{2m\pi}{T}x)}dx = 0$$
- We obtain $gc_k \bullet gs_m = 0$, $gc_k \bullet gc_m = 0, k \neq m$, and $gs_k \bullet gs_m = 0, k \neq m$ this means that each function(vector) of our basis is orthogonal with each other function(vector) of the basis. So B isorthogonal.
- We obtain also $gc_k \bullet gc_k = gs_k \bullet gs_k = \frac{T}{2} = {\lVert g_k\rVert}^2 $, this means that the functions are not unit vectors, so our Basis is not orthonormal. Notice that $g_0 \bullet g_0 =\int_{-T/2}^{T/2}dx = T$
So to make our basis orthonormal, each vector has to be divided by its norm (${\lVert gc_k\rVert} =\sqrt{\frac{T}{2}}$, ${\lVert gs_k\rVert} =\sqrt{\frac{T}{2}}$ and ${\lVert g_0\rVert} =\sqrt{T}$):
$B' = \{\frac{1}{\sqrt{T}}, \sqrt{\frac{2}{T}}\cos{(\frac{2\pi}{T}x)}, \sqrt{\frac{2}{T}}\sin{(\frac{2\pi}{T}x)}, \sqrt{\frac{2}{T}}\cos{(\frac{4\pi}{T}x)}, \sqrt{\frac{2}{T}}\sin{(\frac{4k\pi}{T}x)}, ...,\\ \sqrt{\frac{2}{T}}\cos{(\frac{2n\pi}{T}x)}, \sqrt{\frac{2}{T}}\sin{(\frac{2n\pi}{T}x)}\}$
Coordinates in the basis
Now that we have an orthonormal basis, we can project $f(x)$ on each function of the basis via the dot product and then get the coordinates of $f(x)$ in this basis:
$$fc_k = f(x) \bullet gc'_k(x) = \sqrt{\frac{2}{T}} \int_{-T/2}^{T/2}f(x)\cos{(\frac{2k\pi}{T}x)}dx$$
$$fs_k = f(x) \bullet gs'_k(x) = \sqrt{\frac{2}{T}} \int_{-T/2}^{T/2}f(x)\sin{(\frac{2k\pi}{T}x)}dx$$
$$f_0 = \frac{1}{\sqrt{T}}\int_{-T/2}^{T/2}f(x)dx$$
We have now the coordinates $(f_0,fc_1, fs_1, fc_2, fs_2, ... ,fc_n, fs_n)$ of f(x) in the basis, so we can write the following linear combination:
$$f(x) = f_0g_0 + \sum_{k=1}^{\infty}fc_k\cdot gc'_k(x) + \sum_{k=1}^{\infty}fs_k\cdot gs'_k(x)$$
$f(x) = (\frac{1}{\sqrt{T}}\int_{-T/2}^{T/2}f(x)dx)\frac{1}{\sqrt{T}} +\\ \sum_{k=1}^{\infty}(\sqrt{\frac{2}{T}} \int_{-T/2}^{T/2}f(x)\cos{(\frac{2k\pi}{T}x)}dx)\sqrt{\frac{2}{T}}\cos{(\frac{2k\pi}{T}x)} +\\ \sum_{k=1}^{\infty}(\sqrt{\frac{2}{T}} \int_{-T/2}^{T/2}f(x)\sin{(\frac{2k\pi}{T}x)}dx)\sqrt{\frac{2}{T}}\sin{(\frac{2k\pi}{T}x)}$
If we regroup the $\sqrt{\frac{2}{T}}$ terms, we finally obtain the fourier series:
$$f(x) = c + \sum_{k=1}^{\infty} a_k\cos{(\frac{2k\pi}{T}x)} + \sum_{k=1}^{\infty} b_k\sin{(\frac{2k\pi}{T}x)}$$
$$c = \frac{1}{T}\int_{-T/2}^{T/2}f(x)dx$$
$$a_k = \frac{2}{T} \int_{-T/2}^{T/2}f(x)\cos{(\frac{2k\pi}{T}x)}dx$$
$$b_k = \frac{2}{T} \int_{-T/2}^{T/2}f(x)\sin{(\frac{2k\pi}{T}x)}dx$$
You will find the complete approach here:
https://xaviergerphagnon.com/2017/11/03/fourier-series/
https://xaviergerphagnon.com/2017/11/03/the-fourier-transform/
- 41