Convolution
{{#invoke:Hatnotehatnote}}
In mathematics and, in particular, functional analysis, convolution is a mathematical operation on two functions f and g, producing a third function that is typically viewed as a modified version of one of the original functions, giving the area overlap between the two functions as a function of the amount that one of the original functions is translated. Convolution is similar to crosscorrelation. It has applications that include probability, statistics, computer vision, image and signal processing, electrical engineering, and differential equations.
The convolution can be defined for functions on groups other than Euclidean space. For example, periodic functions, such as the discretetime Fourier transform, can be defined on a circle and convolved by periodic convolution. (See row 10 at DTFT#Properties.) And discrete convolution can be defined for functions on the set of integers. Generalizations of convolution have applications in the field of numerical analysis and numerical linear algebra, and in the design and implementation of finite impulse response filters in signal processing.
Computing the inverse of the convolution operation is known as deconvolution.
Contents
Definition
The convolution of f and g is written f∗g, using an asterisk or star. It is defined as the integral of the product of the two functions after one is reversed and shifted. As such, it is a particular kind of integral transform:
While the symbol t is used above, it need not represent the time domain. But in that context, the convolution formula can be described as a weighted average of the function f(τ) at the moment t where the weighting is given by g(−τ) simply shifted by amount t. As t changes, the weighting function emphasizes different parts of the input function.
For functions f, g supported on only (i.e., zero for negative arguments), the integration limits can be truncated, resulting in
In this case, the Laplace transform is more appropriate than the Fourier transform below and boundary terms become relevant.
For the multidimensional formulation of convolution, see Domain of definition (below).
Derivations
Convolution describes the output (in terms of the input) of an important class of operations known as linear timeinvariant (LTI). See LTI system theory for a derivation of convolution as the result of LTI constraints. In terms of the Fourier transforms of the input and output of an LTI operation, no new frequency components are created. The existing ones are only modified (amplitude and/or phase). In other words, the output transform is the pointwise product of the input transform with a third transform (known as a transfer function). See Convolution theorem for a derivation of that property of convolution. Conversely, convolution can be derived as the inverse Fourier transform of the pointwise product of two Fourier transforms.
Visual explanations of convolution  






Historical developments
One of the earliest uses of the convolution integral appeared in D'Alembert's derivation of Taylor's theorem in Recherches sur différents points importants du système du monde, published in 1754.^{[1]}
Also, an expression of the type:
is used by Sylvestre François Lacroix on page 505 of his book entitled Treatise on differences and series, which is the last of 3 volumes of the encyclopedic series: Traité du calcul différentiel et du calcul intégral, Chez Courcier, Paris, 17971800.^{[2]} Soon thereafter, convolution operations appear in the works of Pierre Simon Laplace, Jean Baptiste Joseph Fourier, Siméon Denis Poisson, and others. The term itself did not come into wide use until the 1950s or 60s. Prior to that it was sometimes known as faltung (which means folding in German), composition product, superposition integral, and Carson's integral.^{[3]} Yet it appears as early as 1903, though the definition is rather unfamiliar in older uses.^{[4]}^{[5]}
The operation:
is a particular case of composition products considered by the Italian mathematician Vito Volterra in 1913.^{[6]}
Circular convolution
{{#invoke:mainmain}}
When a function g_{T} is periodic, with period T, then for functions, f, such that f∗g_{T} exists, the convolution is also periodic and identical to:
where t_{o} is an arbitrary choice. The summation is called a periodic summation of the function f.
When g_{T} is a periodic summation of another function, g, then f∗g_{T} is known as a circular or cyclic convolution of f and g.
And if the periodic summation above is replaced by f_{T}, the operation is called a periodic convolution of f_{T} and g_{T}.
Discrete convolution
For complexvalued functions f, g defined on the set Z of integers, the discrete convolution of f and g is given by:^{[7]}
The convolution of two finite sequences is defined by extending the sequences to finitely supported functions on the set of integers. When the sequences are the coefficients of two polynomials, then the coefficients of the ordinary product of the two polynomials are the convolution of the original two sequences. This is known as the Cauchy product of the coefficients of the sequences.
Thus when g has finite support in the set (representing, for instance, a finite impulse response), a finite summation may be used:^{[8]}
Circular discrete convolution
When a function g_{N} is periodic, with period N, then for functions, f, such that f∗g_{N} exists, the convolution is also periodic and identical to:
The summation on k is called a periodic summation of the function f.
If g_{N} is a periodic summation of another function, g, then f∗g_{N} is known as a circular convolution of f and g.
When the nonzero durations of both f and g are limited to the interval [0, N − 1], f∗g_{N} reduces to these common forms:
The notation (f ∗_{N} g) for cyclic convolution denotes convolution over the cyclic group of integers modulo N.
Circular convolution arises most often in the context of fast convolution with an FFT algorithm.
Fast convolution algorithms
In many situations, discrete convolutions can be converted to circular convolutions so that fast transforms with a convolution property can be used to implement the computation. For example, convolution of digit sequences is the kernel operation in multiplication of multidigit numbers, which can therefore be efficiently implemented with transform techniques (Template:Harvnb; Template:Harvnb).
Template:EquationNote requires N arithmetic operations per output value and N^{2} operations for N outputs. That can be significantly reduced with any of several fast algorithms. Digital signal processing and other applications typically use fast convolution algorithms to reduce the cost of the convolution to O(N log N) complexity.
The most common fast convolution algorithms use fast Fourier transform (FFT) algorithms via the circular convolution theorem. Specifically, the circular convolution of two finitelength sequences is found by taking an FFT of each sequence, multiplying pointwise, and then performing an inverse FFT. Convolutions of the type defined above are then efficiently implemented using that technique in conjunction with zeroextension and/or discarding portions of the output. Other fast convolution algorithms, such as the Schönhage–Strassen algorithm or the Mersenne transform,^{[9]} use fast Fourier transforms in other rings.
If one sequence is much longer than the other, zeroextension of the shorter sequence and fast circular convolution is not the most computationally efficient method available.^{[10]} Instead, decomposing the longer sequence into blocks and convolving each block allows for faster algorithms such as the Overlap–save method and Overlap–add method.^{[11]} A hybrid convolution method that combines block and FIR algorithms allows for a zero inputoutput latency that is useful for realtime convolution computations.^{[12]}
Domain of definition
The convolution of two complexvalued functions on R^{d} is itself a complexvalued function on R^{d}, defined by:
is welldefined only if f and g decay sufficiently rapidly at infinity in order for the integral to exist. Conditions for the existence of the convolution may be tricky, since a blowup in g at infinity can be easily offset by sufficiently rapid decay in f. The question of existence thus may involve different conditions on f and g:
Compactly supported functions
If f and g are compactly supported continuous functions, then their convolution exists, and is also compactly supported and continuous Template:Harv. More generally, if either function (say f) is compactly supported and the other is locally integrable, then the convolution f∗g is welldefined and continuous.
Convolution of f and g is also well defined when both functions are locally square integrable on R and supported on an interval of the form [a, +∞) (or both supported on [∞, a]).
Integrable functions
The convolution of f and g exists if f and g are both Lebesgue integrable functions in L^{1}(R^{d}), and in this case f∗g is also integrable Template:Harv. This is a consequence of Tonelli's theorem. This is also true for functions in , under the discrete convolution, or more generally for the convolution on any group.
Likewise, if f ∈ L^{1}(R^{d}) and g ∈ L^{p}(R^{d}) where 1 ≤ p ≤ ∞, then f∗g ∈ L^{p}(R^{d}) and
In the particular case p = 1, this shows that L^{1} is a Banach algebra under the convolution (and equality of the two sides holds if f and g are nonnegative almost everywhere).
More generally, Young's inequality implies that the convolution is a continuous bilinear map between suitable L^{p} spaces. Specifically, if 1 ≤ p,q,r ≤ ∞ satisfy
then
so that the convolution is a continuous bilinear mapping from L^{p}×L^{q} to L^{r}. The Young inequality for convolution is also true in other contexts (circle group, convolution on Z). The preceding inequality is not sharp on the real line: when 1 < p, q, r < ∞, there exists a constant B_{p, q} < 1 such that:
The optimal value of B_{p, q} was discovered in 1975.^{[13]}
A stronger estimate is true provided 1 < p, q, r < ∞ :
where is the weak L^{q} norm. Convolution also defines a bilinear continuous map for , owing to the weak Young inequality:^{[14]}
Functions of rapid decay
In addition to compactly supported functions and integrable functions, functions that have sufficiently rapid decay at infinity can also be convolved. An important feature of the convolution is that if f and g both decay rapidly, then f∗g also decays rapidly. In particular, if f and g are rapidly decreasing functions, then so is the convolution f∗g. Combined with the fact that convolution commutes with differentiation (see Properties), it follows that the class of Schwartz functions is closed under convolution Template:Harv.
Distributions
{{#invoke:mainmain}} Under some circumstances, it is possible to define the convolution of a function with a distribution, or of two distributions. If f is a compactly supported function and g is a distribution, then f∗g is a smooth function defined by a distributional formula analogous to
More generally, it is possible to extend the definition of the convolution in a unique way so that the associative law
remains valid in the case where f is a distribution, and g a compactly supported distribution Template:Harv.
Measures
The convolution of any two Borel measures μ and ν of bounded variation is the measure λ defined by Template:Harv
This agrees with the convolution defined above when μ and ν are regarded as distributions, as well as the convolution of L^{1} functions when μ and ν are absolutely continuous with respect to the Lebesgue measure.
The convolution of measures also satisfies the following version of Young's inequality
where the norm is the total variation of a measure. Because the space of measures of bounded variation is a Banach space, convolution of measures can be treated with standard methods of functional analysis that may not apply for the convolution of distributions.
Properties
Algebraic properties
{{#invoke:see alsoseealso}} The convolution defines a product on the linear space of integrable functions. This product satisfies the following algebraic properties, which formally mean that the space of integrable functions with the product given by convolution is a commutative algebra without identity Template:Harv. Other linear spaces of functions, such as the space of continuous functions of compact support, are closed under the convolution, and so also form commutative algebras.
for any real (or complex) number .
No algebra of functions possesses an identity for the convolution. The lack of identity is typically not a major inconvenience, since most collections of functions on which the convolution is performed can be convolved with a delta distribution or, at the very least (as is the case of L^{1}) admit approximations to the identity. The linear space of compactly supported distributions does, however, admit an identity under the convolution. Specifically,
where δ is the delta distribution.
 Inverse element
Some distributions have an inverse element for the convolution, S^{(−1)}, which is defined by
The set of invertible distributions forms an abelian group under the convolution.
 Complex conjugation
Integration
If f and g are integrable functions, then the integral of their convolution on the whole space is simply obtained as the product of their integrals:
This follows from Fubini's theorem. The same result holds if f and g are only assumed to be nonnegative measurable functions, by Tonelli's theorem.
Differentiation
In the onevariable case,
where d/dx is the derivative. More generally, in the case of functions of several variables, an analogous formula holds with the partial derivative:
A particular consequence of this is that the convolution can be viewed as a "smoothing" operation: the convolution of f and g is differentiable as many times as f and g are in total.
These identities hold under the precise condition that f and g are absolutely integrable and at least one of them has an absolutely integrable (L^{1}) weak derivative, as a consequence of Young's inequality. For instance, when f is continuously differentiable with compact support, and g is an arbitrary locally integrable function,
These identities also hold much more broadly in the sense of tempered distributions if one of f or g is a compactly supported distribution or a Schwartz function and the other is a tempered distribution. On the other hand, two positive integrable and infinitely differentiable functions may have a nowhere continuous convolution.
In the discrete case, the difference operator D f(n) = f(n + 1) − f(n) satisfies an analogous relationship:
Convolution theorem
The convolution theorem states that
where denotes the Fourier transform of , and is a constant that depends on the specific normalization of the Fourier transform. Versions of this theorem also hold for the Laplace transform, twosided Laplace transform, Ztransform and Mellin transform.
See also the less trivial Titchmarsh convolution theorem.
Translation invariance
The convolution commutes with translations, meaning that
where τ_{x}f is the translation of the function f by x defined by
If f is a Schwartz function, then τ_{x}f is the convolution with a translated Dirac delta function τ_{x}f = f∗τ_{x} δ. So translation invariance of the convolution of Schwartz functions is a consequence of the associativity of convolution.
Furthermore, under certain conditions, convolution is the most general translation invariant operation. Informally speaking, the following holds
 Suppose that S is a linear operator acting on functions which commutes with translations: S(τ_{x}f) = τ_{x}(Sf) for all x. Then S is given as convolution with a function (or distribution) g_{S}; that is Sf = g_{S}∗f.
Thus any translation invariant operation can be represented as a convolution. Convolutions play an important role in the study of timeinvariant systems, and especially LTI system theory. The representing function g_{S} is the impulse response of the transformation S.
A more precise version of the theorem quoted above requires specifying the class of functions on which the convolution is defined, and also requires assuming in addition that S must be a continuous linear operator with respect to the appropriate topology. It is known, for instance, that every continuous translation invariant continuous linear operator on L^{1} is the convolution with a finite Borel measure. More generally, every continuous translation invariant continuous linear operator on L^{p} for 1 ≤ p < ∞ is the convolution with a tempered distribution whose Fourier transform is bounded. To wit, they are all given by bounded Fourier multipliers.
Convolutions on groups
If G is a suitable group endowed with a measure λ, and if f and g are real or complex valued integrable functions on G, then we can define their convolution by
It is not commutative in general. In typical cases of interest G is a locally compact Hausdorff topological group and λ is a (left) Haar measure. In that case, unless G is unimodular, the convolution defined in this way is not the same as . The preference of one over the other is made so that convolution with a fixed function g commutes with left translation in the group:
Furthermore, the convention is also required for consistency with the definition of the convolution of measures given below. However, with a right instead of a left Haar measure, the latter integral is preferred over the former.
On locally compact abelian groups, a version of the convolution theorem holds: the Fourier transform of a convolution is the pointwise product of the Fourier transforms. The circle group T with the Lebesgue measure is an immediate example. For a fixed g in L^{1}(T), we have the following familiar operator acting on the Hilbert space L^{2}(T):
The operator T is compact. A direct calculation shows that its adjoint T* is convolution with
By the commutativity property cited above, T is normal: T*T = TT*. Also, T commutes with the translation operators. Consider the family S of operators consisting of all such convolutions and the translation operators. Then S is a commuting family of normal operators. According to spectral theory, there exists an orthonormal basis {h_{k}} that simultaneously diagonalizes S. This characterizes convolutions on the circle. Specifically, we have
which are precisely the characters of T. Each convolution is a compact multiplication operator in this basis. This can be viewed as a version of the convolution theorem discussed above.
A discrete example is a finite cyclic group of order n. Convolution operators are here represented by circulant matrices, and can be diagonalized by the discrete Fourier transform.
A similar result holds for compact groups (not necessarily abelian): the matrix coefficients of finitedimensional unitary representations form an orthonormal basis in L^{2} by the Peter–Weyl theorem, and an analog of the convolution theorem continues to hold, along with many other aspects of harmonic analysis that depend on the Fourier transform.
Convolution of measures
Let G be a topological group. If μ and ν are finite Borel measures on G, then their convolution μ∗ν is defined by
for each measurable subset E of G. The convolution is also a finite measure, whose total variation satisfies
In the case when G is locally compact with (left)Haar measure λ, and μ and ν are absolutely continuous with respect to a λ, so that each has a density function, then the convolution μ∗ν is also absolutely continuous, and its density function is just the convolution of the two separate density functions.
If μ and ν are probability measures on the topological group (R,+), then the convolution μ∗ν is the probability distribution of the sum X + Y of two independent random variables X and Y whose respective distributions are μ and ν.
Bialgebras
Let (X, Δ, ∇, ε, η) be a bialgebra with comultiplication Δ, multiplication ∇, unit η, and counit ε. The convolution is a product defined on the endomorphism algebra End(X) as follows. Let φ, ψ ∈ End(X), that is, φ,ψ : X → X are functions that respect all algebraic structure of X, then the convolution φ∗ψ is defined as the composition
The convolution appears notably in the definition of Hopf algebras Template:Harv. A bialgebra is a Hopf algebra if and only if it has an antipode: an endomorphism S such that
Applications
Convolution and related operations are found in many applications in science, engineering and mathematics.
 In image processing
{{#invoke:see alsoseealso}}
 In digital image processing convolutional filtering plays an important role in many important algorithms in edge detection and related processes.
 In optics, an outoffocus photograph is a convolution of the sharp image with a lens function. The photographic term for this is bokeh.
 In image processing applications such as adding blurring.
 In digital data processing
 In analytical chemistry, Savitzky–Golay smoothing filters are used for the analysis of spectroscopic data. They can improve signaltonoise ratio with minimal distortion of the spectra.
 In statistics, a weighted moving average is a convolution.
 In acoustics, reverberation is the convolution of the original sound with echos from objects surrounding the sound source.
 In digital signal processing, convolution is used to map the impulse response of a real room on a digital audio signal.
 In electronic music convolution is the imposition of a spectral or rhythmic structure on a sound. Often this envelope or structure is taken from another sound. The convolution of two signals is the filtering of one through the other.^{[15]}
 In electrical engineering, the convolution of one function (the input signal) with a second function (the impulse response) gives the output of a linear timeinvariant system (LTI). At any given moment, the output is an accumulated effect of all the prior values of the input function, with the most recent values typically having the most influence (expressed as a multiplicative factor). The impulse response function provides that factor as a function of the elapsed time since each input value occurred.
 In physics, wherever there is a linear system with a "superposition principle", a convolution operation makes an appearance. For instance, in spectroscopy line broadening due to the Doppler effect on its own gives a Gaussian spectral line shape and collision broadening alone gives a Lorentzian line shape. When both effects are operative, the line shape is a convolution of Gaussian and Lorentzian, a Voigt function.
 In Timeresolved fluorescence spectroscopy, the excitation signal can be treated as a chain of delta pulses, and the measured fluorescence is a sum of exponential decays from each delta pulse.
 In computational fluid dynamics, the large eddy simulation (LES) turbulence model uses the convolution operation to lower the range of length scales necessary in computation thereby reducing computational cost.
 In probability theory, the probability distribution of the sum of two independent random variables is the convolution of their individual distributions.
 In kernel density estimation, a distribution is estimated from sample points by convolution with a kernel, such as an isotropic Gaussian. Template:Harv.
 In radiotherapy treatment planning systems, most part of all modern codes of calculation applies a convolutionsuperposition algorithm..Template:Clarify
See also
 Analog signal processing
 Circulant matrix
 Convolution for optical broadbeam responses in scattering media
 Convolution power
 Crosscorrelation
 Deconvolution
 Dirichlet convolution
 Jan Mikusinski
 List of convolutions of probability distributions
 LTI system theory#Impulse response and convolution
 Scaled correlation
 Titchmarsh convolution theorem
 Toeplitz matrix (convolutions can be considered a Toeplitz matrix operation where each row is a shifted copy of the convolution kernel)
Notes
 ↑ DominguezTorres, p 2
 ↑ DominguezTorres, p 4
 ↑ {{#invoke:citation/CS1citation CitationClass=citation }}
 ↑ {{#invoke:citation/CS1citation CitationClass=citation }}
 ↑ {{#invoke:citation/CS1citation CitationClass=citation }}
 ↑ According to [Lothar von Wolfersdorf (2000), "Einige Klassen quadratischer Integralgleichungen", Sitzungsberichte der Sächsischen Akademie der Wissenschaften zu Leipzig, Mathematischnaturwissenschaftliche Klasse, volume 128, number 2, 6–7], the source is Volterra, Vito (1913), "Leçons sur les fonctions de linges". GauthierVillars, Paris 1913.
 ↑ Template:Harvnb
 ↑ {{#invoke:citation/CS1citation CitationClass=book }}
 ↑ {{#invoke:Citation/CS1citation CitationClass=journal }}
 ↑ {{#invoke:citation/CS1citation CitationClass=book }}
 ↑ Template:Cite web
 ↑ {{#invoke:Citation/CS1citation CitationClass=journal }}
 ↑ Beckner, William (1975), "Inequalities in Fourier analysis", Ann. of Math. (2) 102: 159–182. Independently, Brascamp, Herm J. and Lieb, Elliott H. (1976), "Best constants in Young's inequality, its converse, and its generalization to more than three functions", Advances in Math. 20: 151–173. See Brascamp–Lieb inequality
 ↑ Template:Harvnb
 ↑ Zölzer, Udo, ed. (2002). DAFX:Digital Audio Effects, p.48–49. ISBN 0471490784.
References
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}
 {{#invoke:citation/CS1citation
CitationClass=citation }}
 DominguezTorres, Alejandro (Nov 2, 2010). "Origin and history of convolution". 41 pgs. http://www.slideshare.net/Alexdfar/originadnhistoryofconvolution. Cranfield, Bedford MK43 OAL, UK. Retrieved Mar 13, 2013.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
 {{#invoke:citation/CS1citation
CitationClass=citation }}.
External links
Template:Sister Template:Sister
 Earliest Uses: The entry on Convolution has some historical information.
 Convolution, on The Data Analysis BriefBook
 http://www.jhu.edu/~signals/convolve/index.html Visual convolution Java Applet
 http://www.jhu.edu/~signals/discreteconv2/index.html Visual convolution Java Applet for discretetime functions
 Lectures on Image Processing: A collection of 18 lectures in pdf format from Vanderbilt University. Lecture 7 is on 2D convolution., by Alan Peters
 Convolution Kernel Mask Operation Interactive tutorial
 Convolution at MathWorld
 Freeverb3 Impulse Response Processor: Opensource zero latency impulse response processor with VST plugins
 Stanford University CS 178 interactive Flash demo showing how spatial convolution works.
 A video lecture on the subject of convolution given by Salman Khan
 A Javascript interactive plot of the convolution with several functions