PER Firmware
Loading...
Searching...
No Matches
lerp_lut.c File Reference

Linear interpolation lookup table (LUT). More...

#include "lerp_lut.h"

Functions

float lut_lookup (const lerp_lut_t *lut, float key)
 Lookup a value in a linear interpolation lookup table (LUT).
 

Detailed Description

Linear interpolation lookup table (LUT).

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ lut_lookup()

float lut_lookup ( const lerp_lut_t * lut,
float key )

Lookup a value in a linear interpolation lookup table (LUT).

This function performs a binary search to find the appropriate interval in the LUT and then linearly interpolates between the two nearest entries.

Parameters
lutPointer to the LUT.
keyThe key to look up.
Returns
The interpolated value.