Motorola DSP96002 User Manual page 563

32-bit digital signal processor
Table of Contents

Advertisement

B.1.24
Table Lookup with Linear Interpolation Between Points
This performs a table lookup and linear interpolation between points in the table. It is assumed that the
spacing between the known values (breakpoints) is a constant. No range checking is performed on the
input number because it is assumed that previous calculations may have limiting and range checking. This
can be used to approximate arbitrary functions given a set of known points (such as digital sine wave gen-
eration) or to interpolate linearly between values of a set of data such as an image.
The function to be approximated is shown below:
Y(i)
X(i)
FIRSTINDEX - value of the first index in the table, 1.0
Given an input value "x", the linearly interpolated value "y" from the tabulated known values is:
Y(i+1)-Y(i)
y = --------------(x-X(i)) + Y(i)
X(i+1)-X(i)
;
;
Approximate d4=exp(d0) for 1.0 <= x <= 21.0
;
page
org
table
org
firstindex equ
B-44
o
o
o
----+------+------+------+------+
1.0
6.0
11.0
^
/ spacing between indexes is INDSPC, 5.0
in this example
in this example
132,60,1,1
x:0
dc
2.7182818e+00
dc
4.0342879e+02
dc
5.9874141e+04
dc
8.8861105e+06
dc
1.3188157e+09
p:$50
1.0
DSP96002 USER'S MANUAL
o
¨ known values of function
o
16.0
21.0
¨ indexes
;exp(1.0)
;exp(6.0)
;exp(11.0)
;exp(16.0)
;exp(21.0)
;value of first table index
Program
ICycles
Words
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents