[sdiy] Bezier? B-Spline?

Scott Nordlund gsn10 at hotmail.com
Sat Mar 7 21:59:30 CET 2015


There are many different kinds of interpolation, each with its own tradeoffs. Linear interpolation is simple, but it's not smooth (the first derivative isn't continuous). Higher order interpolation needs to look at more than two points and usually has some overshoot. Simple lowpass filtering doesn't pass through all the points. You might want to try monotone cubic interpolation, as there's no overshoot (i.e. it's monotonic). 

I found a simple variation of linear interpolation that's monotonic and has a continuous first derivative. Use sinusoidal segments rather than linear. To interpolate between points A and B with fractional component x, linear interpolation is (1-x)A+xB. For sinusoidal segments, you can replace x with s = -0.5*cos(pi*x)+0.5

The disadvantage here is that a straight line with multiple consecutive segments (i.e. 1, 2, 3, 4, 5...) will have ripple. It's also not generally useful for interpolating audio signals, as the frequency domain performance is worse than ordinary linear interpolation. But it's nice for crossfading wavetables or constructing smooth-ish curves out of arbitrary points.


----------------------------------------
> Date: Sat, 7 Mar 2015 19:23:01 +0000
> From: timr at circuitabbey.com
> To: synth-diy at dropmix.xs4all.nl
> Subject: [sdiy] Bezier? B-Spline?
>
> Hi,
>
> I have an application where I need to take segments of a multi-segment envelope generator and make them smoothed curves. Each segment is comprised of N samples. I want the smoothed curve to go through the end points of the segments. I was hoping a clever math dude can show me how to do this.
>
> Thanks!
>
> Tim Ressel
> Circuit Abbey
> 503-750-9331
> timr at circuitabbey.com
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
 		 	   		  


More information about the Synth-diy mailing list