Digital delay line explained

A digital delay line (or simply delay line, also called delay filter) is a discrete element in a digital filter, which allows a signal to be delayed by a number of samples. Delay lines are commonly used to delay audio signals feeding loudspeakers to compensate for the speed of sound in air, and to align video signals with accompanying audio, called audio-to-video synchronization. Delay lines may compensate for electronic processing latency so that multiple signals leave a device simultaneously despite having different pathways.

Digital delay lines are widely used building blocks in methods to simulate room acoustics, musical instruments and effects units. Digital waveguide synthesis shows how digital delay lines can be used as sound synthesis methods for various musical instruments such as string instruments and wind instruments.

If a delay line holds a non-integer value smaller than one, it results in a fractional delay line (also called interpolated delay line or fractional delay filter). A series of an integer delay line and a fractional delay filter is commonly used for modelling arbitrary delay filters in digital signal processing. The Dattorro scheme is an industry standard implementation of digital filters using fractional delay lines.

Theory

x

delayed by

M

samples[1] :

y[n]=x[n-M]

\xrightarrow[]{l{Z}}

Y(z)=\overbrace{z-M

HM(z)
}

X(z).

In this case,

z-M=HM(z)

is the integer delay filter with:

\begin{cases}|\centerdot|=1=0dB,&zerodBgain\\measuredangle=-\omegaM,&linearphasewith\omega=2\pifTswhereTsisthesamplingperiodinseconds[s].\end{cases}

The discrete-time domain filter for integer delay

M

as the inverse zeta transform of

HM(z)

is trivial, since it is an impulse shifted by

M

[2] :

hm[n]=\begin{cases}1,&forn=M\ 0,&fornM.\end{cases}

Working in the discrete-time domain with fractional delays is less trivial. In its most general theoretical form, a delay line with arbitrary fractional delay is defined as a standard delay line with delay

D\inR

, which can be modelled as the sum of an integer component

M\inZ

and a fractional component

d\inR

which is smaller than one sample:This is the

l{Z}

domain representation of a non-trivial digital filter design problem: the solution is an any time-domain filter that represents or approximates the inverse Z-transform of

HD(z)

.

Filter design solutions

Naive solution

The conceptually easiest solution is obtained by sampling the continuous-time domain solution, which is trivial for any delay value. Given a continuous-time signal

x

delayed by

D\inR

samples, or

\tau=DTs

seconds[3] :

y(t)=x(t-D)

\xrightarrow[]{l{F}}

Y(\omega)=\overbrace{e-j\omega

Hideal(\omega)
}

X(\omega).

In this case,

e-j\omega=Hideal(\omega)

is the continuous-time domain fractional delay filter with:

\begin{cases}|\centerdot|=1=0dB,&zerodBgain\\measuredangle=-\omegaD,&linearphase\\taugr=-{d\measuredangle\over{d\omega}}=D,&constantgroupdelay\\tauph=-{\measuredangle\over{\omega}}=-D,&constantphasedelay.\end{cases}

The naive solution for the sampled filter

hideal[n]

is the sampled inverse Fourier transform of

Hideal(\omega)

, which produces a non-causal IIR filter shaped as a Cardinal Sine

sinc

shifted by

D

:

hideal[n]=l{F}-1[Hideal(\omega)]= {1\over{2\pi}}

+\pi
\int\limits
-\pi

ej\omegaej\omegad\omega=sinc(n-D)={sin(\pi(n-D))\over{\pi(n-D)}}

The continuous-time domain

sinc

is shifted by the fractional delay while the sampling is always aligned to the cartesian plane, therefore:

D\inN

, the sampled shifted

sinc

degenerates to a shifted impulse just like in the theoretical solution.

D\inR

, the sampled shifted

sinc

produces a non-causal IIR filter, which is not implementable in practice.

Truncated causal FIR solution

The conceptually easiest implementable solution is the causal truncation of the naive solution above.

h\tau[n]=\begin{cases}sinc(n-D)&for0\leqn\leqN\ 0&otherwise\end{cases}     where     {N-1\over{2}}<D<{N+1\over{2}}     and     Nistheorderofthefilter.

Truncating the impulse response might however cause instability, which can be mitigated in a few ways:

L

in order to align the window and the

sinc

and provide symmetric filtering[4] .

h\tau[n]=\begin{cases}w(n-D)sinc(n-D)&forL\leqn\leqL+N\ 0&otherwise\end{cases}     where     L=\begin{cases}round(D)-{N\over{2}}&forevenN\\lfloorD\rfloor-{N-1\over{2}}&foroddN\end{cases}

ELS={1\over{2\pi}}

\alpha\pi
\int\limits
-\alpha\pi

w(\omega)

j\omega
|H
D(e

)-

j\omega
H
D(e

)|2d\omega      where0<\alpha\leq1isthepassbandwidthparameter

hD[n]=

N
\prod
k=0,kn

{D-k\over{n-k}}     where     0\leqn\leqN

What follows is an expansion of the formula above displaying the resulting filters of order up to

N=3

:
Lagrange Interpolator Formula Expansion

h\tau[0]

h\tau[1]

h\tau[2]

h\tau[3]

N = 1

1-D

D

--
N = 2

{(D-1)(D-2)\over{2}}

-D(D-2)

{D(D-1)\over{2}}

-
N = 3

-{(D-1)(D-2)(D-3)\over{6}}

{D(D-2)(D-3)\over{2}}

-{D(D-1)(D-3)\over{2}}

{D(D-1)(D-2)\over{6}}

All-pass IIR phase-approximated solution

Another approach is designing an IIR filter of order

N

with a Z-transform structure that forces it to be an all-pass while still approximating a

D

delay:

HD(z)={z-NA(z)\over{A(z-1)}}={aN+aN-1z-1

-(N-1)
+...+a
1z

+z-N

-1
\over{1+a
1z

+...+aN-1z-(N-1)

-N
+a
Nz
}}\;\;\;\;\; \text \;\;\;\;\; \begin |\centerdot| = 1 = 0dB & 0dB \text \\ \measuredangle_ = -N\omega + 2\measuredangle_ = -D\omega & \text D \end
The reciprocally placed zeros and poles of

A(z)andA(z-1)

respectively flatten the frequency

|\centerdot|

response
, while the phase is function of the phase of

A(z)

. Therefore, the problem becomes designing the FIR filter

A(z)

, that is finding its coefficients

ak

as a function of D (note that

a0=1

always), so that the phase approximates best the desired value
\measuredangle
HD(z)

=-D\omega

.

The main solutions are:

ELS={1\over{2\pi}}

\pi
\int\limits
-\pi

w(\omega)|\underbrace{

\underbrace{-D\omega}
\measuredangleID

-\underbrace{(-N\omega+2\measuredangleA(z)

)}
\measuredangleH
}
\Delta\measuredangle
HD

|2d\omega

ELS={1\over{2\pi}}

\pi
\int\limits
-\pi

w(\omega)|{{

\Delta\measuredangle
HD

}\over{\omega}}|2

ak

for positive delay

D>0

:

ak=

N
(-1)
l=0

{D+l\over{D+k+l}}      where      \binom{n}{k}={N!\over{k!(N-k)!}}

What follows is an expansion of the formula above displaying the resulting coefficients of order up to

N=3

:
Thiran All-Pole Low-Pass Filter Coefficients Formula Expansion[7]

a0

a1

a2

a3

N = 11

-{D-1\over{D+1}}

--
N = 21

-2{D-2\over{D+1}}

{(D-1)(D-2)\over{(D+1)(D+2)}}

-
N = 31

-3{D-3\over{D+1}}

3{(D-2)(D-3)\over{(D+1)(D+2)}}

-{(D-1)(D-2)(D-3)\over{(D+1)(D+2)(D+3)}}

Commercial history

Digital delay lines were first used to compensate for the speed of sound in air in 1973 to provide appropriate delay times for the distant speaker towers at the Summer Jam at Watkins Glen rock festival in New York, with 600,000 people in the audience. New York City–based company Eventide Clock Works provided digital delay devices each capable of 200 milliseconds of delay. Four speaker towers were placed 200feet from the stage, their signal delayed 175 ms to compensate for the speed of sound between the main stage speakers and the delay towers. Six more speaker towers were placed 400 feet from the stage, requiring 350 ms of delay, and a further six towers were placed 600 feet away from the stage, fed with 525 ms of delay. Each Eventide DDL 1745 module contained one hundred 1000-bit shift register chips and a bespoke digital-to-analog converter, and cost $3,800 .[8] [9]

See also

References

  1. Web site: Delay Lines . 2023-07-06 . ccrma.stanford.edu.
  2. Web site: INTRODUCTION TO DIGITAL FILTERS WITH AUDIO APPLICATIONS . 2023-07-06 . ccrma.stanford.edu.
  3. Web site: Ideal Bandlimited (Sinc) Interpolation . 2023-07-06 . ccrma.stanford.edu.
  4. Harris . F.J. . 1978 . On the use of windows for harmonic analysis with the discrete Fourier transform . Proceedings of the IEEE . 66 . 1 . 51–83 . 10.1109/proc.1978.10837 . 426548 . 0018-9219.
  5. Hermanowicz . E. . 1992 . }} formulas for weighting coefficients of maximally flat tunable FIR delays ]. Electronics Letters . en . 28 . 20 . 1936 . 10.1049/el:19921239.
  6. Thiran . J.-P. . 1971 . Recursive digital filters with maximally flat group delay . IEEE Transactions on Circuit Theory . 18 . 6 . 659–664 . 10.1109/TCT.1971.1083363 . 0018-9324.
  7. Web site: Välimäki . Vesa . 1998 . Discrete Time Modeling of Acoustic Tubes Using Fractional Delay Filters .
  8. Web site: Nalia Sanchez . July 29, 2016 . Remembering the Watkins Glen Festival . February 20, 2020 . Eventide Audio . cs2.
  9. Web site: DDL 1745 Digital Delay . 2023-07-22 . Eventide Audio . en-US.

Further reading

External links