# Exercise: Sawtooth Wave Fourier Transform

## Problem Statement

Find the Fourier Tranform of the sawtooth wave given by the equation

$x(t)=t-\lfloor t \rfloor$

## Solution

As shown in class, the general equation for the Fourier Transform for a periodic function with period $T$ is given by

$x(t)=\frac{a_0}{2}+\sum^\infty_{n=1} \left[a_n\cos\frac{2\pi nt}{T}+b_n\sin\frac{2\pi nt}{T}\right]$

where

$\begin{cases} a_n=\frac{2}{T}\int_c^{c+T}x(t)\cos\frac{2\pi nt}{T}dt\\ b_n=\frac{2}{T}\int_c^{c+T}x(t)\sin\frac{2\pi nt}{T}dt \end{cases} \ \ \ \ n=0,1,2,3\dots$

For the sawtooth function given, we note that $T=1$, and an obvious choice for $c$ is 0 since this allows us to reduce the equation to $x(t)=t$. It remains, then, only to find the expression for $a_n$ and $b_n$. We proceed first to find $b_n$.

$b_n=\frac{2}{1}\int_0^1t\sin 2\pi nt\ dt$

which is solved easiest with integration by parts, letting

$u=t\qquad\Rightarrow\qquad du=dt$

$dv=\sin2\pi nt\ dt\qquad\Rightarrow\qquad v=-\frac{1}{2\pi n}\cos 2\pi nt$

so

$b_n=2\left[t\left(-\frac{1}{2\pi n}\right)\cos 2\pi nt\bigg|_0^1+\frac{1}{2\pi n}\int_0^1\cos 2\pi nt\ dt \right]$

$=2\left[\left(-\frac{1}{2\pi n}\cos 2\pi n - 0\right)+\left(\frac{1}{2\pi n}\right)^2\sin 2\pi nt \bigg|_0^1\right]$

$=2\left[-\frac{1}{2\pi n}(1)+0\right]$

$=-\frac{1}{\pi n}$

Now, for $a_n$ we must consider the case when $n=0$ separately.

$a_0=\frac{2}{1}\int_0^1t\ dt=t^2\bigg|_0^1=1$

For $n=1,2,3\dots$, we have

$a_n=\frac{2}{1}\int_0^1t\cos 2\pi nt\ dt$

which again is best solved using integration by parts, this time with

$u=t\qquad\Rightarrow\qquad du=dt$

$dv=\cos 2\pi nt\ dt\qquad \Rightarrow\qquad v=\frac{1}{2\pi n}\sin 2\pi nt$

so

$a_n=2\left[t\left(\frac{1}{2\pi n}\right)\sin 2\pi nt\bigg|_0^1-\int_0^1\frac{1}{2\pi n}\sin 2\pi nt\ dt\right]$

$=2\left[\left(\frac{1}{2\pi n}\sin 2\pi n-0\right)-\left[-\left(\frac{1}{2\pi n}\right)^2\cos 2\pi nt\right]_0^1\right]$

$=2\left[0+\left(\frac{1}{2\pi n}\right)^2\left(\cos 2\pi n-\cos 0\right)\right]$

$\ =0$

Therefore, the Fourier Transform representation of the sawtooth wave given is:

$x(t)=\frac{1}{2}-\sum_{n=1}^\infty \frac{1}{\pi n}\sin 2\pi nt$

## Solution Graphs

The figures below graph the first few iterations of the above solution. The first graph shows the solution truncated after the first 100 terms of the infinite sum, as well as each of the contributing sine waves with offset. The second figure shows the function truncated after 1, 3, 5, 10, 50, and 100 terms. The last figure shows the Error between the Fourier Series truncated after the first 100 terms and the function itself. These figures were constructed using the following matlab code: SawToothFourier.

Solution as number of terms varies from 1 to 30.

John Hawkins

Colby Fullerton