Let \(x\left [ n\right ] =\delta \left [ n\right ] +2\delta \left [ n-1\right ] -\delta \left [ n-3\right ] \) and \(h\left [ n\right ] =2\delta \left [ n+1\right ] +2\delta \left [ n-1\right ] \). Compute and plot each of the following convolutions (a) \(y_{1}\left [ n\right ] =x\left [ n\right ] \circledast h\left [ n\right ] \,\) (b) \(y_{2}\left [ n\right ] =x\left [ n+2\right ] \circledast h\left [ n\right ] \)
Solution
The following is plot of \(x\left [ n\right ] ,h\left [ n\right ] \)
Linear convolution is done by flipping \(h\left [ n\right ] \) (reflection), then shifting the now flipped \(h\left [ n\right ] \) one step to the right at a time. Each step the corresponding entries of \(h\left [ n\right ] \) and \(x\left [ n\right ] \) are multiplied and added. This is done until no overlapping between the two sequences. Mathematically this is the same as\[ y\left [ n\right ] =\sum _{k=-\infty }^{\infty }x\left [ k\right ] h\left [ n-k\right ] \] Since \(x\left [ n\right ] \) length is \(3\) and \(x\left [ n\right ] =0\) for \(n<0\) then the sum is\[ y\left [ n\right ] =\sum _{k=0}^{3}x\left [ k\right ] h\left [ n-k\right ] \] For \(n=-1\)\begin{align*} y\left [ -1\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ -1-k\right ] \\ & =x\left [ 0\right ] h\left [ -1\right ] +x\left [ 1\right ] h\left [ 0\right ] +x\left [ 2\right ] h\left [ 1\right ] +x\left [ 3\right ] h\left [ 2\right ] \\ & =\left ( 1\right ) \left ( 2\right ) +\left ( 2\right ) \left ( 0\right ) +\left ( 0\right ) \left ( 2\right ) +\left ( -1\right ) \left ( 0\right ) \\ & =2 \end{align*}
For \(n=0\)\begin{align*} y\left [ 0\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ -k\right ] \\ & =x\left [ 0\right ] h\left [ 0\right ] +x\left [ 1\right ] h\left [ -1\right ] +x\left [ 2\right ] h\left [ -2\right ] +x\left [ 3\right ] h\left [ -3\right ] \\ & =0+\left ( 2\right ) \left ( 2\right ) +0+0\\ & =4 \end{align*}
For \(n=1\)\begin{align*} y\left [ 1\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ 1-k\right ] \\ & =x\left [ 0\right ] h\left [ 1\right ] +x\left [ 1\right ] h\left [ 0\right ] +x\left [ 2\right ] h\left [ -1\right ] +x\left [ 3\right ] h\left [ -2\right ] \\ & =\left ( 1\right ) \left ( 2\right ) +\left ( 2\right ) \left ( 0\right ) +\left ( 0\right ) \left ( 1\right ) +\left ( -1\right ) \left ( 0\right ) \\ & =2 \end{align*}
For \(n=2\)\begin{align*} y\left [ 2\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ 2-k\right ] \\ & =x\left [ 0\right ] h\left [ 2\right ] +x\left [ 1\right ] h\left [ 1\right ] +x\left [ 2\right ] h\left [ 0\right ] +x\left [ 3\right ] h\left [ -1\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 2\right ) +\left ( 0\right ) \left ( 0\right ) +\left ( -1\right ) \left ( 2\right ) \\ & =2 \end{align*}
For \(n=3\)\begin{align*} y\left [ 3\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ 3-k\right ] \\ & =x\left [ 0\right ] h\left [ 3\right ] +x\left [ 1\right ] h\left [ 2\right ] +x\left [ 2\right ] h\left [ 1\right ] +x\left [ 3\right ] h\left [ 0\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 0\right ) +\left ( 0\right ) \left ( 2\right ) +\left ( -1\right ) \left ( 2\right ) \\ & =0 \end{align*}
For \(n=4\)\begin{align*} y\left [ 4\right ] & =\sum _{k=0}^{3}x\left [ k\right ] h\left [ 4-k\right ] \\ & =x\left [ 0\right ] h\left [ 4\right ] +x\left [ 1\right ] h\left [ 3\right ] +x\left [ 2\right ] h\left [ 2\right ] +x\left [ 3\right ] h\left [ 1\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 0\right ) +\left ( 0\right ) \left ( 2\right ) +\left ( -1\right ) \left ( 2\right ) \\ & =-2 \end{align*}
All higher \(n\) values give \(y\left [ n\right ] =0.\) Therefore \[ y_{1}\left [ n\right ] =2\delta \left [ n+1\right ] +4\delta \left [ n\right ] +2\delta \left [ n-1\right ] +2\delta \left [ n-2\right ] -2\delta \left [ n-4\right ] \]
First \(x\left [ n\right ] \) is shifted to the left by \(2\) to obtain \(x\left [ n+2\right ] \) and the result is convolved with \(h\left [ n\right ] \)
The following is plot of \(x\left [ n+2\right ] ,h\left [ n\right ] \)
Since Linear time invariant system, then shifted input convolved with \(h\left [ n\right ] \) will give the shifted output found in part (a). Hence \(y_{2}\left [ n\right ] =y_{1}\left [ n+2\right ] \). Hence\[ y_{2}\left [ n\right ] =2\delta \left [ n+3\right ] +4\delta \left [ n+2\right ] +2\delta \left [ n+1\right ] +2\delta \left [ n\right ] -2\delta \left [ n-2\right ] \] To show this explicitly, the convolution of shifted input is now computed directly. Linear convolution is \[ y\left [ n\right ] =\sum _{k=-\infty }^{\infty }x\left [ k\right ] h\left [ n-k\right ] \] Since \(x\left [ n+2\right ] \) length is \(3\) and \(x\left [ n\right ] =0\) for \(n<-2\) then the sum is\[ y\left [ n\right ] =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ n-k\right ] \] For \(n=-3\)\begin{align*} y\left [ -3\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ -3-k\right ] \\ & =x\left [ -2\right ] h\left [ -1\right ] +x\left [ -1\right ] h\left [ -2\right ] +x\left [ 0\right ] h\left [ -3\right ] +x\left [ 1\right ] h\left [ -4\right ] \\ & =\left ( 1\right ) \left ( 2\right ) +\left ( 2\right ) \left ( 0\right ) +\left ( 0\right ) \left ( 0\right ) +\left ( -1\right ) \left ( 0\right ) \\ & =2 \end{align*}
For \(n=-2\)\begin{align*} y\left [ -2\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ -2-k\right ] \\ & =x\left [ -2\right ] h\left [ 0\right ] +x\left [ -1\right ] h\left [ -1\right ] +x\left [ 0\right ] h\left [ -2\right ] +x\left [ 1\right ] h\left [ -3\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 2\right ) +0+\left ( -1\right ) \left ( 0\right ) \\ & =4 \end{align*}
For \(n=-1\)\begin{align*} y\left [ -1\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ -1-k\right ] \\ & =x\left [ -2\right ] h\left [ 1\right ] +x\left [ -1\right ] h\left [ 0\right ] +x\left [ 0\right ] h\left [ -1\right ] +x\left [ 1\right ] h\left [ -2\right ] \\ & =\left ( 1\right ) \left ( 2\right ) +\left ( 2\right ) \left ( 0\right ) +0+\left ( -1\right ) \left ( 0\right ) \\ & =2 \end{align*}
For \(n=0\)\begin{align*} y\left [ 0\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ 0-k\right ] \\ & =x\left [ -2\right ] h\left [ 2\right ] +x\left [ -1\right ] h\left [ 1\right ] +x\left [ 0\right ] h\left [ 0\right ] +x\left [ 1\right ] h\left [ -1\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 2\right ) +0+\left ( -1\right ) \left ( 2\right ) \\ & =2 \end{align*}
For \(n=1\)\begin{align*} y\left [ 1\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ 1-k\right ] \\ & =x\left [ -2\right ] h\left [ 3\right ] +x\left [ -1\right ] h\left [ 2\right ] +x\left [ 0\right ] h\left [ 1\right ] +x\left [ 1\right ] h\left [ 0\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 2\right ) +0+\left ( -1\right ) \left ( 0\right ) \\ & =4 \end{align*}
For \(n=2\)\begin{align*} y\left [ 2\right ] & =\sum _{k=-2}^{1}x\left [ k\right ] h\left [ 2-k\right ] \\ & =x\left [ -2\right ] h\left [ 4\right ] +x\left [ -1\right ] h\left [ 3\right ] +x\left [ 0\right ] h\left [ 2\right ] +x\left [ 1\right ] h\left [ 1\right ] \\ & =\left ( 1\right ) \left ( 0\right ) +\left ( 2\right ) \left ( 0\right ) +0+\left ( -1\right ) \left ( 2\right ) \\ & =-2 \end{align*}
Hence\[ y\left [ n\right ] =2\delta \left [ n+3\right ] +4\delta \left [ n+2\right ] +2\delta \left [ n+1\right ] +2\delta \left [ n\right ] -2\delta \left [ n-2\right ] \] Which is the shifted output found in part (a)
Compute and plot the convolution \(y\left [ n\right ] =x\left [ n\right ] \circledast h\left [ n\right ] \) where \(x\left [ n\right ] =\left ( \frac{1}{3}\right ) ^{-n}u\left [ -n-1\right ] \) and \(h\left [ n\right ] =u\left [ n-1\right ] \)
Solution
It is easier to do this using graphical method. \(y\left [ n\right ] =\sum _{k=-\infty }^{\infty }x\left [ k\right ] h\left [ n-k\right ] \). We could either flip and shift \(x\left [ n\right ] \) or \(h\left [ n\right ] \). Let us flip and shift \(h\left [ n\right ] \). This below is the result for \(n=0\) when \(h\left [ n-k\right ] \) and \(x\left [ k\right ] \) are plotted on top of each others
By multiplying corresponding values and summing the result can be seen to be \(\sum _{k=1}^{\infty }\left ( \frac{1}{3}\right ) ^{k}\). Let \(r=\frac{1}{3}\) then this sum is \(\left ( \sum _{k=0}^{\infty }r^{k}\right ) -1\) But \(\sum _{k=0}^{\infty }r^{k}=\frac{1}{1-r}\) since \(r<1\). Therefore\begin{align*} \sum _{k=1}^{\infty }\left ( \frac{1}{3}\right ) ^{k} & =\frac{1}{1-\frac{1}{3}}-1\\ & =\frac{3}{3-1}-1\\ & =\frac{3}{2}-1\\ & =\frac{1}{2} \end{align*}
Hence \(y\left [ 0\right ] =\frac{1}{2}\). Now, the signal \(h\left [ n-k\right ] \) is shifted to the right by \(1\) then \(2\) then \(3\) and so on. This gives \(y\left [ 1\right ] ,y\left [ 2\right ] ,\cdots \). Each time, the same sum result which is \(\frac{1}{2}\). Here is a diagram for \(n=1\) and \(n=2\) for illustration
Therefore \(y\left [ n\right ] =\frac{1}{2}\) for \(n\geq 0\). Now we will look to see what happens when \(h\left [ -k\right ] \) is shifted to the left. For \(n=-1\) this is the result
When multiplying the corresponding elements and adding, now the element \(\frac{1}{3}\) is multiplied by a zero and not by \(1\). Hence the sum becomes \(\left ( \sum _{k=1}^{\infty }\left ( \frac{1}{3}\right ) ^{k}\right ) -\frac{1}{3}\) which is \(\frac{1}{2}-\frac{1}{3}=\frac{1}{6}=\left ( \frac{1}{2}\right ) \left ( \frac{1}{3}\right ) \). Therefore \(y\left [ -1\right ] =\frac{1}{6}\). When \(h\left [ -k\right ] \) is shifted to the left one more step, it gives \(y\left [ -2\right ] \) which is
We see from the above diagram that now \(\frac{1}{3}\) and \(\frac{1}{9}\) do not contribute to the sum since both are multiplied by zero. This means \(y\left [ -2\right ] =\left ( \sum _{k=1}^{\infty }\left ( \frac{1}{3}\right ) ^{k}\right ) -\left ( \frac{1}{3}+\frac{1}{9}\right ) =\frac{1}{2}-\left ( \frac{1}{3}+\frac{1}{9}\right ) =\allowbreak \frac{1}{18}=\left ( \frac{1}{2}\right ) \left ( \frac{1}{9}\right ) \). Each time \(h\left [ -k\right ] \) is shifted to the left by one, the sum reduces. From the above we see that \begin{align*} y\left [ -1\right ] & =\left ( \frac{1}{2}\right ) \left ( \frac{1}{3}\right ) \\ y\left [ -2\right ] & =\left ( \frac{1}{2}\right ) \left ( \frac{1}{3^{2}}\right ) \end{align*}
Hence by extrapolation the pattern is\begin{align*} y\left [ -n\right ] & =\left ( \frac{1}{2}\right ) \left ( \frac{1}{3^{-n}}\right ) \\ & =\frac{3^{n}}{2} \end{align*}
Therefore the final result is \[ y\left [ n\right ] =\left \{ \begin{array} [c]{ccc}\frac{1}{2} & & n\geq 0\\ \frac{3^{n}}{2} & & n<0 \end{array} \right . \] Here is plot of \(y\left [ n\right ] =x\left [ n\right ] \circledast h\left [ n\right ] \) given by the above
Let \(x\left ( t\right ) =u\left ( t-3\right ) -u\left ( t-5\right ) \) and \(h\left ( t\right ) =e^{-3t}u\left ( t\right ) \). (a) compute \(y\left ( t\right ) =x\left ( t\right ) \circledast h\left ( t\right ) \). (b) Compute \(g\left ( t\right ) =\frac{dx}{dt}\circledast h\left ( t\right ) \). (c) How is \(g\left ( t\right ) \) related to \(y\left ( t\right ) \)?
Solution
It is easier to do this using graphical method. This is plot of \(x\left ( t\right ) \) and \(h\left ( t\right ) \).
The next step is to fold one of the signals and then slide it to the right. We can folder either \(x\left ( t\right ) \) or \(h\left ( t\right ) \). Let us fold \(x\left ( t\right ) \). Hence the integral is \[ y\left ( t\right ) =\int _{-\infty }^{\infty }x\left ( t-\tau \right ) h\left ( \tau \right ) d\tau \] If we have chosen to fold \(h\left ( t\right ) \) instead, then the integral would have been\[ y\left ( t\right ) =\int _{-\infty }^{\infty }x\left ( \tau \right ) h\left ( t-\tau \right ) d\tau \] This is the result after folding (reflection) of \(x\left ( t\right ) \)
Next we label each edge of the folded signal before shifting it to the right as follows
We see from the above that for \(t-3<0\) or for \(t<3\) the integral is zero since there is no overlapping between the folded \(x\left ( \tau \right ) \) and \(h\left ( \tau \right ) \). As we slide the folded \(x\left ( \tau \right ) \) more to the right, we end up with \(x\left ( \tau \right ) \) partially under \(h\left ( \tau \right ) \) like this
From the above, we see that for \(0<t-3<2\) (since \(2\) is the width of \(x\left ( \tau \right ) \) ) or for \(3<t<5\), then the overlap is partial. Hence the integral now becomes\begin{align*} y\left ( t\right ) & =\int _{0}^{t-3}x\left ( t-\tau \right ) h\left ( \tau \right ) d\tau \qquad 3<t\leq 5\\ & =\int _{0}^{t-3}e^{-3\tau }d\tau \\ & =\frac{-1}{3}\left [ e^{-3\tau }\right ] _{0}^{t-3}\\ & =\frac{-1}{3}\left [ e^{-3\left ( t-3\right ) }-1\right ] \\ & =\frac{1}{3}\left ( 1-e^{-3\left ( t-3\right ) }\right ) \end{align*}
The next step is when folded \(x\left ( \tau \right ) \) is fully inside \(h\left ( \tau \right ) \) as follows
From the above, we see that for \(0<t-5\) or \(t>5\), then the overlap is complete. Hence the integral now becomes\begin{align*} y\left ( t\right ) & =\int _{t-5}^{t-3}x\left ( t-\tau \right ) h\left ( \tau \right ) d\tau \qquad 5<t\leq \infty \\ & =\int _{t-5}^{t-3}e^{-3\tau }d\tau \\ & =\frac{-1}{3}\left [ e^{-3\tau }\right ] _{t-5}^{t-3}\\ & =\frac{-1}{3}\left ( e^{-3\left ( t-3\right ) }-e^{-3\left ( t-5\right ) }\right ) \\ & =\frac{1}{3}\left ( e^{-3\left ( t-5\right ) }-e^{-3\left ( t-3\right ) }\right ) \end{align*}
The above result \(y\left ( t\right ) =\frac{1}{3}\left [ e^{-3\left ( t-5\right ) }-e^{-3\left ( t-3\right ) }\right ] \) can be rewritten as \(\frac{1}{3}\left [ \left ( 1-e^{-6}\right ) e^{-3\left ( t-5\right ) }\right ] \) if needed to match the book. Therefore the final answer is\[ y\left ( t\right ) =\left \{ \begin{array} [c]{ccc}0 & & -\infty <t\leq 3\\ \frac{1}{3}\left ( 1-e^{-3\left ( t-3\right ) }\right ) & & 3<t\leq 5\\ \frac{1}{3}\left ( e^{-3\left ( t-5\right ) }-e^{-3\left ( t-3\right ) }\right ) & & 5<t\leq \infty \end{array} \right . \] Here is a plot of the above
Solution
The impulse response \(h\left [ n\right ] \) is given. This is the response when the input is \(x\left [ n\right ] =\delta \left [ 0\right ] \). Hence\[ h\left [ n\right ] =h_{1}\left [ n\right ] \circledast \left ( h_{2}\left [ n\right ] \circledast h_{2}\left [ n\right ] \right ) \] But \(h_{2}\left [ n\right ] \) is given as \(h_{2}\left [ n\right ] =\delta \left [ 0\right ] +\delta \left [ 1\right ] \). Hence, let \(H\left [ n\right ] =h_{2}\left [ n\right ] \circledast h_{2}\left [ n\right ] \), therefore \begin{align*} H\left [ n\right ] & =\sum _{k=-\infty }^{\infty }h_{2}\left [ k\right ] h_{2}\left [ n-k\right ] \\ & =\sum _{k=-1}^{2}h_{2}\left [ k\right ] h_{2}\left [ n-k\right ] \end{align*}
For \(n=0\). \begin{align*} H\left [ 0\right ] & =\sum _{k=-1}^{0}h_{2}\left [ k\right ] h_{2}\left [ -k\right ] \\ & =h_{2}\left [ -1\right ] h_{2}\left [ 1\right ] +h_{2}\left [ 0\right ] h_{2}\left [ 0\right ] \\ & =0+1\\ & =1 \end{align*}
For \(n=1\). \begin{align*} H\left [ 1\right ] & =\sum _{k=-1}^{0}h_{2}\left [ k\right ] h_{2}\left [ 1-k\right ] \\ & =h_{2}\left [ -1\right ] h_{2}\left [ 0\right ] +h_{2}\left [ 0\right ] h_{2}\left [ 1\right ] \\ & =0+2\\ & =2 \end{align*}
For \(n=2\). \begin{align*} H\left [ 2\right ] & =\sum _{k=-1}^{0}h_{2}\left [ k\right ] h_{2}\left [ 2-k\right ] \\ & =h_{2}\left [ -1\right ] h_{2}\left [ 3\right ] +h_{2}\left [ 0\right ] h_{2}\left [ 2\right ] \\ & =0+1\\ & =1 \end{align*}
And zero for all other \(n\). Hence\begin{align*} H\left [ n\right ] & =h_{2}\left [ n\right ] \circledast h_{2}\left [ n\right ] \\ & =\delta \left [ n\right ] +2\delta \left [ n-1\right ] +\delta \left [ n-2\right ] \end{align*}
Now we need to find \(h_{1}\left [ n\right ] \) given that \(h_{1}\left [ n\right ] \circledast H\left [ n\right ] \) is what is shown in the problem. We do not know \(h_{1}\left [ n\right ] \). so let us assume it is the sequence \(\left \{ h_{1}\left [ 0\right ] ,h_{2}\left [ 0\right ] ,\cdots \right \} \). Then by doing convolution by folding \(h_{1}\left [ n\right ] \) and then sliding it to the right one step at a time, we obtain the following relations for each \(n\).
\(n=0\) \(h_{1}\left [ 0\right ] H_{1}\left [ 0\right ] =1\) and since \(H_{1}\left [ 0\right ] =1\) then \(h_{1}\left [ 0\right ] =1\)
\(n=1\) \(h_{1}\left [ 1\right ] H_{1}\left [ 0\right ] +h_{1}\left [ 0\right ] H_{1}\left [ 1\right ] =5\) and since \(H_{1}\left [ 0\right ] =1,H_{1}\left [ 1\right ] =2\) then \(h_{1}\left [ 1\right ] +2h_{1}\left [ 0\right ] =5\). But \(h_{1}\left [ 0\right ] =1\) found above. Hence \(h_{1}\left [ 1\right ] +2=5\) or \(h_{1}\left [ 1\right ] =3\)
\(n=2\) \(h_{1}\left [ 2\right ] H_{1}\left [ 0\right ] +h_{1}\left [ 1\right ] H_{1}\left [ 1\right ] +h_{1}\left [ 0\right ] H_{1}\left [ 2\right ] =10\) and since \(H_{1}\left [ 0\right ] =1,H_{1}\left [ 1\right ] =2,H_{1}\left [ 2\right ] =1\) then \(h_{1}\left [ 2\right ] +2h_{1}\left [ 1\right ] +h_{1}\left [ 0\right ] =10\). But \(h_{1}\left [ 0\right ] =1,h_{1}\left [ 1\right ] =3\) found above. Hence \(h_{1}\left [ 2\right ] +\left ( 2\right ) \left ( 3\right ) +1=10\) or \(h_{1}\left [ 2\right ] =3\)
\(n=3\) \(h_{1}\left [ 3\right ] H_{1}\left [ 0\right ] +h_{1}\left [ 2\right ] H_{1}\left [ 1\right ] +h_{1}\left [ 1\right ] H_{1}\left [ 2\right ] =11\) and since \(H_{1}\left [ 0\right ] =1,H_{1}\left [ 1\right ] =2,H_{1}\left [ 2\right ] =1\) then \(h_{1}\left [ 3\right ] +2h_{1}\left [ 2\right ] +h_{1}\left [ 1\right ] =11\). But \(h_{1}\left [ 2\right ] =3,h_{1}\left [ 1\right ] =3\) found above. Hence \(h_{1}\left [ 3\right ] +\left ( 2\right ) \left ( 3\right ) +3=11\) or \(h_{1}\left [ 3\right ] =2\)
\(n=4\) \(h_{1}\left [ 4\right ] H_{1}\left [ 0\right ] +h_{1}\left [ 3\right ] H_{1}\left [ 1\right ] +h_{1}\left [ 2\right ] H_{1}\left [ 2\right ] =8\) and since \(H_{1}\left [ 0\right ] =1,H_{1}\left [ 1\right ] =2,H_{1}\left [ 2\right ] =1\) then \(h_{1}\left [ 4\right ] +2h_{1}\left [ 3\right ] +h_{1}\left [ 2\right ] =8\). But \(h_{1}\left [ 3\right ] =2,h_{1}\left [ 2\right ] =3\) found above. Hence \(h_{1}\left [ 4\right ] +2\left ( 2\right ) +3=8\) or \(h_{1}\left [ 4\right ] =1\)
\(n=5\) \(h_{1}\left [ 5\right ] H_{1}\left [ 0\right ] +h_{1}\left [ 4\right ] H_{1}\left [ 1\right ] +h_{1}\left [ 3\right ] H_{1}\left [ 2\right ] =4\) and since \(H_{1}\left [ 0\right ] =1,H_{1}\left [ 1\right ] =2,H_{1}\left [ 2\right ] =1\) then \(h_{1}\left [ 5\right ] +2h_{1}\left [ 4\right ] +h_{1}\left [ 3\right ] =4\). But \(h_{1}\left [ 4\right ] =1,h_{1}\left [ 3\right ] =2\) found above. Hence \(h_{1}\left [ 5\right ] +2\left ( 1\right ) +2=4\) or \(h_{1}\left [ 5\right ] =0\)
And since the output is zero for \(n>5\) then \(h_{1}\left [ n\right ] =0\) for all \(n>5\). Therefore
\[ h_{1}\left [ n\right ] =\delta \left [ n\right ] +3\delta \left [ n-1\right ] +3\delta \left [ n-2\right ] +2\delta \left [ n-3\right ] +\delta \left [ n-4\right ] \]
When the input is \(x\left [ n\right ] =\delta \left [ n\right ] -\delta \left [ n-1\right ] \) then response is given by \(y\left [ n\right ] =\sum _{k=-\infty }^{\infty }x\left [ k\right ] h\left [ n-k\right ] \) where \(h\left [ n\right ] \) is the impulse response given in the problem P2.24 diagram. Hence we need to convolve the following two signals
By folding \(x\left [ n\right ] \) and then shift it one step at a time, we see that we obtain the following
\(n=0\) \(\left ( 1\right ) \left ( 1\right ) =1\)
\(n=1\) \(\left ( -1\right ) \left ( 1\right ) +\left ( 1\right ) \left ( 5\right ) =4\)
\(n=2\) \(\left ( -1\right ) \left ( 5\right ) +\left ( 1\right ) \left ( 10\right ) =5\)
\(n=3\) \(\left ( -1\right ) \left ( 10\right ) +\left ( 1\right ) \left ( 11\right ) =1\)
\(n=4\) \(\left ( -1\right ) \left ( 11\right ) +\left ( 1\right ) \left ( 8\right ) =-3\)
\(n=5\) \(\left ( -1\right ) \left ( 8\right ) +\left ( 1\right ) \left ( 4\right ) =-4\)
\(n=6\) \(\left ( -1\right ) \left ( 4\right ) +\left ( 1\right ) \left ( 1\right ) =-3\)
\(n=7\) \(\left ( -1\right ) \left ( 1\right ) +\left ( 1\right ) \left ( 0\right ) =-1\)
\(n=8\) \(\left ( -1\right ) \left ( 0\right ) +\left ( 1\right ) \left ( 0\right ) =0\)
And zero for all \(n>7\). This is plot of \(y\left [ n\right ] \)
Solution
Substituting \(y_{h}\left [ n\right ] =A\left ( \frac{1}{2}\right ) ^{n}\) into the difference equation \(y_{h}\left [ n\right ] -\frac{1}{2}y_{h}\left [ n-1\right ] =0\) gives\[ A\left ( \frac{1}{2}\right ) ^{n}-\frac{1}{2}A\left ( \frac{1}{2}\right ) ^{n-1}=0 \] Since \(A\neq 0\), the above simplifies to\begin{align*} \frac{1}{2^{n}}-\frac{1}{2}\left ( \frac{1}{2^{n-1}}\right ) & =0\\ \frac{1}{2^{n}}-\frac{1}{2^{n}} & =0\\ 0 & =0 \end{align*}
Verified OK.
Substituting \(y_{p}\left [ n\right ] =B\left ( \frac{1}{3^{n}}\right ) \) into \(y_{p}\left [ n\right ] -\frac{1}{2}y_{p}\left [ n-1\right ] =\frac{1}{3^{n}}u\left [ n\right ] \) gives\begin{align*} B\left ( \frac{1}{3^{n}}\right ) -\frac{1}{2}B\left ( \frac{1}{3^{n-1}}\right ) & =\frac{1}{3^{n}}u\left [ n\right ] \\ B\left ( \frac{1}{3^{n}}-\frac{1}{2}\frac{1}{3^{n-1}}\right ) & =\frac{1}{3^{n}}u\left [ n\right ] \\ B\left ( \frac{1}{3^{n}}\left ( 1-\frac{1}{2}\frac{1}{3^{-1}}\right ) \right ) & =\frac{1}{3^{n}}u\left [ n\right ] \\ B\left ( \frac{1}{3^{n}}\left ( 1-\frac{3}{2}\right ) \right ) & =\frac{1}{3^{n}}u\left [ n\right ] \\ B\left ( \frac{1}{3^{n}}\left ( \frac{-1}{2}\right ) \right ) & =\frac{1}{3^{n}}u\left [ n\right ] \\ \frac{-1}{2}B & =u\left [ n\right ] \\ B & =-2u\left [ n\right ] \end{align*}
Hence for \(n\geq 0\)\[ B=-2 \] Therefore \[ y_{p}\left [ n\right ] =-2\left ( \frac{1}{3^{n}}\right ) \]
The solution is given by the sum of the homogenous and particular solutions. Hence\begin{align} y\left [ n\right ] & =y_{h}\left [ n\right ] +y_{p}\left [ n\right ] \nonumber \\ & =A\left ( \frac{1}{2}\right ) ^{n}-2\left ( \frac{1}{3^{n}}\right ) \tag{1} \end{align}
Since system initially at rest, then \(y\left [ -1\right ] =0\). The recurrence equation is given as\[ y\left [ n\right ] -\frac{1}{2}y\left [ n-1\right ] =x\left [ n\right ] \] Substituting (1) into the above and using \(x\left [ n\right ] =\frac{1}{3^{n}}u\left [ n\right ] \) gives\[ y\left [ n\right ] -\frac{1}{2}y\left [ n-1\right ] =\frac{1}{3^{n}}u\left [ n\right ] \] At \(n=0\) the above becomes\[ y\left [ 0\right ] -\frac{1}{2}y\left [ -1\right ] =1 \] But \(y\left [ -1\right ] =0\) and \(y\left [ 0\right ] =\left ( A\left ( \frac{1}{2}\right ) ^{n}-2\left ( \frac{1}{3^{n}}\right ) \right ) _{n=0}=A-2\). Hence \(A-2=1\) or \[ A=3 \] Therefore the solution (1) becomes\[ y\left [ n\right ] =3\left ( \frac{1}{2}\right ) ^{n}-2\left ( \frac{1}{3^{n}}\right ) \]
Suppose the signal \(x\left ( t\right ) =u\left ( t+\frac{1}{2}\right ) -u\left ( t-\frac{1}{2}\right ) \) is convolved with the signal \(h\left ( t\right ) =e^{j\omega _{0}t}\). (a) Determine the value of \(\omega _{0}\) which insures that \(y\left ( 0\right ) =0\). Where \(y\left ( t\right ) =x\left ( t\right ) \circledast h\left ( t\right ) \). (b) Is your answer to previous part unique?
Solution
\[ x\left ( t\right ) \circledast h\left ( t\right ) =\int _{-\infty }^{\infty }x\left ( \tau \right ) h\left ( t-\tau \right ) d\tau \] Since \(x\left ( t\right ) \) is box function from \(t=-\frac{1}{2}\) to \(t=\frac{1}{2}\)
Then by folding \(h\left ( t\right ) \) and shifting it over \(x\left ( t\right ) \) it is clear that only the region between \(\tau =-\frac{1}{2}\) to \(\tau =\frac{1}{2}\) will contribute to the integral above since \(x\left ( \tau \right ) \) is zero everywhere else. Hence the integral simplifies to\begin{align*} y\left ( t\right ) & =x\left ( t\right ) \circledast h\left ( t\right ) \\ & =\int _{\frac{-1}{2}}^{\frac{1}{2}}h\left ( t-\tau \right ) d\tau \\ & =\int _{\frac{-1}{2}}^{\frac{1}{2}}e^{j\omega _{0}\left ( t-\tau \right ) }d\tau \\ & =e^{j\omega _{0}t}\int _{\frac{-1}{2}}^{\frac{1}{2}}e^{-j\omega _{0}\tau }d\tau \\ & =e^{j\omega _{0}t}\left [ \frac{e^{-j\omega _{0}\tau }}{-j\omega _{0}}\right ] _{-\frac{1}{2}}^{\frac{1}{2}}\\ & =e^{j\omega _{0}t}\left ( \frac{e^{-\frac{1}{2}j\omega _{0}}-e^{\frac{1}{2}j\omega _{0}}}{-j\omega _{0}}\right ) \\ & =e^{j\omega _{0}t}\left ( \frac{e^{\frac{1}{2}j\omega _{0}}-e^{-\frac{1}{2}j\omega _{0}}}{j\omega _{0}}\right ) \\ & =2\frac{e^{j\omega _{0}t}}{\omega _{0}}\left ( \frac{e^{\frac{1}{2}j\omega _{0}}-e^{-\frac{1}{2}j\omega _{0}}}{2j}\right ) \end{align*}
But \(\frac{e^{\frac{1}{2}j\omega _{0}}-e^{-\frac{1}{2}j\omega _{0}}}{2j}=\sin \left ( \frac{\omega _{0}}{2}\right ) \) using Euler relation. Hence the above becomes\[ y\left ( t\right ) =2\frac{e^{j\omega _{0}t}}{\omega _{0}}\sin \left ( \frac{\omega _{0}}{2}\right ) \] When \(t=0\) we are told \(y\left ( 0\right ) =0\). The above becomes\[ 0=\frac{2}{\omega _{0}}\sin \left ( \frac{\omega _{0}}{2}\right ) \] A value of \(\omega _{0}\) which will satisfy the above is \(\omega _{0}=2\pi \)
The value \(\omega _{0}\) found in part (a) is not unique, since any nonzero integer multiple of \(2\pi \) will also satisfy \(y\left ( 0\right ) =0\)