9.11 Questions for the reader

9.11 Questions for the reader#

Exercise 48

Impulse response from a difference equation. A filter is defined by \(y[n] = \tfrac{1}{3}x[n] + x[n-2]\). Write down its impulse response \(h\), and state its length \(K\).

Reveal solution

\(h = [\tfrac{1}{3}, 0, 1]\), of length \(K = 3\).

Exercise 49

Difference equation from an impulse response. A filter has impulse response \(h = [1, 0, -1]\). Write down the difference equation for \(y[n]\). Is this filter FIR or IIR, and why?

Reveal solution

\(y[n] = x[n] - x[n-2]\). FIR, because it has no feedback (the output depends only on inputs).

Exercise 50

Signal-flow diagrams. Draw a signal-flow diagram (using \(z^{-1}\) delay blocks and a summing junction) for the filter \(y[n] = x[n] - \tfrac{1}{2}x[n-1] + \tfrac{1}{4}y[n-1]\). Label the feedforward and feedback paths, and state the filter’s order.

Exercise 51

Proving the properties of convolution. Starting from the summation definition \(\,(h * x)[n] = \sum_k h[k]\,x[n-k]\), prove that convolution is:

  1. commutative

  2. distributive over addition

For commutativity, the substitution \(m = n - k\) is helpful.

Exercise 52

Ordering a chain of convolutions. You must compute \(a * b * c\), where \(a\), \(b\), and \(c\) have lengths \(2\), \(10\), and \(1000\). Using the multiplication count \(KN\) for convolving a length-\(K\) filter with a length-\(N\) signal, compute the total cost of \((a * b) * c\) versus \(a * (b * c)\). Which ordering is cheaper?

Reveal solution

\((a * b) * c\) costs about \(11{,}020\) multiplications versus about \(12{,}018\) for \(a * (b * c)\), so \((a * b) * c\) is cheaper.

Exercise 53

Computing a convolution. A filter has impulse response \(h = [2, 1, 1]\) and is applied to the input \(x = [1, 2, 4, 2, 1]\) (every sample outside the listed ranges is \(0\)). Using \(y[n] = (h * x)[n] = \sum_k h[k]\,x[n-k]\), compute the full output sequence \(y\). How long is it, and why?

Reveal solution

\(y = [2, 5, 11, 10, 8, 3, 1]\), of length \(7\) (the input length plus the filter length, minus one).

Exercise 54

Stability. For the recursive filter \(y[n] = x[n] + a\,y[n-1]\), write out the first five samples of the impulse response in terms of \(a\). For which values of \(a\) does the impulse response decay to zero, and for which does it grow without bound?

Reveal solution

\(1,\ a,\ a^2,\ a^3,\ a^4\). It decays to zero when \(|a| < 1\) and grows without bound when \(|a| > 1\).

Exercise 55

Identifying a filter’s type. The two-tap averager \(y[n] = x[n] + x[n-1]\) has frequency response \(2\,|\cos(\pi f / f_s)|\). Evaluate the response at \(f = 0\) and at the Nyquist frequency \(f = f_s/2\). Based on these two values, is this a low-pass or a high-pass filter?

Reveal solution

The response is \(2\) at \(f = 0\) and \(0\) at the Nyquist frequency, so it is a low-pass filter.

Exercise 56

Classifying a filter. Consider the filter \(y[n] = x[n] + \tfrac{1}{2}x[n-1] + \tfrac{1}{2}y[n-1]\). For each of the following properties, state whether the filter has it and give a one-line justification:

  1. finite impulse response (FIR) or infinite impulse response (IIR)

  2. stable or unstable

  3. linear

  4. time-invariant

Reveal solution
  1. IIR (it has feedback)

  2. Stable (\(|\tfrac{1}{2}| < 1\))

  3. Linear

  4. Time-invariant