Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qInterp1

One-dimensional interpolation class. More...

Data Structures

struct  qInterp1_t
 A 1D interpolation object. More...
 

Enumerations

enum  qInterp1Method_t {
  QINTERP1_NEXT , QINTERP1_PREVIOUS , QINTERP1_NEAREST , QINTERP1_LINEAR ,
  QINTERP1_SINE , QINTERP1_CUBIC , QINTERP1_HERMITE , QINTERP1_SPLINE ,
  QINTERP1_CONSTRAINED_SPLINE , QINTERP1_MAX
}
 An enum with all the available interpolation methods. More...
 

Functions

int qInterp1_Setup (qInterp1_t *const i, const float *const xTable, const float *const yTable, const size_t sizeTable)
 Setup and initialize the 1D interpolation instance.
 
int qInterp1_SetData (qInterp1_t *const i, const float *const xTable, const float *const yTable, const size_t sizeTable)
 Set the data table for the 1D interpolation instance.
 
int qInterp1_SetMethod (qInterp1_t *const i, const qInterp1Method_t m)
 Specify the interpolation method to use.
 
float qInterp1_Get (qInterp1_t *const i, const float x)
 Interpolate input point x to determine the value of y at the points xi using the current method. If value is beyond the endpoints, extrapolation is performed using the current method.
 

Detailed Description

One-dimensional interpolation class.

Enumeration Type Documentation

◆ qInterp1Method_t

An enum with all the available interpolation methods.

Enumerator
QINTERP1_NEXT 

Return the next neighbor.

QINTERP1_PREVIOUS 

Return the previous neighbor.

QINTERP1_NEAREST 

Return the nearest neighbor.

QINTERP1_LINEAR 

Linear interpolation from nearest neighbors.

QINTERP1_SINE 

Sine interpolation.

QINTERP1_CUBIC 

Cubic interpolation.

QINTERP1_HERMITE 

Piecewise cubic Hermite interpolation.

QINTERP1_SPLINE 

Catmull spline interpolation.

QINTERP1_CONSTRAINED_SPLINE 

A special kind of spline that doesn't overshoot.

Function Documentation

◆ qInterp1_Get()

float qInterp1_Get ( qInterp1_t *const i,
const float x )

Interpolate input point x to determine the value of y at the points xi using the current method. If value is beyond the endpoints, extrapolation is performed using the current method.

Parameters
[in]iA pointer to the interpolation instance.
[in]xThe input point.
Returns
The interpolated-extrapolated y value.

◆ qInterp1_SetData()

int qInterp1_SetData ( qInterp1_t *const i,
const float *const xTable,
const float *const yTable,
const size_t sizeTable )

Set the data table for the 1D interpolation instance.

Parameters
[in]iA pointer to the interpolation instance.
[in]xTableAn array of size sizeTable with the x points sorted in ascending order.
[in]yTableAn array of size sizeTable with the y points.
[in]sizeTableThe number of points in xTable yTable
Returns
1 on success, otherwise return 0.

◆ qInterp1_SetMethod()

int qInterp1_SetMethod ( qInterp1_t *const i,
const qInterp1Method_t m )

Specify the interpolation method to use.

Parameters
[in]iA pointer to the interpolation instance.
[in]mThe interpolation method.
Returns
1 on success, otherwise return 0.

◆ qInterp1_Setup()

int qInterp1_Setup ( qInterp1_t *const i,
const float *const xTable,
const float *const yTable,
const size_t sizeTable )

Setup and initialize the 1D interpolation instance.

Parameters
[in]iA pointer to the interpolation instance.
[in]xTableAn array of size sizeTable with the x points sorted in ascending order.
[in]yTableAn array of size sizeTable with the y points.
[in]sizeTableThe number of points in xTable yTable
Returns
1 on success, otherwise return 0.