A SYSTEM FOR PERFORMING LINEAR INTERPOLATION
Field Of The Invention The invention relates generally to the field of computer systems, and more particularly to computation systems for interpolating between known data points.
Background of the Invention In many applications in the fields of computation and numerical analysis, the value of a function at a desired domain coordinate must be approximated from known values of the function at other points in the domain. As an example, air pressure (the function) may be known at a set of locations on the earth ("location" comprising the domain), and from these known pressures, one may wish to determine a value for pressure at other locations. This can be accomplished by the method of linear interpolation.
In linear interpolation, the function is assumed to be piecewise linear between adjacent points in the domain, each identified by a domain coordinate value at which the function values are known. Thus, the relation of the interpolated value at a target point in the domain, that is, the domain coordinate value of the point in the domain at which the function value is to be interpolated, to the function values at the known points at adjacent domain coordinate value is linearly proportional to (1) the desired domain coordinate's relative distance from the known points, and (2) the difference between the values of the function at the two adjacent known points. Stated mathematically, in a one dimensional domain, this is
f(xd) = f(xχ) + (X2 I X1J (f(x2 ) " f i)) (Equation 1)
where f is the interpolated function, x-j_ and 2 are the domain coordinate values of the points at which the function values are known, and x^ is the domain coordinate value at which the function value is being interpolated.
In the prior art, interpolation calculations have been performed by electronic computing systems. In these systems, the function values for the known points are stored in a single electronic memory. For each interpolation, this memory must be accessed twice, once to obtain a function value for each of the two known points with domain coordinates adjacent to the domain coordinate at which interpolation is to take place.
Summary of the Invention The invention provides a new and improved system for generating an interpolated value.
In brief summary, the invention provides, in one aspect, an interpolation system that generates an interpolated value in response to an input value. The interpolation system includes a function value store comprising a plurality of function value storage tables for storing function values for alternating domain coordinate values in a domain. An address generator, in response to an input value, generates address signals identifying locations in the function value storage tables to enable the function value storage tables to transmit function values in parallel. An interpolator receives function values transmitted in parallel by the function value storage tables and the input value and generating in response thereto the interpolated value. In another aspect, the invention provides a method of generating an interpolated value in response to an input
value comprising the steps of providing a plurality of function value storage tables for storing function values for alternating domain coordinate values in a domain; generating address signals identifying locations in the function value storage tables to enable the function value storage tables to transmit function values in parallel; and receiving function values transmitted by the function value storage tables in parallel and the input value and generating in response thereto the interpolated value.
Brief Description of the Drawings The invention is pointed out with particularity in the appended claims, and may be better understood by referring to the following description taken in conjunction with the accompanying drawings, in which: FIG. 1 depicts a functional block diagram of a linear interpolation system according to the invention;
FIG. 2 depicts a block diagram of an address generator useful in the system depicted in FIG. 1; FIG. 3 depicts a block diagram of an interpolation device useful in the system depicted in FIG. 1;
FIGS. 4A and 4B depict a two-dimensional domain useful in understanding multi-dimensional interpolation in accordance with the invention; and FIG. 5 depicts a functional block diagram of a linear interpolation system for performing linear interpolation in a two-dimensional domain.
Detailed Description of Illustrative Embodiments FIG. 1 shows an illustrative embodiment of a linear interpolation system in accordance with the invention. s can be seen in FIG. 1, an interpolation block 70 includes two table memories 30 and 32 that store the
function values for the known points. These table memories provide known function values along lines 34 and 35 to an interpolation device 36 in parallel in response to ADRS ODD odd address signals and ADRS EVEN even address signal, respectively, from an address generator 38. The address generator 38 receives a high- order portion of XJN signals along lines 12, defining the high order portion of the domain coordinate value of the target point, that is, the point in the domain at which interpolation is to occur, and generates the ADRS ODD odd address signals and ADRS EVEN even address signals which identify storage locations for function values of known points in the table memories 30 and 32, respectively. In addition, address generator 38 generates an SEL select signal which is coupled to interpolation device 36 on a line 40, and is used thereby as described below.
Interpolation device 36 receives low order JJJ signals on lines 14, which define the low-order portion of the domain coordinate value of the target point, as well as the function values at known points from table memories 30 and 32 on lines 34 and 35, respectively, and the SEL select signal. Interpolation device 36 uses these signals as inputs to compute an interpolated function value f(XJ.N) f°r the domain coordinate value identified by the XJJJ signals.
In one embodiment, as shown in FIG. 1, function values of the known points, stored in table memories 30 and 32, are provided for each integer domain coordinate value. The function values stored in table 30 are those associated with odd integer domain coordinate values, and the function values stored in table 32 are those associated with even integer domain coordinate values. The function values in successive storage locations in
each table memory 30 and 32 are stored in ascending order of their respective associated domain coordinate values, and so the address of each function value in the table memories is in direct correspondence to the integer part of the domain coordinate of the function value's respective known point.
As noted above, the function values for the know points are distributed between the two table memories 30 and 32. It will be appreciated that, since function values for odd coordinate values are stored in table memory 30 and function values for even coordinate values are stored in table memory 32 when, during an interpolation operation, the function values for two adjacent domain coordinate values are obtained, one from each of the table memories 30 and 32. Since two table memories 30 and 32 are provided, function values can be obtained from the two table memories simultaneously. As a result, the arrangement depicted in FIG. 1 requires less time to obtain the function values for known points than prior systems using a single table memory.
That is, table memory 30 provides on line 34 the function value for the odd domain coordinate value proximate the target point, as identified by the XJJ- signals on line 12, at which interpolation is to occur and table memory 32 provides, on line 35, the function value for the even domain coordinate value proximate the domain coordinate value identified by the XJN signals. As described below, the SEL select signal indicates whether the domain coordinate value for the function values provided by the table memories 30 and 32 are, respectively, above or below the domain coordinate value defined by the xχ_- signals, to control use by the interpolation device 36 of the signals on lines 34 and 35, as described below. More specifically, with
reference to Equation 1, the SEL select signal indicates which of the ADRS ODD odd address signals or ADRS EVEN even address signals correspond to domain coordinate values x± and x2, and which of the values represented by signals transmitted by the table memories 30 and 32 correspond to function values f(xχ) and f(x2).
An illustrative embodiment of an address generator 38 is shown in FIG. 2. The address generator 38 generates the ADRS ODD odd address signals and ADRS EVEN even address signals to identify storage locations in the two table memories 30 and 32, respectively. In addition, the address generator 38 produces the SEL select signal used by the interpolation device 36. In the address generator 38 depicted in FIG. 2, the high- order portion for the XJJ- signal, which identifies the integer part of the domain coordinate value of the point in the domain at which the function value is to be interpolated, is coupled to address generator 38 along lines 12. The least significant bit of the binary representation of the integer part of the xχ_- signal determines whether the high order portion of the Xjn signal has an even or odd value. Therefore, the least significant bit of the high order portion of the XJN signal indicates whether the domain coordinate value of the target point in the domain, at which the function value is to be interpolated, is just above an even or odd integer domain coordinate value, and so it is coupled onto line 40 as the SEL select signal.
The ADRS ODD odd address signals and ADRS EVEN even address signals are functions of the integer portion of the XJN signals on line 12. More specifically, the address signals are both functions of the integer portion of the XJJJ signals, except for the low-order signal which provides the SEL select signal. Since each
table memory 30 and 32 stores function values for one- half of the integer domain coordinate values, that is, those domain coordinate values at which function values are known, the values of the ADRS ODD odd address signals and ADRS EVEN even address signals are functions of the greatest integer of one-half of the integer portion of the domain coordinate represented by the xjn signals.
More specifically, with reference to FIG. 1, in storage location in the table memories 30 and 32 with the same addresses, the resulting outputs are such that the known point in the domain with the odd integer domain coordinate value has a higher domain coordinate value than the point in the domain having the even integer domain value. Therefore, the address signals generated by the address generator on lines 50 and 52 should represent the same value when the domain coordinate value of the point in the domain at which the function value is to be interpolated lies just above an even integer domain coordinate value. However, when the domain coordinate of the point in the domain at which the function value is to be interpolated lies just above an odd integer domain coordinate value, table memory 32 should be addressed with ADRS EVEN even address signals identifying a location whose address is one greater than the address of the location identified in table memory 30 by the ADRS ODD odd address signals. Address generator 38 generates ADRS ODD odd address signals and ADRS EVEN even address signals that satisfy these criteria.
As discussed above, the least significant bit of the integer part of the domain coordinate of the desired point indicates whether the known point in the domain with the lower domain coordinate value has an even or
odd domain coordinate value. Therefore, this bit also indicates whether the ADRS ODD odd address signals and ADRS EVEN even address signals identify the same storage locations in table memories 30 and 32. As shown in FIG. 2, address generator 38, the least significant bit of the integer part of the xj_- signals, defining the domain coordinate value of the target point, provides a carry input to a binary adder 46, where the B INP summing input terminal to the adder 46 receives binary zero on lines 48, and the A INP summing input terminal receives the more significant bits of the integer part of the xjtj signals. Alternatively, the least significant bit of the integer part of the desired point can simply control the least significant bit carried on lines 48 at the B INP summing input terminal.
The output of the adder 46 provides the ADRS EVEN even address signals generated by the address generator 38, which are used as the address for table memory 32. The more significant bits of the domain coordinate of the desired point, carried on lines 42, are also used as the ADRS ODD odd address signals of the address generator, which is the address for table memory 30. As will be appreciated by those skilled in the art, in this configuration, the value of the ADRS ODD odd address signals equals the value of the ADRS EVEN even address signals when the SEL signal is negated. If the SEL select signal is asserted, the value of the ADRS EVEN even address signals is one greater than the value of the ADRS ODD odd address signal. These results are tabulated in the table at the bottom of FIG. 2. As can be seen from the above, these provide the necessary addresses for the table memories 30 and 32.
A functional block diagram of interpolation device 36 is illustrated in FIG. 3. As shown in FIG. 3, the
interpolation device 36 receives the function values from the table memories 30 and 32 along lines 34 and 35. Lines 34 have been labeled "odd" to indicate that they carry function values from table memory 30, which contains the function values for the odd domain coordinate values. Similarly, lines 35 have been labeled "even" to indicate that they carry the function values for the even domain coordinate values from table memory 32. Lines 34 and 35 connect to two multiplexers 20 and 22, both of which are controlled in unison by the SEL select signal so that multiplexer 20 couples the function value of the known point whose domain coordinate value is immediately above that of the target point, as identified by the xχ~s~ domain coordinate value, onto lines 37 and multiplexer 22 couples the function value of the known point whose domain coordinate value is immediately below the targeted point onto lines 39. Further circuitry, comprising a subtractor 24, a multiplier 26 and a second adder 28, generates the function value at the target point, using the function values represented by the signals on lines 37 and 39 and the low order portion of the XJN signals, denoting the fractional portion of the xχ~- signals, on lines 14. As noted above, the known points are at integer domain coordinate values which simplifies the interpolation computation. Specifically, referring to the equation at the bottom of FIG. 3, the difference between the domain coordinates of the known points, that is, the value "(xi+i - xi)f" is always equal to "one," because the domain coordinate values of the known points always lie at sequential integer domain coordinates. Additionally, for similar reasons, the difference between the domain coordinate of the desired point and the domain coordinate of the lower known point, indicated by the
expression "( IN *~ xi)" *--n the equation is simply equal to the fractional part of the domain coordinate value of the target point, which, in turn, corresponds to the low order portion of the XJ J signals on lines 14. Thus, the calculation circuitry comprising subtractor 24, multiplier 26, and adder 28, in the interpolation device 36 evaluates the expressions in the portion of the interpolation equation illustrated at the lower right of FIG. 3. Specifically, subtractor 24 provides the difference of the function values at the known points, as indicated by the expression labelled 24 in the equation. Multiplier 26 multiplies this difference by the fractional component of the domain coordinate value of the target point (represented by the signals carried on lines 14), as indicated by expression labelled 26 in the equation. Finally, adder 28 provides the sum of the product generated by multiplier 26 and to the function value at the known point having the lower domain coordinate value in the domain, as indicated by expression labelled 28 in the equation, thereby providing the interpolated value for the target point represented by x ~- signals.
In an alternative embodiment, the values for the known points may be stored in content addressable memories (CAMs). In that case, the table memories 30 and 32 store both the domain coordinate values and function values for the known points. The function values for the known points can then be accessed using the domain coordinate value of the desired point. The benefits of using CAM's include the facts that (1) the domain coordinate values for the known points need not lie on integer values and (2) the differences between domain coordinate values need not be uniform. If the differences between the domain coordinate values are
uniform, but not "one," the value as produced by adder 28 (FIG. 3) of the interpolation device 36, may be divided by the difference to produce the actual interpolation value. On the other hand, if the difference is not uniform, the table memories may couple the domain coordinate values to the interpolation device 36, which may determine the difference to be used in the division.
Systems, in accordance with the invention, for performing linear interpolation in multi-dimensional coordinate domains will be described in accordance with FIGS. 4A through 5.
As shown in FIG. 4A, in a two-dimensional interpolation system, the locations of the points in the domain at which the function values are known form a two dimensional grid in a two-dimensional domain denoted by axes x and y. The value of the function at the target point is determined by interpolation from function values at the four nearest known points, which form corners of a rectangular grid "window" in which the target point lies.
As seen in FIG. 4A, the target point S- is projected onto two of the lines 26 defined by the grid of points at which the function values are known. The resulting projection points are identified as points s i and sp . A value for the function at these projections s i and sp2 can be calculated by a one dimensional interpolation system, such as described above in connection with FIGS. 1 through 3, using the pairs of known points sn and sι , s ι and s , respectively.
As shown in FIG. 4B, the two projection points spi and sp can be treated as known points in a one- dimensional domain coordinate system defined by the line between points spi and sp2, on which point sd lies. The
two projections are collinear with the desired point, and thus the value of the function at the desired point S([ can be calculated by one-dimensional interpolation methods, using the calculated values for the function at the projection points spi and sp2.
FIG. 5 shows a circuit for performing interpolation in a two-dimensional coordinate domain according to the invention, in connection with xχ_- and yχ~- signals which identify the domain coordinate values, along the x and y axes respectively, for the target point. The circuit includes two one-dimensional interpolation blocks 70(ODD) and 70(EVEN), both corresponding to interpolation block 70 (FIG. 1). Each block 70(ODD) and 70(EVEN) stores in its table memories (not shown) the function values for the known points in the coordinate domain along alternating lines 26 as depicted in FIG. 4A. Using the circuit shown in FIG. 5, fractional signal xχ~- and the integer portion of yχ_- signal are coupled to the one-dimensional interpolation blocks 70, each of which provides the function values for one of the projection points spi and sp . The outputs of the two one-dimensional blocks 70 are coupled to an interpolation device 36, along with the fractional portion of the yχ_q signal, which provides the function value for the target point.
To accomplish this, the two one-dimensional interpolation blocks 70 include table memories (not shown in FIG. 5) that provide function values for points on alternating lines in the two-dimensional domain. That is, assuming the function values are provided along parallel lines, which are parallel to the x-axis, as shown in FIG. 4A, and which intersect the y-axis at integral points along the y-axis, the one-dimensional interpolation block 70(ODD) includes table memories.
corresponding to table memories 30 and 32 (FIG. 1), which provide function values along lines which intersect the y-axis at odd points along the y-axis, and the other interpolation block 70 (EVEN) includes table memories, also corresponding to table memories 30 and 32, which provide function values along lines which intersect the y-axis at even points along the y-axis.
The table memories 30 and 32 in the interpolation block 70(ODD) stores function values at known points along a line stored therein in a set of successive memory locations, with function values along the successive lines being stored in successive sets of memory locations in the respective memories. The table memories 30 and 32 in the interpolation block 70(ODD) are both addressed in response to portions of the integer portion of the xχ-_- input signals and the integer portion of the yχ_ input signals. Specifically, the address signals are generated by an address generator 38(x), which generates address signals in response to the xχ_- signals and an address generator 38(y), which generates address signals in response to the yjjj signals, with both address generators 38(x) and 38(y) being the same as address generator 38 (FIG. 1). Each of the address generators 38(x) and 38(y) generate even and odd sets of address signals; in particular, the address generator 38(x) generates address signals X ADRS ODD odd address signals and X ADRS EVEN even address signals, both along the x-axis, and address generator 38(y) generates address signals Y ADRS ODD odd address signals and Y ADRS EVEN even address signals, both along the y-axis.
The table memories 30 and 32 in the interpolation blocks 70(ODD) and 70(EVEN) are addressed by address signals formed by various concatenations of the X ADRS
ODD, X ADRS EVEN, Y ADRS ODD, and Y ADRS EVEN signals produced by the address generators 38(x) and 38(y). In particular, the table memory 30 (reference FIG. 1) in the interpolation block 70(ODD), which stores function values, at successive points, which have odd x-axis coordinate values, along successive lines which have odd y-axis coordinate values, is addressed by address signals formed by concatenating the X ADRS ODD odd x- axis address signals onto the low-order end of the Y ADRS ODD odd y-axis address signals. The Y ADRS ODD odd y-axis address signals identify a particular line in the domain, and thus a particular set of function values stored in the table memory 30 (reference FIG. 1), while the X ADRS ODD odd x-axis address signals identify a particular point on the line, and thus a particular memory location, in the set identified by the Y ADRS ODD odd y-axis address signals, which stores the function value for the point.
Similarly, the table memory 32 (reference FIG. 1) in the interpolation block 70(ODD), which stores function values, at successive points, which have even x-axis coordinate values, along successive lines which have odd y-axis coordinate values, is addressed by address signals formed by concatenating the X ADRS EVEN even x-axis address signals onto the low-order end of the Y ADRS ODD odd y-axis address signals. The Y ADRS ODD odd y-axis address signals identify a particular line in the domain, and thus a particular set of function values stored in the table memory 32, while the X ADRS EVEN even x-axis address signals identify a particular point on the line, and thus a particular location, in the set identified by the Y ADRS ODD odd y- axis address signals, which stores the function value for the point.
The table memory 30 (reference FIG. 1) in the interpolation block 70 (EVEN), which stores function values, at successive points, which have odd x-axis coordinate values, along successive lines which have even y-axis coordinate values, is addressed by address signals formed by concatenating the X ADRS ODD odd x- axis address signals onto the low-order end of the Y ADRS EVEN y-axis address signals. The Y ADRS EVEN even y-axis address signals identify a particular line in the domain, and thus a particular set of function values stored in the table memory 30 (reference FIG. 1), while the X ADRS ODD odd axis address signals identify a particular point on the line, and thus a particular location, in the set identified by the Y ADRS EVEN even y-axis address signals, which stores the function value for the point.
Finally, the table memory 32 (reference FIG. 1) in the interpolation block 70(EVEN), which stores function values, at successive points, which have even x-axis coordinate values, along successive lines which have even y-axis coordinate values, is addressed by address signals formed by concatenating the X ADRS EVEN even x- axis address signals onto the low-order end of the Y ADRS EVEN even y-axis address signals. The Y ADRS EVEN even y-axis address signals identify a particular line in the domain, and thus a particular set of function values stored in the table memory 32 (reference FIG. 1), while the X ADRS EVEN even x-axis address signals identify a particular point on the line, and thus a particular location, in the set identified by the Y ADRS EVEN even y-axis address signals, which stores the function value for the point.
Thus, the four sets of address signals, generated by the concatenation of the X ADRS ODD odd x-axis
address signals, X ADRS EVEN even x-axis address signals, Y ADRS ODD odd y-axis address signals, and Y ADRS EVEN even y-axis address signals, as described above, identify the four points in the domain proximate the target point at which the function points are known. As in the embodiment, depicted in FIG. 1, for performing interpolation in a one-dimensional domain, the address generators 38(x) and 38(y) generate, respectively, SELX and SELy select signals that indicate whether the odd- and even-valued domain coordinates are greater and less than the domain coordinate values of the target point, as represented by the XJJJ and yχ_- signals, respectively.
As noted above, the interpolation blocks 70(ODD) and 70(EVEN) generate the interpolated values for the projection points spi and sp2. An interpolation device 36, which is identical to that depicted in FIG. 3, receives the interpolated values from the interpolation blocks 70(ODD) and 70(EVEN) and uses them, along with the SELy select signal and the fraction portion of the yiN signals, to generate an interpolated value for the target point. It will be appreciated that the SELy select signal indicates which of the projection points spi and sp2 is associated with the interpolated value produced by the interpolation block 70 (ODD) and 70(EVEN).
The invention can.be extended to provide interpolated values for higher-dimensional domains in a similar manner. For example, to perform an interpolation in a three-dimensional domain, defined by orthogonal x-, y- and z-axes, it may be recognized that the target point, defined by a coordinate x ]$, yχnr and zjN, may first be projected, along a line parallel to the z-axis, onto two parallel planes at, for example, integral locations along the z-axis. Each of the planes
ay define sets of lines, parallel to the x-axis, which intersects the y-axis at integer locations along the y- axis, which each line containing points, at integer locations along the x-axis, at which the function values are known. An interpolation circuit includes two two- dimensional interpolation blocks, similar to that shown in FIG. 5, with the addition that each of the table memories includes additional sets of memory locations for each of the planes, and the memories are thus also addressed by Z ADRS ODD odd z-axis address signals and Z ADRS EVEN even z-axis address signals provided by an address generator, substantially similar to the address generator 38 (FIG. 2), in response to an integer portion of the zχ_- signal. An interpolation device, similar to that depicted in FIG. 3, receives interpolated values from each of the two-dimensional interpolation blocks, which represent interpolated values in each of the plans parallel to the z-axis, and uses them, the fractional portion of the ZJN signal and SELg select signal to generate the interpolated value. Interpolation in higher-dimensioned domains can be accomplished by a similar extension from successive lower-dimensioned domains.
This invention has been illustrated through the use of a particular embodiment. Other embodiments are within the scope of the appended claims. For example, the interpolation method may use a cylindrical, radial, or any other coordinate system. Also, the known points need not be arranged in a grid, rather they may be randomly dispersed. In a one dimensional system, the points need not be evenly spaced. In an n-dimensional system, the sets of collinear points need not form parallel lines or planes.