Jump to content

Overlap–add method

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Bob K (talk | contribs) at 22:04, 21 January 2020 (remove unused equation number). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In signal processing, the overlap–add method (OA, OLA) is an efficient way to evaluate the discrete convolution of a very long signal with a finite impulse response (FIR) filter :

Fig 1: A sequence of 5 plots depicts one cycle of the Overlap-add convolution algorithm. The first plot is a long sequence of data to be processed with a lowpass FIR filter. The 2nd plot is one segment of the data to be processed in piecewise fashion. The 3rd plot is the filtered segment, including the filter rise and fall transients. The 4th plot indicates where the new data will be added with the result of previous segments. The 5th plot is the updated output stream. The FIR filter is a boxcar lowpass with M=16 samples, the length of the segments is L=100 samples and the overlap is 15 samples.

where h[m] = 0 for m outside the region [1, M].

The concept is to divide the problem into multiple convolutions of h[n] with short segments of :

where L is an arbitrary segment length. Then:

and y[n] can be written as a sum of short convolutions:[1]

where the linear convolution is zero outside the region [1, L + M − 1]. And for any parameter [A] it is equivalent to the N-point circular convolution of with in the region [1, N].  The advantage is that the circular convolution can be computed more efficiently than linear convolution, according to the circular convolution theorem:

where:

  • DFT and DFT−1 refer to the Discrete Fourier transform and its inverse, evaluated over N discrete points, and
  • L is customarily chosen such that N = L+M-1 is an integer power-of-2, and the transforms are implemented with the FFT algorithm, for efficiency.

Pseudocode

The following is a pseudocode of the algorithm:

(Overlap-add algorithm for linear convolution)
h = FIR_impulse_response
M = length(h)
Nx = length(x)
N = 8 × M    (see next section for a better choice)
step_size = N - (M-1)
H = DFT(h, N)
position = 0
y(1 : Nx + M-1) = 0

 while position + step_size ≤ Nx
    y(position+(1:N)) = y(position+(1:N)) + IDFT(DFT(x(position+(1:step_size)), N) × H)
    position = position + step_size
 end

Efficiency considerations

Fig 2: A graph of the values of N (an integer power of 2) that minimize the cost function

Most of the computation required is involved in complex multiplications. The number performed by an -length radix-2 FFT is approximately Consequently, the number of complex multiplications of the overlap-add method is given by:

which includes the FFT, filter multiplication, and FFT-1 operations, and is the total signal length. Figure 2 is a graph of the values of N that minimize for a range of filter lengths (M).

For comparison, the cost of the standard circular convolution of and is:

Hence the cost of the overlap–add method scales almost as while the cost of the standard circular convolution method is almost . The two methods are also compared in Figure 3, created by Matlab simulation. The contours are lines of constant ratio of the times it takes to perform both methods. When the overlap-add method is faster, the ratio exceeds 1, and ratios as high as 3 are seen.

Fig 3: Gain of the overlap-add method wrt the standard FFT method to evaluate a circular convolution, vs signal length Nx and filter length Nh.

See also

Notes

  1. ^ This condition implies that the segment has at least M-1 appended zeros, which prevents circular overlap of the output rise and fall transients.

References

  1. ^ Rabiner, Lawrence R.; Gold, Bernard (1975). "2.25". Theory and application of digital signal processing. Englewood Cliffs, N.J.: Prentice-Hall. pp. 63–65. ISBN 0-13-914101-4.

Further reading

  • Oppenheim, Alan V.; Schafer, Ronald W. (1975). Digital signal processing. Englewood Cliffs, N.J.: Prentice-Hall. ISBN 0-13-214635-5.
  • Hayes, M. Horace (1999). Digital Signal Processing. Schaum's Outline Series. New York: McGraw Hill. ISBN 0-07-027389-8.