Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Interpolate ¶
func Interpolate(in []float64, outSamples int, interpolatorType InterpolatorType) (out []float64, err error)
Interpolate performs interpolation on the input data based on the specified type
func InterpolateInt ¶
func InterpolateInt(in []int, outSamples int, interpolatorType InterpolatorType) (out []int, err error)
InterpolateInt performs interpolation on integer input data and returns integer output This function minimizes conversions by converting to float64 only once at the start and back to int only once at the end (with rounding)
Types ¶
type InterpolatorType ¶
type InterpolatorType int
InterpolatorType defines the type of interpolation to use
const ( // None returns the input data as-is without any interpolation None InterpolatorType = iota // DropSample is the 0th-order B-spline (1-point) DropSample // Linear is the 1st-order B-spline (2-point) Linear // BSpline3 is the 3rd-order B-spline (4-point) BSpline3 // BSpline5 is the 5th-order B-spline (6-point) BSpline5 // Lagrange4 is the 4-point, 3rd-order Lagrange interpolator Lagrange4 // Lagrange6 is the 6-point, 5th-order Lagrange interpolator Lagrange6 // Watte is the 4-point, 2nd-order Watte tri-linear interpolator Watte // Parabolic2x is the 4-point, 2nd-order parabolic 2x interpolator Parabolic2x // Osculating4 is the 4-point, 5th-order 2nd-order-osculating interpolator Osculating4 // Osculating6 is the 6-point, 5th-order 2nd-order-osculating interpolator Osculating6 // Hermite4 is the 4-point, 3rd-order Hermite interpolator (Catmull-Rom spline) Hermite4 // Hermite6_3 is the 6-point, 3rd-order Hermite interpolator Hermite6_3 // Hermite6_5 is the 6-point, 5th-order Hermite interpolator Hermite6_5 // CubicSpline is the natural cubic spline interpolator with C² continuity CubicSpline // MonotonicCubic is the Fritsch-Carlson monotonic cubic interpolator (preserves monotonicity) MonotonicCubic // Lanczos2 is the windowed sinc interpolator with a=2 (4-point) Lanczos2 // Lanczos3 is the windowed sinc interpolator with a=3 (6-point) Lanczos3 // Bezier is the cubic Bezier curve interpolator Bezier // Akima is the Akima spline interpolator (robust to outliers) Akima )
Click to show internal directories.
Click to hide internal directories.