Integral expressing the amount of overlap of one function as it is shifted over another
In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions (formula_1 and formula_2) that produces a third function (formula_3). The term "convolution" refers to both the resulting function and to the process of computing it. It is defined as the integral of the product of the two functions after one is reflected about the y-axis and shifted. The integral is evaluated for all values of shift, producing the convolution function. The choice of which function is reflected and shifted before the integral does not change the integral result (see commutativity). Graphically, it expresses how the 'shape' of one function is modified by the other.
Some features of convolution are similar to cross-correlation: for real-valued functions, of a continuous or discrete variable, convolution (formula_3) differs from cross-correlation (formula_5) only in that either formula_6 or formula_7 is reflected about the y-axis in convolution; thus it is a cross-correlation of formula_8 and formula_6, or formula_10 and formula_7. For complex-valued functions, the cross-correlation operator is the adjoint of the convolution operator.
Convolution has applications that include probability, statistics, acoustics, spectroscopy, signal processing and image processing, geophysics, engineering, physics, computer vision and differential equations.
The convolution can be defined for functions on Euclidean space and other groups (as algebraic structures). For example, periodic functions, such as the discrete-time Fourier transform, can be defined on a circle and convolved by periodic convolution. (See row 18 at .) A "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.
Definition.
The convolution of formula_1 and formula_2 is written formula_14, denoting the operator with the symbol formula_15. It is defined as the integral of the product of the two functions after one is reflected about the y-axis and shifted. As such, it is a particular kind of integral transform:
formula_16
An equivalent definition is (see commutativity):
formula_17
While the symbol formula_18 is used above, it need not represent the time domain. At each formula_18, the convolution formula can be described as the area under the function formula_20 weighted by the function formula_21 shifted by the amount formula_18. As formula_18 changes, the weighting function formula_24 emphasizes different parts of the input function formula_20; If formula_18 is a positive value, then formula_24 is equal to formula_21 that slides or is shifted along the formula_29-axis toward the right (toward formula_30) by the amount of formula_18, while if formula_18 is a negative value, then formula_24 is equal to formula_21 that slides or is shifted toward the left (toward formula_35) by the amount of formula_36.
For functions formula_1, formula_2 supported on only formula_39 (i.e., zero for negative arguments), the integration limits can be truncated, resulting in:
formula_40
For the multi-dimensional formulation of convolution, see "domain of definition" (below).
Notation.
A common engineering notational convention is:
formula_41
which has to be interpreted carefully to avoid confusion. For instance, formula_42 is equivalent to formula_43, but formula_44 is in fact equivalent to formula_45.
Relations with other transforms.
Given two functions formula_46 and formula_47 with bilateral Laplace transforms (two-sided Laplace transform)
formula_48
and
formula_49
respectively, the convolution operation formula_50 can be defined as the inverse Laplace transform of the product of formula_51 and formula_52. More precisely,
formula_53
Let formula_54, then
formula_55
Note that formula_56 is the bilateral Laplace transform of formula_50. A similar derivation can be done using the unilateral Laplace transform (one-sided Laplace transform).
The convolution operation also describes the output (in terms of the input) of an important class of operations known as "linear time-invariant" (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.
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.
Also, an expression of the type:
formula_58
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: , Chez Courcier, Paris, 1797–1800. 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 1960s. Prior to that it was sometimes known as "Faltung" (which means "folding" in German), "composition product", "superposition integral", and "Carson's integral". Yet it appears as early as 1903, though the definition is rather unfamiliar in older uses.
The operation:
formula_59
is a particular case of composition products considered by the Italian mathematician Vito Volterra in 1913.
Circular convolution.
When a function formula_60 is periodic, with period formula_61, then for functions, formula_1, such that formula_63 exists, the convolution is also periodic and identical to:
formula_64
where formula_65 is an arbitrary choice. The summation is called a periodic summation of the function formula_1.
When formula_60 is a periodic summation of another function, formula_2, then formula_69 is known as a "circular" or "cyclic" convolution of formula_1 and formula_2.
And if the periodic summation above is replaced by formula_72, the operation is called a "periodic" convolution of formula_72 and formula_60.
Discrete convolution.
For complex-valued functions formula_1 and formula_2 defined on the set formula_77 of integers, the "discrete convolution" of formula_1 and formula_2 is given by:
formula_80
or equivalently (see commutativity) by:
formula_81
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 formula_82 (representing, for instance, a finite impulse response), a finite summation may be used:
formula_83
Circular discrete convolution.
When a function formula_84 is periodic, with period formula_85 then for functions, formula_86 such that formula_87 exists, the convolution is also periodic and identical to:
formula_88
The summation on formula_89 is called a periodic summation of the function formula_90
If formula_84 is a periodic summation of another function, formula_92 then formula_87 is known as a circular convolution of formula_1 and formula_95
When the non-zero durations of both formula_1 and formula_2 are limited to the interval formula_98  formula_87 reduces to these common forms:
 ;templatestyles src="Numbered block/styles.css" / ;
The notation formula_100 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 a fast Fourier transform (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 multi-digit numbers, which can therefore be efficiently implemented with transform techniques (; ).
Eq.1 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 finite-length 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 zero-extension and/or discarding portions of the output. Other fast convolution algorithms, such as the Schönhage–Strassen algorithm or the Mersenne transform, use fast Fourier transforms in other rings. The Winograd method is used as an alternative to the FFT. It significantly speeds up 1D, 2D, and 3D convolution.
If one sequence is much longer than the other, zero-extension of the shorter sequence and fast circular convolution is not the most computationally efficient method available. 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. A hybrid convolution method that combines block and FIR algorithms allows for a zero input-output latency that is useful for real-time convolution computations.
Domain of definition.
The convolution of two complex-valued functions on R"d" is itself a complex-valued function on R"d", defined by:
formula_101
and is well-defined 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 blow-up 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 . More generally, if either function (say f) is compactly supported and the other is locally integrable, then the convolution "f"∗"g" is well-defined 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 . This is a consequence of Tonelli's theorem. This is also true for functions in "L"1, 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
formula_102
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 non-negative 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:
formula_103
then
formula_104
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:
formula_105
The optimal value of "B""p","q" was discovered in 1975 and independently in 1976, see Brascamp–Lieb inequality.
A stronger estimate is true provided 1 ; "p", "q", "r" ; ∞:
formula_106
where formula_107 is the weak "L""q" norm. Convolution also defines a bilinear continuous map formula_108 for formula_109, owing to the weak Young inequality:
formula_110
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 .
Distributions.
If "f" is a smooth function that is compactly supported and "g" is a distribution, then "f"∗"g" is a smooth function defined by
formula_111
More generally, it is possible to extend the definition of the convolution in a unique way with formula_112 the same as "f" above, so that the associative law
formula_113
remains valid in the case where "f" is a distribution, and "g" a compactly supported distribution .
Measures.
The convolution of any two Borel measures "μ" and "ν" of bounded variation is the measure formula_114 defined by 
formula_115
In particular,
 formula_116
where formula_117 is a measurable set and formula_118 is the indicator function of formula_119.
This agrees with the convolution defined above when μ and ν are regarded as distributions, as well as the convolution of L1 functions when μ and ν are absolutely continuous with respect to the