2-D interpolation for HC11
Bruce Bowling
bowling at cebaf.gov
Thu Sep 21 13:40:26 GMT 1995
~ Hi Bruce,
~ I have some table interpolation code for the HC11 however it is a 1-D
~ table with 16 bit values. The code is optomised inline assembler for
~ the HITECH-C compiler. The code has been tested thoroughly - I
~ sumulated every boundary condition and it allows for positive and
~ negative slope in the map. I started to write a 2-D map but I didn't
~ really need it at the time...
~ I'll send the code if you think it may be useful.
~
~ Andrew
~
Yes, I will take a copy - I am sure can use it.
Researching into the 2-D interpolation problem, the "cleanest"
algorithm that I have found to date is in the Handbook of
Mathematical Functions by Abramowitz and Stegun, which uses
the 4-point method:
f(x0+ph, y0+qk) = (1-p) * (1-q) * f(0,0) + p * (1-q) * f(1,0) +
(1-p) * q * f(0,1) + p * q * f(1,1)
with:
x0, y0 = some arbitrary baseline (D.C. offset)
p = normalized 1st coordinate value (ranging from 0 to 1)
p = normalized 2nd coordinate value (ranging from 0 to 1)
f(0,0) = function value at grid point coordinate (0,0)
f(0,1) = function value at grid point coordinate (0,1)
f(1,0) = function value at grid point coordinate (1,0)
f(1,1) = function value at grid point coordinate (1,1)
There are 5, 6, and 7 point formulas as well, but more complicated.
Anyone out there know of anything else more suited for
integer or fixed-point math?
Thanks again, Andrew
- Bruce
--
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------
Bruce A. Bowling
Staff Scientist - Instrumentation and Controls
The Continuous Electron Beam Accelerator Facility
12000 Jefferson Ave - Newport News, VA 23602
(804) 249-7240
bowling at cebaf.gov
http://devserve.cebaf.gov/~bowling
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------
More information about the Diy_efi
mailing list