Fourier series: Difference between revisions
From biophysics wiki
No edit summary |
No edit summary |
||
| (40 intermediate revisions by the same user not shown) | |||
| Line 19: | Line 19: | ||
To answer this question we take a look at the following properties of trigonometric integrals | To answer this question we take a look at the following properties of trigonometric integrals | ||
\begin{align} | \begin{align} | ||
\int_{-\pi}^{\pi} cos(kx) \, cos(lx)dx=\left\{\begin{array}{ll} 2\pi & \text{ | \int_{-\pi}^{\pi} cos(kx) \, cos(lx)dx=\left\{\begin{array}{ll} 2\pi & \text{for } k=l=0 \\ | ||
\pi & \text{ | \pi & \text{for } k=l>0 \\ | ||
0 & \text{ | 0 & \text{for } k\neq l=0 \end{array}\right. \label{orth1} | ||
\end{align} | \end{align} | ||
\begin{align} | \begin{align} | ||
\int_{-\pi}^{\pi} sin(kx) \, sin(lx)dx=\left\{\begin{array}{ll} 0 & \text{ | \int_{-\pi}^{\pi} sin(kx) \, sin(lx)dx=\left\{\begin{array}{ll} 0 & \text{for } k=l=0 \\ | ||
\pi & \text{ | \pi & \text{for } k=l>0 \\ | ||
0 & \text{ | 0 & \text{for } k\neq l=0 \end{array}\right. \label{orth2} | ||
\end{align} | \end{align} | ||
\begin{align} | \begin{align} | ||
\int_{-\pi}^{\pi} sin(kx) \, cos(lx)dx= 0 \hspace{0.9cm} \text{ | \int_{-\pi}^{\pi} sin(kx) \, cos(lx)dx= 0 \hspace{0.9cm} \text{ for all } k \text{ und } l \label{orth3} | ||
\end{align} | \end{align} | ||
and use this integral properties to calculate the coefficiets. | and use this integral properties to calculate the coefficiets. For the following calculation let us start the index from $n=0$ so that $a_0$ is included in the sum. | ||
\begin{align} | \begin{align} | ||
f(t)=\sum_{n= | f(t)= \sum_{n=0}^{\infty} a_n cos(nt) + b_n sin(nt) | ||
\end{align} | \end{align} | ||
we mulitply this sum by $cos(mt)$ and itegrate over one period. Remember the trigonometric functions cosine and sine are $2 \pi$-periodic. | |||
\begin{align} | \begin{align} | ||
\int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} \sum_{n= | \int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} \sum_{n=0}^{\infty} a_n cos(nt) cos(mt) + b_n \underbrace{sin(nt)cos(mt)}_{=0 \text{ by eq. }4}\, dt= \sum_{n=0}^{\infty}\int_{-\pi}^{\pi} a_n cos(nt) cos(mt)\, dt \label{cos} | ||
\end{align} | \end{align} | ||
All integrals on the right with $m \not = n$ are zero by \ref{orth1}, only the integral | All integrals on the right with $m \not = n$ are zero by \ref{orth1}, only the integral | ||
| Line 43: | Line 43: | ||
\int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} a_n cos(nt)^2 \, dt | \int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} a_n cos(nt)^2 \, dt | ||
\end{align} | \end{align} | ||
which | survives! We only have to integrate one term, which we can do by the half-angle formula | ||
\begin{align} | \begin{align} | ||
a_n \int_{-\pi}^{\pi} cos(nt)^2 \, dt = a_n \int_{-\pi}^{\pi} \frac{1+cos(2nt)}{2} \, dt= a_n \left[ \frac{t}{2}+\frac{sin(2nt)}{4n} \right]_{-\pi}^{\pi}=a_n \left[ \frac{\pi}{2}-\frac{- \pi}{2}+0\right]=a_n \pi | a_n \int_{-\pi}^{\pi} cos(nt)^2 \, dt = a_n \int_{-\pi}^{\pi} \frac{1+cos(2nt)}{2} \, dt= a_n \left[ \frac{t}{2}+\frac{sin(2nt)}{4n} \right]_{-\pi}^{\pi}=a_n \left[ \frac{\pi}{2}-\frac{- \pi}{2}+0\right]=a_n \pi | ||
\end{align} | \end{align} | ||
for $m=0$ we can calculate the coefficient | |||
\begin{align} | \begin{align} | ||
a_0 \int_{-\pi}^{\pi} 1 \, dt = 2 \pi | a_0 \int_{-\pi}^{\pi} 1 \, dt = 2 \pi | ||
\end{align} | \end{align} | ||
in agreement with equation \ref{orth1}. | in agreement with equation \ref{orth1}. The factor $2$ in front of $\pi$ in the last calculation is the reason, why we have to devide $a_0$ in \ref{hfs} by two, if we use the general formula for $a_n$ to calculate $a_0$. | ||
Following property \ref{orth3} all mixed integrals with a product of sine and cosine are zero. This means if we multiply the whole fourier series \ref{hfs} with cosine, we find exactely equation \ref{cos}, because all sine cosine products simply vanish. The similar argument holds for mulitplication with sine. In summary, '''the product of a function with any other function is zero, exept the product with the function itself'''. Functions with this property are called '''orthogonal'''. | |||
We use this curtial concept of othogonality to calculate the general fourier coefficients. We find $a_n$ with property \ref{orth1} | |||
<div style="background:#FEF5CA;border:1px solid #797979;border-radius:10px;padding:5px 15px 5px 15px;"> | <div style="background:#FEF5CA;border:1px solid #797979;border-radius:10px;padding:5px 15px 5px 15px;"> | ||
\begin{align} | \begin{align} | ||
| Line 58: | Line 61: | ||
\end{align} | \end{align} | ||
</div> | </div> | ||
with integral property \ref{orth2} we find | |||
\begin{align} | \begin{align} | ||
f(t)=\sum_{n=1}^{\infty} b_n sin(nt) \label{ofs} | f(t)=\sum_{n=1}^{\infty} b_n sin(nt) \label{ofs} | ||
| Line 71: | Line 74: | ||
What if the phenomena we want to study is not $2\pi$ periodic, but say of period $2L$? This represents no problem, we can make the variable transformation $A: x' \rightarrow B: \frac{\pi x}{L}$, so when $x=L$ we find again $f(\pi)$. This means that a variable in space $A$ has length $L$ but after transformation into $B$ it's again $2 \pi$ periodic. In this way, we can deal with functions of any period $2L$. The fourier series after transformation is | What if the phenomena we want to study is not $2\pi$ periodic, but say of period $2L$? This represents no problem, we can make the variable transformation $A: x' \rightarrow B: \frac{\pi x}{L}$, so when $x=L$ we find again $f(\pi)$. This means that a variable in space $A$ has length $L$ but after transformation into $B$ it's again $2 \pi$ periodic. In this way, we can deal with functions of any period $2L$. The fourier series after transformation is | ||
\begin{align} | \begin{align} | ||
f(t)=\sum_{n=1}^{\infty} b_n sin \left(n \frac{\pi \, t}{L} \right) \label{nfs} | f(t)=\sum_{n=1}^{\infty} a_n cos\left(n \frac{\pi \, t}{L} \right) + b_n sin \left(n \frac{\pi \, t}{L} \right) \label{nfs} | ||
\end{align} | \end{align} | ||
with the fourier coefficients | with the fourier coefficients | ||
\begin{align} | \begin{align} | ||
a_n=\frac{1}{L} \int_{- | a_n=\frac{1}{L} \int_{-L}^{L} f(t) \, cos \left(n\frac{\pi \, t}{L} \right) \, dt | ||
\end{align} | \end{align} | ||
obtained by integrating form $-L$ to $L$ | |||
\begin{align} | \begin{align} | ||
b_n=\frac{1}{L} \int_{- | b_n=\frac{1}{L} \int_{-L}^{L} f(t) \, sin \left(n\frac{\pi \, t}{L} \right) \, dt | ||
\end{align} | \end{align} | ||
Notice, if $L$ is $\pi$, the $\pi$s in our new fourier series \ref{nfs} simply cancel out and we are left with our old fourier series \ref{ofs}. | Notice, if $L$ is $\pi$, the $\pi$s in our new fourier series \ref{nfs} simply cancel out and we are left with our old fourier series \ref{ofs}. | ||
== Complex Fourier Series == | |||
We can find an alternative expression of the Fourier Series by DeMoivre's Formulas | |||
\begin{align} | |||
sin(\theta)=\frac{e^{i \theta}-e^{-i\theta}}{2i} \hspace{2cm} cos(\theta)=\frac{e^{i \theta}+e^{-i\theta}}{2} | |||
\end{align} | |||
If we replace the sine and the cosine term of | |||
\begin{align} | |||
f(x) = \sum_{n=0}^{\infty} a_n cos(nt) + b_n sin(nt) | |||
\end{align} | |||
we get for $\theta=n \frac{t \pi}{L}$ | |||
\begin{align} | |||
f(x) &= \sum_{n=0}^{\infty} a_n \frac{e^{i \theta}+e^{-i\theta}}{2} + b_n \frac{e^{i \theta}-e^{-i\theta}}{2i}\\ | |||
f(x) &= \sum_{n=0}^{\infty} a_n \frac{1}{2} \left( e^{i \theta}+e^{-i\theta} \right) -i b_n \frac{1}{2} \left( e^{i \theta}-e^{-i\theta} \right)\\ | |||
f(x) &= \sum_{n=0}^{\infty} (a_n-ib_n) \frac{1}{2} e^{i \theta} + (a_n +i b_n) \frac{1}{2} e^{-i\theta}\\ | |||
\end{align} | |||
If we now change the sum to run from $k=-\infty$ to $\infty$ we can gather the coefficients | |||
\begin{align} | |||
c_k=\frac{a_n-ib_n}{2}\\ | |||
c_{-k}=\frac{a_n+ib_n}{2}\\ | |||
\end{align} | |||
<div style="background:#FEF5CA;border:1px solid #797979;border-radius:10px;padding:5px 15px 5px 15px;"> | |||
we define the '''Complex Fourier Series''' with $c_k=c_{-k}^*$ | |||
\begin{align} | |||
f(t)=\sum_{k=-\infty}^{\infty} c_k e^{i \, k \, \pi \, t /L} | |||
\end{align} | |||
</div> | |||
We can find the coefficients by multiplying by $e^{-i \, r \, \pi \, t /L}$ | |||
\begin{align} | |||
\int_{-L}^L f(t) e^{-i \, r \, \pi \, t /L} dt=\sum_{-\infty}^{\infty} \int_{-L}^L c_k e^{i \, k \, \pi \, t /L}e^{-i \, r \, \pi \, t /L} dt=\left\{\begin{array}{ll} c_k \, L & \text{for } k=r \\ | |||
0 & \text{for } k \not = r \\ \end{array} \right. \label{com} | |||
\end{align} | |||
<div style="background:#FEF5CA;border:1px solid #797979;border-radius:10px;padding:5px 15px 5px 15px;"> | |||
so the complex fourier coeffiecients $c_k$ are | |||
\begin{align} | |||
c_k=\frac{1}{L} \int_{-L}^L f(t) e^{-i \, r \, \pi \, t /L} dt | |||
\end{align} | |||
</div> | |||
---- | ---- | ||
Latest revision as of 11:38, 16 March 2013
Jean-Baptiste-Joseph Fourier (1768-1830) was concerned with heat flow, while he studied the concvergence of trigonometric series. His article from 1807 was rejected by the scientific community as to imprecise. He finally managed to publish his work in 1822. His idea was to express a periodic function $f(t)$ as a linear combination of sines and cosines and maybe a constant term. We denote the frequency as $n$. \begin{align} f(t)=\frac{a_0}{2} + \sum_{n=1}^{\infty} a_n cos(nt) + b_n sin(nt) \label{hfs} \end{align} Later in the 19th century it was proved by Dirichlet and Riemann, that this is indeed possible.
Let first study the trigonometric series \begin{align} f(t)=\sum_{n=1}^{\infty} a_n cos(nt) \end{align} and \begin{align} f(t)=\sum_{n=1}^{\infty} b_n sin(nt) \end{align} We assume that these series converge to $f(t)$ as we add higher and higher frequencies $n$ and move the discussion of this issue to a seperate article, where we actually prove the convergence of series.
How can we calculate the coefficiets of the series?
To answer this question we take a look at the following properties of trigonometric integrals \begin{align} \int_{-\pi}^{\pi} cos(kx) \, cos(lx)dx=\left\{\begin{array}{ll} 2\pi & \text{for } k=l=0 \\ \pi & \text{for } k=l>0 \\ 0 & \text{for } k\neq l=0 \end{array}\right. \label{orth1} \end{align} \begin{align} \int_{-\pi}^{\pi} sin(kx) \, sin(lx)dx=\left\{\begin{array}{ll} 0 & \text{for } k=l=0 \\ \pi & \text{for } k=l>0 \\ 0 & \text{for } k\neq l=0 \end{array}\right. \label{orth2} \end{align} \begin{align} \int_{-\pi}^{\pi} sin(kx) \, cos(lx)dx= 0 \hspace{0.9cm} \text{ for all } k \text{ und } l \label{orth3} \end{align} and use this integral properties to calculate the coefficiets. For the following calculation let us start the index from $n=0$ so that $a_0$ is included in the sum. \begin{align} f(t)= \sum_{n=0}^{\infty} a_n cos(nt) + b_n sin(nt) \end{align} we mulitply this sum by $cos(mt)$ and itegrate over one period. Remember the trigonometric functions cosine and sine are $2 \pi$-periodic. \begin{align} \int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} \sum_{n=0}^{\infty} a_n cos(nt) cos(mt) + b_n \underbrace{sin(nt)cos(mt)}_{=0 \text{ by eq. }4}\, dt= \sum_{n=0}^{\infty}\int_{-\pi}^{\pi} a_n cos(nt) cos(mt)\, dt \label{cos} \end{align} All integrals on the right with $m \not = n$ are zero by \ref{orth1}, only the integral \begin{align} \int_{-\pi}^{\pi} f(t) \cdot cos(mt) \, dt= \int_{-\pi}^{\pi} a_n cos(nt)^2 \, dt \end{align} survives! We only have to integrate one term, which we can do by the half-angle formula \begin{align} a_n \int_{-\pi}^{\pi} cos(nt)^2 \, dt = a_n \int_{-\pi}^{\pi} \frac{1+cos(2nt)}{2} \, dt= a_n \left[ \frac{t}{2}+\frac{sin(2nt)}{4n} \right]_{-\pi}^{\pi}=a_n \left[ \frac{\pi}{2}-\frac{- \pi}{2}+0\right]=a_n \pi \end{align} for $m=0$ we can calculate the coefficient \begin{align} a_0 \int_{-\pi}^{\pi} 1 \, dt = 2 \pi \end{align} in agreement with equation \ref{orth1}. The factor $2$ in front of $\pi$ in the last calculation is the reason, why we have to devide $a_0$ in \ref{hfs} by two, if we use the general formula for $a_n$ to calculate $a_0$.
Following property \ref{orth3} all mixed integrals with a product of sine and cosine are zero. This means if we multiply the whole fourier series \ref{hfs} with cosine, we find exactely equation \ref{cos}, because all sine cosine products simply vanish. The similar argument holds for mulitplication with sine. In summary, the product of a function with any other function is zero, exept the product with the function itself. Functions with this property are called orthogonal.
We use this curtial concept of othogonality to calculate the general fourier coefficients. We find $a_n$ with property \ref{orth1}
\begin{align} a_n=\frac{1}{\pi} \int_{-\pi}^{\pi} f(t) \, cos(nt) \, dt \end{align}
with integral property \ref{orth2} we find \begin{align} f(t)=\sum_{n=1}^{\infty} b_n sin(nt) \label{ofs} \end{align} with the fourier coefficients
\begin{align} b_n=\frac{1}{\pi} \int_{-\pi}^{\pi} f(t) \, sin(nt) \, dt \end{align}
What if the phenomena we want to study is not $2\pi$ periodic, but say of period $2L$? This represents no problem, we can make the variable transformation $A: x' \rightarrow B: \frac{\pi x}{L}$, so when $x=L$ we find again $f(\pi)$. This means that a variable in space $A$ has length $L$ but after transformation into $B$ it's again $2 \pi$ periodic. In this way, we can deal with functions of any period $2L$. The fourier series after transformation is \begin{align} f(t)=\sum_{n=1}^{\infty} a_n cos\left(n \frac{\pi \, t}{L} \right) + b_n sin \left(n \frac{\pi \, t}{L} \right) \label{nfs} \end{align} with the fourier coefficients \begin{align} a_n=\frac{1}{L} \int_{-L}^{L} f(t) \, cos \left(n\frac{\pi \, t}{L} \right) \, dt \end{align} obtained by integrating form $-L$ to $L$ \begin{align} b_n=\frac{1}{L} \int_{-L}^{L} f(t) \, sin \left(n\frac{\pi \, t}{L} \right) \, dt \end{align} Notice, if $L$ is $\pi$, the $\pi$s in our new fourier series \ref{nfs} simply cancel out and we are left with our old fourier series \ref{ofs}.
Complex Fourier Series
We can find an alternative expression of the Fourier Series by DeMoivre's Formulas \begin{align} sin(\theta)=\frac{e^{i \theta}-e^{-i\theta}}{2i} \hspace{2cm} cos(\theta)=\frac{e^{i \theta}+e^{-i\theta}}{2} \end{align} If we replace the sine and the cosine term of \begin{align} f(x) = \sum_{n=0}^{\infty} a_n cos(nt) + b_n sin(nt) \end{align} we get for $\theta=n \frac{t \pi}{L}$
\begin{align} f(x) &= \sum_{n=0}^{\infty} a_n \frac{e^{i \theta}+e^{-i\theta}}{2} + b_n \frac{e^{i \theta}-e^{-i\theta}}{2i}\\ f(x) &= \sum_{n=0}^{\infty} a_n \frac{1}{2} \left( e^{i \theta}+e^{-i\theta} \right) -i b_n \frac{1}{2} \left( e^{i \theta}-e^{-i\theta} \right)\\ f(x) &= \sum_{n=0}^{\infty} (a_n-ib_n) \frac{1}{2} e^{i \theta} + (a_n +i b_n) \frac{1}{2} e^{-i\theta}\\ \end{align} If we now change the sum to run from $k=-\infty$ to $\infty$ we can gather the coefficients \begin{align} c_k=\frac{a_n-ib_n}{2}\\ c_{-k}=\frac{a_n+ib_n}{2}\\ \end{align}
we define the Complex Fourier Series with $c_k=c_{-k}^*$ \begin{align} f(t)=\sum_{k=-\infty}^{\infty} c_k e^{i \, k \, \pi \, t /L} \end{align}
We can find the coefficients by multiplying by $e^{-i \, r \, \pi \, t /L}$ \begin{align} \int_{-L}^L f(t) e^{-i \, r \, \pi \, t /L} dt=\sum_{-\infty}^{\infty} \int_{-L}^L c_k e^{i \, k \, \pi \, t /L}e^{-i \, r \, \pi \, t /L} dt=\left\{\begin{array}{ll} c_k \, L & \text{for } k=r \\ 0 & \text{for } k \not = r \\ \end{array} \right. \label{com}
\end{align}
so the complex fourier coeffiecients $c_k$ are \begin{align} c_k=\frac{1}{L} \int_{-L}^L f(t) e^{-i \, r \, \pi \, t /L} dt \end{align}
Further Reading:
- Walter A. Strauss - Partial Differential Equations
- Gerald B. Folland - Fourier Analysis and its Applications
- Schaums Ountlines - Fourier Analysis
Video Lectures: