I need to model measurement data of a frequency response with physically meaningful band-pass filters. All Measurements happening in die range of 20Hz to 20000Hz
I have to work with python.
The Problem:
Imagine a rational transfer function as an undefined number of second order band-pass filters in parallel:
$$H(s) = \sum_{n=1}^{N}(\frac{b_{n1} s}{a_{n0} + a_{n1} s + a_{n2} s^{2}})\tag{1}$$
I'm looking for an algorithm that takes a frequency response measurement $f(s)$ to calculate all coefficients in (1) while finding the correct order of $f(s)$.
What I did so far:
Least-squares
$$H(s) = f(s)$$ or $$ \frac{\mbox{num}(H(s))}{\mbox{den}(H(s))} = f(s) $$ Solving $Ax = b$ with least squares.
As an example, for just one band-pass filters: $$A_k = [s_{k}b_1, -f(s_k)a_0 , -f(s_k) s_k a_1, -f(s_k) s_{k}^{2} a_2]$$
and
$$ b_k = f(s_k)$$
and
$$ x = [b1,a_0,a_1,a_2]$$
This is very useful for $ N<2 $ or order 4 of $ H(s) $ respectively. For higher orders, the fitting gets bad because of the high orders of $s$ being multiplied with $f(s)$
Same problem does exsit with the invfreqs() function know from matlab.
Vector Fitting
As shown in this paper by Bjørn Gustavsen, a rational function can be fitted to high accuracy with a model like:
$$H(s) = \sum_{n=1}^{N}(\frac{c_{n}}{(s-p_n)})\tag{2}$$
For resonant peaks in the measurement data, the poles $p_n$ will form complex conjugate pairs. The same is true for the corresponding residues $c_n$
As an exsample for oder 2, this leads to a second order system of the following form:
$$H(s) = \frac{b_0 + b_{1} s}{a_{0} + a_{1} s + a_{2} s^{2}}\tag{3}$$
As you can see, the extra coefficient $b_0$ allows the system to perform a low-pass behavior. In Fact, you can describe this filter as a low-pass and a band-pass in parallel, both share the same poles.
I cant ensure that the Vector Fitting converges on a set of band-pass filters. Especially on band-pass filters with positive gain at the resonance frequency (which is a must for physically meaningful filters)
As you can see in this plot of $|H(s)|$:
The blue curve has been generated by 4 band-pass filters in parallel and is used as input data. I split the results in it's band-pass (BP) and low-pass (LP) parts to show how the response is combined by all of these components. Note the negative gain of the purple band-pass filter and the cancellation of all low-pass filters in low frequencies.
$H(s)$ reassembles $f(s)$ perfectly, but not in a physically meaningful way
My Question:
Can anyone help me find a good working algorithm for my problem? Or do you spot possibilities to modify the Vector Fitting algorithm to work for my problem?
Thanks a LOT!