\documentclass[10pt]{article}
\usepackage{geometry}
\geometry{a4paper}
\pagestyle{myheadings}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{array}  % for table column M
\usepackage{makecell} % to break line within a cell
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{xcolor}
\usepackage{ifthen}
\usepackage{setspace}
\usepackage{enumerate}% http://ctan.org/pkg/enumerate
\usepackage{placeins} % for FloatBarrier
\usepackage[makeroom]{cancel}
\usepackage[absolute,overlay]{textpos}
\usetikzlibrary{calc, angles,quotes}
\usetikzlibrary{pgfplots.fillbetween, backgrounds}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{plotmarks}
\usetikzlibrary{decorations.markings}

\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=newest} 

\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\graphicspath{{../figs/}}

\definecolor{blue2}{RGB}{51, 105, 232}  
\definecolor{red2}{RGB}{213, 15, 37}  
\definecolor{green2}{RGB}{0, 153, 37}  

\input{preamble.tex}

%%%%%%%%%%%%% SOLUTIONS %%%%%%%%%%%%%%%%%
\def\SOLUTIONS{0} % change to 1 to produce solutions
\def\SolutionsColor{red2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Header
\if\SOLUTIONS1
	\markboth{\em \color{\SolutionsColor} \textbf{EE264: Midterm Solutions}}{\em \color{\SolutionsColor} \textbf{EE264: Midterm Solutions}}
    \title{EE 264 Midterm Solutions}
\else
	\markboth{\em EE264: Midterm, August 1st -- Summer 2018}{\em EE264: Midterm, July 23 -- Summer 2018}
    \title{EE 264 Midterm}
\fi

% Document
\begin{document}
\input{cover.tex}
\pagebreak

\section*{Problem 1: Short questions (30 points)}

Please answer each of the following questions. Lengthy explanations or extensive derivations are not necessary. You may answer the questions with a few sentences, equations, or clearly labeled sketches or diagrams.

\begin{description}
\item[(a)] (3 points) Consider a linear and time invariant system with impulse response $h[n]$. The input to this system is the signal $x[n] = \delta[n] - 0.8\delta[n-3]$, where $\delta[n]$ is the unit impulse. Give an expression for the output $y[n]$ and its Fourier transform Fourier transform $Y(e^{j\omega}) = \mathcal{F}\{y[n]\}$. Your answers should be a function of $h[n]$ or $H(e^{j\omega})$.

\if\SOLUTIONS1
{\color{\SolutionsColor} 
	The output is obtained by performing a convolution sum:
	\begin{equation}
		y[n] = \sum_{m=-\infty}^{\infty} x[m]h[n-m] = h[n] + h[n-3].
	\end{equation}
	
	Knowing $h[n]$ and we can easily compute it's Fourier transform: $H(e^{j\omega}) = H(e^{j\omega}) + H(e^{j\omega})e^{-j\omega 3}$.
}
\else\vspace{3cm}
\fi

%
\item[(b)] (6 points) Write the $z$-transform of the linear time invariant system defined by the difference equation:
\begin{equation}
y[n] - 0.5y[n-1] = x[n] - 2x[n-2],
\end{equation}
and determine if each statement about this system is \underline{true} or \underline{false}. Give a brief reason to support your assertion.

\begin{enumerate}\setlength\itemsep{2em}
  \item This system is causal
  \item This system is IIR
  \item The impulse response of this system converges to $h[n] \approx \sqrt{2}$ as $n\to \infty$
  \item This system has constant group delay over all frequencies
  \item This system has a causal and stable inverse.
\end{enumerate}

\if\SOLUTIONS1
{\color{\SolutionsColor} Applying the linearity and time-shift properties of the $z$-transform:
\begin{equation*}
H(z) = \frac{Y(z)}{X(z)} = \frac{1 - 2z^{-2}}{1 - 0.5z^{-1}} = \frac{z^2 - 2}{z(z - 0.5)}
\end{equation*}

\begin{enumerate}
  \item True. The output does not depend on future samples.
  \item True. The system has an pole away from the origin.
  \item False. The system is stable, since all poles are inside the unit circle. Thus, the impulse response must be absolute summable, and consequently $h[n] \to 0$, as $n\to\infty$.
  \item False. It is not FIR, and linear phase rational IIR systems do no exist.
  \item False. There zeros outside the unit circle.
\end{enumerate}
}
\else\vspace{4cm}
\fi

%
\item[(c)] (3 points) Consider the two systems defined below
\begin{equation}
	H_1(z) = \frac{1}{3}(1 + z^{-1} + z^{-2})\qquad H_2(z) = \frac{1 + z^{-1}}{1 - 0.5z^{-1}}.
\end{equation}
Suppose that we apply the signal $x[n] = \cos(n\pi/3)$ to both systems. Which system would produce the output signal with highest magnitude? Justify. Answers without justification will not receive any credit. 

\if\SOLUTIONS1
{\color{\SolutionsColor} 
System 2 would produce an output signal with highest magnitude because system 1 has a zero at frequency $\omega = \pi/3$, which is exactly the frequency of the input signal. Thus, the output of system 1 to signal $x[n]$ is zero.
}
\else\vspace{3cm}
\fi

\item[(d)] (6 points) The random signal $x[n]$ is such that at any given time $n$, we have
\begin{equation}
	x[n] = \begin{cases}
	1, &\text{with probability 0.5} \\
	0, &\text{with probability 0.5} \\
	\end{cases},
\end{equation}
This signal is filtered by a four-point moving average filter $H(z) = \frac{1}{4}(1 + z^{-1} + z^{-2} + z^{-3})$, producing the output signal $y[n]$. Compute the mean value of $y[n]$, $\E(y[n])$.

\if\SOLUTIONS1
{\color{\SolutionsColor} 
	The input signal $x[n]$ is a Bernoulli process. Thus, we have
	\begin{equation}
		\E(x[n]) = 0.5(1) + 0.5(0) = 0.5
	\end{equation}
	
	The mean of a random process after an LTI system is scaled by the magnitude at zero frequency: $\E(y[n]) = H(e^{j0})\E(x[n])$.
	
	Recall that $z = e^{j\omega}$, thus for $\omega = 0 \implies z = 1$, $H(e^{j0}) = 1$. Therefore, $\E(y[n]) = 0.5$.
}
\else\vspace{5cm}
\fi

%
\item[(e)] (6 points) A zero-mean, discrete-time random signal $r[n]$ has autocorrelation function given by $\phi_{rr}[m] = \sigma^2\delta[m]$. This signal is filtered by a filter whose frequency response is given by

\begin{equation}
	H(e^{j\omega}) = \begin{cases}
	(1 - 4\omega/\pi)e^{-j\omega}, & |\omega| < 0.25\pi \\
	0, & 0.25\pi < |\omega| < \pi
	\end{cases}.
\end{equation}

What is the average power of the output noise filtered by $H(e^{j\omega})$?

\if\SOLUTIONS1
{\color{\SolutionsColor} 
	Since the autocorrelation function is an impulse, the input noise has a white power spectrum density (PSD) with average power $\sigma^2$. The PSD of the output signal is simply $\Phi_{yy}(e^{j\omega}) = \sigma^2|H(e^{j\omega})|^2$. And the average power is the area under $\Phi_{yy}(e^{j\omega})$. Thus,
	
	\begin{align}
		\E(y^2[n]) &= \frac{1}{2\pi}\int_{-\pi}^{\pi} \Phi_{yy}(e^{j\omega})d\omega \\
		&= \frac{1}{2\pi}\int_{-\pi}^{\pi} \sigma^2|H(e^{j\omega})|^2 d\omega.
	\end{align}
	This integral $\int_{-\pi}^{\pi} |H(e^{j\omega})|^2 d\omega$ is simply the area under a triangle of height 1 and base $\pi/2$. Thus, $\E(y^2[n]) = \frac{\sigma^2}{8}$.
}
\else\vspace{6cm}
\fi

\item[(f)] (6 points) The following four facts are known about a LTI system with impulse response $h[n]$ and $z$-transform $H(z)$:
\begin{enumerate}[i]
	\item $h[n]$ is real valued.
	\item $h[n]$ has even symmetry.
	\item $h[n]$ is only zero outside the interval $0 \leq n \leq 4$.
	\item $H(z)$ has a zero at $z = 1/2e^{j\pi/4}$.
\end{enumerate}

Using this information, please answer the following questions. You must justify your answers. If the information given is not sufficient to answer one of the questions, please explain what information is lacking. 

\begin{enumerate}	
	\item Give all the poles and zeros of $H(z)$?
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor} 
		From (iii) we know that $h[n]$ is FIR with 5 coefficients, or equivalently the order of the filter is $M = 4$. From (ii) we know that $h[n]$ is even symmetric and therefore $h[n]$ has linear phase. Linear phase system with real coefficients (item (i)), have zeros that appear in conjugate reciprocal. Thus, from (iv) we can determine all the other four zeros of $H(z)$. They are $z = \{1/2e^{j\pi/4}, 1/2e^{-j\pi/4}, 2e^{j\pi/4}, 2e^{-j\pi/4}\}$. Since the system is FIR, all poles are at $z = 0$.
	}
	\else\vspace{4cm}
	\fi
	
	\item Is $H(z)$ system stable?
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor} 
		$H(z)$ is stable because its impulse response is finite, thus it is absolute summable.
	}
	\else\vspace{2cm}
	\fi
	
	\item Is $H(z)$ a minimum phase system?
		\if\SOLUTIONS1
	{\color{\SolutionsColor} 
		This system is not minimum phase because it has zeros outside the unit circle.
	}
	\else\vspace{2cm}
	\fi
	
	\item Does $H(z)$ have a stable and causal inverse?
	\if\SOLUTIONS1
	{\color{\SolutionsColor} 
		This is equivalent to asking whether $H(z)$ is minimum phase, which is answered above.
	}
	\else\vspace{2cm}
	\fi
	
	\item What is the group delay of $H(z)$?
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor} 
		The group delay of a linear phase FIR filter with $M+1$ coefficients is $M/2$. In this case, $M = 4$, thus the group delay is 2.
	}
	\else\vspace{1cm}
	\fi
\end{enumerate}

\end{description}
\newpage

\section*{Problem 2 (30 points)}
Consider the stable and causal system $H(z)$, whose system function is

\begin{equation}
	H(z) = \frac{(1 - 1.5e^{j3\pi/4}z^{-1})(1 - 1.5e^{-j3\pi/4}z^{-1})}{(1 - 0.5e^{j\pi/4}z^{-1})(1 - 0.5e^{-j\pi/4}z^{-1})}.
\end{equation}

\begin{description}
\item{(a)} (4 points)
Sketch the pole-zero diagram of $H(z)$ in the diagram given in Fig.~\ref{fig:pole-zero-sketch}a.

\begin{figure}[!h]
\centering
	\resizebox{0.45\textwidth}{!}{\input{figs/pole-zero-problem2.tex}}
    \caption{Pole-zero diagram of $H(z)$.} \label{fig:pole-zero-sketch}
\end{figure}

\item{(b)} (5 points) Use the figure blow to sketch the pole-zero diagram of $H_{min}(z)$ and $H_{ap}(z)$ so that $H(z) = H_{min}(z)H_{ap}(z)$, where $H_{min}(z)$ is a minimum-phase system and $H_{ap}(z)$ is an all-pass system. 

\begin{figure}[!h]
	\centering
	\resizebox{0.9\textwidth}{!}{\input{figs/min-ap-decomposition.tex}}
	\caption{Minimum-phase and all-pass decomposition of $H(z)$.} \label{fig:min-all-pass}
\end{figure}

\item{(c)} (7 points) We can also decompose the system $H(z)$ such that $H(z) = H_{lin}(z)H_p(z)$, where $H_{lin}(z)$ is a linear phase system, and $H_p(z)$ is an all-pole system (only has zeros at $z = 0$). Sketch the pole-zero diagram of $H_{lin}(z)$ and $H_{p}(z)$ in Fig.~\ref{fig:lin-p}.

\begin{figure}[!h]
	\centering
	\resizebox{0.9\textwidth}{!}{\input{figs/lin-p-decomposition.tex}}
	\caption{Linear-phase / all-pole decomposition of $H(z)$.} \label{fig:lin-p}
\end{figure}

\item{(d)} (7 points) Suppose that we want to cascade another LTI system, $G(z)$, with $H(z)$ to perfectly compensate for the \underline{magnitude response} of $H(z)$. That is, we'd like to find a $G(z)$ such that $|H(e^{j\omega})G(e^{j\omega})| = 1$ for all $\omega$. Sketch the poles and zeros diagram of $G(z)$ in Fig.~\ref{fig:Hz-inverses}.

\if\SOLUTIONS1
{\color{\SolutionsColor}
	To obtain $|H(e^{j\omega})G(e^{j\omega})| = 1$, we must make $G(z) = H_{min}^{-1}(z)$. This way $|H(e^{j\omega})G(e^{j\omega})| = |H_{ap}(e^{j\omega})| = 1$. The poles and zeros diagram is shown in Fig.~\ref{fig:Hz-inverses}.
}
\else\vspace{1cm}
\fi
\item{(e)} (7 points) Now consider that we would like to use a different cascaded system $F(z)$ to perfectly compensate for the \underline{phase response} of $H(z)$. That is, we'd like to find a $F(z)$ such that $H(e^{j\omega})F(e^{j\omega})$ has linear phase. But we \underline{do not} require that $|H(e^{j\omega})F(e^{j\omega})|$ be constant. Sketch the poles and zeros diagram of $F(z)$ in Fig.~\ref{fig:Hz-inverses}.

\FloatBarrier
\begin{figure}[!h]
	\centering
	\resizebox{0.9\textwidth}{!}{\input{figs/Hz-inverses.tex}}
	\caption{Poles and zeros of $G(z)$ (left) and $F(z)$ (right).} \label{fig:Hz-inverses}
\end{figure}
\FloatBarrier

\if\SOLUTIONS1
{\color{\SolutionsColor}
	\begin{align} \nonumber
	H(e^{j\omega})F(e^{j\omega}) &= H_{lin}(e^{j\omega}) \\ \nonumber
	F(e^{j\omega}) &= \frac{H_{lin}(e^{j\omega})}{H(e^{j\omega})} = \frac{1}{H_p(e^{j\omega})} \implies F(z) = H_p^{-1}(z)
	\end{align}
}
\else\vspace{1cm}
\fi
\end{description}

\section*{Problem 3: Negative feedback loop (20 points)}
A linear time-invariant system $F(z)$ with input $x[n]$ and output $y[n]$ is described by the difference equation:
\begin{equation}
	y[n] + 4y[n-2] = x[n] -0.5x[n-1],
\end{equation}
\begin{description}
	\item[(a)] (7 points) Give the transfer function $F(z)$. Is this system causal? Is this system stable? What is the ROC of $F(z)$?
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor}
		From the difference equation, we can see that the system is causal since it's output $y[n]$ only depends on current and previous samples of the input and output.
		
		To compute the $z$-transform we just need to apply the linearity and time delay properties of the $z$-transform:
		\begin{align} \nonumber
			Y(z) + 4Y(z)z^{-2} &= X(z) -0.5X(z)z^{-1} \\
			Y(z)(1 + 4z^{-2}) &= X(z)(1 -0.5z^{-1}) \\ \nonumber
			F(z) \equiv \frac{Y(z)}{X(z)} &= \frac{1 -0.5z^{-1}}{1 + 4z^{-2}} \\ \nonumber
			&= \frac{z(z - 0.5)}{z^2 + 4} = \frac{z(z - 0.5)}{(z -2j)(z + 2j)}
		\end{align}
		Thus, this system has two zeros at $z = 0$ and $z = 2$, and two poles at $z = \pm 2j$. As the poles are located outside the unit circle, this system is not stable. The ROC of a causal system is the exterior of a circle whose radius is the outermost poles. Thus, $\mathrm{ROC} = \{|z| > 2\}$.
	}	
	\else\vspace{7cm}
	\fi

\end{description}
\noindent Suppose that $F(z)$ is interconnected in a negative-feedback arrangement with a causal, linear time-invariant system $G(z)$, as shown in Fig.~\ref{fig:feedback-loop}.

\begin{figure}[!h]
	\centering
	\resizebox{0.5\textwidth}{!}{\input{figs/feedback_loop.tex}}
	\caption{Negative feedback loop.} \label{fig:feedback-loop}
\end{figure}

\begin{description}	

	\item[(b)] (7 points) Derive an expression for the overall system diagram $H(z)$. Your expression should depend on $F(z)$ and $G(z)$ only.
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor}
		\begin{align} \nonumber
			Y(z) &= X(z)F(z) - Y(z)G(z)F(z) \\
			Y(z)(1 + G(z)F(z)) &= X(z)F(z) \\ \nonumber
			H(z) \equiv \frac{Y(z)}{X(z)} &= \frac{F(z)}{1 + G(z)F(z)}
		\end{align}
	}
	\else\vspace{5cm}
	\fi
	
	\item[(c)] (6 points) Find $G(z)$ such that $H(z) = 1$. Is the system $G(z)$ stable?
		
	\noindent Note: By achieving $H(z) = 1$, we're effectively \textit{controlling} the system $F(z)$. That is, we're making $F(z)$ produce whatever output we set it.
	
	\if\SOLUTIONS1
	{\color{\SolutionsColor}
		\begin{align} \nonumber
		z^{-1} &= \frac{F(z)}{1 + G(z)F(z)} \\ \nonumber
		z^{-1}(1 + G(z)F(z)) &= F(z) \\ \nonumber
		G(z) &= 1 - \frac{1}{F(z)} \\ \nonumber
		G(z) &= 1 - \frac{z^2 + 4}{z(z - 0.5)} \\ \nonumber
		G(z) &= -\frac{2(z + 2)}{z(z - 0.5)} \\ \nonumber
		\end{align}
		
		$G(z)$ is causal and it has all its poles inside the unit circle. Thus, it is stable.
	}
	\else\vspace{5cm}
	\fi

\end{description}

%\begin{figure}[!h]
%	\centering
%	\resizebox{0.6\textwidth}{!}{\input{figs/mag-autocorr.tex}}
%	\caption{Sketch of the PSD of the output of $h[n]$ for a white noise input.} \label{fig:mag-resp}
%\end{figure}

\newpage
\section*{Problem 4 (30 points)}

Fig.~\ref{fig:sampling_diagram} shows the block diagram of a digital-signal processing system involving sampling, downconversion, and upsampling. The input to this system $x_c(t)$ is a continuous-time signal, whose Fourier transform is shown in Fig.~\ref{fig:sampling_spectrum}a. This signal is band-limited with maximum frequency given by $\Omega_b$. Suppose that the sampling frequency of the continuous-to-digital converter (C-to-D) is $\Omega_s = 2\Omega_b$. 

\begin{figure}[!h]
	\centering
	\resizebox{\textwidth}{!}{\input{figs/sampling_diagram.tex}} 
	\caption{Block diagram of system for problem 4.}\label{fig:sampling_diagram}
\end{figure}


After sampling, the discrete-time signal $x[n]$ is \textit{down-converted}, which is realized by the time-domain multiplication with the signal $e^{-j\pi n}$. This results in the down-converted signal $x_d[n]$. 

After down-conversion, the signal $x_d[n]$ is upsampled by a factor of 2. The resulting signal $x_e[n]$ is filtered by an ideal lowpass filter $H(z)$, whose Fourier transform is given by
\begin{equation}
	H(e^{j\omega}) = \begin{cases}
	1, &|\omega| \leq \pi/4, \\
	0, & \pi/4 < |\omega| < \pi
	\end{cases}.
\end{equation}

\begin{description}
\item[(a)] (28 points) Use the graphs below to sketch the Fourier transform of the signals $x[n]$, $x_d[n]$, $x_e[n]$, $x_f[n]$, obtained after each operation along the system block diagram. Be sure to clearly label all your plots, indicating values in the amplitude and frequency whenever appropriate. Sketches must be clearly labeled and unambiguous to receive full credit. 
\end{description}
\begin{figure}[!h]
\centering
	\resizebox{0.87\textwidth}{!}{\input{figs/sampling_spectrum.tex}}
    \caption{Spectrum plots for Problem 4.} \label{fig:sampling_spectrum}
\end{figure}


\begin{description}
\item[(b)]  (2 points) Suppose that we would like to downsample the output signal $x_f[n]$. What is the largest downsampling rate that we could use to downsample $x_f[n]$ and still avoid aliasing? Justify. \\
\if\SOLUTIONS1
{\color{\SolutionsColor}
The largest downsampling factor is 4, since the ideal lowpass filter cutoff frequency is $\pi/4$.
}
\else\vspace{1cm}
\fi

\end{description}
\newpage
%\item[(b)] (6 points) Suppose that $\Omega_c = 8\pi$ rad/s and $\Omega_b = \pi$ rad/s. Draw the spectrum of $x[n]$ when $x_c(t)$ is sampled with sampling frequency $\Omega_s = 2\pi$ rad/s  (much smaller than the Nyquist rate). 
%
%\begin{figure}[!h]
%\centering
%	\resizebox{\textwidth}{!}{\input{figs/bandpass_sampling_sol1.tex}}\label{fig:bp_spectrum_sol1}
%\end{figure}
%\if\SOLUTIONS0\vspace{5cm}
%\fi
%
%\item[(c)] (7 points) In part (b) you saw that there is no spectrum overlap, even though $x_c(t)$ was sampled below the Nyquist rate. Is that always possible? Give conditions on the sampling frequency $\Omega_s$ in terms of $\Omega_c$ and $\Omega_b$ so that: (i) the spectrum is centered around $\omega = 0$ as in Figure~\ref{fig:bp_spectrum1}b, \underline{and} (ii) such that there is no spectrum overlap. 
%
%\textit{Hint:} The spectrum replicas occur according to the sampling equation:
%\begin{equation}
%X(e^{j\Omega T}) = \frac{1}{T}\sum_{k=-\infty}^\infty X_c(j(\Omega-k\Omega_s))
%\end{equation}
%
%\if\SOLUTIONS1
%{\color{\SolutionsColor}
%Staring with the sampling equation we have the following conditions:
%
%(i) In order to bring the signal down to baseband:
%\begin{align*}
%0 - k\Omega_s = \Omega_c \implies \Omega_c = -k\Omega_s
%\end{align*}
%for some negative integer $k$.
%
%(ii) The ($-k-1$)th spectrum replica must fall at least at $-2\Omega_b$ in order to avoid spectrum overlap. Therefore, 
%\begin{align*} \nonumber
%-2\Omega_b - (k-1)\Omega_s &\geq \Omega_c \\ \nonumber
%-2\Omega_b - (k-1)\Omega_s &\geq -k\Omega_s \tag{since $\Omega_c = -k\Omega_s$} \\
%\Omega_s &\geq 2\Omega_b
%\end{align*}
%}
%\else\vspace{10cm}
%\fi
%
%
%\item[(d)] (5 points) Repeat part (b), but now assume that $\Omega_c = 7\pi$ rad/s and $\Omega_b = \pi$ rad/s. Sampling is still performed with sampling frequency $\Omega_s = 2\pi$ rad/s. 
%
%\textit{Note:} Although there isn't spectrum overlap in this case either, further processing would be necessary to center the spectrum around $\omega = 0$, as in Figure~\ref{fig:bp_spectrum1}b.
%
%\begin{figure}[!h]
%\centering
%	\def\SolD{1}
%	\resizebox{\textwidth}{!}{\input{figs/bandpass_sampling_sol1.tex}} \label{fig:bp_spectrum_sol1}
%\end{figure}
%\if\SOLUTIONS0\vspace{5cm}
%\fi
%
%\end{description}
%
%\newpage
%\section*{Problem 4: (20 points)}
%The diagram of Figure~\ref{fig:sampling_diagram} represents the initial DSP of a high-speed application. Since fast ADCs are expensive, the design engineers decided to perform Nyquist-rate sampling and upsample the signal immediately after the ADC, as illustrated in Figure~\ref{fig:sampling_diagram}. The lowpass filter $H(z)$ after upsampling is used to eliminate unwanted spectrum replicas of the signal and of quantization noise. The additive white  noise introduced by the quantizer has average power $\sigma_Q^2$.
%
%
%
%\begin{description}
%\item[(a)] (8 points) The plot below shows the spectrum $X(e^{j\omega})$ with signal (triangular shape) and quantization noise (dashed red line) components. Use the empty graphs below to sketch $X_e(e^{j\omega})$ and $Y(e^{j\omega})$. In your plots, draw both the signal and noise components. Assume that $H(z)$ is the ideal lowpass filter with cutoff frequency $\pm\pi/2$ and \underline{unit gain}.
%
%\textit{Hint:} consider signal and noise separately.
% 
%\FloatBarrier
%\begin{figure}[!h]
%\centering
%	\resizebox{0.9\textwidth}{!}{\input{figs/spectrum_upsampled.tex}} \label{fig:spectrum_upsample}
%\end{figure}
%\FloatBarrier
%
%\item[(b)] (6 points) Now assume that $H(z)$ is the first-order lowpass filter given by
%\begin{equation}
%H(z) = \frac{1 + cz^{-1}}{1 - cz^{-1}}, \qquad 0 < c < 1.
%\end{equation}
%
%Assume that this filter is implemented using the transposed direct form II with signal values and filter coefficients scaled as Q15 integers. The result of multiplications is quantized to 16-bits (15 bits plus sign) \underline{immediately after} the multiplications and \underline{before} any additions are done. Draw the signal flow graph diagram of this system. In your drawing include noise sources representing the quantization of the multiplications. Label each noise source with average power $\sigma_{15}^2$. You may combine noise sources whenever possible. In addition, circle \underline{all nodes} in which overflow may happen.
%
%\textit{Note:} You do not need to include noise sources in multiplications by 1.
%
%\if\SOLUTIONS1
%{\color{\SolutionsColor}
%Overflow may happen in any node in which additions are performed. Multiplications do not overflow. 
%
%The noise sources were combined into one with average power $2\sigma_{15}^2$. Note that since $b_0 = 1$, in this case, then this multiplication is not performed and therefore we should not include a noise source for it.
%
%\FloatBarrier
%\begin{figure}[h!]
%\centering
%	\def\SolD{1}
%	\resizebox{0.5\textwidth}{!}{\input{figs/IIR_transposed_direct_form_II.tex}}
%\end{figure}
%\FloatBarrier
%}
%\else\vspace{7cm}
%\fi
%
%\item{(c)} (6 points) Write an equation for the PSD of the total noise at the output of $H(z)$. The total noise includes quantization noise from the quantizer and roundoff noise from your filter implementation in part (b). Write your answer in terms of $\sigma_{15}^2$, $\sigma_{Q}^2$, and $c$.
%
%\if\SOLUTIONS1
%{\color{\SolutionsColor}
%Using superposition, we see that the quantization noise is filtered by $H(z)$, while the roundoff noise is filtered only by the poles of $H(z)$, which we'll denoted by $\frac{1}{A(z)}$. Therefore,
%
%\begin{align*}
%\Phi_{ff}(e^{j\omega}) &= \sigma_Q^2|H(e^{j\omega})|^2 + 2\sigma_{15}^2\frac{1}{|A(e^{j\omega})|} \\
%&= \sigma_Q^2|H(e^{j\omega})|^2 + 2\sigma_{15}^2\frac{1}{|A(e^{j\omega})|} \\
%& = \frac{\sigma_Q^2(1 + c^2 + 2c\cos\omega) + 2\sigma_{15}^2}{1 + c^2 - 2c\cos\omega}
%\end{align*}
%
%}
%\else\vspace{5cm}
%\fi
%\end{description}


\end{document}
