Theorem
(references: Second Order Linear Partial Differential Equations , 复数形式傅立叶变换的物理意义,相位究竟指的是什么? )
Suppose f ( x ) is a periodic function with period T and is an integrable function on [ 0 , T ] . Then, the Fourier Series of f ( x ) can be written as \text{Suppose } f(x) \text{ is a periodic function with period } T \text{ and is an integrable function on } [0, T]. \\ \text{Then, the Fourier Series of } f(x) \text{ can be written as } Suppose f ( x ) is a periodic function with period T and is an integrable function on [ 0 , T ] . Then, the Fourier Series of f ( x ) can be written as
f ( x ) = c 0 2 + ∑ n = 1 ∞ c n c o s ( n ⋅ 2 π T ⋅ x + φ n ) = c 0 2 + ∑ n = 1 ∞ c n c o s ( φ n ) c o s ( n ⋅ 2 π T ⋅ x ) + ( − c n ) s i n ( φ n ) s i n ( n ⋅ 2 π T ⋅ x ) ( let a 0 = c 0 , a n = c n c o s ( φ n ) and b n = ( − c n ) s i n ( φ n ) ) = a 0 2 + ∑ n = 1 ∞ a n c o s ( n ⋅ 2 π T ⋅ x ) + b n s i n ( n ⋅ 2 π T ⋅ x ) where c n = a n 2 + b n 2 = c n 2 ( c o s 2 ( φ n ) + s i n 2 ( φ n ) ) = c n 2 ( A m p l i t u d e ) φ n = t a n − 1 ( − b n a n ) ( P h a s e ) a 0 = 1 T ∫ 0 T f ( x ) d x a n = 1 T ∫ 0 T f ( x ) ⋅ c o s ( n ⋅ 2 π T ⋅ x ) d x b n = 1 T ∫ 0 T f ( x ) ⋅ s i n ( n ⋅ 2 π T ⋅ x ) d x
\begin{align}
f(x) & = \frac{c_0}{2} + \sum_{n=1}^{\infty} c_ncos(n \cdot \frac{2\pi}{T} \cdot x + \varphi_n) \\
&= \frac{c_0}{2} + \sum_{n=1}^{\infty} c_ncos(\varphi _n)cos(n \cdot \frac{2\pi}{T} \cdot x)+ (-c_n)sin(\varphi _n)sin(n \cdot \frac{2\pi}{T} \cdot x) \\
&\text{( let } a_0 = c_0, \;a_n = c_ncos(\varphi _n) \text{ and } b_n = (-c_n)sin(\varphi _n) \;) \\
&= \frac{a_0}{2} + \sum_{n=1}^{\infty} a_ncos(n \cdot \frac{2\pi}{T} \cdot x)+ b_nsin(n \cdot \frac{2\pi}{T} \cdot x) \\
\\
\text{where } c_n &= \sqrt{a_n^2 + b_n^2} = \sqrt{c_n^2(cos^2(\varphi _n) + sin^2(\varphi _n))} = \sqrt{c_n^2} \;\; (Amplitude)\\
\varphi_n &= tan^{-1}(-\frac{b_n}{a_n}) \;\; (Phase)\\
a_0 &= \frac{1}{T}\int_{0}^{T}f(x)dx \\
a_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot cos(n \cdot \frac{2\pi}{T} \cdot x)dx \\
b_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot sin(n \cdot \frac{2\pi}{T} \cdot x)dx
\end{align}
f ( x ) where c n φ n a 0 a n b n = 2 c 0 + n = 1 ∑ ∞ c n cos ( n ⋅ T 2 π ⋅ x + φ n ) = 2 c 0 + n = 1 ∑ ∞ c n cos ( φ n ) cos ( n ⋅ T 2 π ⋅ x ) + ( − c n ) s in ( φ n ) s in ( n ⋅ T 2 π ⋅ x ) ( let a 0 = c 0 , a n = c n cos ( φ n ) and b n = ( − c n ) s in ( φ n ) ) = 2 a 0 + n = 1 ∑ ∞ a n cos ( n ⋅ T 2 π ⋅ x ) + b n s in ( n ⋅ T 2 π ⋅ x ) = a n 2 + b n 2 = c n 2 ( co s 2 ( φ n ) + s i n 2 ( φ n )) = c n 2 ( A m pl i t u d e ) = t a n − 1 ( − a n b n ) ( P ha se ) = T 1 ∫ 0 T f ( x ) d x = T 1 ∫ 0 T f ( x ) ⋅ cos ( n ⋅ T 2 π ⋅ x ) d x = T 1 ∫ 0 T f ( x ) ⋅ s in ( n ⋅ T 2 π ⋅ x ) d x
Derivation for the Fourier Coefficients, a 0 a_0 a 0 , a n a_n a n , b n b_n b n :
(references: Khan - Fourier Series introduction , 8 Fourier Series )
Using the facts that
∫ 0 2 π s i n ( m x ) d x = 0 , ∀ integer m ∫ 0 2 π c o s ( m x ) d x = 0 , ∀ non-zero integer m ∫ 0 2 π s i n ( m x ) c o s ( n x ) d x = 0 , ∀ integer m , n ∫ 0 2 π c o s ( m x ) c o s ( n x ) d x = { 0 , m ≠ n 2 π , m = n = 0 π , m = n ≠ 0 ∫ 0 2 π s i n ( m x ) s i n ( n x ) d x = { 0 , m ≠ n π , m = n ≠ 0
\begin{align}
\int_{0}^{2 \pi} sin(mx)dx &= 0\; , \forall \text{ integer } m \\
\int_{0}^{2 \pi} cos(mx)dx &= 0\; , \forall \text{ non-zero integer } m \\
\int_{0}^{2 \pi} sin(mx)cos(nx)dx &= 0\; , \forall \text{ integer } m \text{, } n\\
\int_{0}^{2 \pi} cos(mx)cos(nx)dx &= \left\{
\begin{matrix}
0\;, &\;\; m \neq n \\
2\pi\;, &\;\; m = n = 0\\
\pi\;, &\;\; m = n \neq 0
\end{matrix}\right. \\
\int_{0}^{2 \pi} sin(mx)sin(nx)dx &= \left\{
\begin{matrix}
0 \;, &\;\; m \neq n\\
\pi \;, &\;\; m = n \neq0
\end{matrix}\right.
\end{align}
∫ 0 2 π s in ( m x ) d x ∫ 0 2 π cos ( m x ) d x ∫ 0 2 π s in ( m x ) cos ( n x ) d x ∫ 0 2 π cos ( m x ) cos ( n x ) d x ∫ 0 2 π s in ( m x ) s in ( n x ) d x = 0 , ∀ integer m = 0 , ∀ non-zero integer m = 0 , ∀ integer m , n = ⎩ ⎨ ⎧ 0 , 2 π , π , m = n m = n = 0 m = n = 0 = { 0 , π , m = n m = n = 0
to calculate ∫ 0 2 π f ( x ) d x \int_{0}^{2 \pi}f(x)dx ∫ 0 2 π f ( x ) d x , ∫ 0 2 π f ( x ) c o s ( m x ) d x \int_{0}^{2 \pi}f(x)cos(mx)dx ∫ 0 2 π f ( x ) cos ( m x ) d x and ∫ 0 2 π f ( x ) s i n ( m x ) d x \int_{0}^{2 \pi}f(x)sin(mx)dx ∫ 0 2 π f ( x ) s in ( m x ) d x .
Then obtain the Fourier Coefficients,
a 0 = 1 π ∫ 0 2 π f ( x ) d x a n = 1 π ∫ 0 2 π f ( x ) ⋅ c o s ( n ⋅ x ) d x b n = 1 π ∫ 0 2 π f ( x ) ⋅ s i n ( n ⋅ x ) d x
\begin{align}
a_0 &= \frac{1}{\pi}\int_{0}^{2\pi}f(x)dx \\
a_n &= \frac{1}{\pi}\int_{0}^{2\pi}f(x) \cdot cos(n \cdot x)dx \\
b_n &= \frac{1}{\pi}\int_{0}^{2\pi}f(x) \cdot sin(n \cdot x)dx
\end{align}
a 0 a n b n = π 1 ∫ 0 2 π f ( x ) d x = π 1 ∫ 0 2 π f ( x ) ⋅ cos ( n ⋅ x ) d x = π 1 ∫ 0 2 π f ( x ) ⋅ s in ( n ⋅ x ) d x
Let x = 2 π T ⋅ y x = \frac{2\pi}{T} \cdot y x = T 2 π ⋅ y and d x = 2 π T ⋅ d y dx = \frac{2\pi}{T} \cdot dy d x = T 2 π ⋅ d y ,
then
a 0 = 1 T ∫ 0 T f ( x ) d x a n = 1 T ∫ 0 T f ( x ) ⋅ c o s ( n ⋅ 2 π T ⋅ x ) d x b n = 1 T ∫ 0 T f ( x ) ⋅ s i n ( n ⋅ 2 π T ⋅ x ) d x
\begin{align}
a_0 &= \frac{1}{T}\int_{0}^{T}f(x)dx \\
a_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot cos(n \cdot \frac{2\pi}{T} \cdot x)dx \\
b_n &= \frac{1}{T}\int_{0}^{T}f(x) \cdot sin(n \cdot \frac{2\pi}{T} \cdot x)dx
\end{align}
a 0 a n b n = T 1 ∫ 0 T f ( x ) d x = T 1 ∫ 0 T f ( x ) ⋅ cos ( n ⋅ T 2 π ⋅ x ) d x = T 1 ∫ 0 T f ( x ) ⋅ s in ( n ⋅ T 2 π ⋅ x ) d x
Complex Form :
(references: wiki-Euler’s formula , Complex Fourier Series )
f ( x ) = ∑ n = − ∞ ∞ d n e i ( n 2 π T x ) f(x) = \sum_{n=-\infty}^{\infty} d_ne^{i(n\frac{2\pi}{T}x)} f ( x ) = ∑ n = − ∞ ∞ d n e i ( n T 2 π x )
By using Euler’s formula, e i x = c o s ( x ) + i s i n ( x ) e^{ix} = cos(x) + isin(x) e i x = cos ( x ) + i s in ( x ) , we know
c o s ( x ) = e i x + e − i x 2 s i n ( x ) = e i x − e − i x 2 i = − i e i x + i e − i x 2
\begin{align}
cos(x) &= \frac{e^{ix} + e^{-ix}}{2} \\
sin(x) &= \frac{e^{ix} - e^{-ix}}{2i} = \frac{-ie^{ix} + ie^{-ix}}{2}
\end{align}
cos ( x ) s in ( x ) = 2 e i x + e − i x = 2 i e i x − e − i x = 2 − i e i x + i e − i x
The f ( x ) f(x) f ( x ) can be rewritten as,
f ( x ) = a 0 2 + ∑ n = 1 ∞ a n ( 1 2 e i ( n 2 π T x ) + 1 2 e − i ( n 2 π T x ) ) + b n ( 1 2 i e i ( n 2 π T x ) − 1 2 i e − i ( n 2 π T x ) ) = a 0 2 + ∑ n = 1 ∞ ( a n − i b n ) 2 e i ( n 2 π T x ) + ( a n + i b n ) 2 e − i ( n 2 π T x ) = ∑ n = − ∞ ∞ d n e i ( n 2 π T x )
\begin{align}
f(x) &= \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n(\frac{1}{2}e^{i(n\frac{2\pi}{T}x)} + \frac{1}{2}e^{-i(n\frac{2\pi}{T}x)}) + b_n(\frac{1}{2}ie^{i(n\frac{2\pi}{T}x)} - \frac{1}{2}ie^{-i(n\frac{2\pi}{T}x)}) \\
&= \frac{a_0}{2} + \sum_{n=1}^{\infty} \frac{(a_n - ib_n)}{2}e^{i(n\frac{2\pi}{T}x)} + \frac{(a_n + ib_n)}{2}e^{-i(n\frac{2\pi}{T}x)} \\
&= \sum_{n=-\infty}^{\infty} d_ne^{i(n\frac{2\pi}{T}x)}
\end{align}
f ( x ) = 2 a 0 + n = 1 ∑ ∞ a n ( 2 1 e i ( n T 2 π x ) + 2 1 e − i ( n T 2 π x ) ) + b n ( 2 1 i e i ( n T 2 π x ) − 2 1 i e − i ( n T 2 π x ) ) = 2 a 0 + n = 1 ∑ ∞ 2 ( a n − i b n ) e i ( n T 2 π x ) + 2 ( a n + i b n ) e − i ( n T 2 π x ) = n = − ∞ ∑ ∞ d n e i ( n T 2 π x )
where the d n d_n d n is called the Complex Fourier Coefficients,
d n = { a n − i b n 2 , n ≥ 1 a 0 2 , n = 0 a ∣ n ∣ + i b ∣ n ∣ 2 , n ≤ 1
\begin{align}
d_n = \left\{\begin{matrix}
\frac{a_n - ib_n}{2}&, \;\;\;n\geq 1\\
\frac{a_0}{2}&, \;\;\;n= 0\\
\frac{a_{\left | n \right |} + ib_{\left | n \right |}}{2}&, \;\;\;n\leq 1
\end{matrix}\right.
\end{align}
d n = ⎩ ⎨ ⎧ 2 a n − i b n 2 a 0 2 a ∣ n ∣ + i b ∣ n ∣ , n ≥ 1 , n = 0 , n ≤ 1