Recent

Author Topic: Interpolate1234D - Fast multidimensional interpolation library  (Read 2581 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Interpolate1234D - Fast multidimensional interpolation library
« on: September 12, 2019, 11:31:05 am »
Interpolate1234D

Interpolate1234D is fast 1D, 2D, 3D and 4D linear interpolation library with O(1) time complexity. It is made in an "old school" procedural programming with pointer arithmetic without using any of the modern pascal language features, because it's primary goal is to run on a very simple low power microcontroller which calculates hundreds of fuzzy logic fuzzifications, operations and defuzzifications every second in a real time control loop. The only way to achieve this goal was to avoid intensive calculations and read values for interpolation directly from precalculated lookup tables which can have up to 4 dimensions - depending on the number of numerical inputs. That was the main reason for creation of this library. My effort to visually present how multidimensional linear interpolation works can be found here. As an interesting side effect this library also handles linear extrapolation when input values are outside of the table range.


Info and Download

https://bitbucket.org/avra/interpolate1234d


License

Interpolate1234D is released under commercial friendly Mozilla Public License 2.0 (MPL-2.0). Here is license explained in plain English.


Author

Made by Avra (Zeljko Avramovic). Big thanks go to Gernot Hoffmann for his paper Multidimensional Linear Interpolation.
« Last Edit: September 12, 2019, 02:28:16 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Interpolate1234D - Fast multidimensional interpolation library
« Reply #1 on: January 15, 2020, 02:44:03 pm »
v1.2   Added support for dynamic arrays. Added 3D printer bed level mesh map visualization demo.

https://bitbucket.org/avra/interpolate1234d
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

devEric69

  • Hero Member
  • *****
  • Posts: 648
Re: Interpolate1234D - Fast multidimensional interpolation library
« Reply #2 on: January 15, 2020, 04:32:38 pm »
Interesting also for those who make logic, with fuzzy sets (whether they are SQL or not).
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Interpolate1234D - Fast multidimensional interpolation library
« Reply #3 on: February 24, 2020, 02:28:37 pm »
v1.4   Split library into DynamicInterpolation and StaticInterpolation. That way library is much easier to use in embedded devices with limited resources.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018