## Midterm

#### I. Partial Sum of a Fourier Series

In the notes for Fourier Series, we claimed that $D_K(t) = \frac{1}{2} + \cos(t) + \cos(2t) + \cos(3t) + \cdots + \cos(Kt) = \frac{\sin((K+\frac{1}{2})t)}{2\sin(\frac{t}{2})}$

We can prove this by noting that $\cos(t) = \frac{1}{2}(e^{jt}+e^{-jt})$. So we get \begin{align*} D_K(t) &= \frac{1}{2} + \frac{e^{jt} + e^{-jt}}{2} + \frac{e^{j2t} + e^{-j2t}}{2} + \frac{e^{j3t} + e^{-j3t}}{2} + \cdots + \frac{e^{jKt} + e^{-jKt}}{2} \\ &= \frac{1}{2}\left(1 + e^{jt} + e^{j2t} + e^{j3t} + \cdots + e^{jKt}\right) + \frac{1}{2}\left(e^{-jt} + e^{-j2t} + e^{-j3t} + \cdots + e^{-jKt}\right) \end{align*}

We use the following rule for summing of geometric series : $\sum_{k=n_1}^{n_2} a^k = \frac{a^{n_1} - a^{n_2+1}}{1-a}$, setting $a = e^{jt},~~n_1 = 0,~~n_2 = K$ to sum the series of positive powers (in the first parantheses) and $a=^{-jt},~~n_1 = 1,~~n_2 = K$ for the series of negative powers to get $D_K(t) = \frac{1 - e^{j(K+1)t}}{2 (1-e^{jt})} + \frac{e^{-jt} - e^{-j(K+1)t}}{2 (1-e^{-jt})}$

Multiplying the numerator and denominator of the first term by $e^{\frac{-jt}{2}}$, and the second term by $e^{\frac{jt}{2}}$, we get \begin{align*} D_K(t) &= \frac{e^{\frac{-jt}{2}} - e^{j(K+\frac{1}{2})t}}{2 (e^{\frac{-jt}{2}}-e^{\frac{jt}{2}})} + \frac{e^{-\frac{jt}{2}} - e^{-j(K+\frac{1}{2})t}}{2 (e^{\frac{jt}{2}}-e^{\frac{-jt}{2}})} \\ &= \frac{-e^{\frac{-jt}{2}} + e^{j(K+\frac{1}{2})t} + e^{-\frac{jt}{2}} - e^{-j(K+\frac{1}{2})t}}{2 (e^{\frac{jt}{2}}-e^{\frac{-jt}{2}})} &= \frac{e^{j(K+\frac{1}{2})t} - e^{-j(K+\frac{1}{2})t}}{2 (e^{\frac{jt}{2}}-e^{\frac{-jt}{2}})} \end{align*}

Dividing both the numerator and denominator by $2j$, we get \begin{align*} D_K &= \frac{\frac{e^{j(K+\frac{1}{2})t} - e^{-j(K+\frac{1}{2})t}}{2j}}{2 \frac{e^{\frac{jt}{2}}-e^{\frac{-jt}{2}}}{2j}} &= \frac{\sin((K+\frac{1}{2})t)}{2 \sin(\frac{t}{2})} \end{align*}

which proves our original contention.

Problem:

The Fourier series expansion of any periodic signal $s(t)$ with period $T$ can be written as $s(t) = \sum_{k=0}^\infty a_k \cos(\frac{2\pi kt}{T}) + \sum_{k=1}^\infty b_k \sin(\frac{2\pi kt}{T}) = a_0 + (a_1 \cos(\frac{2\pi t}{T}) + b_1 \sin(\frac{2\pi t}{T})) + (a_2 \cos(\frac{2\pi 2t}{T}) + b_2 \sin(\frac{2\pi 2t}{T})) + (a_3 \cos(\frac{2\pi 3t}{T}) + b_3 \sin(\frac{2\pi 3t}{T})) + \cdots$

A partial series sum approximating $s(t)$ is obtained by terminating the above series after only $K$ terms: $s_K(t) = a_0 + \left(a_1 \cos(\frac{2\pi t}{T}) + b_1 \sin(\frac{2\pi t}{T})\right) + \left(a_2 \cos(\frac{2\pi 2t}{T}) + b_2 \sin(\frac{2\pi 2t}{T})\right) + \cdots + \left(a_K \cos(\frac{2\pi Kt}{T}) + b_K \sin(\frac{2\pi Kt}{T})\right)$

Prove that $s_K(t) = \frac{2}{T}\int_0^T s(\tau) D_K\left(\frac{2\pi (\tau-t)}{T}\right) d\tau$

Hint: Write out the formulae for $a_i$ and $b_i$ in the definition of $s_K(t)$ and use the approach used to derive the formula for $D_K(t)$.

#### II. Properties of Fourier Series

Prove the following properties of Fourier Series. We will consider only the complex exponential based expansions.

1. $x(t)$ is a periodic signal with period $T$. $X_k$ are its FS coefficients. John mistakenly assumes that the period of $x(t)$ is $\hat{T} = 2T$ and computes its Fourier series coefficients as $\hat{X}_k$. Show that $\hat{X}_k = \begin{cases} 0~~k~odd \\ X_{k/2}~~k~even \end{cases}$

Show that in general if John assumes the period to be $\hat{T} = KT$, $\hat{X}_k = \begin{cases} 0~~k~not~divisible~by~K \\ X_{k/K}~~k~divisible~by~K \end{cases}$

2. Let $x(t)$ be a periodic signal with period $T_x$, and $X_k,~~k=-\infty,\cdots,\infty$ be its Fourier series coefficients. Let $y(t)$ be a periodic signal with period $T_y$, and $Y_k,~~k=-\infty,\cdots,\infty$ be the Fourier series coefficients of $y(t)$. Show that $x(t)y(t)$ is periodic with $T_z = LCM(T_x,T_y)$.
3. Continuing from part 2, let $\hat{X}_k$ and $\hat{Y}_k$ be the Fourier Series coefficients of $x(t)$ and $y(t)$ obtained by the formula of part 1 of this problem, assuming that both of them have a period $T_z$. Show that the Fourier series coefficients of $x(t)y(t)$ are given by $Z_k = \sum_r \hat{X}_{r} \hat{Y}_{k-r}$.
4. Show that if $x(t)$ is an even periodic signal, its Fourier series coefficients $X_k$ are even (i.e. $X_k = X_{-k}$).
5. Show that if $x(t)$ is an odd periodic signal, its Fourier series coefficients $X_k$ are odd (i.e. $X_k = -X_{-k}$).
6. Show that if $x(t)$ is a real periodic signal, its Fourier series coefficients $X_k$ have the property $X_k = x^*_{-k}$, where the superscript $*$ represents complex conjugation.
7. Show that if $x(t)$ is a periodic signal with Fourier Series coefficients $X_k$, the time-reversed signal $x(-t)$ has FS coefficients $X_{-k}$.

#### III. Examples of Fourier Series

Compute the FS coefficients of the following signals

1. A sawtooth waveform $s(t) = \begin{cases} 0.5t~~0\le t < T \\ s(t+T) ~in~general \end{cases}$
2. The following shifted sawtooth $s(t) = \begin{cases} 0.5(t+T/2)~~-\frac{T}{2}\le t < \frac{T}{2} \\ s(t+T) ~in~general \end{cases}$

Hint: You can use the shift property of FS.