8.2.5. Lab week 5. Digital filters

8.2.5.1. Assignment 1

The order of a filter is often determined by the cut-off frequency and a required attenuation in dB at a certain frequency. Suppose we want to use a Butterworth filter with the following characteristic:

\[H(\omega) = \frac{G_0^2}{1 + (\frac{\omega}{\omega_c})^{2n}}\]

The cut-off frequency is 250 Hz and we want an attenunation of -30 dB at 500 Hz. What is the order of the filter? Give the result of your calculation in a pdf document. Show the amplitude respons of this filter and check if the calculated result is correct. You can use the scipy butter function for this, but note that this function uses a normalised frequency (like in the equation above). Take care that axis is correct and check the slope of the filter. What is the slope in dB/octave (remember that for a doubling of frequency the filter output falls with 6 dB for a first order filter)

8.2.5.2. Assignment 2

The scipy function is an IIR implementation. Create a FIR implementation with the same characteristics. Check how many “taps” you need (taps are the typical blocks containing the b parameters between z transform delays with adders). Create an amplitude response (take care of correct axis type etc and a pole-zero plot)

8.2.5.3. Assignment 3

One ‘problem’ of FIR filters is the window we normally used. The impulse response with using a rectangular window leads to overshoot and ripple in the frequency response which can problematic (it’s known as ‘Gibb’s phenomenom’): the overshoot in the amplitude response does not decrease if we start to use more taps. We therefore often use a different window: hamming is common, but there are more. Show the difference of the two windows in a plot.

8.2.5.4. Assignment 4

Create am IIR filter of the type Chebyshev “1” with again the same characteristics. Do you see the difference between the first and second implementations? Check the order of the filter you are using. Create again an amplitude and pole-zero plot.

8.2.5.5. Assignment 5

You have seen when you use the Chebyshev type of filter that this type of filter has a ripple on the amplitude response, but a typical characteristic is that this filter has a very steep slope for the attenuation. When this filter is used one normally wants to have some control on the ripple on the passband. Experiment with the scipy.signal.cheb1ord function which can be used to control the ripple with different orders using this filter characteristic.

8.2.5.6. Assignment 6

Analyze the behavior of the following filter:

\[y[n] = 1.85y[n-1] - 0.95y[n-2] + x[n] - 1.9x[n-1] + x[n-2]\]

See also Rein’s filter cookbook in ipython:

https://staff.fnwi.uva.nl/r.vandenboomgaard/SP20162017/Applications/Filters/index.html

8.2.5.7. Assignment 7

Do the same for this notch filter:

\[y[n] = 1.5y[n-1] - 0.85 y[n-2]+ x[n]\]