Tuesday, 22 July 2014

Butterworth IIR Filter

Whew! That's the groundwork in place, we're now able to move onto something a bit more interesting and hopefully get back into code at some point too.

In the previous example we looked at the general normalised second order low-pass filter function:

$$ H(s) = \frac {1}{s^2 + \frac {s}{Q} + 1} $$

When \( Q = \frac {1}{\sqrt 2} \)  this is known as the Butterworth function and gives a magnitude of \(\frac {1}{\sqrt 2}\) at the passband frequency (in the normalised function where \( \omega = 1 \) ). i.e.

$$ |H(\omega)|^2 = \frac {1}{(\omega^4+(\frac {1}{Q^2}-2)\omega^2+1)} $$
$$ |H(j\omega)|_{\omega=1}^2 = \frac {1}{1^4 + (\sqrt 2^2 - 2)1^2 + 1}= \frac {1}{\sqrt 2} $$

The magnitude response for an analogue low-pass filter can be generalised into function of \(\frac{n}{2}\) of terms of \(\omega\) in the denominator where the Q term in the 2nd order case has been brought into a general purpose coefficient \(D_n\).

$$ |H(j\omega)|^2 = \frac {1}{D_{2n}\omega^n+...+D_2\omega^2+1} $$

Note that as this is a squared function it only contains even terms, which can be written:

$$ |H(j\omega)|^2 = \frac {1}{1+D_{2n}\omega^{2n}} $$

Graphing this function shows the Butterworth response giving the maximally flat magnitude response in the passband:



This clearly shows for the prototype filter, when the passband frequency is normalised \(\frac {\omega}{\omega_p}=1\) that the magnitude response is \( |H(j\omega)|^2 = \frac {1}{2} \).



Translating this back from \(j\omega \rightarrow s \) domains gives the following transfer function:

$$ \frac {1}{1+D_{2n}\omega^{2n}}|_{\omega \rightarrow s} \rightarrow H(s)H(-s) = \frac {1}{1+(-1)^ns^{2n}} $$

Giving 2n roots (poles) of the denominator:

$$ 1+(-1)^ns^{2n}=0 $$

$$ s^{2n} = \begin{cases}
1=e^{j2k\pi} & \text{n odd} \\
-1=e^{j(2k+1)\pi} & \text{n even} \\
\end{cases} $$

Which gives us 2n poles:

$$ s_k = e^{j[\frac {(2k+n-1)}{2n}]\pi} \qquad \text{   k=1,2,....,(2n)}$$

Each of the poles have unitary magnitude and are spread evenly around the left side of the s-plane. In all cases (except n=1) there are a set of matched conjugate pairs and in odd orders an additional pole at \(s=-j\omega\).

The poles have the following polar angle and are positioned as follows on the s-plane where the circle has unitary magnitude:
















The denominator polynomial for the transfer function can then be described as:

$$ H(s) = \frac {1}{D_{B}(s)} \qquad  \text{where} \qquad D_{B}(s)=\prod^n_{k=1}(s-s_k) = 1+d_1s+d_2s^2+...+d_ns^n$$

Where \(D_B(s)\) is the Butterworth polynomial which can be expressed as a set of roots (\(s_k\)) or expanded form which can be found in many places and has the following values expressed in factored or non-factored form.



The factored forms show sets of quadratics each representing the complex-conjugate pairs. The polynomial terms can be calculated by:

$$ d_k = \frac { cos \left( (k-1) \frac {\pi}{2} \right)}{sin \left( \frac {k\pi}{2n} \right)}d_{k-1} \qquad \text {k=1,2,3...,n} $$

So, with these numbers we just need to apply the s-plane to z-plane mapping, using the Bilinear Transform as described before to calculate the appropriate filter. Well, we didn't quite get to code tonight. Let's see how tomorrow evening goes.


No comments:

Post a Comment