Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books



Chapters

Chapter Contents:

Search Physical Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Tuning by Linear Interpolation

An overview of linear interpolation, among others, is given in §3.2. The transfer function of first-order linear-interpolation can be written as

$\displaystyle H_\eta(z) = (1-\eta) + \eta z^{-1},
$

where $ \eta\in[0,1]$ denotes the desired delay in samples at low frequencies compared with the sampling rate.


Faust Implementation.

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 $ (1-\eta)$ and $ \eta$, as indicated in Fig.[*]. 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