MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ lagrange_delay()

MAYAFLUX_API std::vector< double > MayaFlux::Kinesis::Discrete::lagrange_delay ( double  delay,
size_t  order 
)

Lagrange fractional-delay FIR coefficients.

Interpolates between samples at a non-integer offset by fitting a polynomial through order + 1 consecutive points. Order 1 is linear interpolation; order 3 at a fractional position reproduces the Catmull-Rom weights held as a matrix in Kinesis::BasisMatrices, generalised to any order.

Accuracy is highest when delay falls near the centre of the tap span, so callers wanting a delay of D samples with order N typically use an integer delay line of D - N/2 followed by this kernel for the remainder.

Parameters
delayDelay in samples, need not be integral; clamped to [0, order]
orderPolynomial order; produces order + 1 taps
Returns
Coefficient vector of length order + 1

Definition at line 360 of file Coefficients.cpp.

361{
362 std::vector<double> h(order + 1);
363 lagrange_weights(delay, h);
364 return h;
365}
uint32_t h
Definition InkPress.cpp:29
void lagrange_weights(double delay, std::span< double > weights) noexcept
Lagrange interpolation weights written to an array, without allocating.

References delay(), h, and lagrange_weights().

+ Here is the call graph for this function: