I've noticed a couple of similar questions which haven't been answered such as:


Anyway, I thought I would ask since it hasn't been answered. So as I understand the s-variable in the s-domain can be thought of as $j\omega $. I have a Bode plot so I have values of $$H(j\omega)=H(j\omega) \exp[j\arg(H(j\omega))]=\textsf{gain}\cdot\exp(j \cdot\textsf{phase})$$ (The graph I had was not a magnitude in terms of decibel but not gain) Now I tried to do a regression on it(actually probably technically not a regression from a statisticians' point of view by trying to minimise the least square error of a rational function $$(as^2+bs+c)/(ds^2+es+f)$$ and the values of $H(j\omega)$ that we have from the Bode plot. (Tried higher order rational function as well like of degree 10). And I get absolutely rubbish results for $a$,$b$,$c$,$d$,$e$,$f$ with Bode plots which look nothing alike. What am I doing wrong?

  • $\begingroup$ Just to understand what you did: you took the (linear!) gain, the phase in radians (!), and you formed a complex frequency response on a frequency grid, and then you tried to fit a rational function in $s$ with quadratic numerator and denominator, setting $s=j\omega$? $\endgroup$ – Matt L. Jul 10 '15 at 15:35
  • $\begingroup$ Yes,Matt. That's exactly what I did. (Sorry I asked the question and I had a previous stackexchange account but I don't think it registered with dsp.stackexchange for some reason as I am not too familiar with everything.) I used Python. I might try it with Matlab and see if that works. I used the scipy.optimize.minimize function to minimise the least square error of the rational function and the values of H(jw) I obtained from the plots getting different Bode plots so I thought it might be something to do with the actual process rather than the implementation. $\endgroup$ – daruma Jul 10 '15 at 19:16
  • $\begingroup$ You could describe in more detail how you arrived at the result, because like this it's impossible to tell what went wrong. As far as I understand, the approach itself is OK. One problem could be the convergence of the optimization routine, because this is a non-linear problem which can get stuck in a local minimum. Do you use Matlab? $\endgroup$ – Matt L. Jul 11 '15 at 9:51
  • $\begingroup$ Usually with a transfer function you would be able to guess the values of the zeros and poles by looking at it, these can be used to fit $\frac{a(s-z_1)(s-z_2)\dots}{(s-p_1)(s-p_2)\dots}$. Also note that I removed one gain of the highest power, since this is not fully defined. It would also be better to split up the popes and zeros into real and complex parts and probably these will come in complex conjugate pairs. $\endgroup$ – fibonatic Jul 13 '15 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.