The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Class for interpolation with non-equidistant x values. More...
Public Member Functions | |
xy_table_t () | |
mha_real_t | lookup (mha_real_t x) const |
Return the y-value at the position of the nearest x value below input. More... | |
mha_real_t | interp (mha_real_t x) const |
Linear interpolation function. More... | |
void | add_entry (mha_real_t x, mha_real_t y) |
Add a single x-y pair entry. More... | |
void | add_entry (mha_real_t *pVX, mha_real_t *pVY, unsigned int len) |
Add multiple entries at once. More... | |
void | clear () |
Clear the table and transformation functions. More... | |
void | set_xfun (float(*pXFun)(float)) |
Set transformation function for x values. More... | |
void | set_yfun (float(*pYFun)(float)) |
Set transformation function for y values during insertion. More... | |
void | set_xyfun (float(*pYFun)(float, float)) |
Set transformation function for y values during insertion, based on x and y values. More... | |
std::pair< mha_real_t, mha_real_t > | get_xlimits () const |
returns the min and max x of all mesh points that are stored in the lookup table, i.e. More... | |
Public Member Functions inherited from MHATableLookup::table_t | |
table_t (void) | |
virtual | ~table_t (void) |
Private Attributes | |
std::map< mha_real_t, mha_real_t > | mXY |
float(* | xfun )(float) |
float(* | yfun )(float) |
float(* | xyfun )(float, float) |
Additional Inherited Members |
Class for interpolation with non-equidistant x values.
Linear interpolation of the x-y table is performed. A transformation of x and y-values is possible; if a transformation function is provided for the x-values, the same function is applied to the argument of xy_table_t::interp() and xy_table_t::lookup(). The transformation of y values is applied only during insertion into the table. Two functions for y-transformation can be provided: a simple transformation which depends only on the y values, or a transformation which takes both (non-transformed) x and y value as an argument. The two-argument transformation is applied before the one-argument transformation.
xy_table_t::xy_table_t | ( | ) |
|
virtual |
Return the y-value at the position of the nearest x value below input.
x | Input value |
Implements MHATableLookup::table_t.
|
virtual |
Linear interpolation function.
x | x value |
Implements MHATableLookup::table_t.
void xy_table_t::add_entry | ( | mha_real_t | x, |
mha_real_t | y | ||
) |
Add a single x-y pair entry.
x | x value |
y | corresponding y value |
void xy_table_t::add_entry | ( | mha_real_t * | pVX, |
mha_real_t * | pVY, | ||
unsigned int | uLength | ||
) |
Add multiple entries at once.
pVX | array of x values |
pVY | array of y values |
uLength | Length of x and y arrays |
|
virtual |
Clear the table and transformation functions.
Implements MHATableLookup::table_t.
void xy_table_t::set_xfun | ( | float(*)(float) | fun | ) |
Set transformation function for x values.
fun | Transformation function. |
void xy_table_t::set_yfun | ( | float(*)(float) | fun | ) |
Set transformation function for y values during insertion.
fun | Transformation function. |
void xy_table_t::set_xyfun | ( | float(*)(float, float) | fun | ) |
Set transformation function for y values during insertion, based on x and y values.
fun | Transformation function. |
|
inline |
returns the min and max x of all mesh points that are stored in the lookup table, i.e.
after transformation with xfun, if any. Not real-time safe
|
private |
|
private |
|
private |
|
private |