A digital delay line (or simply delay line, also called delay filter) is a discrete element in a digital filter that 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 The standard delay line with integer delay is derived from the Z-transform of a discrete-time signal x delayed by M samples:y[n]=x[n−M] →𝒵 Y(z)=z−M⏞HM(z)X(z). In this case, z−M=HM(z) is the integer delay filter with: {|⋅|=1=0dB,zero dB gain∡=−ωM,linear phase with ω=2πfTs where Ts is the sampling period in seconds [s].
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: hm[n]={1,for n=M0,for n≠M. 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∈ℝ, which can be modelled as the sum of an integer component M∈ℤ and a fractional component d∈ℝ which is smaller than one sample:This is the 𝒵 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∈ℝ samples, or τ=DTs seconds:y(t)=x(t−D) →ℱ Y(ω)=e−jωD⏞Hideal(ω)X(ω). In this case, e−jωD=Hideal(ω) is the continuous-time domain fractional delay filter with: {|⋅|=1=0dB,zero dB gain∡=−ωD,linear phaseτgr=−d∡dω=D,constant group delayτph=−∡ω=−D,constant phase delay.
The naive solution for the sampled filter hideal[n] is the sampled inverse Fourier transform of Hideal(ω), which produces a non-causal IIR filter shaped as a Cardinal Sine sinc() shifted by D:hideal[n]=ℱ−1[Hideal(ω)]=12π∫−π+πejωDejωndω=sinc(n−D)=sin(π(n−D))π(n−D)The continuous-time domain sinc is shifted by the fractional delay while the sampling is always aligned to the cartesian plane, therefore: when the delay is an integer number of samples D∈ℕ, the sampled shifted sinc degenerates to a shifted impulse just like in the theoretical solution. when the delay is a fractional number of samples D∈ℝ, 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τ[n]={sinc(n−D)for 0≤n≤N0otherwisewhereN−12<D<N+12andNis the order of the filter.Truncating the impulse response might however cause instability, which can be mitigated in a few ways: Windowing the truncated impulse response, therefore smoothing it. Note that in this case we have to add a further shift L in order to align the window and the sinc() and provide symmetric filtering.hτ[n]={w(n−D)sinc(n−D)for L≤n≤L+N0otherwisewhereL={round(D)−N2for even N⌊D⌋−N−12for odd N General Least Square (GLS) Method: iteratively adjusts the frequency response by windowing a Least Square Integral Error design, which minimises the square integral error between ideal and truncated frequency responses of the filter, defined as: ELS=12π∫−απαπw(ω)|HDtruncated(ejω)−HDid(ejω)|2dωwhere 0<α≤1 is the passband width parameter Lagrange Interpolator (Maximally Flat Fractional Delay Filter): adds "flatness" constraints to the first N derivatives of the Least Square Integral Error. This method is of particular interest because it has a closed form solution:
hD[n]=∏k=0,k≠nND−kn−kwhere0≤n≤NWhat follows is an expansion of the formula above displaying the resulting filters of order up to N=3:
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)A(z−1)=aN+aN−1z−1+...+a1z−(N−1)+z−N1+a1z−1+...+aN−1z−(N−1)+aNz−Nwhich has{|⋅|=1=0dB0dB gain∡HD(z)=−Nω+2∡A(z)=−Dωdesired value for delay DThe reciprocally placed zeros and poles of A(z) and A(z−1) respectively flatten the frequency |⋅| 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 ∡HD(z)=−Dω. The main solutions are:
Iterative minimization of Least Square Phase Error, which is defined as: ELS=12π∫−ππw(ω)|−Dω⏟∡ID−(−Nω+2∡A(z))⏟∡H⏟Δ∡HD|2dω Iterative minimization of Least Square Phase Delay Error, which is defined as: ELS=12π∫−ππw(ω)|Δ∡HDω|2 Thiran All-Pole Low-Pass Filter with Maximally Flat Group Delay. This yields a closed solution for finding the coefficients ak for positive delay D>0: ak=(−1)k(Nk)∏l=0ND+lD+k+lwhere(nk)=N!k!(N−k)! What follows is an expansion of the formula above displaying the resulting coefficients of order up to N=3:
Commercial history
… excerpt ends here. Continue reading the full article.

![Digital delay line: A block diagram representation of the Lagrange Interpolator formula.[10]](https://thumb.wikimedia.org/wikipedia/commons/thumb/d/dd/Block_Diagram_for_the_Explicit_Formula_for_Lagrange_Interpolation_Coefficients.png/1280px-Block_Diagram_for_the_Explicit_Formula_for_Lagrange_Interpolation_Coefficients.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)
