An overview of linear interpolation, among others, is given
The transfer function of first-order
linear-interpolation can be written as
Faust includes a function fdelay(n,d,x) defined in music.lib which provides fractional (non-integer) delay by means of linear interpolation:
fdelay(n,d,x) = delay(n,int(d),x)*(1 - frac(d)) + delay(n,int(d)+1,x)*frac(d);Note that it also specifies a second delay line. However, a second delay-line is not implemented in the generated C++ code because Faust has an optimization rule that consolidates all delay-lines having the same input signal to one shared delay line.
A single-delay-line version can be defined as follows:
linterp(d,x) = (1-d) * x + d * x'; fdelay1(n,d,x) = delay(n,int(d),x) : linterp(frac(d));Note that these definitions are not equivalent. While they are equivalent when the delay d is fixed, they diverge when int(d) changes from one sample to the next. In the dual-delay-line specification, the desired result is obtained, while in the single-delay-line case, x' becomes a one-sample delay of the old delay-line output instead of the new delay-line output. This inconsistency can potentially cause audible clicks when the tuning is rapidly varied.
A proper implementation of the single-delay-line case involves resetting the linear-interpolator state variable when the delay-length changes. Conceptually, the linear interpolator should be implemented as two delay-line taps with gains and . This structure is produced by the Faust optimization rules from the dual-delay-line specification as above.
Linear delay-line interpolation works well in a digital waveguide string model as long as the modeled string is sufficiently damped. Specifically, the string damping must be sufficient to mask the changing roll-off in the amplitude response of the linear interpolator. In the case of very light damping (such as when simulating steel strings at normal audio sampling rates), certain notes (such as B-flat at a sample rate of 44.1 kHz) will jump out as ``buzzy'' when they correspond to a nearly integer delay-line length (fundamental frequencies close to the sampling rate divided by an integer). This artifact diminishes with oversampling factor, of course.