overlap–add method
   HOME

TheInfoList



OR:

In
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, and scientific measurements. Signal processing techniq ...
, the overlap–add method is an efficient way to evaluate the discrete
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
of a very long signal x /math> with a
finite impulse response In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to infinite impulse r ...
(FIR) filter h /math>: where for ''m'' outside the region . This article uses common abstract notations, such as y(t) = x(t) * h(t), or y(t) = \mathcal\, in which it is understood that the functions should be thought of in their totality, rather than at specific instants t (see Convolution#Notation). The concept is to divide the problem into multiple convolutions of ''h'' 'n''with short segments of x /math>: :x_k \triangleq\ \begin x + kL & n = 1, 2, \ldots, L\\ 0, & \text, \end where ''L'' is an arbitrary segment length. Then: :x = \sum_ x_k - kL\, and ''y'' 'n''can be written as a sum of short convolutions: :\begin y = \left(\sum_ x_k - kLright) * h &= \sum_ \left(x_k - kL* h right)\\ &= \sum_ y_k - kL \end where the linear convolution y_k \triangleq\ x_k * h , is zero outside the region . And for any parameter N \ge L + M - 1,\, it is equivalent to the ''N''-point
circular convolution Circular convolution, also known as cyclic convolution, is a special case of periodic convolution, which is the convolution of two periodic functions that have the same period. Periodic convolution arises, for example, in the context of the discre ...
of x_k , with h , in the .  The advantage is that the circular convolution can be computed more efficiently than linear convolution, according to the circular convolution theorem: where: * DFTN and IDFTN refer to the
Discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex- ...
and its inverse, evaluated over ''N'' discrete points, and * is customarily chosen such that is an integer power-of-2, and the transforms are implemented with the
FFT A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in the ...
algorithm, for efficiency.


Pseudocode

The following is a
pseudocode In computer science, pseudocode is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language, but is intended for human reading rather than machine re ...
of the algorithm: (''Overlap-add algorithm for linear convolution'') h = FIR_filter M = length(h) Nx = length(x) N = 8 × 2^ceiling( log2(M) ) (8 times the smallest power of two bigger than filter length M. See next section for a slightly better choice.) step_size = N - (M-1) (L in the text above) H = DFT(h, N) position = 0 y(1 : Nx + M-1) = 0 while position + step_size ≤ Nx do y(position+(1:N)) = y(position+(1:N)) + IDFT(DFT(x(position+(1:step_size)), N) × H) position = position + step_size end


Efficiency considerations

When the DFT and IDFT are implemented by the FFT algorithm, the pseudocode above requires about complex multiplications for the FFT, product of arrays, and IFFT. Each iteration produces output samples, so the number of complex multiplications per output sample is about: For example, when M=201 and N=1024, equals 13.67, whereas direct evaluation of would require up to 201 complex multiplications per output sample, the worst case being when both x and h are complex-valued. Also note that for any given M, has a minimum with respect to N. Figure 2 is a graph of the values of N that minimize for a range of filter lengths (M). Instead of , we can also consider applying to a long sequence of length N_x samples. The total number of complex multiplications would be: :N_x\cdot (\log_2(N_x) + 1). Comparatively, the number of complex multiplications required by the pseudocode algorithm is: :N_x\cdot (\log_2(N) + 1)\cdot \frac. Hence the ''cost'' of the overlap–add method scales almost as O\left(N_x\log_2 N\right) while the cost of a single, large circular convolution is almost O\left(N_x\log_2 N_x \right). 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.


See also

*
Overlap–save method In signal processing, ''overlap–save'' is the traditional name for an efficient way to evaluate the Convolution#Discrete convolution, discrete convolution between a very long signal x and a finite impulse response (FIR) filter h where for ...


Notes


References


Further reading

* * {{DEFAULTSORT:Overlap-Add Method Signal processing Transforms Fourier analysis Numerical analysis