# Convolution

Convolution of two square pulses: the resulting waveform is a triangular pulse. One of the functions (in this case g) is first reflected about $tau=0$ and then offset by t, making it $g(t-tau)$. The area under the resulting product gives the convolution at t. The horizontal axis is $tau$ for fand g, and t for $fast g$.
Convolution of a square pulse (as input signal) with the impulse response of an RC circuit to obtain the output signal waveform. The integral of their product is the area of the yellow region. In both animations the function gis symmetric, and so is unchanged under reflection.
Visual comparison of convolution, cross-correlation and autocorrelation.

In mathematics and, in particular, functional analysis, convolution is a mathematical operation on two functions fand 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 istranslated. Convolution is similar to cross-correlation. 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. 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.

Computing the inverse of the convolution operation is known as deconvolution.

[hide]

## History

The operation

$int_0^tvarphi(s)psi(t-s) , ds, qquad 0le t

is a particular case of composition products considered by the Italian mathematician Vito Volterra in 1913.[1]

Convolution is also sometimes called "Faltung" (which means folding in German); both Faltung and convolution were used as early as 1903, though the definition is rather unfamiliar in older uses.[2][3] The term Faltung was sometimes used in English through the 1940s, before the notion of convolution became widely used, along with other terms such as composition product,superposition integral, and Carson's integral.[4]

## Definition

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

 $(f * g )(t) ,$ $stackrel{mathrm{def}}{=} int_{-infty}^infty f(tau), g(t - tau), dtau$ $= int_{-infty}^infty f(t-tau), g(tau), 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(τ) 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.

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

$(f * g )(x) = int_{mathbf{R}^d} f(y)g(x-y),dy = int_{mathbf{R}^d} f(x-y)g(y),dy.$
Visual explanation of convolution.
1. Express each function in terms of a dummy variable $tau.$

2. Reflect one of the functions: $g(tau)$$g(-tau).$

3. Add a time-offset, t, which allows $g(t-tau)$ to slide along the $tau$-axis.

4. Start t at -∞ and slide it all the way to +∞. Wherever the two functions intersect, find the integral of their product. In other words, compute a sliding, weighted-average of function $f(tau)$, where the weighting function is $g(-tau).$

The resulting waveform (not shown here) is the convolution of functions f and g. If f(t) is a unit impulse, the result of this process is simply g(t), which is therefore called the impulse response.

### Circular convolution

When a function gT is periodic, with period T, then for functions, f, such that fgT exists, the convolution is also periodic and identical to:

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

where to is an arbitrary choice. The summation is called a periodic summation of the function f.

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

## Discrete convolution

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

$(f * g)[n] stackrel{mathrm{def}}{=} sum_{m=-infty}^infty f[m], g[n - m]$
$= sum_{m=-infty}^infty f[n-m], g[m].$       (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, then for functions, f, such that fgN exists, the convolution is also periodic and identical to:

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

The summation on k is called a periodic summation of the function f.

If gN is a periodic summation of another function, g, then fgN is known as a circular convolution of f and g.

When the non-zero durations of both f and g are limited to the interval [0, N − 1], fgN reduces to these common forms:

begin{align} (f * g_N)[n] &= sum_{m=0}^{N-1} f[m] g_N[n-m] &= 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)_{bmod{N}}] equiv (f *_N g)[n] end{align}

(Eq.1)

The notation fN 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 multi-digit numbers, which can therefore be efficiently implemented with transform techniques (Knuth 1997, §4.3.3.C; von zur Gathen & Gerhard 2003, §8.2).

Eq.1 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 processingand 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)(x) = int_{mathbf{R}^d}f(y)g(x-y),dy$

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 ing 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 (Hörmander). More generally, if either function (sayf) is compactly supported and the other is locally integrable, then the convolution fg is well-defined and continuous.

### Integrable functions

The convolution of f and g exists if f and g are both Lebesgue integrable functions (in L1(Rd)), and in this case fg is also integrable (Stein & Weiss 1971, Theorem 1.3). This is a consequence of Tonelli's theorem. Likewise, if fL1(Rd) and gLp(Rd) where 1 ≤ p ≤ ∞, then fgLp(Rd) and

$|{f}*g|_ple |f|_1|g|_p. ,$

In the particular case p= 1, this shows that L1 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 Lp spaces. Specifically, if 1 ≤ p,q,r ≤ ∞ satisfy

$frac{1}{p}+frac{1}{q}=frac{1}{r}+1,$

then

$|f*g|_rle |f|_p|g|_q,quad fin L^p, gin L^q,$

so that the convolution is a continuous bilinear mapping from Lp×Lq to Lr.

### 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 fg also decays rapidly. In particular, if f and g are rapidly decreasing functions, then so is the convolution fg. 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 f is a compactly supported function and g is a distribution, then fg is a smooth function defined by a distributional formula analogous to

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

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

$f*(g*varphi) = (f*g)*varphi,$

remains valid in the case where f is a distribution, and g a compactly supported distribution (Hörmander 1983, §4.2).

### Measures

The convolution of any two Borel measures μ and ν of bounded variation is the measure λ defined by

$int_{mathbf{R}^d} f(x)dlambda(x) = int_{mathbf{R}^d}int_{mathbf{R}^d}f(x+y),dmu(x),dnu(y).$

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 Lebesgue measure.

The convolution of measures also satisfies the following version of Young's inequality

$|mu*nu|le |mu||nu| ,$

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 offunctional analysis that may not apply for the convolution of distributions.

## 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 (Strichartz 1994, §3.3). 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 * (g * h) = (f * g) * h ,$
Distributivity
$f * (g + h) = (f * g) + (f * h) ,$
Associativity with scalar multiplication
$a (f * g) = (a f) * g ,$

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.

Inverse element

Some distributions have an inverse element for the convolution, S(−1), which is defined by

$S^{(-1)} * S = delta. ,$

The set of invertible distributions forms an abelian group under the convolution.

Complex conjugation
$overline{f * g} = overline{f} * overline{g} !$

### 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:

$int_{mathbf{R}^d}(f*g)(x) , dx=left(int_{mathbf{R}^d}f(x) , dxright)left(int_{mathbf{R}^d}g(x) , dxright).$

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 one-variable case,

$frac{d}{dx}(f * g) = frac{df}{dx} * g = f * frac{dg}{dx} ,$

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{partial}{partial x_i}(f * g)(x) = frac{partial f}{partial x_i} * g = f * frac{partial g}{partial x_i}.$

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 (L1) weak derivative, as a consequence ofYoung's inequality. For instance, when f is continuously differentiable with compact support, and g is an arbitrary locally integrable function,

$frac{d}{dx}({f} * g) = frac{df}{dx} * g.$

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:

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

### Convolution theorem

The convolution theorem states that

$mathcal{F}{f * g} = kcdot mathcal{F}{f}cdot mathcal{F}{g}$

where $mathcal{F}{f},$ denotes the Fourier transform of $f$, and $k$ is a constant that depends on the specific normalization of the Fourier transform (see “Properties of the Fourier transform”). 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 ({f}*g) = (tau_x f)*g = {f}*(tau_x g),$

where τxf is the translation of the function f by x defined by

$(tau_x f)(y) = f(y-x).,$

If f is a Schwartz function, then τxf is the convolution with a translated Dirac delta function τxf = 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: Sxf) = τx(Sf) for all x. Then S is given as convolution with a function (or distribution)gS; that is Sf = gSf.

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.

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 acontinuous linear operator with respect to the appropriate topology. It is known, for instance, that every continuous translation invariant continuous linear operator on L1 is the convolution with a finite Borel measure. More generally, every continuous translation invariant continuous linear operator on Lp 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

$(f * g)(x) = int_G f(y) g(y^{-1}x),dlambda(y). ,$

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 $textstyle{int f(xy^{-1})g(y) , dlambda(y)}$. The preference of one over the other is made so that convolution with a fixed function g commutes with left translation in the group:

$L_h(f*g) = (L_hf)*g = f*(L_hg).,$

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 Twith 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}(x) = frac{1}{2 pi} int_{mathbf{T}} {f}(y) g( x - y) , dy.$

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

$bar{g}(-y). ,$

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 {hk} that simultaneously diagonalizes S. This characterizes convolutions on the circle. Specifically, we have

$h_k (x) = e^{ikx}, quad k in mathbb{Z},;$

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 finite-dimensional unitary representations form an orthonormal basis in L2 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

$(mu * nu)(E) = int!!!int 1_E(xy) ,dmu(x) ,dnu(y)$

for each measurable subset E of G. The convolution is also a finite measure, whose total variation satisfies

$|mu * nu| le |mu| |nu|. ,$

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 andY 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, φ,ψ : XX are functions that respect all algebraic structure of X, then the convolution φ∗ψ is defined as the composition

$X xrightarrow{Delta} Xotimes X xrightarrow{phiotimespsi} Xotimes X xrightarrow{nabla} X. ,$

The convolution appears notably in the definition of Hopf algebras (Kassel 1995, §III.3). A bialgebra is a Hopf algebra if and only if it has an antipode: an endomorphism S such that

$S * operatorname{id}_X = operatorname{id}_X * S = etacircvarepsilon.$

## Applications

Blurring of an image using the Gaussian function, implemented using a sequence of one-dimensional convolutions; see Gaussian blur

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

• In electrical engineering, the convolution of one function (the input signal) with a second function (the impulse response) gives the output of a linear time-invariant 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 digital signal processing and image processing applications, the entire input function is often available for computing every sample of the output function. In that case, the constraint that each output is the effect of only prior inputs can be relaxed.

• Convolution amplifies or attenuates each frequency component of the input independently of the other components.

• 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 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.[5]

• 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 radiotherapy treatment planning systems, most part of all modern codes of calculation applies a convolution-superposition algorithm.

• In physics, wherever there is a linear system with a "superposition principle", a convolution operation makes an appearance. For instance, given a function that describes an electriccharge distribution and the function that gives the electric potential of a point charge, then the potential of the charge distribution is the convolution of these two functions.

• In kernel density estimation, a distribution is estimated from sample points by convolution with a kernel, such as an isotropic Gaussian. (Diggle 1995).

• 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.

Visual comparison of convolution, cross-correlation and autocorrelation.

## Notes

1. ^ According to [Lothar von Wolfersdorf (2000), "Einige Klassen quadratischer Integralgleichungen", Sitzungsberichte der Sächsischen Akademie der Wissenschaften zu Leipzig, Mathematisch-naturwissenschaftliche Klasse, volume 128, number 2, 6–7], the source is Volterra, Vito (1913), "Leçons sur les fonctions de linges". Gauthier-Villars, Paris 1913.

2. ^ John Hilton Grace and Alfred Young (1903), The algebra of invariants, Cambridge University Press, p. 40

3. ^ Leonard Eugene Dickson (1914), Algebraic invariants, J. Wiley, p. 85

4. ^ R. N. Bracewell (2005), "Early work on imaging theory in radio astronomy", in W. T. Sullivan, The Early Years of Radio Astronomy: Reflections Fifty Years After Jansky's Discovery, Cambridge University Press, p. 172, ISBN 978-0-521-61602-7

5. ^ Zölzer, Udo, ed. (2002). DAFX:Digital Audio Effects, p.48-49. ISBN 0471490784.

## References

• Bracewell, R. (1986), The Fourier Transform and Its Applications (2nd ed.), McGraw–Hill, ISBN 0-07-116043-4.

• Hewitt, Edwin; Ross, Kenneth A. (1979), Abstract harmonic analysis. Vol. I, Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences], 115 (2nd ed.), Berlin, New York: Springer-Verlag, ISBN 978-3-540-09434-0, MR 551496.

• Hewitt, Edwin; Ross, Kenneth A. (1970), Abstract harmonic analysis. Vol. II: Structure and analysis for compact groups. Analysis on locally compact Abelian groups, Die Grundlehren der mathematischen Wissenschaften, Band 152, Berlin, New York: Springer-Verlag, MR 0262773.

• Hörmander, L. (1983), The analysis of linear partial differential operators I, Grundl. Math. Wissenschaft., 256, Springer, ISBN 3-540-12104-8, MR 0717035.

• Kassel, Christian (1995), Quantum groups, Graduate Texts in Mathematics, 155, Berlin, New York: Springer-Verlag, ISBN 978-0-387-94370-1, MR 1321145.

• Knuth, Donald (1997), Seminumerical Algorithms (3rd. ed.), Reading, Massachusetts: Addison–Wesley, ISBN 0-201-89684-2.

• Rudin, Walter (1962), Fourier analysis on groups, Interscience Tracts in Pure and Applied Mathematics, No. 12, Interscience Publishers (a division of John Wiley and Sons), New York–London, ISBN 0-471-52364-X, MR 0152834.

• Sobolev, V.I. (2001), "Convolution of functions", in Hazewinkel, Michiel, Encyclopedia of Mathematics, Springer, ISBN 978-1-55608-010-4.

• Stein, Elias; Weiss, Guido (1971), Introduction to Fourier Analysis on Euclidean Spaces, Princeton University Press, ISBN 0-691-08078-X.

• Strichartz, R. (1994), A Guide to Distribution Theory and Fourier Transforms, CRC Press, ISBN 0-8493-8273-4.

• Titchmarsh, E (1948), Introduction to the theory of Fourier integrals (2nd ed.), New York, N.Y.: Chelsea Pub. Co. (published 1986), ISBN 978-0-8284-0324-5.

• Uludag, A. M. (1998), "On possible deterioration of smoothness under the operation of convolution", J. Math. Anal. Appl. 227 no. 2, 335–358

• Treves, François (1967), Topological Vector Spaces, Distributions and Kernels, Academic Press, ISBN 0-486-45352-9.

• von zur Gathen, J.; Gerhard, J. (2003), Modern Computer Algebra, Cambridge University Press, ISBN 0-521-82646-2.

• Diggle, P. J. (1995), "A kernel method for smoothing point process data", Journal of the Royal Statistical Society, Series C) 34 (1985) 138–147

## 

View page ratings
Trustworthy
Objective
Complete
Well-written