Jump to content

Overlap–add method

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Paolostar (talk | contribs) at 20:11, 9 June 2007 (Created page with '== The Overlap-add Method == The '''overlap-add method''' (OA) is an efficient way to evaluate the discrete convolution between a very long signal <math>x(n)</...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The Overlap-add Method

The overlap-add method (OA) is an efficient way to evaluate the discrete convolution between a very long signal with a FIR filter .

The basic idea is to use block convolution between short segments of and the FIR filter through the FFT algorithm. Strictly speaking, let , a -point signal that has to be convolved with a short filter , , with . The result of the convolution turns out to be:

Such linear convolution coincide with the -point circular convolution of and provided that . The circular convolution can be evaluated in an efficient way through the FFT algorithm (standard approach):

where FFT and IFFT refer to the fast Fourier transform and inverse fast Fourier transform, respectively, evaluated over discrete points. Instead of computing the global FFT of , the overlap-add method makes use of the following identity:

where:

and is the number of block into which is subdivided. indicates the smallest integer larger than . One can therefore write the linear convolution (1) as the following block convolution:

where is a sequence of length . The sequence , can be evaluated with the same approach of (2), but with shorter FFTs of length . Due to the nonlinear relation between the cost of the FFT and the sequence length, the overlap-add method can be faster than performing the circular convolution directly with only one block, i.e. with (2).


The Algorithm

Figure 1: Overlap-add Method.


Fig. 1 sketches the idea of the overlap-add method. The signal is first partitioned into non-overlapping sequences, then the discrete Fourier transforms of the sequences are evaluated by multiplying the FFT of with the FFT of . After recovering of by inverse FFT, the resulting output signal is reconstructed by overlapping and adding the as shown in the figure. The overlap arises form the fact that a linear convolution is always longer than the original sequences. Note that should be chosen to have a power of 2 which makes the FFT computation efficient. A pseudocode of the algorithm is the following:

   Algorithm 1 (OA for linear convolution)
   
   Evaluate the best value of NFFT and L
   H = FFT(h,NFFT)
   i = 1
   while i <= Nx
       il = min(i+L-1,Nx)
       yt = IFFT( FFT(x(i:il,NFFT)) * H )
       k  = min(i+NFFT-1,Nx)
       y(i:k) = y(i:k) + yt
       i = i+L
   end


Circular convolution with the Overlap-add method

The overlap-add method can be used as well to evaluate circular convolutions, i.e. convolutions of periodic signals. In this case and are vectors of points containing one period of the corresponding periodic sequences, and respectively. The method is the same as the one sketched in Fig. 1 except that now the first sections of receive overlapping samples from the convolution of with the period of placed before the period having as samples. indicates the largest integer smaller than . Note that, in the general case with non-integer, the sections ending the last period before differ from the last sections of the vector . The algorithm Alg. 1 can be extended in the following way:

   Algorithm 2 (OA for circular convolution)
   
   Evaluate Algorithm 1
   ML = (NFFT-1)/L
   i = Nx-L+1
   k = NFFT - L
   while k >= 1
       il = i+L-1
       yt = IFFT( FFT(x(i:il,NFFT)) * H )
       y(1:k) = y(1:k) + yt(NFFT-k+1:NFFT)
       k  = k-L
       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 (2) 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 algortihms have been implemented under Matlab. The bold line represent the boundary of the region where the overlap-add method is faster (ratio>1) 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 (2) and the time required by the overlap-add Alg. 2 to evaluate a complex circular convolution, vs the sequence length and the filter length .


References

  • Hayes, M.H. (1999). Digital Signal Processing. Schaum's Outline Series. McGraw-Hill.
  • Matlab for the implementation of the overlap-add method through the function fftfilt.m.