Definitions

# Convolution

[kon-vuh-loo-shuhn]

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. Convolution is similar to cross-correlation. It has applications that include 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. In particular, the circular convolution can be defined for periodic functions (that is, functions on the circle), and the discrete convolution can be defined for functions on the set of integers. These generalizations of the 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.

## Definition

The convolution of $f,$ and $g,$ is written $f * g,$. 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:

 $\left(f * g \right)\left(t\right) ,$ $stackrel\left\{mathrm\left\{def\right\}\right\}\left\{=\right\} int_\left\{-infty\right\}^\left\{infty\right\} f\left(tau\right)cdot g\left(t - tau\right), dtau$ $= int_\left\{-infty\right\}^\left\{infty\right\} f\left(t-tau\right)cdot g\left(tau\right), dtau.$       (commutativity)

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\left(tau\right),$ at the moment $t.,$  The weighting function is $g\left(-tau\right),,$ simply shifted by amount $t,.$  As $t,$ changes, the weighting function emphasizes different parts of the input function.

More generally, if f and g are complex-valued functions on Rd, then their convolution may be defined as the integral

$f * g\left(x\right) = int_\left\{mathbf\left\{R\right\}^d\right\} f\left(y\right)g\left(x-y\right),dy = int_\left\{mathbf\left\{R\right\}^d\right\} f\left(x-y\right)g\left(y\right),dy.$

### Circular convolution

When a function gT is periodic, with period T (and f is not), then ƒ*gT is also periodic and identical to:

$\left(f * g_T \right)\left(t\right) equiv int_\left\{t_0\right\}^\left\{t_0+T\right\} left\left[sum_\left\{k=-infty\right\}^\left\{infty\right\} f\left(tau + kT\right)right\right] g_T\left(t - tau\right) dtau,,$

where to is an arbitrary choice. The summation is called a periodic extension of the function ƒ.  If the non-zero duration of f is limited to the interval [to, to+T], only the k=0 term of the summation matters, leaving:

$\left(f * g_T \right)\left(t\right) = int_\left\{t_0\right\}^\left\{t_0+T\right\} f\left(tau\right) g_T\left(t-tau\right) dtau.,$

If gT is a periodic extension of another function, g, then ƒ*gT is known as a circular, cyclic, or periodic convolution of f and g.

## Discrete convolution

For complex-valued functions ƒ, g defined on the set of integers, the discrete convolution of ƒ and g is given by:

$\left(f * g\right)\left[n\right],$
{=}sum_{m=-infty}^{infty} f[m]cdot g[n - m],| }}
$= sum_\left\{m=-infty\right\}^\left\{infty\right\} f\left[n-m\right]cdot g\left[m\right].,$       (commutativity)

When multiplying two polynomials, the coefficients of the product are given by the convolution of the original coefficient sequences, extended with zeros where necessary to avoid undefined terms; this is known as the Cauchy product of the coefficients of the two polynomials.

### Circular discrete convolution

When a function gN is periodic, with period N (and f is not), then ƒ*gN is also periodic and identical to:

$\left(f * g_N\right)\left[n\right] equiv sum_\left\{m=0\right\}^\left\{N-1\right\} left\left(sum_\left\{k=-infty\right\}^\left\{infty\right\} f\left[m+kN\right] right\right) g_N\left[n-m\right].,$

The summation on k is called a periodic extension of the function ƒ. If the non-zero duration of f is limited to the interval [0, N-1], only the k=0 term of the summation matters, leaving:

{{NumBlk|:|$\left(f * g_N\right)\left[n\right] = sum_\left\{m=0\right\}^\left\{N-1\right\} f\left[m\right] g_N\left[n-m\right].,$| }}

If gN is a periodic extension of another function, g, then ƒ*gN is known as a circular, cyclic, or periodic convolution of f and g. When g is also limited to the interval [0, N-1],   reduces to these common forms:


begin{align} (f * g_N)[n] &= sum_{m=0}^n f[m] g[n-m] + sum_{m=n+1}^{N-1} f[m] g[N+n-m] &=sum_{m=0}^{N-1} f[m] g[(n-m)_{mod{N}}] &stackrel{mathrm{def}}{=} (f *_N g)[n]. end{align}

The notation $\left(f *_N g\right),$ for cyclic convolution denotes convolution over the cyclic group of integers modulo N.

### 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 ().

When $f\left[n\right],$ is a finite duration function of length N,   requires N arithmetic operations per output value and N2 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, use fast Fourier transforms in other rings.

## Domain of definition

The convolution of two complex-valued functions on Rd
$f*g\left(x\right) = int_\left\{mathbf\left\{R\right\}^d\right\}f\left(y\right)g\left(x-y\right),dy$
is well-defined only if ƒ 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 ƒ. The question of existence thus may involve different conditions on ƒ and g.

### Compactly supported functions

If ƒ and g are compactly supported continuous functions, then their convolution exists, and is also compactly supported and continuous . More generally, if either function (say ƒ) is compactly supported and the other is locally integrable, then the convolution ƒ*g is well-defined and continuous.

### Integrable functions

The convolution of ƒ and g exists if ƒ and g are both Lebesgue integrable functions (in L1(Rd)), and ƒ*g is also integrable . This is a consequence of Tonelli's theorem. Likewise, if ƒ∈L1(Rd) and g ∈ Lp(Rd) where 1 ≤ p ≤ ∞, then ƒ*g ∈ Lp(Rd) and
$|f*g|_ple |f|_1|g|_p.$

### 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 ƒ and g both decay rapidly, then ƒ*g also decays rapidly. In particular, if ƒ and g are rapidly decreasing functions, then so is the convolution ƒ*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

Under some circumstances, it is possible to define the convolution of a function with a distribution, or of two distributions. If ƒ is a compactly supported function and g is a distribution, then ƒ*g is a smooth function defined by a distributional formula analogous to

$int_\left\{mathbf\left\{R\right\}^d\right\} f\left(y\right)g\left(x-y\right),dy.$

More generally, it is possible to extend the definition of the convolution in a unique way so that the associative law

$f*\left(g*phi\right) = \left(f*g\right)*phi$

remains valid in the case where ƒ is a distribution, and g a compactly supported distribution .

## Properties

### Algebraic properties

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 . 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.Commutativity
$f * g = g * f ,$Associativity
$f * \left(g * h\right) = \left(f * g\right) * h ,$Distributivity
$f * \left(g + h\right) = \left(f * g\right) + \left(f * h\right) ,$Associativity with scalar multiplication
$a \left(f * g\right) = \left(a f\right) * g = f * \left(a g\right) ,$
for any real (or complex) number $a,$.Multiplicative identity 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 L1) admit approximations to the identity.

The linear space of compactly supported distributions does, however, admit an identity under the convolution. Specifically,

$f*delta = f$
where δ is the delta distribution.

### Differentiation

In the one variable case,
$frac\left\{d\right\}\left\{dx\right\}\left(f * g\right) = frac\left\{df\right\}\left\{dx\right\} * g = f * frac\left\{dg\right\}\left\{dx\right\} ,$
where d/dx is the derivative. More generally, in the case of functions of several variables, an analogous formula holds with the partial derivative:
$frac\left\{partial\right\}\left\{partial x_i\right\}\left(f * g\right)\left(x\right) = frac\left\{partial f\right\}\left\{partial x_i\right\} * g = f * frac\left\{partial g\right\}\left\{partial x_i\right\}.$
A particular consequence of this is that the convolution can be viewed as a "smoothing" operation: the convolution of ƒ and g is differentiable as many times as ƒ and g are together.

In the discrete case, the difference operator Dƒ(n) = ƒ(n+1) − ƒ(n) satisfies an analogous relationship:

$D\left(f*g\right) = \left(Df\right)*g = f*\left(Dg\right).,$

### Convolution theorem

The convolution theorem states that

$mathcal\left\{F\right\}\left\{f * g\right\} = kcdot mathcal\left\{F\right\}\left\{f\right\}cdot mathcal\left\{F\right\}\left\{g\right\}$

where $mathcal\left\{F\right\}\left\{f\right\},$ denotes the Fourier transform of $f$, and $k$ is a constant that depends on the specific normalization of the Fourier transform (see Fourier_transform#Some_Fourier_transform_properties).  Versions of this theorem also hold for the Laplace transform, two-sided Laplace transform, Z-transform and Mellin transform.

### Translation invariance

The convolution commutes with translations, meaning that

$tau_x \left(f*g\right) = \left(tau_x f\right)*g = f*\left(tau_x g\right),$

where τxƒ is the translation of the function ƒ by x defined by

$\left(tau_x f\right)\left(y\right) = f\left(y-x\right).,$

Furthermore, under certain conditions, convolution is the most general translation invariant operation. Roughly speaking, the following holds

• Suppose that S is a linear operator acting on functions which commutes with translations: Sxƒ) = τx(Sƒ) for all x. Then S is given as convolution with a function (or distribution) gS; that is Sƒ = gS*ƒ.

Thus any translation invariant operation can be represented as a convolution. Convolutions play an important role in the study of time-invariant systems, and especially LTI system theory. The representing function gS is the impulse response of the transformation S.

## Convolution inverse

Many functions have an inverse element, f(-1), which satisfies the relationship:
$f^\left\{\left(-1\right)\right\} * f = delta ,$
These functions form an abelian group, with the group operation being convolution.

## Convolutions on groups

If G is a suitable group endowed with a measure m (for instance, a locally compact Hausdorff topological group with the Haar measure) and if f and g are real or complex valued m-integrable functions on G, then we can define their convolution by

$\left(f * g\right)\left(x\right) = int_G f\left(y\right)g\left(xy^\left\{-1\right\}\right),dm\left(y\right) ,$

The circle group T with the Lebesgue measure is an immediate example. For a fixed g in L1(T), we have the following familiar operator acting on the Hilbert space L2(T):

$T f\left(x\right) = frac\left\{1\right\}\left\{2 pi\right\} int_\left\{mathbb\left\{T\right\}\right\} f\left(y\right) g\left(x - y\right) dy.$

The operator T is compact. A direct calculation shows that its adjoint T* is convolution with

$bar\left\{g\right\}\left(-y\right).$

By the commutativity property cited above, T is normal, i.e. 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. S is a commuting family of normal operators. According to spectral theory, there exists an orthonormal basis {hk} that simultaneously diagonalizes S. This characterizes convolutions on the circle. Specifically, we have

$h_k \left(x\right) = e^\left\{ikx\right\},;$

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.

The above example may convince one that convolutions arise naturally in the context of harmonic analysis on groups. For more general groups, it is also possible to give, for instance, a Convolution Theorem, however it is much more difficult to phrase and requires representation theory for these types of groups and the Peter-Weyl theorem. It is very difficult to do these calculations without more structure, and Lie groups turn out to be the setting in which these things are done.

## Convolution of measures

If μ and ν are measures on the family of Borel subsets of the real line, then the convolution μ * ν is defined by

$\left(mu * nu\right)\left(A\right) = \left(mu times nu\right)\left(\left\{, \left(x,y\right) in mathbb\left\{R\right\}^2 ,:, x+y in A ,\right\}\right).$

In case μ and ν are absolutely continuous with respect to Lebesgue measure, 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, 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 ν.

## Applications

Convolution and related operations are found in many applications of engineering and mathematics.

• In electrical engineering, the convolution of one function (the input) with a brief but strong impulse (see impulse response) gives the output of a linear time-invariant system. 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 statistics, as noted above, a weighted moving average is a convolution.
• In probability theory, the probability distribution of the sum of two independent random variables is the convolution of their individual distributions.
• In optics, many kinds of "blur" are described by convolutions. A shadow (e.g. the shadow on the table when you hold your hand between the table and a light source) is the convolution of the shape of the light source that is casting the shadow and the object whose shadow is being cast. An out-of-focus photograph is the convolution of the sharp image with the shape of the iris diaphragm. The photographic term for this is bokeh.
• Similarly, in digital image processing, convolutional filtering plays an important role in many important algorithms in edge detection and related processes.
• In linear acoustics, an echo is the convolution of the original sound with a function representing the various objects that are reflecting it.
• In artificial reverberation (digital signal processing, pro audio), convolution is used to map the impulse response of a real room on a digital audio signal (see previous and next point for additional information).
• In electrical engineering and other disciplines, the output (response) of a (stationary, or time- or space-invariant) linear system is the convolution of the input (excitation) with the system's response to an impulse or Dirac delta function. See LTI system theory and digital signal processing.
• In time-resolved 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 physics, wherever there is a linear system with a "superposition principle", a convolution operation makes an appearance.
• This is the fundamental problem term in the Navier–Stokes equations relating to the Clay Mathematics Millennium Problem and the associated million dollar prize.
• In digital signal processing, frequency filtering can be simplified by convolving two functions (data with a filter) in the time domain, which is analogous to multiplying the data with a filter in the frequency domain.