Acoustic Modeling with Digital Delay
Delay Lines
A Software Delay LineSearch Physical Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
In software, a delay line is often implemented using a circular
buffer. Let D denote an array of length
. Then we can
implement the
-sample delay line in the C programming
language as shown in Fig.1.2.
/* 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
return y;
}
|
Delay lines of this type are typically used in digital reverberators and other acoustic simulators involving fixed propagation delays. Later, in Chapter 3, we will consider time-varying delay lengths.
