Q1. IIR fifilter
1−2 cos(ω0)z −1 +z −2
/1−2r cos(ω0)z−1 +r 2z−2
(a) Draw a data flflow diagram of the fifilter. 
(b) Sketch the frequency response for a low value of r and a high value of r. 
(c) The high level python commands you used in the lab create the bandstop response by combining a high- and a low-pass. Provide one advantage of this approach and one disadvantage against the fifilter above, taking into account real world inaccuracies.
Q2. FIR fifilter design in the frequency domain
(a) Sketch the frequency response of an ideal highpass fifilter. 
(b) Perform an inverse Fourier transform of a ideal highpass amplitude response to obtain the impulse response of the fifilter. 
(c) Explain which minimal additional steps need to be untertaken after having obtained the impulse response in Q2b) with the help of an IDFT so that it can be implemented as an linear phase FIR fifilter. 
(d) Explain how the inverse Discrete Fourier Transform (IDFT) can be used to obtain the impulse response in contrast to Q2b) and which minimal design steps are required here. What is different compared to the analytical approach of Q2b)? 
Q3. Practical FIR fifiltering
(a) An ECG has an unwanted slowly changing drift which must be eliminated by means of a fifilter. State the type of fifilter which should be applied (lowpass, highpass, bandstop or bandpass). 
(b) Considering the heart rate of a healthy person, what is the cut-off frequency of the fifilter from Q3a:
In both cases provide an explanation.
(c) State how many taps for an FIR implementation of Q3(b)ii are required at a sampling rate of 250Hz. 
(d) In the lab you have implemented the FIR fifilter as class. Why is a class an ideal choice for an FIR fifilter? Explain which data structures need to be implemented within an FIR fifilter class and how they are processed to implement a realtime FIR fifilter. 
(a) In the assignment you detected the heart beat of an ECG with a matched fifilter. What kind of pre-processing digital fifiltering is highly benefificial for the detection process for both the template and the signal and why? 
(b) The output of the matched fifilter will contain the detected signal but also noise.
Which non-linear function can be applied which compresses the noise and amplififies the signal? 
(c) Even with improved signal to noise ratio the detection of the heartbeats with a threshold is never perfect with most certainly some heartbeats being missed or wrongly detected. What is the standard approach to correct or identify such errors as much as possible? 
(d) The matched fifilter in the assignment to detect the R peak was implemented as an FIR fifilters. Could such an R peak detctor also be implemented as an IIR fifilters and what would be the challenge here?