forum.alglib.net

ALGLIB forum
 It is currently Mon May 29, 2023 10:04 pm

 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.

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Complex FittingPosted: Tue May 17, 2016 1:08 pm

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

 Post subject: Re: Complex FittingPosted: Wed May 18, 2016 10:26 am

Joined: Fri May 07, 2010 7:06 am
Posts: 885
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

 Post subject: Re: Complex FittingPosted: Thu May 19, 2016 2:23 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

Who is online

Users browsing this forum: No registered users and 10 guests

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

Search for: