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.
 
The standard delay line with integer delay is derived from the Z-transform of a discrete-time signal 
  
    
      
        x
      
    
    {\displaystyle x}
  
 delayed by 
  
    
      
        M
      
    
    {\displaystyle M}
  
 samples: 
  
    
      
        y
        [
        n
        ]
        =
        x
        [
        n
        −
        M
        ]
      
    
    {\displaystyle y[n]=x[n-M]}
  
    
  
    
      
        
          
            →
            
              

              
            
            
              
                Z
              
            
          
        
      
    
    {\displaystyle {\xrightarrow[{}]{\mathcal {Z}}}}
  
    
  
    
      
        Y
        (
        z
        )
        =
        
          
            
              
                z
                
                  −
                  M
                
              
              ⏞
            
          
          
            
              H
              
                M
              
            
            (
            z
            )
          
        
        X
        (
        z
        )
        .
      
    
    {\displaystyle Y(z)=\overbrace {z^{-M}} ^{H_{M}(z)}X(z).}
  
 In this case, 
  
    
      
        
          z
          
            −
            M
          
        
        =
        
          H
          
            M
          
        
        (
        z
        )
      
    
    {\displaystyle z^{-M}=H_{M}(z)}
  
 is the integer delay filter with:
 
  
    
      
        
          
            {
            
              
                
                  
                    |
                  
                  ⋅
                  
                    |
                  
                  =
                  1
                  =
                  0
                  d
                  B
                  ,
                
                
                  
                    zero dB gain
                  
                
              
              
                
                  ∡
                  =
                  −
                  ω
                  M
                  ,
                
                
                  
                    linear phase with 
                  
                  ω
                  =
                  2
                  π
                  f
                  
                    T
                    
                      s
                    
                  
                  
                     where 
                  
                  
                    T
                    
                      s
                    
                  
                  
                     is the sampling period in seconds 
                  
                  [
                  s
                  ]
                  .
                
              
            
            
          
        
      
    
    {\displaystyle {\begin{cases}|\centerdot |=1=0dB,&{\text{zero dB gain}}\\\measuredangle =-\omega M,&{\text{linear phase with }}\omega =2\pi fT_{s}{\text{ where }}T_{s}{\text{ is the sampling period in seconds }}[s].\end{cases}}}
  

 
The discrete-time domain filter for integer delay 
  
    
      
        M
      
    
    {\displaystyle M}
  
 as the inverse zeta transform of 
  
    
      
        
          H
          
            M
          
        
        (
        z
        )
      
    
    {\displaystyle H_{M}(z)}
  
 is trivial, since it is an impulse shifted by 
  
    
      
        M
      
    
    {\displaystyle M}
  
: 

  
    
      
        
          h
          
            m
          
        
        [
        n
        ]
        =
        
          
            {
            
              
                
                  
                    1
                  
                  ,
                
                
                  
                    for 
                  
                  n
                  =
                  M
                
              
              
                
                  0
                  ,
                
                
                  
                    for 
                  
                  n
                  ≠
                  M
                  .
                
              
            
            
          
        
      
    
    {\displaystyle h_{m}[n]={\begin{cases}{\text{1}},&{\text{for }}n=M\\0,&{\text{for }}n\neq M.\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
        ∈
        
          R
        
      
    
    {\displaystyle D\in \mathbb {R} }
  
, which can be modelled as the sum of an integer component 
  
    
      
        M
        ∈
        
          Z
        
      
    
    {\displaystyle M\in \mathbb {Z} }
  
 and a fractional component 
  
    
      
        d
        ∈
        
          R
        
      
    
    {\displaystyle d\in \mathbb {R} }
  
 which is smaller than one sample:         (Def. 1) This is the 
  
    
      
        
          
            Z
          
        
      
    
    {\displaystyle {\mathcal {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 
  
    
      
        
          H
          
            D
          
        
        (
        z
        )
      
    
    {\displaystyle H_{D}(z)}
  
.
 
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
      
    
    {\displaystyle x}
  
 delayed by 
  
    
      
        D
        ∈
        
          R
        
      
    
    {\displaystyle D\in \mathbb {R} }
  
 samples, or  
  
    
      
        τ
        =
        D
        
          T
          
            s
          
        
      
    
    {\displaystyle \tau =DT_{s}}
  
 seconds: 
  
    
      
        y
        (
        t
        )
        =
        x
        (
        t
        −
        D
        )
      
    
    {\displaystyle y(t)=x(t-D)}
  
     
  
    
      
        
          
            →
            
              

              
            
            
              
                F
              
            
          
        
      
    
    {\displaystyle {\xrightarrow[{}]{\mathcal {F}}}}
  
     
  
    
      
        Y
        (
        ω
        )
        =
        
          
            
              
                e
                
                  −
                  j
                  ω
                  D
                
              
              ⏞
            
          
          
            
              H
              
                i
                d
                e
                a
                l
              
            
            (
            ω
            )
          
        
        X
        (
        ω
        )
        .
      
    
    {\displaystyle Y(\omega )=\overbrace {e^{-j\omega D}} ^{H_{ideal}(\omega )}X(\omega ).}
  
        In this case, 
  
    
      
        
          e
          
            −
            j
            ω
            D
          
        
        =
        
          H
          
            i
            d
            e
            a
            l
          
        
        (
        ω
        )
      
    
    {\displaystyle e^{-j\omega D}=H_{ideal}(\omega )}
  
 is the continuous-time domain fractional delay filter with:
 
  
    
      
        
          
            {
            
              
                
                  
                    |
                  
                  ⋅
                  
                    |
                  
                  =
                  1
                  =
                  0
                  d
                  B
                  ,
                
                
                  
                    zero dB gain
                  
                
              
              
                
                  ∡
                  =
                  −
                  ω
                  D
                  ,
                
                
                  
                    linear phase
                  
                
              
              
                
                  
                    τ
                    
                      g
                      r
                    
                  
                  =
                  −
                  
                    
                      
                        d
                        ∡
                      
                      
                        d
                        ω
                      
                    
                  
                  =
                  D
                  ,
                
                
                  
                    constant group delay
                  
                
              
              
                
                  
                    τ
                    
                      p
                      h
                    
                  
                  =
                  −
                  
                    
                      ∡
                      
                        ω
                      
                    
                  
                  =
                  −
                  D
                  ,
                
                
                  
                    constant phase delay.
                  
                
              
            
            
          
        
      
    
    {\displaystyle {\begin{cases}|\centerdot |=1=0dB,&{\text{zero dB gain}}\\\measuredangle =-\omega D,&{\text{linear phase}}\\\tau _{gr}=-{d\measuredangle  \over {d\omega }}=D,&{\text{constant group delay}}\\\tau _{ph}=-{\measuredangle  \over {\omega }}=-D,&{\text{constant phase delay.}}\end{cases}}}
  

 
The naive solution for the sampled filter 
  
    
      
        
          h
          
            i
            d
            e
            a
            l
          
        
        [
        n
        ]
      
    
    {\displaystyle h_{ideal}[n]}
  
 is the sampled inverse Fourier transform of 
  
    
      
        
          H
          
            i
            d
            e
            a
            l
          
        
        (
        ω
        )
      
    
    {\displaystyle H_{ideal}(\omega )}
  
, which produces a non-causal IIR filter shaped as a Cardinal Sine 
  
    
      
        s
        i
        n
        c
        (
        )
      
    
    {\displaystyle sinc()}
  
 shifted by 
  
    
      
        D
      
    
    {\displaystyle D}
  
: 
  
    
      
        
          h
          
            i
            d
            e
            a
            l
          
        
        [
        n
        ]
        =
        
          
            
              F
            
          
          
            −
            1
          
        
        [
        
          H
          
            i
            d
            e
            a
            l
          
        
        (
        ω
        )
        ]
        =
        
          
            1
            
              2
              π
            
          
        
        
          ∫
          
            −
            π
          
          
            +
            π
          
        
        
          e
          
            j
            ω
            D
          
        
        
          e
          
            j
            ω
            n
          
        
        d
        ω
        =
        s
        i
        n
        c
        (
        n
        −
        D
        )
        =
        
          
            
              s
              i
              n
              (
              π
              (
              n
              −
              D
              )
              )
            
            
              π
              (
              n
              −
              D
              )
            
          
        
      
    
    {\displaystyle h_{ideal}[n]={\mathcal {F}}^{-1}[H_{ideal}(\omega )]={1 \over {2\pi }}\int \limits _{-\pi }^{+\pi }e^{j\omega D}e^{j\omega n}d\omega =sinc(n-D)={sin(\pi (n-D)) \over {\pi (n-D)}}}
  
 The continuous-time domain 
  
    
      
        s
        i
        n
        c
      
    
    {\displaystyle sinc}
  
 is shifted by the fractional delay while the sampling is always aligned to the cartesian plane, therefore:
 
The conceptually easiest implementable solution is the causal truncation of the naive solution above.  
  
    
      
        
          h
          
            τ
          
        
        [
        n
        ]
        =
        
          
            {
            
              
                
                  s
                  i
                  n
                  c
                  (
                  n
                  −
                  D
                  )
                
                
                  
                    for 
                  
                  0
                  ≤
                  n
                  ≤
                  N
                
              
              
                
                  0
                
                
                  
                    otherwise
                  
                
              
            
            
          
        
        
        
        
        
        
        
          where
        
        
        
        
        
        
        
          
            
              N
              −
              1
            
            
              2
            
          
        
        <
        D
        <
        
          
            
              N
              +
              1
            
            
              2
            
          
        
        
        
        
        
        
        
          and
        
        
        
        
        
        
        N
        
        
          is the order of the filter.
        
      
    
    {\displaystyle h_{\tau }[n]={\begin{cases}sinc(n-D)&{\text{for }}0\leq n\leq N\\0&{\text{otherwise}}\end{cases}}\;\;\;\;\;{\text{where}}\;\;\;\;\;{N-1 \over {2}}<D<{N+1 \over {2}}\;\;\;\;\;{\text{and}}\;\;\;\;\;N\;{\text{is the order of the filter.}}}
  
 Truncating the impulse response might however cause instability, which can be mitigated in a few ways:
 
  
    
      
        
          h
          
            τ
          
        
        [
        n
        ]
        =
        
          
            {
            
              
                
                  w
                  (
                  n
                  −
                  D
                  )
                  s
                  i
                  n
                  c
                  (
                  n
                  −
                  D
                  )
                
                
                  
                    for 
                  
                  L
                  ≤
                  n
                  ≤
                  L
                  +
                  N
                
              
              
                
                  0
                
                
                  
                    otherwise
                  
                
              
            
            
          
        
        
        
        
        
        
        
          where
        
        
        
        
        
        
        L
        =
        
          
            {
            
              
                
                  r
                  o
                  u
                  n
                  d
                  (
                  D
                  )
                  −
                  
                    
                      N
                      
                        2
                      
                    
                  
                
                
                  
                    for even 
                  
                  N
                
              
              
                
                  ⌊
                  D
                  ⌋
                  −
                  
                    
                      
                        N
                        −
                        1
                      
                      
                        2
                      
                    
                  
                
                
                  
                    for odd 
                  
                  N
                
              
            
            
          
        
      
    
    {\displaystyle h_{\tau }[n]={\begin{cases}w(n-D)sinc(n-D)&{\text{for }}L\leq n\leq L+N\\0&{\text{otherwise}}\end{cases}}\;\;\;\;\;{\text{where}}\;\;\;\;\;L={\begin{cases}round(D)-{N \over {2}}&{\text{for even }}N\\\lfloor D\rfloor -{N-1 \over {2}}&{\text{for odd }}N\end{cases}}}
  
 
  
    
      
        
          E
          
            L
            S
          
        
        =
        
          
            1
            
              2
              π
            
          
        
        
          ∫
          
            −
            α
            π
          
          
            α
            π
          
        
        w
        (
        ω
        )
        
          |
        
        
          H
          
            D
          
          
            t
            r
            u
            n
            c
            a
            t
            e
            d
          
        
        (
        
          e
          
            j
            ω
          
        
        )
        −
        
          H
          
            D
          
          
            i
            d
          
        
        (
        
          e
          
            j
            ω
          
        
        )
        
          
            |
          
          
            2
          
        
        d
        ω
        
        
        
        
        
        
          where 
        
        0
        <
        α
        ≤
        1
        
           is the passband width parameter
        
      
    
    {\displaystyle E_{LS}={1 \over {2\pi }}\int \limits _{-\alpha \pi }^{\alpha \pi }w(\omega )|H_{D}^{truncated}(e^{j\omega })-H_{D}^{id}(e^{j\omega })|^{2}d\omega \;\;\;\;\;{\text{where }}0<\alpha \leq 1{\text{ is the passband width parameter}}}
  
 
  
    
      
        
          h
          
            D
          
        
        [
        n
        ]
        =
        
          ∏
          
            k
            =
            0
            ,
            
            k
            ≠
            n
          
          
            N
          
        
        
          
            
              D
              −
              k
            
            
              n
              −
              k
            
          
        
        
        
        
        
        
        
          where
        
        
        
        
        
        
        0
        ≤
        n
        ≤
        N
      
    
    {\displaystyle h_{D}[n]=\prod _{k=0,\;k\neq n}^{N}{D-k \over {n-k}}\;\;\;\;\;{\text{where}}\;\;\;\;\;0\leq n\leq N}
  
 What follows is an expansion of the formula above displaying the resulting filters of order up to 
  
    
      
        N
        =
        3
      
    
    {\displaystyle N=3}
  
:
 
 
Another approach is designing an IIR filter of order 
  
    
      
        N
      
    
    {\displaystyle N}
  
 with a Z-transform structure that forces it to be an all-pass while still approximating a 
  
    
      
        D
      
    
    {\displaystyle D}
  
 delay: 
  
    
      
        
          H
          
            D
          
        
        (
        z
        )
        =
        
          
            
              
                z
                
                  −
                  N
                
              
              A
              (
              z
              )
            
            
              A
              (
              
                z
                
                  −
                  1
                
              
              )
            
          
        
        =
        
          
            
              
                a
                
                  N
                
              
              +
              
                a
                
                  N
                  −
                  1
                
              
              
                z
                
                  −
                  1
                
              
              +
              .
              .
              .
              +
              
                a
                
                  1
                
              
              
                z
                
                  −
                  (
                  N
                  −
                  1
                  )
                
              
              +
              
                z
                
                  −
                  N
                
              
            
            
              1
              +
              
                a
                
                  1
                
              
              
                z
                
                  −
                  1
                
              
              +
              .
              .
              .
              +
              
                a
                
                  N
                  −
                  1
                
              
              
                z
                
                  −
                  (
                  N
                  −
                  1
                  )
                
              
              +
              
                a
                
                  N
                
              
              
                z
                
                  −
                  N
                
              
            
          
        
        
        
        
        
        
        
          which has
        
        
        
        
        
        
        
          
            {
            
              
                
                  
                    |
                  
                  ⋅
                  
                    |
                  
                  =
                  1
                  =
                  0
                  d
                  B
                
                
                  0
                  d
                  B
                  
                     gain
                  
                
              
              
                
                  
                    ∡
                    
                      
                        H
                        
                          D
                        
                      
                      (
                      z
                      )
                    
                  
                  =
                  −
                  N
                  ω
                  +
                  2
                  
                    ∡
                    
                      A
                      (
                      z
                      )
                    
                  
                  =
                  −
                  D
                  ω
                
                
                  
                    desired value for delay 
                  
                  D
                
              
            
            
          
        
      
    
    {\displaystyle H_{D}(z)={z^{-N}A(z) \over {A(z^{-1})}}={a_{N}+a_{N-1}z^{-1}+...+a_{1}z^{-(N-1)}+z^{-N} \over {1+a_{1}z^{-1}+...+a_{N-1}z^{-(N-1)}+a_{N}z^{-N}}}\;\;\;\;\;{\text{which has}}\;\;\;\;\;{\begin{cases}|\centerdot |=1=0dB&0dB{\text{ gain}}\\\measuredangle _{H_{D}(z)}=-N\omega +2\measuredangle _{A(z)}=-D\omega &{\text{desired value for delay }}D\end{cases}}}
  
 The reciprocally placed zeros and poles of 
  
    
      
        A
        (
        z
        )
        
           and 
        
        A
        (
        
          z
          
            −
          
        
        1
        )
      
    
    {\displaystyle A(z){\text{ and }}A(z^{-}1)}
  
 respectively flatten the frequency 
  
    
      
        
          |
        
        ⋅
        
          |
        
      
    
    {\displaystyle |\centerdot |}
  
 response, while the phase is function of the phase of 
  
    
      
        A
        (
        z
        )
      
    
    {\displaystyle A(z)}
  
. Therefore, the problem becomes designing the FIR filter 
  
    
      
        A
        (
        z
        )
      
    
    {\displaystyle A(z)}
  
, that is finding its coefficients 
  
    
      
        
          a
          
            k
          
        
      
    
    {\displaystyle a_{k}}
  
 as a function of D (note that 
  
    
      
        
          a
          
            0
          
        
        =
        1
      
    
    {\displaystyle a_{0}=1}
  
 always), so that the phase approximates best the desired value 
  
    
      
        
          ∡
          
            
              H
              
                D
              
            
            (
            z
            )
          
        
        =
        −
        D
        ω
      
    
    {\displaystyle \measuredangle _{H_{D}(z)}=-D\omega }
  
. 
 The main solutions are:
 
  
    
      
        
          E
          
            L
            S
          
        
        =
        
          
            1
            
              2
              π
            
          
        
        
          ∫
          
            −
            π
          
          
            π
          
        
        w
        (
        ω
        )
        
          |
        
        
          
            
              
                
                  
                    
                      
                        −
                        D
                        ω
                      
                      ⏟
                    
                  
                  
                    
                      ∡
                      
                        I
                        D
                      
                    
                  
                
                −
                
                  
                    
                      
                        (
                        −
                        N
                        ω
                        +
                        2
                        
                          ∡
                          
                            A
                            (
                            z
                            )
                          
                        
                        )
                      
                      ⏟
                    
                  
                  
                    
                      ∡
                      
                        H
                      
                    
                  
                
              
              ⏟
            
          
          
            Δ
            
              ∡
              
                
                  H
                  
                    D
                  
                
              
            
          
        
        
          
            |
          
          
            2
          
        
        d
        ω
      
    
    {\displaystyle E_{LS}={1 \over {2\pi }}\int \limits _{-\pi }^{\pi }w(\omega )|\underbrace {\underbrace {-D\omega } _{\measuredangle _{ID}}-\underbrace {(-N\omega +2\measuredangle _{A(z)})} _{\measuredangle _{H}}} _{\Delta \measuredangle _{H_{D}}}|^{2}d\omega }
  
 
  
    
      
        
          E
          
            L
            S
          
        
        =
        
          
            1
            
              2
              π
            
          
        
        
          ∫
          
            −
            π
          
          
            π
          
        
        w
        (
        ω
        )
        
          |
        
        
          
            
              Δ
              
                ∡
                
                  
                    H
                    
                      D
                    
                  
                
              
            
            
              ω
            
          
        
        
          
            |
          
          
            2
          
        
      
    
    {\displaystyle E_{LS}={1 \over {2\pi }}\int \limits _{-\pi }^{\pi }w(\omega )|{{\Delta \measuredangle _{H_{D}}} \over {\omega }}|^{2}}
  
 
  
    
      
        
          a
          
            k
          
        
        =
        (
        −
        1
        
          )
          
            k
          
        
        
          
            
              (
            
            
              N
              k
            
            
              )
            
          
        
        
          ∏
          
            l
            =
            0
          
          
            N
          
        
        
          
            
              D
              +
              l
            
            
              D
              +
              k
              +
              l
            
          
        
        
        
        
        
        
        
          where
        
        
        
        
        
        
        
          
            
              (
            
            
              n
              k
            
            
              )
            
          
        
        =
        
          
            
              N
              !
            
            
              k
              !
              (
              N
              −
              k
              )
              !
            
          
        
      
    
    {\displaystyle a_{k}=(-1)^{k}{\binom {N}{k}}\prod _{l=0}^{N}{D+l \over {D+k+l}}\;\;\;\;\;{\text{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
      
    
    {\displaystyle N=3}
  
:
 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 200 feet (60 m) 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 (equivalent to $26,585 in 2022).