11.4. Exercises#

Exercise 11.1

Consider the following IIR system:

\[y[n] = \frac{1}{2} \left(x[n] - x[n-2]\right) + y[n-1]\]
  1. What is the order of this system?

  2. Put this system into the standard form of (11.2). What are \(b\) and \(a\) for this system?

  3. What is its impulse response?

Exercise 11.2

Use scipy.signal.butter to construct a high-pass filter at (and \(f_s=44100\)) with the following properties:

  • \(f_c = 500\)

  • a transition width of 250 Hz,

  • at most 1 dB of pass-band loss, and

  • stop-band attenuation of 60 dB.

What is the order of the resulting filter?

Exercise 11.3

You are asked to implement a low-pass filter at \(f_s=44100\) with the following specification:

  • Cut-off frequency \(f_c = 1000\) Hz

  • No more than 1.5 dB of ripple in the pass-band (less is acceptable)

  • At least 80 dB of attenuation in the stop-band (more is acceptable)

  • A transition band of no more than 500 Hz (less is acceptable)

  1. Which of the IIR filter(s) covered in this chapter could you use to implement a filter with these constraints?

  2. Using the helper functions provided by scipy (e.g., scipy.signal.ellipord), determine the order of the filter. If there are multiple filter types that will work, which one gives the smallest order?

  3. Use the Parks-McClellan method to implement an FIR filter with the given constraints. What order does the filter need to be to satisfy the constraints?

For this question, stick to single-pass (lfilter) filtering, and not bidirectional (filtfilt) filtering.

Hint

For part (c), the remez function does not allow explicit constraints on the attenuation. Try starting with a small order, measuring the frequency response, and then increasing the order until the constraints are satisfied.