Collection of interpolation algorithms for reading between samples. More...
#include <interpolator.hpp>
Static Public Member Functions | |
| template<typename SampleType> | |
| static SampleType | linear (SampleType frac, SampleType y0, SampleType y1) |
| Linear interpolation between two samples. | |
| template<typename SampleType> | |
| static SampleType | hermite (SampleType frac, SampleType ym1, SampleType y0, SampleType y1, SampleType y2) |
| Cubic Hermite (Catmull-Rom) interpolation. | |
| template<typename SampleType> | |
| static SampleType | lagrange (SampleType frac, SampleType ym1, SampleType y0, SampleType y1, SampleType y2) |
| 4-point Lagrange interpolation. | |
| template<typename SampleType> | |
| static SampleType | sinc6 (SampleType frac, SampleType ym2, SampleType ym1, SampleType y0, SampleType y1, SampleType y2, SampleType y3) |
| Windowed-sinc interpolation (6-point). | |
Collection of interpolation algorithms for reading between samples.
All functions take a fractional position and neighboring samples. Use with delay lines, wavetable oscillators, and resamplers.
RT contract: all interpolation functions are stateless scalar helpers and allocate no memory.
|
inlinestatic |
Cubic Hermite (Catmull-Rom) interpolation.
Requires 4 points: ym1 (pos -1), y0 (pos 0), y1 (pos 1), y2 (pos 2). Good balance of quality vs cost for most audio applications.
|
inlinestatic |
4-point Lagrange interpolation.
Requires 4 points: ym1, y0, y1, y2 (same layout as hermite). Slightly different character than Hermite — no overshoot guarantee but mathematically exact for polynomials up to degree 3.
|
inlinestatic |
Linear interpolation between two samples.
Requires 2 points: y0 (at position 0), y1 (at position 1).
|
inlinestatic |
Windowed-sinc interpolation (6-point).
Highest quality, suitable for mastering-grade resampling. Requires 6 points: ym2, ym1, y0, y1, y2, y3.