# Thread: Digital IIR filters

1. ## Digital IIR filters

I need to design a number of digital IIR filters based upon transfer functions given in the s-domain. I have applied the bilinear transform to give the transfer functions in the Z-domain, however I need to expand and simplify the equations to place them in the form below:

Once the equations are in the above form I can get the IIR filter coefficients and implement them into my filters, however I'm not quite sure how to go about it. Would anybody like to take a crack for me?

The three equations are as follows;

1.

2.

3.

An example is given below;

Any help would be very much appreciated!

2. Well it only involves expanding like this:$\displaystyle (1 \pm z^{-1})^2 = 1 + z^{-2} \pm 2z^{-1}$

Then you have to group coefficients with a common degree. I will work out the second one as an example:

Lets write $\displaystyle x = \frac{\omega_4 ^2}{\omega_3}, y = \frac{\omega_4}{Q_4}, w = \omega_4 ^2$ for ease of typing.

Now,

$\displaystyle H(z) = \dfrac{\dfrac{2x(1 - z^{-1}) + w (1 + z^{-1})}{1 + z^{-1}}}{\dfrac{4(1 - z^{-1})^2 + 2y(1 - z^{-1})(1 + z^{-1}) + w (1 + z^{-1})^2}{(1 + z^{-1})^2}}$

$\displaystyle H(z) = \dfrac{2x(1 - z^{-1})(1 + z^{-1}) + w (1 + z^{-1})^2}{4(1 - z^{-1})^2 + 2y(1 - z^{-1})(1 + z^{-1}) + w (1 + z^{-1})^2}$

$\displaystyle H(z) = \dfrac{2x(1 - z^{-2})+ w (1 + z^{-1})^2}{4(1 - z^{-1})^2 + 2y(1 - z^{-1})(1 + z^{-1}) + w (1 + z^{-1})^2}$

Now use $\displaystyle (1 \pm z^{-1})^2 = 1 + z^{-2} \pm 2z^{-1}$ to expand.

$\displaystyle H(z) = \dfrac{2x(1 - z^{-2})+ w(1 + z^{-2} + 2z^{-1})}{4(1 + z^{-2} - 2z^{-1}) + 2y(1 - z^{-2})+ w (1 + z^{-2} + 2z^{-1})}$

Group terms with common powers...

$\displaystyle H(z) = \dfrac{(w - 2x)z^{-2} + (2w)z^{-1} + (w + 2x)}{(4 - 2y + w) z^{-2} +(2w - 8)z^{-1} + (w + 2y +4)}$

Thus comparing it with your first image:

$\displaystyle b_2 = w - 2x, b_1 = 2w, b_0 = w + 2x, a_2 = w -2y + 4,a_1 = 2w - 8, a_0 = w + 2y +4$

So substitute back $\displaystyle x = \frac{\omega_4 ^2}{\omega_3}, y = \frac{\omega_4}{Q_4}, w = \omega_4 ^2$ and get the final answer...

3. Hi,

Thanks for that.

Things are a little clearer now, however I'm still a little bit unsure about what you did.
Is there any way you could break it down a little more?

Sorry, maths really isn't a strong point of mine (which is why I'm here).

Cheers!

4. Originally Posted by RyanW
Hi,

Thanks for that.

Things are a little clearer now, however I'm still a little bit unsure about what you did.
Is there any way you could break it down a little more?

Sorry, maths really isn't a strong point of mine (which is why I'm here).

Cheers!
Well I think I am not sure what is it that you do not understand. Tell me the step that you dont understand and I will explain...

5. To be honest, the only part which I really get is the substitution at the end.
The rest I can sort of follow when its written in front of me, however I'm not confident I could come up with the same answer by myself, and I really need to be sure of my answers to make sure the filters are doing exactly what I want.

6. Originally Posted by RyanW
To be honest, the only part which I really get is the substitution at the end.
The rest I can sort of follow when its written in front of me, however I'm not confident I could come up with the same answer by myself, and I really need to be sure of my answers to make sure the filters are doing exactly what I want.
Unless this is course/home work get a computer algebra system (Maxima is opensource and free) and use the rational simplification tools on these expressions.

RonL

7. Originally Posted by CaptainBlack
Unless this is course/home work get a computer algebra system (Maxima is opensource and free) and use the rational simplification tools on these expressions.

RonL
No its not course/home work, its work related, however obviously not something I do every day. I'll give Maxima a try and see how it goes.
Thanks for the tip!

8. Ok, I tried Maxima, and its just confused me further!
When I try and simlify it seems to give huge answers which don't really resemble what I need. Any tips?

9. Originally Posted by RyanW
Ok, I tried Maxima, and its just confused me further!
When I try and simlify it seems to give huge answers which don't really resemble what I need. Any tips?

The attachment is a Maxima session (you will need to divide top and bottom through by $\displaystyle z^2$ to finnish.

(the radscan function is accessible using the simplify (r) button, the ordinary simplify will also do the job)

RonL

10. Thanks for your help so far, however, I'm still not getting the correct answer when I input the example.