forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 8:58 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Complex Fitting
PostPosted: Tue May 17, 2016 1:08 pm 
Offline

Joined: Tue May 17, 2016 12:32 pm
Posts: 2
Hello,
I am using the alglib in Python. My task is, to identify the parameters of a transfer function from frequency response measurement. By the frequency response measurement I get a complex vector (real and imaginary part) and a frequency vector. Is it possible to find a complex transfer function that fits the measured data (Complex curve fitting)?

I already tried to fit a transfer function to the amplitude frequency response. It worked well with the non linear least square solver. (I edited the example "lsfit_d_nlf example" ). But now I want to do a complex fitting.

Does anyone have a solution for my problem? I am very grateful for any help.


Best regards
Markus


Top
 Profile  
 
 Post subject: Re: Complex Fitting
PostPosted: Wed May 18, 2016 10:26 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
ALGLIB does not support complex fitting directly, but you may implement it indirectly using ALGLIB optimizers. Complex value, after all, is just a pair of real values (x,y), so you may replace N-dimensional complex problem by equivalent 2N-dimensional real valued one.

Mathematics of the target function shows similar two-fold increase in size. During fitting you multiply complex residuals by their conjugates, so in original formulation you have a term like residual_i*conj(residual_i). In the real-valued formulation, you have equivalent residual_i_x*residual_i_x + residual_i_y*residual_i_y. So, in original formulation you had M squared summands, now you have 2M squared summands.

I recommend you to use minlm subpackage, because it is flexible enough for the task you want to solve. lsfit is explicitly tied to real valued fitting and can not be used for tasks like this.


Top
 Profile  
 
 Post subject: Re: Complex Fitting
PostPosted: Thu May 19, 2016 2:23 pm 
Offline

Joined: Tue May 17, 2016 12:32 pm
Posts: 2
Hey Sergey,
I had check how the minlm subpackage work. But after getting familiar with it, I was able to solve the task.
Thanks a lot for your help.

Best Regards
Markus


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 57 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group