Page MenuHomec4science

2013final.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 03:38

2013final.tex

\documentclass[12pt,a4paper]{article}
\usepackage{styles/SPhw}
\includecomment{sol}
\begin{document}
\begin{exercise}{Linearity}
Suppose you know that a system $\mathcal{H}$ is time-invariant. Below you can see the system's outputs $y_1[n]$ and $y_2[n]$ when the inputs are $x_1[n]$ and $x_2[n]$ respectively (all signals are infinite-length and all samples not shown in the figure are equal to zero). Based on the plots:
\begin{enumerate}
\item Can you tell if the system $\mathcal{H}$ is linear?
\item Compute $\mathcal{H}\{\delta[n]\}$.
\end{enumerate}
\begin{tabular}{cc}
\begin{dspPlot}[width=5cm,height=2.5cm,xout=true,ylabel={$x_1[n]$}]{-2,6}{-3,3}
\dspTapsAt{-2}{0 0 2 -1 1 0 0 0 0}
\end{dspPlot}
&
\begin{dspPlot}[width=5cm,height=2.5cm,xout=true,ylabel={$y_1[n]$}]{-2,6}{-5,5}
\dspTapsAt{-2}{0 0 4 3 2 1 0 0 0}
\end{dspPlot}
\\
\begin{dspPlot}[width=5cm,height=2.5cm,xout=true,ylabel={$x_2[n]$}]{-2,6}{-3,3}
\dspTapsAt{-2}{0 0 0 0 0 1 0 0 0}
\end{dspPlot}
&
\begin{dspPlot}[width=5cm,height=2.5cm,xout=true,ylabel={$y_2[n]$}]{-2,6}{-3,3}
\dspTapsAt{-2}{0 0 0 0 0 2 1 0 0}
\end{dspPlot}
\end{tabular}
\begin{sol}
\Solution
\begin{enumerate}
\item By simple inspection we can write:
\[
x_1[n] = 2x_2[n+3] - x_2[n+2] + x_2[n+1];
\]
We know that the system is time invariant, therefore $\mathcal{H}\{x_2[n+N]\} = y_2[n+N]$. If the system were linear we would therefore have:
\[
\mathcal{H}\{x_1[n]\} = \hat{y}[n] = 2y_2[n+3] - y_2[n+2] + y_2[n+1]
\]
However it is easy to see that $\hat{y}[n] \neq y_1[n]$ (in fact, $\hat{y}[n] = \ldots, 0, 0, \underline{4}, 0, 1, 1, 0, 0, \ldots$). As a consequence, $\mathcal{H}$ is not linear.
\item $\delta[n] = x_2[n+3]$ so that, because of time invariance, $\mathcal{H}\{\delta[n]\} = y_2[n+3] = \ldots, 0, 0, \underline{2}, 1, 0, 0, \ldots$
\end{enumerate}
\end{sol}
\end{exercise}
\begin{exercise}{System analysis}
Consider the causal LTI system shown in the following block diagram and consider $\alpha = -2$:
\begin{center}
\begin{dspBlocks}{1.2}{0.4}
$x[n]$ & \BDadd & \BDsplit & \BDadd & \BDsplit & $y[n]$ \\%
& & \BDdelay & & \\%
& \BDadd & \BDsplit & & \\%
& & \BDdelay & & \\%
& & & & \\
& & \BDdelay & & \\%
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,4} \ncline{1,4}{1,6}
\ncline{3,3}{3,2} \taput{$2$} \ncline{-}{3,3}{3,4}\taput{$-5/4$}
\ncline{-}{5,3}{5,2} \taput{$-2$}
\ncline{1,3}{2,3} \ncline{2,3}{4,3} \ncline{-}{4,3}{5,3}
\ncline{5,2}{3,2}
\ncline{3,2}{1,2} \ncline{3,4}{1,4}
\ncline{-}{1,5}{6,5}\ncline{-}{6,5}{6,3}\taput{$\alpha$}
\ncline{-}{6,3}{6,1}\ncline{-}{6,1}{2,1}\ncline{2,1}{1,2}
\end{dspBlocks}
\end{center}
\begin{enumerate}
\item Compute the system's transfer function $H(z)$
\item Plot the system's poles and zeros on the complex plane
\item Sketch the magnitude of the system's frequency response $|H(e^{j\omega})|$
\item Find the transfer function of a {\em stable} filter $G(z)$ so that $|H(z)G(z)| = 1$
\item Would the system be stable if we removed the lowest branch (i.e. if we set $\alpha = 0$)?
\end{enumerate}
\begin{sol}
\Solution
The system can be simplified as
\begin{center}
\begin{dspBlocks}{1.2}{0.4}
$x[n]$ & \BDadd & \BDfilter{$D(z)$} & & \BDsplit & $y[n]$ \\%
& & \BDdelay & & \\%
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3} \ncline{1,3}{1,6}
\ncline{-}{1,5}{2,5}\ncline{2,5}{2,3}\taput{$\alpha$}
\ncline{-}{2,3}{2,2}\ncline{2,2}{1,2}
\end{dspBlocks}
\end{center}
From this we can write the input/output relation in the $z$ domain
\[
Y(z) = D(z)[X(z) + \alpha z^{-1} Y(z)]
\]
from which we obtain the transfer function
\[
H(z) = \frac{D(z)}{1-\alpha z^{-1}D(z)}
\]
If we write $D(z)$ as a ratio of polynomials, i.e. $D(z) = B(z)/A(z)$, we finally obtain
\[
H(z) = \frac{B(z)}{B(z)-\alpha z^{-1}A(z)}
\]
From the figure, it is immediate to see that $D(z)$ is an (incomplete) second order section in direct form II, incomplete since it has a single zero. Its transfer function is therefore
\begin{align*}
D(z) &= \frac{1 - (5/4)z^{-1}}{1 -2z^{-1} + 2z^{-2}} \\
&= \frac{1 - (5/4)z^{-1}}{(1 -(1+j)z^{-1})(1 -(1-j)z^{-1})}
\end{align*}
\begin{enumerate}
\item By letting $B(z) = 1 - (5/4)z^{-1}$ and $A(z) = 1 -2z^{-1} + 2z^{-2}$, the transfer function with $\alpha=-2$ becomes
\[
H(z) = \frac{1 - (5/4)z^{-1}}{1 -2z^{-1} + 2z^{-2} +2z^{-1}(1 - (5/4)z^{-1})} = \frac{1 - (5/4)z^{-1}}{1 -(1/2)z^{-2}}
\]
\item There is a zero in $z = 5/4$ and two poles in $z = \pm \sqrt{1/2}$
\begin{center}
\begin{dspPZPlot}[width=5cm,clabel={$1$}]{1.8}
\dspPZ[type=zero,label=none]{1.25,0}
\dspPZ[label=none]{-.7,0}
\dspPZ[label=none]{0.7,0}
\end{dspPZPlot}
\end{center}
\item since pole and zero on the positive real axis are almost equidistant from one, their effects cancel each other out; the pole in $z = -\sqrt{1/2}$ brings the magnitude of the frequency response up to create a highpass characteristic:
\begin{center}
\begin{dspPlot}[xtype=freq,xticks=4,yticks=none]{-1,1}{0,25}
\dspFunc{x \dspTFM{1 -1.25}{1 0 -0.5}}
\end{dspPlot}
\end{center}
\item The inverse transfer function is not stable because the zero of $H(z)$ is outside the unit circle. By choosing
\[
G(z) = \frac{1 -(1/2)z^{-2}}{(5/4) - z^{-1}}
\]
the product G(z)H(z) is the allpass term $(1 - (5/4)z^{-1})/((5/4) - z^{-1})$ whose frequency response magnitude is one.
\item If we remove the feedback branch, the transfer function becomes $H(z) = D(z)$. The poles of $D(z)$ are larger than one in magnitude ($|z_{1,2}| = |1 \pm j| = \sqrt{2}$) and so the system would not be stable.
\end{enumerate}
\end{sol}
\end{exercise}
\begin{exercise}{FIR filtering}
Consider a finite-support sequence $x[n]$ and an LTI filter $\mathcal{H}$.
\begin{enumerate}
\item Prove that if $\mathcal{H}$ is FIR then $y[n] = \mathcal{H}\{x[n]\}$ is a finite-support sequence as well.
\item Show with a counterexample that the converse is not true, i.e. show that, for a filter $\mathcal{H}$, if the the input $x[n]$ is finite-support and the output $y[n]$ is also finite-support, this does not imply that $\mathcal{H}$ is FIR.
\end{enumerate}
\begin{sol}
\Solution
\begin{enumerate}
\item The easiest way to prove the result is to invoke the convolution theorem. In the $z$-transform domain, the filter's output can be expressed as $Y(z) = H(z)X(z)$. If $x[n]$ is finite-support and $h[n]$ is FIR, then both $X(z)$ and $H(z)$ are finite-degree polynomials in $z$ and so their product is also finite-degree.
Alternatively, you can consider the convolution sum for a FIR with support over $[M_1,M_2]$:
\[
y[n] = \sum_{k = -\infty}^{\infty}h[k]x[n-k] = \sum_{k = M_1}^{M_2}h[k]x[n-k]
\]
If $x[n]$ is zero outside of $[N_1,N_2]$, then all the terms in the sum will be zero for $n> N_2+M_2$ and for $n<N_1+M_1$.
\item The simplest example is to have an input that exactly cancels the filter's poles. As an IIR filter, take a simple leaky integrator with transfer function
\[
H(z) = \frac{1}{1-\lambda z^{-1}}
\]
and consider the finite-support input $x[n] = \ldots, 0, 0, \underline{1}, -\lambda, 0, 0, \ldots$. We have that $Y(z) = H(z)X(z) = 1$ so that $y[n] = \delta[n]$, which is finite-support.
\end{enumerate}
\end{sol}
\end{exercise}
\begin{exercise}{Noise}
Let $x[n]$ be the discrete-time version of an audio signal, originally bandlimited to 20KHz and sampled at 40KHz; assume that we can model $x[n]$ as an i.i.d. process with variance $\sigma^2_x$. The signal is converted to continuous time, sent over a noisy analog channel and resampled at the receiving end using the following scheme, where both the ideal interpolator and sampler work at a frequency $F_s = 40$KHz:
\begin{center}
\begin{dspBlocks}{1.5}{0.5}
$x[n]~$ & \BDsinc[0.6em] & \BDadd & \BDsamplerFramed[0.6em] & $~\hat{x}[n]$ \\
& $F_s$ & $\eta(t)$ & $F_s$
\psset{arrows=->}
\ncline{1,1}{1,2}\ncline{1,2}{1,3}\ncline{1,3}{1,4}\ncline{1,4}{1,5}
\ncline{2,3}{1,3}
\end{dspBlocks}
\end{center}
The channel introduces zero-mean, additive white Gaussian noise. At the receiving end, after the sampler, assume that the effect of the noise introduced by the channel can be modeled as a zero-mean white Gaussian stochastic signal $\eta[n]$ with power spectral density $P_\eta(e^{j\omega}) = \sigma_0^2$.
\begin{enumerate}
\item What is the signal to noise ratio of $\hat{x}[n]$, i.e. the ratio of the power of the ``good'' signal and the power of the noise? (Call this signal to noise ratio $\mbox{SNR}_1$)
\end{enumerate}
The SNR obtained with the transmission scheme above is too low for our purposes. Unfortunately the power constraint of the channel prevents us from simply amplifying the audio signal (in other words: the total power $\int_{-\pi}^{\pi}P_x(e^{j\omega})$ cannot be greater than $2\pi\sigma_x^2$). In order to improve the quality of the received signal, we modify the transmission scheme as shown below, by adding pre-processing and post-processing digital blocks at the transmitting and receiving ends, while $F_s$ is still equal to $40000$Hz.
\begin{center}
\begin{dspBlocks}{1.2}{0.5}
$x[n]~$ & \BDfilter{A} & \BDsinc[0.6em] & \BDadd & \BDsamplerFramed[0.6em] & \BDfilter{B} & $~\hat{x}[n]$ \\
& & $F_s$ & $\eta(t)$ & $F_s$
\psset{arrows=->}
\ncline{1,1}{1,2}\ncline{1,2}{1,3}\taput{$x'[n]$~~~}
\ncline{1,3}{1,4}\ncline{1,4}{1,5}\ncline{1,5}{1,6}\taput{~~$\hat{x'}[n]$}
\ncline{1,6}{1,7}
\ncline{2,4}{1,4}
\end{dspBlocks}
\end{center}
\begin{enumerate}
\setcounter{enumi}{1}
\item Design the processing blocks A and B so that the signal to noise ratio of $\hat{x}[n]$ is at least three times better (i.e. $\mbox{SNR}_{2} \geq 3\mbox{SNR}_{1}$). You should use upsamplers, downsamplers and lowpass filters only. Please specify all the details. {(\em Hint: the idea is to transmit the signal more ``slowly'' and trade bandwidth for SNR...)}
\item Using your new scheme, how long does it take to transmit a 3-minute song?
\end{enumerate}
\begin{sol}
\Solution
\begin{enumerate}
\item The power of the good signal is simply
\[
\int_{-\pi}^{\pi}P_x(e^{j\omega})d\omega = 2\pi\sigma^2_x
\]
The power of the noise is
\[
\int_{-\pi}^{\pi}P_\eta(e^{j\omega})d\omega = 2\pi\sigma^2_0
\]
so that the SNR is simply $\sigma^2_x/\sigma^2_0$
\item Just as in oversampling, the idea is to send the signal more slowly as to occupy less bandwidth. If the signal has a smaller bandwidth, we can increase its amplitude without exceeding the power constraint, which will allow us to have a better SNR over the band of interest.
Consider the following preprocessing chain:
\begin{center}
\begin{dspBlocks}{2}{0.5}
$x[n]~$ & \BDupsmp{3} & \BDlowpass[0.6em] & $~x'[n]$
\psset{arrows=->}
\ncline{1,1}{1,2}\ncline{1,2}{1,3}\taput{$\sqrt{3}$~~~~~}\ncline{1,3}{1,4}\ncline{1,4}{1,5}
\end{dspBlocks}
\end{center}
where the lowpass filter has a cutoff frequency $\pi/3$. The power of $x'[n]$ is
\[
\int_{-\pi}^{\pi}P_{x'}(e^{j\omega})d\omega =
\int_{-\pi/3}^{\pi/3}3\,\sigma^2_x = 2\pi\sigma^2_x
\]
so that the power constraint is fulfilled.
The signal and the noise at the receiver after the sampler have the following psd's:
\begin{center}
\begin{dspPlot}[xtype=freq,xticks=3,yticks=custom]{0,1}{0,10}
\dspFunc{x \dspRect{0}{0.66666} 9 mul}
\dspFunc[linecolor=gray]{1}
\dspCustomTicks[axis=y]{1 $\sigma_0^2$ 3 $\sigma_x^2$ 6 $2\sigma_x^2$ 9 $3\sigma_x^2$}
\end{dspPlot}
\end{center}
At the receiver we can filter out the out-of-band noise with the following scheme:
\begin{center}
\begin{dspBlocks}{2}{0.5}
$\hat{x'}[n]~$ & \BDlowpass[0.6em] & \BDdwsmp{3} & $~\hat{x}[n]$
\psset{arrows=->}
\ncline{1,1}{1,2}\ncline{1,2}{1,3}\ncline{1,3}{1,4}\ncline{1,4}{1,5}
\end{dspBlocks}
\end{center}
where, once again, the lowpass has cutoff frequency $\pi/3$. After the filter the psd is
\begin{center}
\begin{dspPlot}[xtype=freq,xticks=3,yticks=custom]{0,1}{0,10}
\dspFunc{x \dspRect{0}{0.66666} 9 mul}
\dspFunc[linecolor=gray]{x \dspRect{0}{0.66666}}
\dspCustomTicks[axis=y]{1 $\sigma_0^2$ 3 $\sigma_x^2$ 6 $2\sigma_x^2$ 9 $3\sigma_x^2$}
\end{dspPlot}
\end{center}
the downsampler stretches the signal to full band again but reduces the spectral ``amplitude'' by a factor of 3, which means the psd gets divided by 9:
\begin{center}
\begin{dspPlot}[xtype=freq,xticks=3,yticks=custom]{0,1}{0,10}
\dspFunc{9}
\dspFunc[linecolor=gray]{1}
\dspCustomTicks[axis=y]{1 $\sigma_0^2/9$ 9 $\sigma_x^2/3$}
\end{dspPlot}
\end{center}
and the signal-to-noise ratio becomes
\[
\mbox{SNR}_{2} = 2\pi(\sigma_x^2/3)/2\pi(\sigma_0^2/9) = 3\mbox{SNR}_{1}
\]
\item 9 minutes.
\end{enumerate}
\end{sol}
\end{exercise}
\begin{exercise}{Infinite sum}
Compute the sum
\[
\sum_{n=-\infty}^{\infty} \frac{\sin(2\pi n/3)}{4\pi n}\cos(\pi n/3) %\frac{\sin(3\pi n/2)}{3\pi n}
\]
\begin{sol}
\Solution
Whenever we have a sum of the form $\sum_{n=-\infty}^{\infty} x[n]$ it is always useful to see if we can compute the DTFT of $x[n]$ since the sum is equal to the value of the DTFT in $\omega = 0$
\[
\sum_{n=-\infty}^{\infty} x[n] = X(e^{j\omega})|_{\omega=0}.
\]
In this case we have
\begin{align*}
x[n] &= \frac{\sin(2\pi n/3)}{4\pi n}\cos(\pi n/3) \\
&= \frac{1}{4}\left[\frac{2}{3}\sinc\left(\frac{2}{3}n\right)\right]\cos\left(\frac{\pi}{3}n\right)
\end{align*}
By using the modulation theorem, the DTFT of $x[n]$ is
\[
X(e^{j\omega}) = \frac{1}{2}\left[\frac{1}{4}\rect\left(\frac{\omega - (\pi/3)}{2\pi/3}\right) + \frac{1}{4}\rect\left(\frac{\omega +(\pi/3)}{2\pi/3}\right)\right]
\]
Graphically:
\begin{center}
\begin{dspPlot}[xtype=freq,xticks=3,yticks=0.25]{-1,1}{0,0.5}
\dspFunc{x \dspRect{0.333333}{1.333333} 0.25 mul 0.5 mul
x \dspRect{-0.333333}{1.333333} 0.25 mul 0.5 mul
add}
\end{dspPlot}
\end{center}
so that $X(e^{j\omega})|_{\omega=0} = 1/4$
\end{sol}
\end{exercise}
\begin{exercise}{Optimal FIR}
Below are the pole-zero plots of four different transfer functions, where zeros are indicated by a dot and poles are indicated by a cross. For each plot, say if the corresponding filter \textit{could} be a real-valued linear-phase FIR filter. If your answer is yes, specify the length of the associated impulse response; if your answer is no, briefly explain why.
\begin{tabular}{cc}
\begin{dspPZPlot}[width=5cm,clabel={$1$}]{1.8}
\dspPZ[type=zero,label=none]{0,1}
\dspPZ[type=zero,label=none]{0,-1}
\dspPZ[type=zero,label=none]{ 0.1736,0.9848}
\dspPZ[type=zero,label=none]{-0.1736,0.9848}
\dspPZ[type=zero,label=none]{ 0.3420,0.9397}
\dspPZ[type=zero,label=none]{-0.3420,0.9397}
\end{dspPZPlot}
&
\begin{dspPZPlot}[width=5cm,clabel={$1$}]{1.8}
\dspPZ[type=zero,label=none]{-1,0}
\dspPZ[type=zero,label=none]{0.1908, 0.9816}
\dspPZ[type=zero,label=none]{0.1908, -0.9816}
\end{dspPZPlot}
\\ $H_1(z)$ & $H_2(z)$ \\ \\ \\
\begin{dspPZPlot}[width=5cm,clabel={$1$}]{1.8}
\dspPZ[type=zero,label=none]{ -0.8067, 0.5910}
\dspPZ[type=zero,label=none]{ -0.8067, -0.5910}
\dspPZ[type=zero,label=none]{0.7,0}
\end{dspPZPlot}
&
\begin{dspPZPlot}[width=5cm,clabel={$1$}]{1.8}
\dspPZ[type=zero,label=none]{-0.9679, 0.2514}
\dspPZ[type=zero,label=none]{-0.9679, -0.2514}
\dspPZ[type=zero,label=none]{-0.7242, 0.6896}
\dspPZ[type=zero,label=none]{-0.7242, -0.6896}
\dspPZ[type=zero,label=none]{-0.3046, 0.9525}
\dspPZ[type=zero,label=none]{-0.3046, -0.9525}
\dspPZ[type=zero,label=none]{ 0.1691, 0.9856}
\dspPZ[type=zero,label=none]{ 0.1691, -0.9856}
\dspPZ[type=zero,label=none]{ 0.5291, 0.8486}
\dspPZ[type=zero,label=none]{ 0.5291, -0.8486}
\dspPZ[label=none]{0.7,0}
\end{dspPZPlot}
\\ $H_3(z)$ & $H_4(z)$
\end{tabular}
\begin{sol}
\Solution
\begin{enumerate}
\item NO. The zeros are not in complex-conjugate pairs, so the filter's impulse response cannot be real-valued.
\item YES. The filter has three zeros therefore its impulse response has length 4.
\item NO. The zero $z_0$ on the positive axis does not have a reciprocal zero in $1/z_0$ so the filter cannot be linear-phase.
\item NO. The filter has a pole, so it cannot be FIR linear phase.
\end{enumerate}
\end{sol}
\end{exercise}
\end{document}

Event Timeline