5
$\begingroup$

It is widely known that matching a FIR filter of fixed length to a band model is an unconstrained QP-problem. The MATLAB function firls() implements a solution to this problem. Basically, one symbolically evaluates integrals of the (Z-domain) transfer function over the unit circle, getting astonishingly simple expressions for the match quality. Additionally, that method is stable and will not fail, other than the Parks McClellan Filter Design Algorithm.

Is it possible to fit IIR filters to such a model in the $ {L}_{2} $ Norm Sense?
Several problems arise:

  1. While the cost function (fit quality?) can be written down, is it not a simple quadratic anymore, but a fraction of two quadractics.
  2. You appear to have to optimize nominator and denominator at the same time.
  3. It might be hard to constrain the denominator to "minimum phase", so that the resulting filter is stable.

I am not looking for gradient descent or other local optimization methods, as the cost function might have several local optima. An idea that crossed my mind would be that it appears possible to pose the FIR problem so that it yields the optimal coefficients for an IIR all-pass.

$\endgroup$
1

1 Answer 1

9
$\begingroup$

As you have already pointed out in your question, it is not possible (without using optimization methods) to compute an exact L2 solution for the frequency domain design problem of IIR filters due to the non-linear relationship between the filter coefficients and the error function. There is, however, a method which can come close and which transforms the problem to a linear one: the Equation Error Method. Instead of defining the error measure as

$$E_0=\sum_k\left |H_k -\frac{B_k}{A_k}\right|^2\tag{1}$$

(where $k$ is the frequency index, $H_k$ is the complex desired frequency response at frequency $\omega_k$, and $B_k$ and $A_k$ are the numerator and denominator polynomials, respectively, also evaluated at the frequency point with index $k$), one defines an error measure

$$E_1=\sum_k\left |H_kA_k -B_k\right|^2\tag{2}$$

Minimizing $E_1$ is a linear problem in the filter coefficients. You get an overdetermined system of linear equations which can be solved (in the $l_2$ sense) by solving a set of linear equations. (Of course, the number of frequency points must be greater than the number of filter coefficients). The result of minimizing (2) is identical to solving a weighted $l_2$ problem with weight function $|A_k|^2$:

$$E_1=\sum_kW_k\left|H_k -\frac{B_k}{A_k}\right|^2\quad\textrm{with}\quad W_k=|A_k|^2$$

There are two (related) problems with this method:

  1. The specification must not only include the desired magnitude response but also the desired phase. If the phase specification is chosen in a way that does not fit the chosen filter order and the general properties of IIR filters, the approximation error will be large, and the filter might be unstable (which brings us to the next point).

  2. Stability is not considered in the design process. Depending on the specification, the best approximation could either be stable or unstable.

Of course, poles outside the unit circle can be reflected inside the unit circle without affecting the designed magnitude response, but the approximation error might still be large, because an unstable filter indicates that the specification is not well suited to the chosen filter order. So it takes quite some experience to choose an appropriate desired phase response.

An in-depth explanation of the equation error method can be found in the book Digital Filter Design by Parks and Burrus. You can find a good overview in Julius O. Smith III - Introduction to Digital Filters - With Audio Applications - Equation Error Formulation.

$\endgroup$
5
  • $\begingroup$ Matt - In the link to Julius' page he uses the Hermitian conjugate ($\hat{A}_k$) but you don't show that here. I thought I understood the reason it needed to be Hermitian conjugate but now I am no longer confident: My thought was this is important because then your error equation is based on the phase response of the IIR (and magnitude of the FIR) while with what you show it would be the error from the FIR component ($B_k$) only. (The FIR $H_k\hat{A}_k$ has the same phase response as the IIR $H_k$ with an additional delay). $\endgroup$ Commented Sep 10 at 12:19
  • $\begingroup$ (you also use $A^*(j\omega)$ in your blog post on it: mattsdsp.blogspot.com/2022/10/… ) $\endgroup$ Commented Sep 10 at 12:27
  • $\begingroup$ @DanBoschen: I believe that's a misunderstanding. I don't think that the hat means complex conjugate. And in my blog post, there's just a complex conjugate because for allpass filters the numerator can be written in terms of the complex conjugate of the denominator. For general IIR filter you could simply replace the numerator by some polynomial $B(e^{j\omega})$ without complex conjugation. $\endgroup$
    – Matt L.
    Commented Sep 10 at 16:51
  • $\begingroup$ He defines it on this page as the Hermitian Conjugate (and specifically the “Reverse Filter”): ccrma.stanford.edu/~jos/filters06/…. But if it wasn’t that then your error ends up being the difference of just the numerator alone while if you do the Hermitian conjugate it still includes the phase effect of the denominator —- that’s what got me curious. $\endgroup$ Commented Sep 10 at 22:25
  • $\begingroup$ Matt - I think I understand now, thanks for your patience with me. I think he uses the hat notation to denote "the estimate of" while what is actually shown as a reverse filter (and Hermitian conjugate) has a tilde over the variable - so looked similar to me. Some notation showing that it is "the estimate of" makes sense to what you are explaining here, in what the error represents (vs a perfect cancellation as I was incorrectly interpreting). $\endgroup$ Commented Sep 11 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.