Exploring Bandpass Transformation
Table Of Contents
In this article, we present a method for applying the bandpass transform to any second-order filter decomposition. This approach results in a new second-order filter decomposition with twice the initial order. It can effectively convert elliptic and Chebyshev filters into their bandpass versions or transform shelf filters into peaks.
Understanding the Bandpass Transform
The bandpass transform is defined as:
$$s \leftarrow Q\left(s+\frac{1}{s}\right)$$
By applying this transform to a biquad transfer function:
$$H(s) = \frac{b_0 s^2 + b_1 s + b_2}{a_0 s^2 + a_1 s + a_2}$$
we obtain the transformed transfert function:
$$H_{BP}(s) = \frac{b_{0}s^{4} + \frac{b_{1}}{Q}s^{3} + \left(2b_{0} + \frac{b_{2}}{Q^{2}}\right)s^{2} + \frac{b_{1}}{Q}s + b_{0}}{a_{0}s^{4} + \frac{a_{1}}{Q}s^{3} + \left(2a_{0} + \frac{a_{2}}{Q^{2}}\right)s^{2} + \frac{a_{1}}{Q}s + a_{0}}$$
To simplify this expression, we can rewrite it in the canonical form as follows:
$$H_{BP}(s) = \frac{b_{0}}{a_{0}} \left( \frac{s^{4} + \frac{b_{1}}{b_{0}Q}s^{3} + \left(2 + \frac{b_{2}}{b_{0}Q^{2}}\right)s^{2} + \frac{b_{1}}{b_{0}Q}s + 1}{s^{4} + \frac{a_{1}}{a_{0}Q}s^{3} + \left(2 + \frac{a_{2}}{a_{0}Q^{2}}\right)s^{2} + \frac{a_{1}}{a_{0}Q}s + 1} \right), \quad b_0 \neq 0, \ a_0 \neq 0$$
Our goal is to factor \(H_{BP}(s)\) into two second-order sections, expressed as:
$$H_{BP}(s) = H_1(s) H_2(s)$$
where both \(H_1(s)\) and \(H_2(s)\) have real coefficients. This requires solving the roots of the numerator and denominator polynomials of \(H_{BP}(s)\) and pairing any conjugate roots.
Solving the Fourth-Order Polynomials
The numerator and denominator polynomials of \(H_{BP}(s)\) can be represented in the form:
$$P(x) = x^4 + cx^3 + dx^2 + cx + 1$$
where \(c, d \in \mathbb{R}\).
The four roots \(r_k\) of \(P(x)\) are calculated as follows1:
$$r_1 = \frac{u + v_1 - c}{4} \quad r_2 = \frac{u - v_1 - c}{4}$$ $$r_3 = \frac{-u + v_2 - c}{4} \quad r_4 = \frac{-u - v_2 - c}{4}$$
with the variables defined as:
$$v_1 = \sqrt{2c^2 - 4d - 8 - cu}$$ $$v_2 = \sqrt{2c^2 - 4d - 8 + cu}$$ $$u = \sqrt{c^2 - 4d + 8}$$
Root Pairing
To factor the fourth-order polynomial into two second-order real polynomials, we need to pair conjugate roots when applicable. Pairing can be complex, as some pairs might swap during modulation, potentially causing unsolvable audio artifacts. Nevertheless, this issue is relatively minor compared to managing the numerical stability of a single fourth-order filter, which is more likely to propagate errors due to its long recursive structure.
The appropriate pairing of the roots \(r_1, r_2, r_3, r_4\) depends on the coefficients \(c\) and \(d\) of polynomial \(P(x)\):
-
If \(c^{2} - 4d + 8 \geq 0\):
- If \(2c^{2} - 4d - 8 - cu \geq 0\) and \(2c^{2} - 4d - 8 + cu \geq 0\), then both \(v_1\) and \(v_2\) are real, allowing flexible pairing.
- Otherwise (either \(v_1\) or \(v_2\) is purely imaginary), pair roots as \((r_1, r_2)\) and \((r_3, r_4)\).
-
If \(c^{2} - 4d + 8 < 0\):
- If \(c \neq 0\), then \(v_1 = \overline{v_2}\), leading to conjugate pairs \((r_1, r_3)\) and \((r_2, r_4)\).
- If \(c = 0\):
- If \(2c^{2} - 4d - 8 \geq 0\) (\(v_1\) and \(v_2\) are real), then pair conjugates \((r_1, r_3)\) and \((r_2, r_4)\).
- Otherwise (\(v_1\) or \(v_2\) is purely imaginary), pair conjugates \((r_1, r_4)\) and \((r_2, r_3)\).
Let \(r_A, r_B, r_C, r_D\) represent the reordered roots, grouped into pairs \((r_A, r_B)\) and \((r_C, r_D)\). With this arrangement, the polynomial \( P(x) \) can now be factored as:
$$P(x) = \left(x^{2} - (r_A + r_B)x + r_Ar_B\right)\left(x^{2} - (r_C + r_D)x + r_Cr_D\right)$$
Applying Factorization to \(H_{BP}\)
Now, we can apply the factorization obtained from \(P(x)\) to both the numerator and denominator of \(H_{BP}(s)\):
$$ \begin{aligned} H_{BP}(s)&=\frac{b_{0}}{a_{0}}\left(\frac{s^{2}-\left(z_{1}+z_{2}\right)s+z_{1}z_{2}}{s^{2}-\left(p_{1}+p_{2}\right)s+p_{1}p_{2}}\right)\left(\frac{s^{2}-\left(z_{3}+z_{4}\right)s+z_{3}z_{4}}{s^{2}-\left(p_{3}+p_{4}\right)s+p_{3}p_{4}}\right) \newline &=\left(\frac{b_{0}s^{2}-b_{0}\left(z_{1}+z_{2}\right)s+b_{0}z_{1}z_{2}}{a_{0}s^{2}-a_{0}\left(p_{1}+p_{2}\right)s+a_{0}p_{1}p_{2}}\right)\left(\frac{s^{2}-\left(z_{3}+z_{4}\right)s+z_{3}z_{4}}{s^{2}-\left(p_{3}+p_{4}\right)s+p_{3}p_{4}}\right) \end{aligned} $$
Special Cases
Case 1: \(b_0 = 0\) or \(a_0 = 0\)
When \(b_0 = 0\), the function simplifies to:
$$H_{BP}(s)=\frac{\left(b_{1}s^{2}+\frac{b_{2}}{Q}s+b_{1}\right)\frac{s}{Q}}{a_{0}s^{4}+\frac{a_{1}}{Q}s^{3}+\left(2a_{0}+\frac{a_{2}}{Q^{2}}\right)s^{2}+\frac{a_{1}}{Q}s+a_{0}}$$
In this case, the factorization of the numerator is already explicit. The same applies for the case \(a_0 = 0\).
Case 2: \(b_1 = b_2 = 0\) or \(a_1 = a_2 = 0\)
For instance, applying the bandpass transform to an analog high-pass filter where \(b_1 = b_2 = 0\) yields:
$$H_{BP}(s)=\frac{b_{0}\left(s^{2}+1\right)^{2}}{a_{0}s^{4}+\frac{a_{1}}{Q}s^{3}+\left(2a_{0}+\frac{a_{2}}{Q^{2}}\right)s^{2}+\frac{a_{1}}{Q}s+a_{0}}$$
Note that this case is already addressed by the root-solving method, however, using this formula provides a faster computation. The same applies for the case \(a_1 = a_2 = 0\).
Implementation
The code below demonstrates the application of the bandpass transform to several common filters.
|
|
-
The solution is given by Wolfram Alpha or by Jyrki Lahtonen ↩︎