# interpolation

Paul Masri Paul.Masri at bristol.ac.uk
Fri Nov 28 10:15:39 EST 1997

```Hi Espen,

> we're making a tracker, for interpolation is splines the best as they make
> a smooth line between sample points?, or are there better (and remember
> this has to be calculated on the fly) methods ? I've looked at divided
> differences and other interpolations routines, but how these effect audio
> I don't know. Any hints url's books etc. ?

A spline does not have to be a straight line between points.  Indeed the most
common one is the cubic spline, which fits a cubic polynomial function to four
points; the solution of this gives a much better local approximation to the
actual analogue curve.  There is nothing to stop you going to higher orders of
polynomial, except that a) you would need more sample points and b)
developing an automatic method for solving polynomials of higher than third
order is not an enjoyable pasttime for many people.

Basically, the method for the cubic is:
To interpolate between s(k) and s(k+1), fit the equation to s(k-1), s(k),
s(k+1), s(k+2).  If you want to interpolate between s(k+1) and s(k+2), don't
use the same cubic function; instead repeat the process with a new cubic
centred on those points. (This is because with curve fitting, the approximation
is generally better toward the centre of the range.)

I have heard of other interpolation methods (many of which also fit cubics, but
they may also try to make sure that there is less of a phase derivative
discontinuity at sample boundaries).  I can give only the names - I saw these
in relation to computer graphics modelling some years ago.  They are:
Overhauser curves,
Bezier curves,
Hermite curves,
B-splines (of which beta-splines are a special case).

Personally I would just stick with the basic cubic - for all audio
applications I have come across, it easily suffices

How this helps.

Cheers,
Paul.
------------------------------------------------------------------------------
Dr. Paul Masri
Digital Music Research Group, University of Bristol, England.
Tel:   +44 (0)117 954-5192
Fax:   +44 (0)117 954-5206
email: Paul.Masri at bristol.ac.uk
WWW:   http://www.fen.bris.ac.uk/elec/dmr

```