{\LARGE \bfseries COM-303 - Signal Processing for Communications \\ Midterm Exam} \\
\vspace{1em}
{\large Monday, April 2 2012, 08:15 to 11:00}
\vspace{1em}
\end{center}
\centerline{\rule{\textwidth}{.5pt}}
\begin{itemize}
\item {\bf Write your name} on the top left corner of {\bf ALL sheets you turn in}, including this one. When you are done, \textbf{staple} all your sheets together \textbf{with this sheet on top}!
\item You can have two A4 sheet of \emph{handwritten} notes (front and back). Please \textbf{no photocopies, no books and no electronic devices}. Turn off your phone if you have it with you.
\item There are 7 problems (two are on the other side of this page) for a total of 100 points; the number of points for each problem is indicated next to it.
\item Please write your derivations clearly, as there is partial credit.
\end{itemize}
\centerline{\rule{\textwidth}{.5pt}}
\vspace{1em}
\begin{exercise}[Problem]{(5 points)}
Compute the DTFT of $x[n] = a^{|n|}$ for $n\in\mathbb{Z}$ and $|a| < 1$. Compute $X(e^{j\omega})$ and sketch its magnitude for $a$ close to 1.
\end{exercise}
\begin{exercise}[Problem]{(5 points)}
Consider a filter with frequency response $H(e^{j\omega}) = \cos 4\omega$.
\begin{enumerate}
\item write out the impulse response $h[n]$
\item what is the delay introduced by the filter?
\end{enumerate}
\end{exercise}
\begin{exercise}[Problem]{(10 points)}
Consider an $M$-tap FIR filter with frequency response $H(e^{j\omega})$. Suppose you know that $H(e^{j\omega}) = 0$ for $\omega = 0.5\pi$, $\omega = 0.6\pi$ and $\omega = 0.7\pi$. What is the minimum value of $M$? Explain.
\end{exercise}
\begin{exercise}[Problem]{(15 points)}
Consider a sequence $x[n] \in l_2(\mathbb{Z})$. Another sequence $y[n]$ is defined from $x[n]$ as
\[
y[n] = \begin{cases}
x[n] \quad & \mbox{for $n$ even} \\
1 \quad & \mbox{for $n$ odd}
\end{cases}
\]
Express $Y(e^{j\omega})$ in terms of $X(e^{j\omega})$. [{\em Hint: the sequence~ $(1+\cos(\pi n))/2$ may prove useful.}]
\end{exercise}
%\begin{exercise}[Problem]{(15 points)}
%Consider an LTI system described by the following constant-coefficient difference equation:
%\[
% y[n-2] + 0.6\,y[n-3] = x[n+1]
%\]
%\begin{enumerate}
%\item Write the transfer function of the system.
%\item Plot its poles and zeros, and show the ROC for a {\em causal} realization of the system.
%\item Compute the impulse response of the system.
%\end{enumerate}
%\end{exercise}
\begin{exercise}[Problem]{(15 points)}
Consider the signal $\mathbf{x} \in \mathbb{C}^{8}$:
If $\mathbf{X} = \mbox{DFT}\{\mathbf{x}\}$, compute $\mathbf{X}_0$ and $\mathbf{X}_1$ (or, in a different notation, if $X[k] = \mbox{DFT}\{x[n]\}$, compute $X[0]$ and $X[1]$). Remember it's always a good idea to visualize the unit circle and the roots of unity. All you need to remember, from the numerical point of view, is that $\cos(\pi/4) = \sin(\pi/4) = \sqrt{2}/2$.
\end{exercise}
\newpage
\begin{exercise}[Problem]{(20 points)}
A causal LTI system is described by the following difference equation:
\item Compute the output $y[n]$ of the system when the input is $x[n] = u[n] - 0.5u[n-1]$
\end{enumerate}
\end{exercise}
\begin{exercise}[Problem]{(30 points)}
Consider a length-$M$ moving average filter with impulse response
\[
h[n] = \begin{cases}
1 \quad & \mbox{for $0 \leq n \leq M-1$} \\
0 \quad & \mbox{otherwise}
\end{cases}
\]
(note that we're not normalizing the filter by $1/M$ for simplicity).
\begin{enumerate}
\item sketch the pole-zero plot for the filter for $M = 8$
\end{enumerate}
Consider now the {\em inverse}\/ filter $g[n]$, i.e. the filter for which $g[n]\ast h[n] = \delta[n]$;
\begin{enumerate}
\setcounter{enumi}{1}
\item sketch the pole-zero plot for the inverse filter
\item is the inverse filter BIBO stable?
\item assume $M=2$ and compute the first ten values of $g[n] \ast u[n]\cos(\pi n)$ (where $u[n]$ is the unit step)
\end{enumerate}
Let's now consider a different approach to inverting the moving average operation that works for finite-support sequences and uses only FIR operators. Consider a filter $w[n] = \delta[n] - \delta[n-1]$:
\begin{enumerate}
\setcounter{enumi}{4}
\item write the difference equation that describes the system obtained by cascading the moving average with $w[n]$, i.e. the filter $h[n]\ast w[n]$
\item assume the following:
\begin{itemize}
\item $M = 2$
\item $x[n] = 0$ for $n < 0$ and $n > 5$, i.e. $x[n]$ has a finite-length support of size $6$.
Show that $(x[x] \ast h[n]) \ast w[n] \ast p[n] = x[n]$ ({\em hint: do it in the time domain}).
\item \em(bonus: 5 points) can you give a general expression for a $p[n]$ that recovers an $L$-tap-support $x[n]$ given a moving average of length $M$?