Producing Lookup Table Data
A function lookup table is a method by which you can approximate a function by a table with a finite number of points (X,Y). Function lookup tables are essential to many fixed-point applications. The function you want to approximate is called the ideal function. The X values of the lookup table are called the breakpoints. You approximate the value of the ideal function at a point by linearly interpolating between the two breakpoints closest to the point.
In creating the points for a function lookup table, you generally want to achieve one or both of the following goals:
Minimize the worst-case error for a specified maximum number of breakpoints
Minimize the number of breakpoints for a specified maximum allowed error
Create Lookup Tables for a Sine Function shows you how to create function lookup
tables using the function fixpt_look1_func_approx
. You can optimize the
lookup table to minimize the number of data points, the error, or both. You can also restrict
the spacing of the breakpoints to be even or even powers of two to speed up computations using
the table.
Worst-Case Error for a Lookup Table explains how to use the function
fixpt_look1_func_plot
to find the worst-case
error of a lookup table and plot the errors at all points.