A discrete time linear shift-invariant system has an impulse response h[n] with h[0] = 1, h[1] = -1, h[2] = 2, and zero otherwise. The system is given an input sequence x[n] with x[0] = x[2] = 1 and zero otherwise. The number of nonzero samples in the output sequence y[n], and the value of y[2] are, respectively

5, 2
6, 2
6, 1
5, 3

The correct answer is $\boxed{\text{(A) 5, 2}}$.

The output sequence $y[n]$ is given by the convolution of the input sequence $x[n]$ and the impulse response $h[n]$:

$$y[n] = \sum_{k=-\infty}^{\infty} x[k] h[n-k]$$

In this case, we have:

$$y[0] = x[0] h[0] + x[2] h[-2] = 1 \cdot 1 + 1 \cdot 2 = 3$$

$$y[1] = x[0] h[1] + x[2] h[-1] = 1 \cdot -1 + 1 \cdot 0 = -1$$

$$y[2] = x[0] h[2] + x[2] h[0] = 1 \cdot 2 + 1 \cdot 1 = 3$$

$$y[n] = 0 \text{ for } n \neq 0, 1, 2$$

Therefore, the number of nonzero samples in the output sequence is 5, and the value of $y[2]$ is 3.

Option (B) is incorrect because the number of nonzero samples in the output sequence is 5, not 6.

Option (C) is incorrect because the value of $y[2]$ is 3, not 1.

Option (D) is incorrect because the number of nonzero samples in the output sequence is 5, not 3.

Exit mobile version