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 04:37, 15 January 2020 (Replace graphic depiction of algorithm with new version derived from Overlap-save method). 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 :

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 -point circular convolution of with in the region [1, N].

The advantage is that the circular convolution can be computed very efficiently as follows, according to the circular convolution theorem:

where FFT and IFFT refer to the fast Fourier transform and inverse fast Fourier transform, respectively, evaluated over discrete points.

Pseudocode

A pseudocode of the algorithm is the following:

   Algorithm 1 (OA for linear convolution)
   Evaluate the best value of N and L (L > 0, N = M + L - 1 nearest to power of 2).
   Nx = length(x);
   H = FFT(h, N)       (zero-padded FFT)
   i = 1
   y = zeros(1, M + Nx - 1)
   while i <= Nx  (Nx: the last index of x[n])
       il = min(i + L - 1, Nx)
       yt = IFFT( FFT(x(i:il), N) * H, N)
       k  = min(i + N - 1, M + Nx - 1)
       y(i:k) = y(i:k) + yt(1:k - i + 1)    (add the overlapped output blocks)
       i = i + L
   end

Cost of the overlap-add method

The cost of the convolution can be associated to the number of complex multiplications involved in the operation. The major computational effort is due to the FFT operation, which for a radix-2 algorithm applied to a signal of length roughly calls for complex multiplications. It turns out that the number of complex multiplications of the overlap-add method are:

accounts for the FFT + filter multiplication + IFFT operation.

The additional cost of the sections involved in the circular version of the overlap–add method is usually very small and can be neglected for the sake of simplicity. The best value of can be found by numerical search of the minimum of by spanning the integer in the range . Being a power of two, the FFTs of the overlap–add method are computed efficiently. Once evaluated the value of it turns out that the optimal partitioning of has . 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 . However such functions accounts only for the cost of the complex multiplications, regardless of the other operations involved in the algorithm. A direct measure of the computational time required by the algorithms is of much interest. Fig. 2 shows the ratio of the measured time to evaluate a standard circular convolution using Eq.1 with the time elapsed by the same convolution using the overlap–add method in the form of Alg. 2, vs. the sequence and the filter length. Both algorithms have been implemented under Matlab. The bold line represents the boundary of the region where the overlap–add method is faster than the standard circular convolution. Note that the overlap–add method in the tested cases can be three times faster than the standard method.

Figure 2: Ratio between the time required by Eq.1 and the time required by the overlap–add Alg. 2 to evaluate a complex circular convolution, vs the sequence length and the filter length .

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.