tags:

views:

41

answers:

3

I have a set of data points:

(x1, y1) (x2, y2) (x3, y3) ... (xn, yn)

The number of sample points can be thousands. I want to represent the same curve as accurately as possible with minimal (lets suppose 30) set of points. I want to capture as many inflection points as possible. However, I have a hard limit on the number of allowed points to represent the data.

What is the best algorithm to achieve the same? Is there any free software library that can help?

PS: I have tried to implement relative slope difference based point elimination, but this does not always result in the best possible data representation.

Thanks for your time.

-Gowtham

A: 

it depends on must your curve intersect each point or it is approximation. Try:

  1. Take points
  2. Apply any interpolation (http://en.wikipedia.org/wiki/Polynomial_interpolation) to get equation of curve
  3. Then take sample points with specific step.
Andrey
The problem with this approach is, it will capture points with a fixed step, without regard to the variation in the data. It might so happen that there is no change in the `yn` data, but yet this method will capture points there.
Gowtham
Newton interpolation captures ANY points. After you have equation of interpolated curve you can get ANY points from it.
Andrey
A: 

Look at ZunZun, an on-line tool.

Doug Currie
+1  A: 

You are searching for an interpolation algorithm. Is your set of points a function in a mathematical sense (all x values are disjunct from each other) then you can go for a polynomial interpolation, or are they distributed over the 2d plane, then you could use bezier curves.

Philip Daubmeier