4.3 HW3, March. 3,2010

  4.3.1 Problem 1 (in class)
  4.3.2 Problem 2 (problem 1.20 in text)
  4.3.3 Problem 3
  4.3.4 Problem 4 (1.28 in text)
  4.3.5 Problem 5
  4.3.6 Problem 6
  4.3.7 key solution
PDF (letter size)
PDF (legal size)

4.3.1 Problem 1 (in class)

Let \(x=\left \{ \underset{\uparrow }{1},2,-2,1,4,-1,1,2\right \} \) and let \(h=\left \{ \frac{1}{4},\underset{\uparrow }{\frac{1}{2}},\frac{1}{4}\right \} \ \)Find \(y=x\circledast h\) and \(z=y\circledast h\)

solution

First we find \(y\left ( n\right ) \). Using graphical solution, we obtain\[ y=\left \{ 0.25\ ,\underset{\uparrow }{1}\ ,0.75\ ,-0.25\ ,1\ ,2\ ,0.75\ ,\ 0.75\ ,1.25\ ,\ 0.5\right \} \]

pict

Now evaluate \(z=y\circledast h\), using graphical solution, we obtain\[ z=\{\underset{-2}{0.0625},\ \underset{-1}{0.375},\underset{\uparrow }{\ 0.75},\ \underset{1}{0.5625},\ \underset{2}{0.3125},\ \underset{3}{0.9375},\ \underset{4}{1.4375},\ \underset{5}{1.0625},\underset{6}{\ 0.875},\ \underset{7}{0.9375},\ \underset{8}{0.5625},\ \underset{9}{0.125}\} \]

pict

4.3.2 Problem 2 (problem 1.20 in text)

A causal linear shift invariant system is described by the difference equation\[ y\left ( n\right ) -ay\left ( n-1\right ) =x\left ( n\right ) -bx\left ( n-1\right ) \] Determine the value of \(b\left ( b\neq a\right ) \) such that this system is an allpass system. i.e. the magnitude of its frequency response is constant independent of the frequency.

Answer:

We can either let \(x\left ( n\right ) =e^{j\omega n}\), and since it is a shift invariant linear system, then the output is \(y\left ( n\right ) =H\left ( \omega \right ) e^{j\omega n}\), and plug in these in the difference equation to solve for \(H\left ( \omega \right ) \), or we can use the \(Z\) transform approach. Using the Z transform approach:

We find \(H\left ( z\right ) \), the frequency response. Assuming zero initial conditions, and taking the \(Z\) transform of the above, we obtain\begin{align*} Y\left ( z\right ) -az^{-1}Y\left ( z\right ) & =X\left ( z\right ) -bz^{-1}X\left ( z\right ) \\ Y\left ( z\right ) \left ( 1-az^{-1}\right ) & =X\left ( z\right ) \left ( 1-bz^{-1}\right ) \\ H\left ( z\right ) & =\frac{Y\left ( z\right ) }{X\left ( z\right ) }=\frac{\left ( 1-bz^{-1}\right ) }{\left ( 1-az^{-1}\right ) } \end{align*}

Let \(z=re^{j\omega }\) and evaluate at the unit circle (\(r=1\)), we obtain the DTFT of \(h\left ( n\right ) \) which is\[ H\left ( e^{j\omega }\right ) =\frac{\left ( 1-be^{-j\omega }\right ) }{\left ( 1-ae^{-j\omega }\right ) }=\frac{1-b\left ( \cos \omega -j\sin \omega \right ) }{1-a\left ( \cos \omega -j\sin \omega \right ) }=\frac{\left ( 1-b\cos \omega \right ) +j\left ( b\sin \omega \right ) }{\left ( 1-a\cos \omega \right ) +j\left ( a\sin \omega \right ) }\] Hence\[ \left \vert H\left ( e^{j\omega }\right ) \right \vert ^{2}=\frac{1-2b\cos \omega +b^{2}}{1-2a\cos \omega +a^{2}}\] We want this to be constant, i.e. does not depend on \(\omega \). If we let \(b=\frac{1}{a}\), we obtain\[ \left \vert H\left ( e^{j\omega }\right ) \right \vert ^{2}=\frac{1-\frac{2}{a}\cos \omega +\frac{1}{a^{2}}}{1-2a\cos \omega +a^{2}}=\frac{a^{2}-2a\cos \omega +1}{\left ( 1-2a\cos \omega +a^{2}\right ) a^{2}}=\frac{1}{a^{2}}\] Hence \(b=\frac{1}{a}\) will make the magnitude spectrum independent of \(\omega \) which is what we want for an allpass filter.

4.3.3 Problem 3

Let \(h\left ( n\right ) \) be the impulse response function of the above system (problem 1 above).  determine

\(h\left ( n\right ) \circledast \tilde{h}\left ( n\right ) \) where \(\tilde{h}\left ( n\right ) =h\left ( -n\right ) \)

Answer:

To find \(h\left ( n\right ) \) we need to determine the \(Z\) inverse transform of \(\frac{\left ( 1-bz^{-1}\right ) }{\left ( 1-az^{-1}\right ) }\) when \(b=\frac{1}{a}\), i.e. \(H\left ( z\right ) =\frac{\left ( 1-a^{-1}z^{-1}\right ) }{\left ( 1-az^{-1}\right ) }\)

We can solve this in the discrete time domain or in the Z domain.

Solution in the Z domain is easier: Since convolution in time domain becomes multiplication in the Z domain, we write\[ h\left ( n\right ) \circledast h\left ( -n\right ) \overset{Z}{\rightarrow }Z\left ( h\left ( n\right ) \right ) Z\left ( h\left ( -n\right ) \right ) \] But \(Z\left ( h\left ( -n\right ) \right ) =H\left ( \frac{1}{z}\right ) \) where \(H\left ( z\right ) \) is the Z transform of \(h\left ( n\right ) \), hence the above becomes\[ h\left ( n\right ) \circledast h\left ( -n\right ) \overset{Z}{\rightarrow }\frac{\left ( 1-a^{-1}z^{-1}\right ) }{\left ( 1-az^{-1}\right ) }\frac{\left ( 1-a^{-1}z\right ) }{\left ( 1-az\right ) }\] Therefore\begin{align*} h\left ( n\right ) \circledast h\left ( -n\right ) & =Z^{-1}\left [ \frac{\left ( 1-a^{-1}z^{-1}\right ) }{\left ( 1-az^{-1}\right ) }\frac{\left ( 1-a^{-1}z\right ) }{\left ( 1-az\right ) }\right ] =Z^{-1}\left [ \frac{1+a^{-2}-a^{-1}z-a^{-1}z^{-1}}{1+a^{2}-az-az^{-1}}\right ] \\ & =Z^{-1}\left [ \frac{1+\frac{1}{a^{2}}-\frac{z}{a}-\frac{1}{az}}{1+a^{2}-az-\frac{a}{z}}\right ] =Z^{-1}\left [ \frac{\frac{a^{2}z}{a^{2}z}+\frac{z}{a^{2}z}-\frac{az^{2}}{a^{2}z}-\frac{a}{a^{2}z}}{\frac{z+za^{2}-az^{2}-a}{z}}\right ] =Z^{-1}\left [ \frac{za^{2}+z-az^{2}-a}{a^{2}\left ( za^{2}+z-az^{2}-a\right ) }\right ] \\ & =Z^{-1}\left [ \frac{1}{a^{2}}\right ] =\frac{1}{a^{2}}Z^{-1}\left [ 1\right ] =\frac{1}{a^{2}}\delta \left ( n\right ) \end{align*}

Hence \[ h\left ( n\right ) \circledast h\left ( -n\right ) =\left \{ \cdots ,0,0,0,\frac{1}{a^{2}},0,0,0,\cdots \right \} \] Where \(\frac{1}{a^{2}}\) is at \(n=0.\)

4.3.4 Problem 4  (1.28 in text)

pict

solution\begin{align} h\left ( n\right ) & =h_{r}\left ( n\right ) +jh_{i}\left ( n\right ) \tag{1}\\ H\left ( \omega \right ) & =H_{R}\left ( \omega \right ) +jH_{I}\left ( \omega \right ) \tag{2} \end{align}

Take the DTFT of \(h\left ( n\right ) \), we obtain (I write \(F_{s}\) to mean DTFT)\begin{align} F_{s}\left \{ h\left ( n\right ) \right \} & =F_{s}\left \{ h_{r}\left ( n\right ) +jh_{i}\left ( n\right ) \right \} \nonumber \\ & =F_{s}\left \{ h_{r}\left ( n\right ) \right \} +F_{s}\left \{ jh_{i}\left ( n\right ) \right \} \nonumber \\ & =F_{s}\left \{ h_{r}\left ( n\right ) \right \} +jF_{s}\left \{ h_{i}\left ( n\right ) \right \} \nonumber \\ & =\left [ H_{A}\left ( \omega \right ) +jH_{B}\left ( \omega \right ) \right ] +j\left [ H_{c}\left ( \omega \right ) +jH_{D}\left ( \omega \right ) \right ] \nonumber \\ & =H_{A}\left ( \omega \right ) +jH_{B}\left ( \omega \right ) +jH_{c}\left ( \omega \right ) +j^{2}H_{D}\left ( \omega \right ) \nonumber \\ & =\left [ H_{A}\left ( \omega \right ) -H_{D}\left ( \omega \right ) \right ] +j\left [ H_{B}\left ( \omega \right ) +H_{c}\left ( \omega \right ) \right ] \tag{3} \end{align}

Compare (2) and (3), we see that \[ H_{A}\left ( \omega \right ) -H_{D}\left ( \omega \right ) =H_{R}\left ( \omega \right ) \] And\[ H_{B}\left ( \omega \right ) +H_{c}\left ( \omega \right ) =H_{I}\left ( \omega \right ) \]

4.3.5 Problem 5

   4.3.5.1 part (a)
   4.3.5.2 Part (b)

(a) Analog signals \(\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) t\) and \(\cos \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) t\) are sampled at a sampling rate \(\omega _{s}\), show that they give identical sampled data.

(b) Does the same hold true for  \(\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) t\) and \(\sin \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) t\) \(,\) if not, what similarity does exist between them?

solution:

4.3.5.1 part (a)

Let \(x_{1}\left ( t\right ) =\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) \) and let \(x_{2}\left ( t\right ) =\cos \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) t\), hence when they are sampled at \(\omega _{s}\). this means \(\omega _{s}=\frac{2\pi }{T}\) or \(T=\frac{2\pi }{\omega _{s}}\) where \(T\) is the sampling period. Therefore\[ x_{1}\left ( n\right ) =\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) nT=\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) n\frac{2\pi }{\omega _{s}}=\cos \left ( n\pi -n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] But \(\cos \left ( A-B\right ) =\cos A\cos B+\sin A\sin B\), hence the above becomes\[ x_{1}\left ( n\right ) =\cos \left ( n\pi \right ) \cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) +\sin n\pi \sin \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] But \(n\) is integer, hence \(\sin n\pi \sin \left ( n2\pi \frac{\omega }{\omega _{s}}\right ) =0\) and \(\cos \left ( n\pi \right ) =\left ( -1\right ) ^{n}\), so

\[ x_{1}\left ( n\right ) =\left ( -1\right ) ^{n}\cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \]

And similarly\[ x_{2}\left ( n\right ) =\cos \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) nT=\cos \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) n\frac{2\pi }{\omega _{s}}=\cos \left ( n\pi +n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] But \(\cos \left ( A+B\right ) =\cos A\cos B-\sin A\sin B\), hence the above becomes\[ x_{2}\left ( n\right ) =\cos \left ( n\pi \right ) \cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) -\sin n\pi \sin \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] Hence\[ x_{2}\left ( n\right ) =\left ( -1\right ) ^{n}\cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] Therefore, sampled versions of the signals is the same.

4.3.5.2 Part (b)

Let \(x_{1}\left ( t\right ) =\cos \left ( \frac{\omega _{s}}{2}-\omega _{0}\right ) t\) and let \(x_{2}\left ( t\right ) =\) \(\sin \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) t\), hence as was shown above\[ x_{1}\left ( n\right ) =\left ( -1\right ) ^{n}\cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] And\[ x_{2}\left ( n\right ) =\sin \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) nT=\sin \left ( \frac{\omega _{s}}{2}+\omega _{0}\right ) n\frac{2\pi }{\omega _{s}}=\sin \left ( n\pi +n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \] But \(\sin \left ( A+B\right ) =\sin A\cos B+\cos A\sin B\), hence the above becomes\begin{align*} x_{2}\left ( n\right ) & =\sin n\pi \cos \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) +\cos n\pi \sin \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \\ & =\cos n\pi \sin \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \\ & =\left ( -1\right ) ^{n}\sin \left ( n2\pi \frac{\omega _{0}}{\omega _{s}}\right ) \end{align*}

Therefore the sampled signals are not the same in general. However, \(\sin \left ( a\right ) =\cos \left ( a\right ) \) when \(a=\frac{\pi }{4}\) and \(a=-\frac{3\pi }{4}\), then they are the same.

Therefore, we conclude that \(x_{1}\left ( n\right ) =x_{2}\left ( n\right ) \) when when \(n2\pi \frac{\omega _{0}}{\omega _{s}}=\frac{\pi }{4}\) or \(n=\frac{1}{8}\frac{\omega _{s}}{\omega _{0}}\)or when \(n2\pi \frac{\omega _{0}}{\omega _{s}}=\frac{-3\pi }{4}\), hence \(n=\frac{-3}{8}\frac{\omega _{s}}{\omega _{0}}\), so taking the only the positive \(n\) value, we say that\[ x_{1}(n)=x_{2}(n)\ \text{when\ }n=\frac{1}{8}\frac{\omega _{s}}{\omega _{0}}\]

4.3.6 Problem 6

pict

Solution:

Part (a)

Let \(f_{1}=4Khz\) and let \(f_{2}=6Khz\)

Let \(G\left ( \Omega \right ) \) be the CTFT of \(g\left ( t\right ) \), hence its spectrum will look like (assuming \(g\left ( t\right ) \) is real and even), where \(\Omega _{1}=2\pi f_{1}\) and \(\Omega _{h}=2\pi f_{2}\) and let \(W=\left \vert \Omega _{h}-\Omega _{1}\right \vert \)

pict

Hence, by shifting the right part of the spectrum, call it \(G_{R}\) to the left by \[ f_{shift}=4kHz \] Hence \(\Omega _{shift}=2\pi f_{shift}\) and also by shifting the left part of the spectrum, call it \(G_{L}\) to the right by \(\Omega _{shift},\) we obtain

pict

Therefore the highest frequency now becomes \(2\) kHz or in circular frequency it becomes\begin{align*} \Omega _{h} & =2\pi \left ( 2000\right ) \\ & =4000\pi \end{align*}

So, now we can use \(\Omega _{s}=2\Omega _{h}\), hence \(\Omega _{s}=2\pi \left ( 4000\right ) =8000\pi \ \)hence \[ f_{s}=4 \text{kHz}\] Hence sampling period is\[ T=\frac{1}{4000} \text{sec} \] This is the lowest sampling frequency. (I used Hz, but samples per second also can be used as units)

Part (b)

Let \(H_{R}\) be the bandpass filter over \(G_{R}\left ( \Omega \right ) \) before it was shifted and let \(H_{L}\) be the bandpass filter over \(G_{L}\left ( \Omega \right ) \) before it was shifted, and let \(H_{R}^{\prime }\) be the low pass filter over \(G_{R}\left ( \Omega \right ) \) after it was shifted and let \(H_{L}^{\prime }\) be the low pass filter over \(G_{L}\left ( \Omega \right ) \) after it was shifted

pict

Let \(\Omega _{shift}\equiv \bar{\Omega }\), and \(W\) is the width of the rect function, which is \(2khz\) but in circular frequency, \(4000\pi \) hence we write\[ h\left ( t\right ) =h_{R}\left ( t\right ) +h_{L}\left ( t\right ) \] Where\[ h_{R}\left ( t\right ) =F^{-1}\left ( H_{R}\left ( \Omega \right ) \right ) =F^{-1}\left ( H_{R}^{\prime }\left ( \Omega -\bar{\Omega }\right ) \right ) =e^{+j\bar{\Omega }t}F^{-1}\left ( H_{R}^{\prime }\left ( \Omega \right ) \right ) \] But \begin{align*} F^{-1}\left ( H_{R}^{\prime }\left ( \Omega \right ) \right ) & =F^{-1}\left ( T\ \text{Rect}\left ( \frac{\Omega -\frac{W}{2}}{W}\right ) \right ) \\ & =e^{+j\frac{W}{2}t}F^{-1}\left ( T\ \text{Rect}\left ( \frac{\Omega }{W}\right ) \right ) \\ & =e^{+j\frac{W}{2}t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \end{align*}

Hence\[ h_{R}\left ( t\right ) =e^{+j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \] Similarly,\[ h_{L}\left ( t\right ) =F^{-1}\left ( H_{L}\left ( \Omega \right ) \right ) =F^{-1}\left ( H_{L}^{\prime }\left ( \Omega +\bar{\Omega }\right ) \right ) =e^{-j\bar{\Omega }t}F^{-1}\left ( H_{L}^{\prime }\left ( \Omega \right ) \right ) \] But \begin{align*} F^{-1}\left ( H_{L}^{\prime }\left ( \Omega \right ) \right ) & =F^{-1}\left ( T\ \text{Rect}\left ( \frac{\Omega +\frac{W}{2}}{W}\right ) \right ) \\ & =e^{-j\frac{W}{2}t}F^{-1}\left ( T\ \text{Rect}\left ( \frac{\Omega }{W}\right ) \right ) \\ & =e^{-j\frac{W}{2}t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \end{align*}

Hence\[ h_{L}\left ( t\right ) =e^{-j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \] Therefore, the interpolation filter is\begin{align*} h\left ( t\right ) & =h_{R}\left ( t\right ) +h_{L}\left ( t\right ) \\ & =e^{+j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) +e^{-j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \\ & =\frac{WT}{2\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \left ( e^{+j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}+e^{-j\left ( \bar{\Omega }+\frac{W}{2}\right ) t}\right ) \end{align*}

Therefore\[ h\left ( t\right ) =\frac{WT}{\pi }\operatorname{sinc}\left ( \frac{W}{2}t\right ) \cos \left ( \left ( \bar{\Omega }+\frac{W}{2}\right ) t\right ) \] Substitute \(W=2\pi \left ( 2000\right ) =4000\pi ,\bar{\Omega }=2\pi \left ( 4000\right ) =8000\pi \), and \(T=\frac{1}{4000}\) the above becomes\[ h\left ( t\right ) =\operatorname{sinc}\left ( 2000\pi \ t\right ) \cos \left ( 10000\pi \ t\right ) \] Note: This solution can also be rewritten as 1 \[ 3\operatorname{sinc}\left ( 12000\pi \ t\right ) -2\operatorname{sinc}\left ( 8000\pi \ t\right ) \] Now I show a verification that \(h_{1}\left ( t\right ) \) interpolation will reconstruction a bandpass signal in the band of \(4\) to \(6khz\), using sampling rate of \(4kz\).

To reconstruct the original signal, we write\begin{align*} g\left ( t\right ) & ={\displaystyle \sum \limits _{n}} g\left ( nT\right ) h\left ( t-nT\right ) \\ & ={\displaystyle \sum \limits _{n}} g\left ( nT\right ) \frac{WT}{\pi }\operatorname{sinc}\left ( \frac{W}{2}\left ( t-nT\right ) \right ) \cos \left ( \left ( \bar{\Omega }+\frac{W}{2}\right ) \left ( t-nT\right ) \right ) \end{align*}

Putting numerical values, \(W=2\pi \left ( 2000\right ) =4000\pi ,\bar{\Omega }=2\pi \left ( 4000\right ) =8000\pi \), \(\ \) and \(T=\frac{1}{4000}\), hence the above becomes\[ g\left ( t\right ) ={\sum \limits _{n}}g\left ( nT\right ) \operatorname{sinc}\left ( 2000\pi \left ( t-n\frac{1}{4000}\right ) \right ) \cos \left ( 10000\pi \left ( t-n\frac{1}{4000}\right ) \right ) \] To verify this solution, I tested it with a signal which contains 2 harmonics one at \(4\)kHz and the second at \(6khz\), then applied the above interpolation to the samples obtained from the signal using sampling rate of \(t=\frac{1}{4000}\), and I do obtain the original signal back. Here is the code:

pict

4.3.7 key solution

PDF