3
votes

I am trying to find a transfer function from frequency response data using invfreqs in octave. In principle it works, the problem is that the resulting transfer function is always fitting the highest frequencies, low frequencies are badly matched.

Trying to weight the fit-errors versus frequency doesn't work. Am I doing something wrong?

Hg = 10.^(mg/20).*exp(i*pg*pi/180);
wt(fgrps>1500) = 0;
m = 44;
n = 52;
[Bg,Ag] = invfreqs(Hg,fgrps,m,n,wt);

This is the result I get:

enter image description here

The result is more or less the same for different orders of the numerator and denominator polynomials. High frequencies are matched good, low frequencies are matched bad.

What can I do about this?

Thank you very much in advance!

Kind regards Stefan

1
Have you tried restricting your frequency vector to the lower frequencies (e.g. less than 1,500 Hz) for the fitting and then checking how well it fares over the whole frequency spectrum?am304

1 Answers

0
votes

My first bet is that since frequency domain (for convenience) is most often (and from your plot also for you) shown in logarithmic scaling. Thus, if you fit, the function isn't fit like you'd "imagine", but rather scaled and then fit. On a logarithmic scale higher values are represented more often -> your fit is better there.

So what you should do is: find out what scaling is applied, and try a linear frequency scaling. Bear in mind, that this is also not a "good" idea. So try to find a frequency vector, for which you need to be close and fit with that.