25#ifndef LMMS_INTERPOLATION_H
26#define LMMS_INTERPOLATION_H
37 const float frsq = frac_pos*frac_pos;
38 const float frsq2 = 2*frsq;
39 return( ( (x2-x0) *0.5f ) * ( frac_pos * (frsq+1) -frsq2 ) +
40 ( frsq2*frac_pos - 3*frsq ) * ( x1-x2 ) +
41 frsq2 * (frac_pos-1) * ( ( x3-x1 ) * 0.25f ) + x1 );
68 float frcu = frsq * v0;
69 float t1 = v1 * 3.f + v3;
71 return v1 + (0.5f * frcu +
x) * (
v2 - frcu * (1.0f / 6.0f) -
72 (t1 * (1.0f / 6.0f) - v0) * (1.0f / 3.0f)) + frsq *
x * (t1 *
73 (1.0f / 6.0f) - 0.5f *
v2) + frsq * (0.5f *
v2 - v1);
80 const float f = (1.0f - std::cos(
x * std::numbers::pi_v<float>)) * 0.5f;
81 return f * (v1 - v0) + v0;
87 const float z =
x - 0.5f;
88 const float even = v1 + v0;
89 const float odd = v1 - v0;
91 const float c0 = even * 0.50037842517188658;
92 const float c1 = odd * 1.00621089801788210;
93 const float c2 = even * -0.004541102062639801;
94 const float c3 = odd * -1.57015627178718420;
96 return ((c3 *
z +
c2) *
z + c1) *
z + c0;
102 const float z =
x - 0.5f;
103 const float even1 =
v2 + v1;
104 const float odd1 =
v2 - v1;
105 const float even2 = v3 + v0;
106 const float odd2 = v3 - v0;
108 const float c0 = even1 * 0.45868970870461956 + even2 * 0.04131401926395584;
109 const float c1 = odd1 * 0.48068024766578432 + odd2 * 0.17577925564495955;
110 const float c2 = even1 * -0.246185007019907091 + even2 * 0.24614027139700284;
111 const float c3 = odd1 * -0.36030925263849456 + odd2 * 0.10174985775982505;
113 return ((c3 *
z +
c2) *
z + c1) *
z + c0;
121 const float c1 =
v2 - v0 * ( 1.0f / 3.0f ) - v1 * 0.5f - v3 * ( 1.0f / 6.0f );
122 const float c2 = 0.5f * (v0 +
v2) - v1;
123 const float c3 = ( 1.0f/6.0f ) * ( v3 - v0 ) + 0.5f * ( v1 -
v2 );
124 return ((c3 *
x +
c2) *
x + c1) *
x + c0;
unsigned z
Definition inflate.c:1589
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
static void v2(register WDL_FFT_REAL *a)
Definition fft.c:1099
static void c2(register WDL_FFT_COMPLEX *a)
Definition fft.c:270
Definition AudioAlsa.cpp:35
float optimalInterpolate(float v0, float v1, float x)
Definition interpolation.h:85
float hermiteInterpolate(float x0, float x1, float x2, float x3, float frac_pos)
Definition interpolation.h:34
float cubicInterpolate(float v0, float v1, float v2, float v3, float x)
Definition interpolation.h:65
float lagrangeInterpolate(float v0, float v1, float v2, float v3, float x)
Definition interpolation.h:118
float optimal4pInterpolate(float v0, float v1, float v2, float v3, float x)
Definition interpolation.h:100
float cosinusInterpolate(float v0, float v1, float x)
Definition interpolation.h:78