\documentclass[12pt]{article}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\setlength{\textheight}{23cm}
\setlength{\textwidth}{15cm}
\setlength{\topmargin}{-2cm}
\setlength{\oddsidemargin}{0cm}
\raggedbottom

\begin{document}

\begin{center}
\textbf{Physics 120  \smallskip - \smallskip David Kleinfeld \smallskip - \smallskip Spring 2017}
\end{center}

\setcounter{section}{0}

\setcounter{equation}{0}

\section{Notes on Fourier series of periodic functions}

\subsection{Background}

Any temporal function can be represented by a multiplicity of basis sets. When the function is assumed to exist for all of time, a not unreasonable
approximation for real signals in the steady state, the optimal representation is in the frequency domain.
Here we express  function $V(t)$ in terms of a continuous expansion in sines and cosines, which are most conveniently written in their complex
forms, $i.e.$, sin$x$ = $( e^{ix} - e^{-ix})/(2i)$ and cos$x$ = $( e^{ix} + e^{-ix})/2$. Then

\newcommand{\dotp}[2]{\langle#1,#2\rangle}
\medskip

\begin{equation}
V (t) = \frac{1}{{2 \pi}} \int \limits_{-\infty}^{\infty} d\omega \; \tilde{V}(\omega) \; e^{i \omega t}
\end{equation}

\noindent
where $\tilde{V}(\omega)$ is a complex function that sets the contribution of different frequencies, $\omega$. The
inverse transform is

\begin{equation}
\tilde{V}(\omega) =  \int \limits_{-\infty}^{\infty} dt \; V(t) \; e^{-i \omega t}.
\end{equation}

\medskip

\noindent
When $V(t)$ is periodic with period $T$, so that $V(t+T)$ = $V(t)$, we have

\begin{equation}
\int \limits_{-\infty}^{\infty} dt \; V(t) \; e^{-i \omega t} \; = \;  \int \limits_{-\infty}^{\infty} dt \; V(t) \; e^{-i \omega (t+T)}
\end{equation}

\noindent
so that 

\begin{equation}
e^{-i \omega T} \; = \; 1
\end{equation}

\noindent
and $\omega$ can only take on discrete values, $i.e.$,

\begin{equation}
\omega \; = \; 0, \; \pm\frac{2 \pi}{T}, \; \pm\frac{4 \pi}{T}, \; \pm\frac{6 \pi}{T}, \; ... \; .
\end{equation}

\noindent
We define $\omega_o$ = $2 \pi/T$ so that

\begin{equation}
\omega \; = \; 0, \; \pm\omega_o, \; \pm2 \omega_o, \; \pm3 \omega_o, \; ... \; .
\end{equation}

\noindent
and write the Fourier expansion in a discrete form, $i.e.$,

\begin{equation}
V (t) =  \sum \limits_{k = -\infty}^{\infty} \; \tilde{c}_k \; e^{i k \omega_o t}.
\end{equation}

\noindent
The $\tilde{c}_k$ are complex numbers that weight each of the harmonics $\omega_o$. They are defined by

\begin{equation}
\tilde{c}_k \;  =  \frac{1}{T} \int \limits_{-T/2}^{+T/2} dt \; V(t) \; e^{-i k \omega_o t}.
\end{equation}

\noindent
Since we need to end up with sines and cosines, the constant are constrained so that
$\tilde{c}_k$ = $\tilde{c}_{-k}$ for $\tilde{c}_k$ real and $\tilde{c}_k$ = $-\tilde{c}_{-k}$ for $\tilde{c}_k$ imaginary.

\subsection{Sine waves}

This is a trivial case. We have:

\begin{eqnarray}
\tilde{c}_0 \; &=&  0 \\
\tilde{c}_{\pm 1} \; &=& \pm \frac{1}{2i} \nonumber \\
\tilde{c}_{\pm k;  \; k \geq 2} \; &=&  0 \nonumber
\end{eqnarray}

\subsection{Square waves}

Here $V(-T/2 <t<0)$ = -1 and $V(0 <t<T/2)$ = +1. We have:

\begin{eqnarray}
\tilde{c}_k \;  &=&  \frac{1}{T} \left[ \int \limits_{-T/2}^{0} dt \;  (-1) \; e^{-i k \omega_o t} \; + \; \int \limits_{0}^{+T/2} dt \;  (+1) \; e^{-i k \omega_o t}\right] \\
 &=&  \frac{1}{-i k \omega_o T} \left[- \; e^{-i k \omega_o t} |_{-T/2}^{0} \; + \; e^{-i k \omega_o t} |_{0}^{T/2}  \right] \nonumber \\
 &=&  \frac{1}{-i k \omega_o T} \left[ -1 \; + \; e^{+i k \omega_o T/2} \; + \; e^{-i k \omega_o T/2} \; - \; 1  \right] \nonumber \\
 &=&  \frac{1}{i k \omega_o T} \left[ 2 \; - 2 \; cos \left(k \omega_o T/2 \right)  \right] \nonumber.
\end{eqnarray}

\noindent
We recall that $\omega_o T$ = $2 \pi$, so that 

\begin{eqnarray}
\tilde{c}_k \;  &=&   \left(\frac{4}{\pi}\right)  \left(\frac{1}{2i}\right) \left[ \frac{1 \; - \; cos \left(\pi k \right)}{2k} \right]  \\
   &=&   \left( \frac{4}{\pi} \right)  \left(  \frac{1}{2i} \right) \left( ..., \; 0, \; -\frac{1}{5}, \; 0, \; -\frac{1}{3}, \; 0, \; -1, \; 0, \; +1, \; 0, \; +\frac{1}{3}, \; 0, \; +\frac{1}{5}, \; 0, \; ... \right)  \nonumber
\end{eqnarray}

\noindent
and

\begin{eqnarray}
V(t) &=& \frac{4}{\pi} \left( \frac{... - \frac{1}{5} e^{-i 5\omega_o t} -  \frac{1}{3} e^{-i 3\omega_o t} - e^{-i \omega_o t} + e^{i \omega_o t} + \frac{1}{3} e^{i 3\omega_o t} + \frac{1}{5} e^{i 5\omega_o t} + ...}{2 i} \right)  \nonumber \\
&=&\frac{4}{\pi} \left[ sin(\omega_o t) \; + \;   \frac{1}{3} sin(3 \omega_o t)  \; + \;   \frac{1}{5} sin(5 \omega_o t) \; + \; ...  \right] .
\end{eqnarray}

\noindent
The result is that the square wave is constructed from a weakly converging set of odd harmonics.

\noindent
Of potential interest, the "smoother" the function the faster the series for $\tilde{c}_k$ converges, $i. e.$, $\tilde{c}_k$ = constant for a period series of delta functions, $i.e.$, the so-called comb function,  $\tilde{c}_k$ $\propto$ $1/k$ for a square wave as derived above, $\tilde{c}_k$ $\propto$ $1/k^2$ for a triangular wave, $etc$.

\end{document}
