Sub-sampling the minimum number of points to accurately reproduce a curve

mgranatosky

New member
Joined
Feb 16, 2018
Messages
6
Hello,
Currently some students of mine are working on a bioinspired robot. We are using poistion data collected directly from a moving animal and putting those values onto servo motors. Recently, we have come across a bit of an over-sampling issue that is casuing some computational issues.
Anyway, when I collect data from an animal I can get kinematic movements of position versus time. For this question, let's assume 100 data points. (Sorry about the sideways orientation of the photos).

5.jpg


Together these 100 data points can be graphed as a continuous curve

7.jpg



Now my problem is that if I make our robot hit all 100 data points the movement is highly accurate, but causes the servo motors to be very jerky and a lot of computational power. So my hope is to downsample/ subsample the number of points I have, but still retain the shape of that curve. For example:

6.jpg


If I reduce the data down to two points I get an abysmal representation of the original curve. What about 3 points?

3.jpg

Still not great...

However, by the time I hit 9 points, we're doing pretty good.
1.jpg


Essentially, I'd like some advice on 1) what this form of downsampling/ subsampling is even called; and 2) any ideas that can help me maximize accuracy while limiting data.

4.jpg


Any advice is greatly appreciated.
 
Limit the Scope. If you know a basic movement, you may be better off estimating the parameters of a known function.

Consider splines of order greater than one.

There are many other ways to proceed.
 
Limit the Scope. If you know a basic movement, you may be better off estimating the parameters of a known function.

Consider splines of order greater than one.

There are many other ways to proceed.

Thanks, but wouldn't a spline just give me a line/equation not the XY coordinates?
 
This is called systematic sampling.
Some other tech guys have had this problem, with different ways of taking the sample, such as taking a constant, e.g. 5, and selecting every 5th part of data.
This looks like an awesome piece of work. Keep it up.
 
Thanks, but wouldn't a spline just give me a line/equation not the XY coordinates?
Your drawings show that you are using linear splines. Why would a cubic spline provide a different kind of information?

The trick, here, is capturing the interesting parts of the curves. The easiest way to do that is to know beforehand where the interesting parts are. Without that information, you have a more difficult task.

Personally, I worked on an assignment with 3D telemetry. My task was to find the Center of Rotation and the Radius of Rotation of human limbs, with the hope that we could save tiny cancer patients from myriad xrays. This is particularly tricky on a human, because skin isn't rigid. I discovered quickly that close data points (close in time) were not very helpful. That was before I realized I had a "loose skin" problem. In my case, the winning simplification was realizing that I HAD to have a sphere (or at least part of one). In this way, I didn't have to figure out the exact path; I just needed the parameters of the sphere that I had assumed. After that, I sampled data at various times separated from one another; hoping to minimize error with progressively improved estimates. Funny thing was, the best estimates usually came from RANDOM samples, rather than regularly spaced samples. I think I solved the loose skin problem, but that research has yet to be reviewed, challenged, or published.

Your task is to figure out what works best for your data and your purpose. Try stuff. Try anything. See how it comes out.
 
Last edited:
I second tkhunny's suggestion to try splines. In particular, cubic splines. For example, your graphics above look like they could be modeled with a single cubic spline. That would require knowing the two end points and two more control points. I don't know anything about robotics and servos, but I guess I'm assuming that if you actually had the parametric equation(s) of the curve, you could make your robot track it smoothly. Is that an accurate assumption?
 
Top