This page is available in English only

6-th order Lagrange Sample Interpolator

High-quality sample interpolator

(18 Votes)
2.0 (Updated 14 years ago)
July 30, 2006
Reaktor 5 or lower


This macro performs sample interpolation on an array of samples, given a floating-point index into the sample buffer.

The macro implements a 6th-order Lagrange interpolator, that provides significantly better quality (flatter frequency response) than the common-use 4-point interpolators.

Not only useful, but also pretty in it's implemenation, in a strange Reaktor core kind of way (see the picture). The implementation has a curious and elegant symmetry, for those who care for such things. And as usual, a totally impenetrable implementation after the fact. But it looks pretty.

For those who don't care for such things, worry not: it just works.

Performance is about 50% more than a 4-point interpolator. (Table reads are slowish compared to math operations, so this macro is 50% slower because it does 50% more table reads).

You would use this macro to build good sample players, for example. That is left as an exercise for the downloader. But, if you implement a sample player that uses this macro, please keep the Karma balanced, and upload it to the library.

(oops. v1.1: bug fix).


Douglas Powell
13 years ago
This is very usefull and exactly the kind of thing I think the UL needs more of. Great work. Thanks.