这是一篇关于绘制该文件的数据流程图的作业代写

 

 

𝐻(𝑧) =1 − 𝑧 −1/(1 − 𝑟𝑒 𝑗𝜔0𝑧 −1)(1 − 𝑟𝑒 −𝑗𝜔0𝑧 −1)

  1. Draw a data flow diagram of the filter.
  2. Sketch the frequency response of the filter for a low value of r << 1 and a

value of r just below 1.

  1. Somebody sets ⍵0 = 0, r = 1 and executes a unit test with the input

sequence x(n) = [5, 3, -2]. Calculate the filter output by hand.

Questions 4 and 5 are optional and are thought provoking questions for

further study.

  1. class IIR2_filter:

“““2nd order IIR filter”””

def __init__(self, s):

“““Instantiates a 2nd order IIR filter

s – numerator and denominator coefficients

”””

self.s = s

def filter(self, v)

“““Sample by sample filtering

v – scalar sample

returns filtered sample

”””

input = v – (self.s[4] * self.buffer1) – (self.s[5] * self.buffer2)

output = (self.s[1] * self.buffer1) + (self.s[2] * self.buffer2) + input

* self.s[0]

self.buffer2 = self.buffer1

self.buffer1 = input

return output

Explain how to use the unit test above for this 2nd order filter and check

if the code is correct.

𝐻(𝑧) =

1 − 𝑧 −1

(1 − 𝑟𝑒 𝑗𝜔0𝑧 −1)(1 − 𝑟𝑒 −𝑗𝜔0𝑧 −1)5. Why is the above unit test with its parameter choices not a good test

case?