{\LARGE\bfseries COM-303 - Signal Processing for Communications \\ ``Mock'' Midterm Exam}\\
\vspace{1em}
{\large}
\vspace{1em}
\end{center}
\centerline{\rule{\textwidth}{.5pt}}
\begin{itemize}
\item This is a no-grade, take-home midterm exam: try to work on the problems as if taking a real exam, i.e.: work uninterruptedly for 2 hours, do not use the internet and use only handwritten notes for support.
\item The solution will be discussed in class after the spring break.
\item There are 6 problems with different scores for a total of 100 points.
\end{itemize}
\centerline{\rule{\textwidth}{.5pt}}
\vspace{1em}
\onebyone
\begin{exercise}{(5 points)}
Consider a length-$N$ signal $\mathbf{x} =[x[0]\, x[1]\,\ldots\, x[N-1]]^T$ and its DFT $\mathbf{X} =[X[0]\, X[1]\,\ldots\, X[N-1]]^T$.
s[n]=\cos(\frac{\pi}{2}n)+\cos(\frac{5\pi}{8}n)\qquad n \in\mathbb{Z}
\]
Consider now the finite-length signal
\[
x[n]= s[n], \quad n =0, 1, \ldots N-1
\]
Determine the minimum value for $N$ so that the DFT $X[k]$ satisfies the following requirements:
\begin{itemize}
\item$X[k]$ has only four nonzero values
\item the nonzero values are non-contiguous (i.e. there should be one or more zero values for $X[k]$ between the nonzero values); this corresponds to being able to resolve the frequencies of the sinusoids of the original signal.
The original signal contains two sinusoids at frequencies
\begin{align*}
\omega_0 &= \frac{\pi}{2}\\
\omega_1 &= \frac{5\pi}{8}
\end{align*}
In order for the DFT of the finite-length signal to contain only four nonzero values we must choose $N$ so that both frequencies are integer multiples of the fundamental frequency for the space of length-$N$ signals; that is, we need to find a value for $N$ such that
\begin{align*}
\omega_0 &= k_0 \frac{2\pi}{N}\\
\omega_1 &= k_1 \frac{2\pi}{N}
\end{align*}
for integer values of $k_{0,1}$. By replacing the values for $\omega_{0,1}$ we have
\begin{align*}
k_0 &= \frac{N}{4}\\
k_1 &= \frac{5}{16} N
\end{align*}
so that, in order to have $k_{0,1} \in\mathbb{N}$, $N$ must be a multiple of 16. If we choose $N=16$, however, we have that $k_0=4$ and $k_1=5$ which does not fulfill the requirement of having at least one zero value between the nonzero DFT values. We therefore must choose at least $N=32$, for which $k_0=8$ and $k_1=10$.
}\fi
\end{exercise}
\onebyone
\begin{exercise}{(25 points)}
Determine the impulse response $h[n]$ of an ideal filter whose real-valued frequency response $H(e^{j\omega})$ is shown in the following figure:
The real-valued frequency response in the figure can be decomposed as the difference between an ideal lowpass with cutoff frequency $\pi/2$ and an ideal filter with triangular characteristic and support between $-\pi/4$ and $\pi/4$:
\[
H(e^{j\omega})=\rect(\omega/\pi)- T(e^{j\omega})
\]
In order to find the expression for $T(e^{j\omega})$, consider that the convolution of a rect shape with itself produces a triangular shape with twice the support:
The frequency response of the filter is real-valued; therefore its phase response is zero and so the filter introduces no delay. This is also apparent by the shape of the impulse response, which is symmetrical around zero.
\vspace{1em}
To make the filter causal, we need to add a delay so that all the nonzero values of the impulse response are for positive values of the index. This can be achieved with a delay by five, so that the resulting frequency response becomes
and, since the pole is outside the unit circle, the system is unstable.
}\fi
\end{exercise}
\onebyone
\begin{exercise}{(20 points)}
The figures below show the pole-zero plots of two filters, $H_1(z)$ and $H_2(z)$. The poles and the zeros lie on circles of radius $\alpha$ and $1/\alpha$. Sketch as accurately as you can the magnitude responses of both filters, highlighting the differences if any.
The frequency response of $H_1(z)$ and $H_2(z)$ can be decomposed into a cascade of two filters: the first filter is determined by the two zeros in the right half-plane while the second filter accounts for the pole-zero pair in the left half-plane. The two complex-conjugate zeros in the right half-plane are at $z_0$ and $z_0^*$ with $z_0=\alpha e^{j\omega_0}$ for some angle $\omega_0$; their response is described by the transfer function:
The shape of the magnitude response will be the same for both filters and is determined by $B(z)$, which is a simple notch filter, sketched here for $\alpha=0.8$ and $\omega_0=\pi/4$: