class

DSP::Interpolation

Inherits Reference < Object

Linear and polynomial interpolation methods

Constants

ZERO_TO_ONE = 0.0..1.0

Class methods

cubic(y0, y1, y2, y3, x : Float64)

4-point, 3rd-order (cubic) Hermite interpolater (x-form).

Given 4 evenly-spaced sample points, interpolate a value anywhere between the middle two points.

implementation source: www.musicdsp.org/archive.php?classid=5#93

@param [Float] y0 First y-value @param [Float] y1 Second y-value (first middle point) @param [Float] y2 Third y-value (second middle point) @param [Float] y3 Fourth y-value @param [Float] rel_dist Relative distance (0.0 to 1.0) along the x-axis between the two middle points, at which to interpolate

Source
linear(y0, y1, x : Float64)

Linear interpolator Given 2 sample points, interpolates a value anywhere between.

@param [Numeric] y0 First (left) y-value @param [Numeric] y1 Second (right) y-value @param [Numeric] x Amount of interpolation (0.0 to 1.0)

Source