LIBML
Version 3.2.4
LIBML DSP Software Library
|
Functions | |
static f32_t | tpt_linear_interpolate_f32 (tpt_linear_interpolate_f32_t *aFunction, f32_t aX) |
Process function for the floating-point Linear Interpolation Function. More... | |
static q31_t | tpt_linear_interpolate_q31 (q31_t *pYData, q31_t aX, uint32_t nValues) |
Process function for the Q31 Linear Interpolation Function. More... | |
static q15_t | tpt_linear_interpolate_q15 (q15_t *pYData, q31_t aX, uint32_t nValues) |
Process function for the Q15 Linear Interpolation Function. More... | |
static q7_t | tpt_linear_interpolate_q7 (q7_t *pYData, q31_t aX, uint32_t nValues) |
Process function for the Q7 Linear Interpolation Function. More... | |
Linear interpolation is a method of curve fitting using linear polynomials. Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line.
y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)) where x0, x1 are nearest values of input x y0, y1 are nearest values to output y
aFunction
points to an instance of the Linear Interpolate function data structure. aX
is the input sample value. The functions returns the output value.
|
inlinestatic |
Process function for the floating-point Linear Interpolation Function.
[in,out] | aFunction | an instance of the Linear Interpolation structure |
[in] | aX | input sample to process |
Process function for the Q15 Linear Interpolation Function.
Input sample aX
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
[in] | pYData | pointer to Linear Interpolation table. |
[in] | aX | input sample to process |
[in] | nValues | number of table values |
Process function for the Q31 Linear Interpolation Function.
Input sample aX
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
[in] | pYData | pointer to Linear Interpolation table. |
[in] | aX | input sample to process |
[in] | nValues | number of table values |
Process function for the Q7 Linear Interpolation Function.
Input sample aX
is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. This function can support maximum of table size 2^12.
[in] | pYData | pointer to Linear Interpolation table. |
[in] | aX | input sample to process |
[in] | nValues | number of table values |