franko / gsl-shell

GSL library shell based on LuaJIT2
http://franko.github.io/gsl-shell/
GNU General Public License v3.0
93 stars 12 forks source link

linfit for complex #2

Closed sonoro1234 closed 11 years ago

sonoro1234 commented 12 years ago

I have written a routine for fiting rational functions. Now I am trying to do it with complex rational function (with real coefs for digital filter design as invfreqz in matlab) but I see that linfit works only with real matrix. What should be changed for making it work with complex matrixes?

Best Regards Victor Bombi

franko commented 12 years ago

Hi,

linfit does not directly support complex matrix just like the GSL library. The good news is that it is easy to manage by splitting the value in real and imaginary part and use the ordinary linfit functions. This means that if you have n complex valued observations you have to create a 2*n system to accommodate the real and imaginary part of each value. For the derivatives you have to use the same approach.

Please consider to subscribe the gsl shell mailing list for these kind of questions.

Best regards Francesco