Curve Fitting / Interpolation

I'm currently looking for a method to interpolate a set of data points. I've been looking through numerical methods libraries but it seems like most of the code is too large to fit onto the chip I'm using.

Currently using an Arduino Pro Board Mini which is telling me it has around 32kb of space.

Would I be better off exporting the data to a C++ program running on the computer? If so, any idea on where to begin doing this?

There is no reason that it NEEDS to be all accomplished on the chip, but I figured it would be worth trying to avoid the whole export from arduino into C++ mess?

Thanks!

What do the points represent? Why do you need to fit a curve through the points?

What do the points represent? Why do you need to fit a curve through the points?

The points represent pressure at a specific distance. There doesn’t really NEED to be a curve per say, just a function or way to approximate values at any point.

I need to be able to integrate though, which I’m guessing the easiest way would be to interpolate and use a numerical integration method.

google splines :)

Ok - after much searching I found this (in C#):

http://www.codeproject.com/KB/recipes/BezirCurves.aspx

Now - I don't have any clue if this will work, or if there is even enough RAM on the Arduino for it to work. Apparently, curve-fitting is a class of algorithms that takes up a lot of program space and RAM; none of it seemed "simple" to me. The above was the simplest I could find.

I still don't know, though, whether it is really that simple - because the above code calls a function "Bernstein()" - which isn't explained, and I could only find a few references to it (wikipedia, mainly) - the math is something I don't understand, unfortunately.

I hope this helps in some manner; otherwise, I think you are going to have to do this on a PC...

:-/

google splines

I came across a few spline interpolation techniques in my search; none seemed small enough to fit on an Arduino, though I could be wrong. Indeed, the above Bezier approximation seems to be the simplest I could find (aside from that strange "Berstein" function call)...

:)

I need to be able to integrate though, which I'm guessing the easiest way would be to interpolate and use a numerical integration method.

What will the integral be used for? If all you need to know is what the pressure would be at intermediate points, interpolation is all the is required, and that is very simple.

Maybe a simple linear interpolation would do?

Thanks for the responses guys, I'll check out that Bezier approximation!

What will the integral be used for? If all you need to know is what the pressure would be at intermediate points, interpolation is all the is required, and that is very simple.

The integrals will be used to calculate lift

Maybe a simple linear interpolation would do?

One of the problems with linear interpolation is that our end points for integration are OUTSIDE the first and last data points. Linear interpolation is pretty inaccurate when trying to approximate outside of the data points.

Though, most methods are as well!

I came across a few spline interpolation techniques in my search; none seemed small enough to fit on an Arduino, though I could be wrong. Indeed, the above Bezier approximation seems to be the simplest I could find (aside from that strange "Berstein" function call)...

Hmm.. That code / method looks like it would work well, but that Berstein thing is very weird. I couldn't find much searching around either.

How complicated is the process of exporting data into a running C++ program?