Page MenuHomec4science

sol07.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 02:20

sol07.tex

\documentclass[12pt,a4paper,fleqn]{article}
\usepackage{../styles/defsDSPcourse}
\title{COM-303 - Signal Processing for Communications}
\author{Solutions for Homework \#7}
\date{}
\begin{document}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{solution}{Interleaving}
\begin{enumerate}
\item We have clearly:
\begin{eqnarray*}
X(z) &=& \sum_{n=-\infty}^{\infty} h[n]z^{-2n} + g[n]z^{-(2n+1)}\\
&=& H(z^2) + z^{-1}G(z^2)
\end{eqnarray*}
\item The ROC is determined by the zeros of the transform. Since
the sequence is two-sided, the ROC is a ring bounded by two poles
$z_L$ and $z_R$ such that $|z_L| < |z_R|$ and no other pole has
magnitude between $|z_L|$ and $|z_R|$. Consider $H(z)$; if $z_0$
is a pole of $H(z)$, $H(z^2)$ will have two poles at $\pm
z_0^{1/2}$; however, the square root preserves the monotonicity of
the magnitude and therefore no new poles will appear between the
circles $|z| = \sqrt{|z_L|}$ and $|z| = \sqrt{|z_R|}$. Therefore
the ROC for $H(z^2)$ is the ring $\sqrt{|z_L|} < |z| < \sqrt{|z_R|}$. The ROC of
the sum $H(z^2) + z^{-1}G(z^2)$ is the intersection of the ROCs,
and so:
\[
\mbox{ROC } = 0.8 < |z| < 2.
\]
\end{enumerate}
\end{solution}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{solution}{Impulse Response}
\begin{enumerate}
\item $\mathcal{H}\{x[n]\}$ is like so:
\begin{center}
\begin{dspPlot}[height=3cm,xticks=5,xout=true,yticks=1]{-10, 10}{-2.5, 4.5}
\dspTapsAt{-10}{0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 2 0 0}
\end{dspPlot}
\end{center}
\item We have:
\begin{eqnarray*}
h[n] & = & h_1[n] * (h_2[n] - h_3[n] * h_4[n]) \\
& = & h_1[n]*(u[n+2] - u[n+2]*\delta[n - 1]) \\
& = & h_1[n]*(u[n+2] - u[n+1]) \\
& = & h_1[n]*\delta[n+2] \\
& = & h_1[n+2] \\
& = & 3 (-1)^n (\frac{1}{4})^{n + 2} u[n].
\end{eqnarray*}
\item A discrete system is BIBO stable if the impulse response is absolutely summable.
We have:
\[
\displaystyle\sum\limits_{n=-\infty}^\infty \vert h[n] \vert = 3\frac{1}{1 - 1/4}-3\left(1+\frac{1}{4}\right) = \frac{1}{4},
\]
which means the system is BIBO stable.
\end{enumerate}
\end{solution}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{solution}{Generalized Linear Phase Filters}
\begin{enumerate}
\item $H(e^{j\omega})$ can be easily factored:
\begin{align*}
H(e^{j\omega}) &= 1 - e^{-j\omega} \\
&= e^{-j\omega/2}[e^{j\omega/2} - e^{-j\omega/2}] \\
&= e^{-j\omega/2} \; 2j\sin(\omega/2) \\
&= 2\sin(\omega/2) \; e^{-j(\omega/2 - \pi/2)}.
\end{align*}
Thus $H(z)$ is a generalized linear phase filter with fractional delay $d=1/2$ and phase factor $\alpha=\pi/2$. %
\item The filter is of type IV since it has an even number of taps (2), it is antisymmetric, has a fractional group delay and a $\pi/2$ phase factor. %
\item The filter impulse response is given by
\[
h[n] = \delta[n] - \delta[n-1].
\]
Thus,
\[
\sum_n h[n]\sin(\omega(n-d) + \alpha) = \sin(-\omega/2 + \pi/2) - \sin(\omega/2 + \pi/2) = 0
\]
for all $\omega$. %
\end{enumerate}
\end{solution}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{solution}{Zero-Phase Filtering}
\begin{enumerate}
\item Consider the sequence $x[n] = \delta[n-1]$. We should have $\mathcal{R}\{x[n]\}[n] = \mathcal{R}\{\delta[n]\}[n-1]$, but instead it is:
\begin{align*}
\mathcal{R}\{x[n]\}[n] &= x[-n] = \delta[-(n+1)] = \delta[n+1] \\
\mathcal{R}\{\delta[n]\}[n-1] &= \delta[n-1]
\end{align*}
\item First of all recall that the DTFT of $x[-n]$ is $X(e^{-j\omega})$; if $x[n]$ is real, we also have $X(e^{j\omega})
= X^*(e^{-j\omega})$. In the frequency domain we therefore have:
\begin{enumerate}
\renewcommand{\labelenumi}{\arabic{enumi})}
\item $S(e^{j\omega}) = H(e^{j\omega})X(e^{j\omega})$
\item $R(e^{j\omega}) = S(e^{-j\omega}) = H^*(e^{j\omega})X(e^{-j\omega})$ since $h[n]$ is real.
\item $W(e^{j\omega}) = H(e^{j\omega})R(e^{j\omega}) = |H(e^{j\omega})|^2X(e^{-j\omega})$ \item $Y(e^{j\omega}) = W(e^{-j\omega}) = |H(e^{j\omega})|^2X(e^{j\omega})$
\end{enumerate}
Therefore the chain of transformations defines an LTI filter $\mathcal{G}$ with frequency response $G(e^{j\omega}) = |H(e^{j\omega})|^2$. The corresponding impulse response is simply
\[
g[n] = h[n] \ast h[-n]
\]
What is interesting to note here is that, even though $\mathcal{R}$ is not time invariant, we can combine time variant
operators into an overall time-invariant transformation.
\item $G(e^{j\omega})$ is a real function, therefore its phase is zero.
\end{enumerate}
\end{solution}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{solution}{Optimal FIR Filters}
The filter is clearly a bland lowpass with transition band approximatly between $0.3\pi$ and $0.4\pi$. [For the record, it has been designed with the command {\tt firpm(12, [0 .3 .35 1], [1 1 0 0])}, but this knowledge is not necessary to solve the exercise.]
\begin{enumerate}
\item By elimination, it cannot be Type III or IV, because either would have a zero in $\omega=0$ and it cannot be a Type II, since it would have a zero in $\pi$. Therefore it is Type I (odd-lenght, symmetric)
\item The plot shows the magnitude, but it is easy to count the 8 alternations:
\begin{itemize}
\item 3 alternations in the passband (one at zero, one around $0.25\pi$ and one at band edge)
\item 5 alternations in stopband (ont at band edge, one at $\pi$ and 3 in between
\end{itemize}
We know that the number of taps will be $M = 2L+1$ where $L+2$ is the number of alternations. Therefore, $M=13$.
\item Since we don't know the phase (the plot only shows the magnitude), we can't say if the filter is causal.
\item We're modulating the filter to $\pi$, thereby transforming the lowpass in highpass:
\begin{center}
\begin{dspPlot}[height=4cm,xtype=freq,xout=true]{-1,1}{0,1.3}
\dspFunc{x \dspFIRI{-0.3251 0.2721 -0.1428 0.0057 0.0845 -0.1630 -0.0291} abs }
\end{dspPlot}
\end{center}
Note that it doesn't matter where the nonzero taps of the original impulse response are, since we're interested just in the magnitude response.
\end{enumerate}
\end{solution}
\def\pth#1{(#1)}
\begin{solution}{Demodulation}
The modulated signal is given by
\[
y[n] = x[n] \cos \omega_c n,
\]
where $x[n]$ is the bandlimited signal. The purpose of demodulation is to extract the original signal from the modulated input signal. Remark that techniques A and B require the knowledge of the carrier frequency $\omega_c$, while the Galena demodulator does not.
\begin{itemize}
\item[A)] {\bf Classic demodulation:} After the multiplication by a copy of the carrier, the signal is given by
\begin{eqnarray*}
u[n] &=& y[n] \cos \omega_c n\\
&=& x[n] \cos^2\omega_c n\\
&=& \frac{1}{2}x[n] + \frac{1}{2}x[n] \cos 2\omega_c n
\end{eqnarray*}
The spectrum of the signal is
\[
U(e^{j\omega})=\frac{1}{2}X(e^{j\omega}) + \frac{1}{4}\left[ X(e^{j(\omega+2\omega_c)}) + X(e^{j(\omega-2\omega_c)}) \right]
\]
and it is sketched here:
\begin{center}
\begin{dspPlot}[height=3cm,width=10cm,xtype=freq,xout=true,yticks=none,xticks=custom]{-1,1}{0,1.4}
\dspFunc[linestyle=dashed,linecolor=green!80,linewidth=1pt]{x \dspRect{0}{.4} 1.2 mul}
\dspFunc{x \dspTri{0}{.1} x \dspTri{.7}{.1} 0.5 mul x \dspTri{-.7}{.1} 0.5 mul add add}
\dspCustomTicks[axis=x]{-1 $-\pi$ 1 $\pi$ 0 0 0.1 $\frac{\omega_b}{2}$ -0.1 $-\frac{\omega_b}{2}$ 0.7 $2\omega_c$ -0.7 $-2\omega_c$}
\end{dspPlot}
\end{center}
From the figure, it's clear that if we use a lowpass with cutoff frequency just above $\omega_b/2$ (shown with a dashed line in the picture), then the components at $\pm 2\omega_c$ will be filtered out, thereby recovering the orignal signal. Of course an ideal low-pass as in the plot is impossible to design in practice but we can use an IIR or an FIR filter with good properties instead. In particular, we can exploit the gap between the baseband spectrum and the copy at the higher frequency to allocate a gently sloping transition band for the filter; this allows us to use very simple lowpass filters. The drawback of this approach, however, is that if there is noise in the received signal, more noise will leak through into the demodulated signal if the transition band is large.
\item[B)] {\bf Complex demodulation:} remember that the Hilbert filter is defined as
\[
H(e^{j\omega})=\biggl\lbrace \begin{array}{cc}
-j & \omega>0\\
j & \omega<0 \end{array}.
\]
The DTFT of the modulated signal is
\[
Y(e^{j\omega})=\frac{1}{2} \left[ X(e^{j(\omega-\omega_c)})+X(e^{j(\omega+\omega_c)}) \right].
\]
The complex signal $c[ n ]$ is the sum of $a[ n ]=y[ n ]$ and $b[ n ]=y[ n ] \ast h[ n ]$. Therefore the spectra are given by:
\begin{eqnarray*}
A(e^{j\omega}) &=& Y(e^{j\omega})\mathrm{, and}\\
B(e^{j\omega}) &=& H(e^{j\omega})Y(e^{j\omega}) = \frac{1}{2}[ -jX(e^{j(\omega-\omega_c)}) + jX(e^{j(\omega+\omega_c)})].
\end{eqnarray*}
The spectrum of the complex signal is
\begin{eqnarray*}
C(e^{j\omega}) &=& A(e^{j\omega})+jB(e^{j\omega})\\
&=& \frac{1}{2} \left[ X(e^{j(\omega-\omega_c)}) + X(e^{j(\omega+\omega_c)}) + X(e^{j(\omega-\omega_c)}) - X(e^{j(\omega+\omega_c)}) \right] \\
&=& X(e^{j(\omega-\omega_c)}).
\end{eqnarray*}
(Note that the amplitude of the spectrum of a complex signal is not necessarily a symmetric function.)
Now, we know from the properties of the Fourier transform that $\mathrm{DTFT} \lbrace e^{j\omega_c n}x[ n ] \rbrace =
X(e^{j(\omega-\omega_c)})$, and therefore
\[
c[ n ] = e^{j\omega_c n} x[ n ].
\]
The demodulated signal is finally
\[
\hat{x}[ n ] = \Re\lbrace c[ n ] e^{-j\omega_c n} \rbrace = \Re\lbrace x[ n ] \rbrace = x[ n ].
\]
\item[C)] {\bf Galena demodulation:} The principle of operation of
a Galena demodulator is best understood graphically. The first two
panels in Figure~\ref{fig:spec_c} show the original signal and its
modulated version respectively. The magnitude operation introduces
as nonlinearity which, electrically, corresponds to passing the
signal through a diode and which, in the Galena receivers, was
introduced by the electrical properties of the contact between a
Galena crystal and a thin wire called the ``cat's whisker''. The
diode kills the negative part of the modulated waveform and the
lowpass filter operates a smoothing process which retains the
waveform envelope as in the last panel. The beauty of this system
is that it can recover the original signal with no explicit knowledge of
the carrier's frequency.
\begin{center}
\begin{tabular}{cc}
\small
\begin{dspPlot}[height=3cm,width=6cm,xticks=none,yticks=none,sidegap=0]{0,70}{-20,20}
\dspFunc[linecolor=red!70]{x 8 mul cos x 2 mul cos add 4 mul 8 add }
\end{dspPlot}
&
\begin{dspPlot}[height=3cm,width=6cm,xticks=none,yticks=none,sidegap=0]{0,70}{-20,20}
\dspFunc[linecolor=red!20]{x 8 mul cos x 2 mul cos add 4 mul 8 add }
\dspFunc[linecolor=red!20]{x 8 mul cos x 2 mul cos add 4 mul 8 add -1 mul}
\dspFunc[linecolor=blue!70]{x 8 mul cos x 2 mul cos add 4 mul 8 add x 200 mul cos mul}
\end{dspPlot}
\\
original waveform & modulated signal \\
\begin{dspPlot}[height=3cm,width=6cm,xticks=none,yticks=none,sidegap=0]{0,70}{-20,20}
\dspFunc[linecolor=red!20]{x 8 mul cos x 2 mul cos add 4 mul 8 add }
\dspFunc[linecolor=red!20]{0}
\dspFunc[linecolor=blue!70]{x 8 mul cos x 2 mul cos add 4 mul 8 add x 200 mul cos mul dup 0 gt {} {pop 0} ifelse}
\end{dspPlot}
&
\begin{dspPlot}[height=3cm,width=6cm,xticks=none,yticks=none,sidegap=0]{0,70}{-20,20}
\dspFunc[linecolor=blue!70]{x 8 mul cos x 2 mul cos add 4 mul 8 add x 200 mul cos 0.2 mul 0.2 add add}
\end{dspPlot}
\\
rectified signal & lowpass-filtered reconstruction
\end{tabular}
\end{center}
\end{itemize}
\vspace{2em}
\end{solution}
\end{document}

Event Timeline