Fourier Series/Square Wave

Theorem


Let $\map S x$ be the square wave defined on the open interval $\openint {-l} l$ as:


 * $\forall x \in \R: \map S x = \begin {cases}

1 & : x \in \openint 0 l \\ -1 & : x \in \openint {-l} 0 \end {cases}$

Then its Fourier series can be expressed as:

Proof
Let $\map f x$ be the function defined as:
 * $\forall x \in \openint {-l} l: \begin{cases} -1 & : -l < x < 0 \\ 1 & : 0 < x < l \end {cases}$

By inspection we see that $\map f x$ is an odd function.

Hence from Fourier Series for Odd Function over Symmetric Range we can express $f$ by a half-range Fourier sine series:


 * $\displaystyle \map f x \sim \sum_{n \mathop = 1}^\infty b_n \sin \dfrac {n \pi x} l$

where for all $n \in \Z_{> 0}$:
 * $b_n = \displaystyle \frac 2 l \int_0^l \map f x \sin \dfrac {n \pi x} l \rd x$

over the interval $\openint 0 l$.

In that interval $\openint 0 l$, we have:
 * $\map S x = 1$

Hence:

The result follows.