DSPRelated.com
Free Books

Delay Lines

The delay line is an elementary functional unit which models acoustic propagation delay. It is a fundamental building block of both delay-effects processors and digital-waveguide synthesis models. The function of a delay line is to introduce a time delay between its input and output, as shown in Fig.2.1.

Figure 2.1: The $ M$-sample delay line.
\includegraphics{eps/delay}

Let the input signal be denoted $ x(n),\, n=0,1,2,\ldots$, and let the delay-line length be $ M$ samples. Then the output signal $ y(n)$ is specified by the relation

$\displaystyle y(n) = x(n-M),\quad n=0,1,2,\ldots \protect$ (3.1)

where $ x(n)\isdef 0$ for $ n<0$.

Before the digital era, delay lines were expensive and imprecise in ``analog'' form. For example, ``spring reverberators'' (common in guitar amplifiers) use metal springs as analog delay lines; while adequate for that purpose, they are highly dispersive and prone to noise pick-up. Large delays require prohibitively long springs or coils in analog implementations. In the digital domain, on the other hand, delay by $ N$ samples is trivially implemented, and non-integer delays can be implemented using interpolation techniques, as discussed later in §4.1.

A Software Delay Line

In software, a delay line is often implemented using a circular buffer. Let D denote an array of length $ M$. Then we can implement the $ M$-sample delay line in the C programming language as shown in Fig.2.2.

Figure 2.2: The $ M$-sample delay line.

 
    /* delayline.c */
    static double D[M];  // initialized to zero
    static long ptr=0;   // read-write offset

    double delayline(double x)
    {
      double y = D[ptr];    // read operation
      D[ptr++] = x;         // write operation
      if (ptr >= M) { ptr -= M; } // wrap ptr
//    ptr %= M; // modulo-operator syntax
      return y;
    }

Delay lines of this type are typically used in digital reverberators and other acoustic simulators involving fixed propagation delays. Later, in Chapter 5, we will consider time-varying delay lengths.


Next Section:
Acoustic Wave Propagation Simulation
Previous Section:
Elementary Physical Modeling Problems