Functions

Linear Interpolation
[Interpolation Functions]

Functions

static INLINE void arm_linear_interp_f32 (arm_linear_interp_instance_f32 *S, float32_t *pIn, float32_t *pOut, uint32_t blockSize)
static INLINE void arm_linear_interp_q31 (q31_t *pYData, q31_t *pIn, q31_t *pOut, uint32_t nValues, uint32_t blockSize)
static INLINE void arm_linear_interp_q15 (q15_t *pYData, q31_t *pIn, q15_t *pOut, uint32_t nValues, uint32_t blockSize)
static INLINE void arm_linear_interp_q7 (q7_t *pYData, q31_t *pIn, q7_t *pOut, uint32_t nValues, uint32_t blockSize)

Detailed Description

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

LinearInterp.gif

Linear interpolation

A Linear Interpolate function calculates an output value(y), for the input(x) using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values)
Algorithm:
  
       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  
 
This set of functions implements Linear interpolation process for Q7, Q15, Q31, and floating-point data types. The functions operate on a single sample of data and each call to the function returns a single processed value. S points to an instance of the Linear Interpolate function data structure. x is the input sample value. The functions returns the output value.

Function Documentation

static INLINE void arm_linear_interp_f32 ( arm_linear_interp_instance_f32 S,
float32_t *  pIn,
float32_t *  pOut,
uint32_t  blockSize 
) [static]

Process function for the floating-point Linear Interpolation Function.

Parameters:
[in,out]*Sis an instance of the floating-point Linear Interpolation structure
[in]*pIninput sample buffer to process.
[out]*pOutpoints to output buffer.
[in]blockSizepoints to number of sampels.
Returns:
none.

Definition at line 5199 of file arm_math.h.

static INLINE void arm_linear_interp_q31 ( q31_t *  pYData,
q31_t *  pIn,
q31_t *  pOut,
uint32_t  nValues,
uint32_t  blockSize 
) [static]

Process function for the Q31 Linear Interpolation Function.

Parameters:
[in]*pYDatapointer to Q31 Linear Interpolation table
[in]*pIninput sample buffer to process.
[out]*pOutpoints to output buffer.
[in]nValuesnumber of table values.
[in]blockSizepoints to number of sampels.
Returns:
none.
Input sample x 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.
y = y0 + (x - x0) * (y1 - y0) where y0 and y1 are nearest values of output y, (x1 - x0) is always one and (x - x0) is fractional part.
Equation can be furthur modified as y = y0 + fract * (y1 - y0) which is equialant to y = y0 * (1 - fract) + y1 * fract

Definition at line 5285 of file arm_math.h.

static INLINE void arm_linear_interp_q15 ( q15_t *  pYData,
q31_t *  pIn,
q15_t *  pOut,
uint32_t  nValues,
uint32_t  blockSize 
) [static]

Process function for the Q15 Linear Interpolation Function.

Parameters:
[in]*pYDatapointer to Q15 Linear Interpolation table
[in]*pIninput sample buffer to process.
[out]*pOutpoints to output buffer.
[in]nValuesnumber of table values.
[in]blockSizepoints to number of sampels.
Returns:
none.
Input sample x 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.
y = y0 + (x - x0) * (y1 - y0) where y0 and y1 are nearest values of y, (x1 - x0) is always one and (x - x0) is fractional part
Equation can be furthur modified as y = y0 + fract * (y1 - y0) which is equialant to y = y0 * (1 - fract) + y1 * fract

Definition at line 5367 of file arm_math.h.

static INLINE void arm_linear_interp_q7 ( q7_t *  pYData,
q31_t *  pIn,
q7_t *  pOut,
uint32_t  nValues,
uint32_t  blockSize 
) [static]

Process function for the Q7 Linear Interpolation Function.

Parameters:
[in]*pYDatapointer to Q7 Linear Interpolation table
[in]*pIninput sample buffer to process.
[out]*pOutpoints to output buffer.
[in]nValuesnumber of table values.
[in]blockSizepoints to number of sampels.
Returns:
none.
Input sample x 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.
y = y0 + (x - x0) * ((y1 - y0)/(x1-x0)) where y0 and y1 are nearest values of y, (x1 - x0) is always one and (x - x0) is fractional part
Equation can be furthur modified as y = y0 + fract * (y1 - y0) which is equialant to y = y0 * (1 - fract) + y1 * fract

Definition at line 5450 of file arm_math.h.

 All Data Structures Files Functions Variables Enumerations Enumerator Defines