# How can I smoothly interpolate between 2 position?

I've got a 1D signal (position of a servo motor over time) and I've extracted 'peaks'/'key' positions picking running average "local extrema" points.

Below is are 2 plots from 2 servos and the white markers indicate key positions I'd like to interpolate between:

I've played with linear interpolation, but the motion looks robotic. I'd like to get a more natural/smoother motion and I imagine it's posible by using bezier interpolation between two key points. These two points would be the start and end point of the bezier I imagine, but I need to solve/find out the 'anchor' points as well. Since I have all the points I can get the velocities as well I imagine, but not sure how to plug them into the equation.

Any idea on how I can find the other two members of a bezier equation for easing/smooth interpolation ?

Also, since I'm new to this: is my approach ok ? Is there a simpler solution I'm missing ?

• Have you looked on spline interpolation? You need to specify only the known points and their distances. These "piece-wise" polynomials can be computed for any segment of your dataset (the border ones need to be treated differently) and smooth transition between any adjacent segments are guaranteed. Aug 29, 2012 at 10:18