Re: C for Polynomial Fit
- From: pnachtwey <pnachtwey@xxxxxxxxx>
- Date: Sat, 29 Dec 2007 08:52:10 -0800 (PST)
On Dec 28, 7:35 pm, Gary Pace <x...@xxxxxxx> wrote:
Howdy :
Does anybody know where I can find code for a C function to fit an
(N-1)th order polynomial to N (x,y) data points. Actually I need to fit
a 5th order polynomial to 11 x,y points.
I would try the least squares method first using a math package. It
should be easy to implement and test to see if it meets your needs.
If the least squares method doesn't work I would try the Levenberg-
Marquardt algorithm which can be use to fit both linear and non-linear
functions but it may be more work and it will take up more resources.
I can't imagine using either is an embedded application as they use a
lot of resources. If you know your data set is small and fixed as
you say then I would consider solving for the 6 coefficients
symbolically using a symbolic math software. That way you have just 6
big ugly equations that are as efficient as they can be for embedded
use. This way one avoid the matrix library or macros that take up a
lot of code.
Peter Nachtwey
.
- References:
- C for Polynomial Fit
- From: Gary Pace
- C for Polynomial Fit
- Prev by Date: Re: BIN-LADEN IS KILLED! (PHOTO)
- Next by Date: Re: 4_=; Look at my horny girlfriend! 4_=;
- Previous by thread: Re: C for Polynomial Fit
- Next by thread: Re: C for Polynomial Fit
- Index(es):
Relevant Pages
|