Code covered by the BSD License
-
[x,pp]=create_lut3(fcn, rng, ...
this is a function to generate approximation lookup tables using
-
example
demonstrates the use of the HDL function approximation utilities.
-
nearestpoint(x,y,m) ;
NEARESTPOINT - find the nearest value in another vector
-
varargout=adj_unique(in)
[out,indx,count,fcn]=adj_unique(in)
-
varargout=compute_fp_tables(w...
want to compute the optimal fractional size for the lookup table block
-
varargout=nline(x1,y1,x2,y2,s...
nline.m
-
write_lookup(pp, word_size, f...
write_lookup(pp, word_size, filename)
-
y=apply_table2(s, x)
note that the ideas for this function were taken from the brilliant
-
lut_test
-
View all files
Spline based function approximation for HDL synthesis
by Sean Little
25 May 2010
This is a suite of simple utilities that allow for efficient approximation of complex functions in a
|
Watch this File
|
| File Information |
| Description |
This tool accepts a function handle for a "well behaved" function. It then automatically finds the best position for the knots for cubic spline approximation based on the error tolerance specified by the user. Areas of the approximation region with more rapid changes require more closely placed knots.
Once the knots are positioned and the requested error tolerance is achieved, a computation is made to convert the coefficient tables to fixed point. The lookup operation is automatically coded in EML. Note that the best way to code the EML lookup operation is with a linear O(n) search, that will be further optimized by the synthesis tools.
To demonstrate the utility of these functions, run the "example.m" function that is included with this submission.
|
| Required Products |
Fixed-Point Toolbox
Simulink
Simulink Fixed Point
Simulink HDL Coder
|
| MATLAB release |
MATLAB 7.10 (2010a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
|
Contact us at files@mathworks.com