Convolution
Convolution
t
(f g)(t) = f ( ) g(t ) d for f, g : [0, ) R
0
convolution is a mathematical operation on two functions
(f and g); it produces a third function, that is typically In this case, the Laplace transform is more appropriate
viewed as a modied version of one of the original func- than the Fourier transform below and boundary terms be-
tions, giving the integral of the pointwise multiplication come relevant.
of the two functions as a function of the amount that one For the multi-dimensional formulation of convolution,
of the original functions is translated. Convolution is sim- see domain of denition (below).
ilar to cross-correlation. It has applications that include
probability, statistics, computer vision, natural language
processing, image and signal processing, engineering, and 1.1 Notation
dierential equations.
The convolution can be dened for functions on groups A primarily engineering convention that one often sees
other than Euclidean space. For example, periodic func- is:[1]
tions, such as the discrete-time Fourier transform, can be
dened on a circle and convolved by periodic convolution.
(See row 11 at DTFT Properties.) A discrete convolu- def
f (t) g(t) = f ( ) g(t ) d ,
tion can be dened for functions on the set of integers.
Generalizations of convolution have applications in the | {z }
(f g)(t)
eld of numerical analysis and numerical linear algebra,
and in the design and implementation of nite impulse which has to be interpreted carefully to avoid confusion.
response lters in signal processing. For instance, (t)*g(t t 0 ) is equivalent to (*g)(t t 0 ),
Computing the inverse of the convolution operation is but (t t 0 )*g(t t 0 ) is in fact equivalent to (*g)(t-
known as deconvolution. 2t0 ).[2]
1
2 6 CIRCULAR DISCRETE CONVOLUTION
= f [n m] g[m].
f (u) g(x u) du m=
(commutativity)
is used by Sylvestre Franois Lacroix on page 505 of his The convolution of two nite sequences is dened by ex-
book entitled Treatise on dierences and series, which is tending the sequences to nitely supported functions on
the last of 3 volumes of the encyclopedic series: Trait the set of integers. When the sequences are the coef-
du calcul direntiel et du calcul intgral, Chez Courcier, cients of two polynomials, then the coecients of the
Paris, 1797-1800.[4] Soon thereafter, convolution opera- ordinary product of the two polynomials are the convolu-
tions appear in the works of Pierre Simon Laplace, Jean- tion of the original two sequences. This is known as the
Baptiste Joseph Fourier, Simon Denis Poisson, and oth- Cauchy product of the coecients of the sequences.
ers. The term itself did not come into wide use until the
1950s or 60s. Prior to that it was sometimes known as fal- Thus when g has nite support in the set {M, M +
tung (which means folding in German), composition prod- 1, . . . , M 1, M } (representing, for instance, a nite im-
uct, superposition integral, and Carsons integral.[5] Yet it pulse response), a nite summation may be used:[10]
appears as early as 1903, though the denition is rather
unfamiliar in older uses.[6][7]
M
The operation: (f g)[n] = f [n m]g[m].
m=M
t
(s)(t s) ds, 0 t < ,
6 Circular discrete convolution
0
When a function gN is periodic, with period N, then for
is a particular case of composition products considered functions, f, such that fgN exists, the convolution is also
by the Italian mathematician Vito Volterra in 1913.[8] periodic and identical to:
3
In many situations, discrete convolutions can be con- If f and g are compactly supported continuous functions,
verted to circular convolutions so that fast transforms then their convolution exists, and is also compactly sup-
with a convolution property can be used to implement ported and continuous (Hrmander 1983, Chapter 1).
the computation. For example, convolution of digit More generally, if either function (say f) is compactly
sequences is the kernel operation in multiplication of supported and the other is locally integrable, then the con-
multi-digit numbers, which can therefore be eciently volution fg is well-dened and continuous.
implemented with transform techniques (Knuth 1997, Convolution of f and g is also well dened when both
4.3.3.C; von zur Gathen & Gerhard 2003, 8.2). functions are locally square integrable on R and supported
Eq.1 requires N arithmetic operations per output value on an interval of the form [a, +) (or both supported on
and N 2 operations for N outputs. That can be signi- [-, a]).
cantly reduced with any of several fast algorithms. Digital
signal processing and other applications typically use fast
convolution algorithms to reduce the cost of the convolu- 7.2 Integrable functions
tion to O(N log N) complexity.
The convolution of f and g exists if f and g are both
The most common fast convolution algorithms use fast
Lebesgue integrable functions in L1 (Rd ), and in this case
Fourier transform (FFT) algorithms via the circular con-
fg is also integrable (Stein & Weiss 1971, Theorem 1.3).
volution theorem. Specically, the circular convolution
This is a consequence of Tonellis theorem. This is also
of two nite-length sequences is found by taking an FFT
true for functions in 1 , under the discrete convolution,
of each sequence, multiplying pointwise, and then per-
or more generally for the convolution on any group.
forming an inverse FFT. Convolutions of the type de-
1 d p d
ned above are then eciently implemented using that Likewise, if f L (R ) and g L (R ) where 1 p ,
p d
technique in conjunction with zero-extension and/or dis- then fg L (R ) and
carding portions of the output. Other fast convolution
algorithms, such as the SchnhageStrassen algorithm or
the Mersenne transform,[11] use fast Fourier transforms f gp f 1 gp .
in other rings.
1
If one sequence is much longer than the other, zero- In the particular case p = 1, this shows that L is a Banach
extension of the shorter sequence and fast circular con- algebra under the convolution (and equality of the two
volution is not the most computationally ecient method sides holds if f and g are non-negative almost every-
available.[12] Instead, decomposing the longer sequence where).
into blocks and convolving each block allows for faster al- More generally, Youngs inequality implies that the con-
gorithms such as the Overlapsave method and Overlap volution is a continuous bilinear map between suitable Lp
add method.[13] A hybrid convolution method that com- spaces. Specically, if 1 p,q,r satisfy
4 8 PROPERTIES
1 1 1
+ = + 1, f (y)g(x y) dy.
p q r Rd
f gr f p gq , f Lp , g Lq ,
f (g ) = (f g)
so that the convolution is a continuous bilinear mapping
from Lp Lq to Lr . The Young inequality for convolution remains valid in the case where f is a distribution, and
is also true in other contexts (circle group, convolution on g a compactly supported distribution (Hrmander 1983,
Z). The preceding inequality is not sharp on the real line: 4.2).
when 1 < p, q, r < , there exists a constant Bp, q < 1
such that:
7.5 Measures
The convolution of any two Borel measures and of
f gr Bp,q f p gq , f Lp , g Lq .
bounded variation is the measure dened by (Rudin
1962)
The optimal value of Bp, q was discovered in 1975.[15]
A stronger estimate is true provided 1 < p, q, r < :
f (x)d(x) = f (x + y) d(x) d(y).
Rd Rd Rd
f gr Cp,q f p gq,w
This agrees with the convolution dened above when
where gq,w is the weak Lq norm. Convolution also de- and are regarded as distributions, as well as the convo-
nes a bilinear continuous map Lp,w Lq.w Lr,w lution of L1 functions when and are absolutely con-
for 1 < p, q, r < , owing to the weak Young tinuous with respect to the Lebesgue measure.
inequality:[16] The convolution of measures also satises the following
version of Youngs inequality
7.3 Functions of rapid decay where the norm is the total variation of a measure. Be-
cause the space of measures of bounded variation is a
In addition to compactly supported functions and inte- Banach space, convolution of measures can be treated
grable functions, functions that have suciently rapid with standard methods of functional analysis that may not
decay at innity can also be convolved. An important apply for the convolution of distributions.
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 con- 8 Properties
volution fg. Combined with the fact that convolution
commutes with dierentiation (see Properties), it fol-
lows that the class of Schwartz functions is closed under 8.1 Algebraic properties
convolution (Stein & Weiss 1971, Theorem 3.3).
See also: Convolution algebra
Proof: By denition (f g) = f g = f g
Proof:
f g = f ( )g(t )d
d
(f g) = f ( )g(t )d
dt
Changing the variable of integration to u = t and the
result follows.
= f ( ) g(t )d
t
Associativity f (g h) = (f g) h
= f ( )g (t )d = f g .
Proof: This follows from using Fubinis theorem (i.e.,
( ) ( )
Multiplicative identity
(f g)(x) dx = f (x) dx g(x) dx .
Rd Rd Rd
No algebra of functions possesses an identity for the con-
volution. The lack of identity is typically not a major in- This follows from Fubinis theorem. The same result
convenience, since most collections of functions on which holds if f and g are only assumed to be nonnegative mea-
the convolution is performed can be convolved with a surable functions, by Tonellis theorem.
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
8.3 Dierentiation
an identity under the convolution. Specically,
In the one-variable case,
f =f d df dg
(f g) = g =f
dx dx dx
where is the delta distribution.
where d/dx is the derivative. More generally, in the case
Inverse element of functions of several variables, an analogous formula
holds with the partial derivative:
Some distributions have an inverse element for the con-
volution, S (1) , which is dened by f g
(f g) = g =f .
xi xi xi
is continuously dierentiable with compact support, and Suppose that S is a linear operator acting on func-
g is an arbitrary locally integrable function, tions which commutes with translations: S(xf) =
x(Sf) for all x. Then S is given as convolution with
a function (or distribution) gS; that is Sf = gSf.
d df
(f g) = g.
dx dx Thus any translation invariant operation can be repre-
These identities also hold much more broadly in the sense sented as a convolution. Convolutions play an important
of tempered distributions if one of f or g is a compactly role in the study of time-invariant systems, and especially
supported distribution or a Schwartz function and the LTI system theory. The representing function gS is the
other is a tempered distribution. On the other hand, two impulse response of the transformation S.
positive integrable and innitely dierentiable functions A more precise version of the theorem quoted above re-
may have a nowhere continuous convolution. quires specifying the class of functions on which the con-
In the discrete case, the dierence operator D f(n) = f(n volution is dened, and also requires assuming in addition
+ 1) f(n) satises an analogous relationship: 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 lin-
ear operator on L1 is the convolution with a nite Borel
D(f g) = (Df ) g = f (Dg).
measure. More generally, every continuous translation
invariant continuous linear operator on Lp for 1 p <
8.4 Convolution theorem is the convolution with a tempered distribution whose
Fourier transform is bounded. To wit, they are all given
The convolution theorem states that by bounded Fourier multipliers.
hk (x) = eikx , k Z,
X X X X X X.
which are precisely the characters of T. Each convolution
is a compact multiplication operator in this basis. This The convolution appears notably in the denition of Hopf
can be viewed as a version of the convolution theorem algebras (Kassel 1995, III.3). A bialgebra is a Hopf al-
discussed above. gebra if and only if it has an antipode: an endomorphism
A discrete example is a nite cyclic group of order n. S such that
Convolution operators are here represented by circulant
matrices, and can be diagonalized by the discrete Fourier
transform. S idX = idX S = .
A similar result holds for compact groups (not necessar-
ily abelian): the matrix coecients of nite-dimensional
unitary representations form an orthonormal basis in L2 12 Applications
by the PeterWeyl theorem, and an analog of the convo-
lution theorem continues to hold, along with many other
Convolution and related operations are found in many ap-
aspects of harmonic analysis that depend on the Fourier
plications in science, engineering and mathematics.
transform.
In image processing
10 Convolution of measures
See also: digital signal processing
Let G be a topological group. If and are nite Borel
measures on G, then their convolution is dened by
In digital image processing convo-
lutional ltering plays an important
role in many important algorithms
( )(E) = 1E (xy) d(x) d(y)
in edge detection and related pro-
cesses.
for each measurable subset E of G. The convolution is
In optics, an out-of-focus photo-
also a nite measure, whose total variation satises
graph is a convolution of the sharp
image with a lens function. The
photographic term for this is bokeh.
.
In image processing applications
In the case when G is locally compact with (left-)Haar such as adding blurring.
measure , and and are absolutely continuous with
respect to a , so that each has a density function, then In digital data processing
8 13 SEE ALSO
In Time-resolved uorescence
spectroscopy, the excitation signal
can be treated as a chain of delta
pulses, and the measured uo-
rescence is a sum of exponential
decays from each delta pulse.
In computational uid dynamics,
the large eddy simulation (LES)
turbulence model uses the convo-
Gaussian blur can be used in order to obtain a smooth grayscale
digital image of a halftone print lution operation to lower the range
of length scales necessary in com-
putation thereby reducing compu-
In analytical chemistry, Savitzky tational cost.
Golay smoothing lters are used for
the analysis of spectroscopic data.
In probability theory, the probability distribution of
They can improve signal-to-noise
the sum of two independent random variables is the
ratio with minimal distortion of the
convolution of their individual distributions.
spectra.
In statistics, a weighted moving av-
erage is a convolution. In kernel density estimation, a dis-
tribution is estimated from sample
In acoustics, reverberation is the convolution of the points by convolution with a ker-
original sound with echoes from objects surrounding nel, such as an isotropic Gaussian.
the sound source. (Diggle 1995).
Convolution for optical broad-beam responses in [10] Press, William H.; Flannery, Brian P.; Teukolsky, Saul
scattering media A.; Vetterling, William T. (1989). Numerical Recipes in
Pascal. Cambridge University Press. p. 450. ISBN 0-
Convolution power 521-37516-9.
[1] Smith, Stephen W (1997). 13.Convolution. The Sci- [17] Zlzer, Udo, ed. (2002). DAFX:Digital Audio Eects,
entist and Engineers Guide to Digital Signal Process- p.4849. ISBN 0471490784.
ing (1 ed.). California Technical Publishing. ISBN
0966017633. Retrieved 22 April 2016.
[7] Leonard Eugene Dickson (1914), Algebraic invariants, J. Dominguez-Torres, Alejandro (Nov 2, 2010).
Wiley, p. 85 Origin and history of convolution. 41
pgs. http://www.slideshare.net/Alexdfar/
[8] According to [Lothar von Wolfersdorf (2000), Einige origin-adn-history-of-convolution. Craneld,
Klassen quadratischer Integralgleichungen, Sitzungs-
Bedford MK43 OAL, UK. Retrieved Mar 13,
berichte der Schsischen Akademie der Wissenschaften zu
Leipzig, Mathematisch-naturwissenschaftliche Klasse, vol-
2013.
ume 128, number 2, 67], the source is Volterra, Vito
Grinshpan, A. Z. (2017), An inequality for multi-
(1913), Leons sur les fonctions de linges. Gauthier-
Villars, Paris 1913. ple convolutions with respect to Dirichlet probabil-
ity measure, Advances in Applied Mathematics, 82
[9] Damelin & Miller 2011, p. 232 (1): 102119, doi:10.1016/j.aam.2016.08.001
10 16 EXTERNAL LINKS
Hewitt, Edwin; Ross, Kenneth A. (1979), Abstract Treves, Franois (1967), Topological Vector Spaces,
harmonic analysis. Vol. I, Grundlehren der Math- Distributions and Kernels, Academic Press, ISBN 0-
ematischen Wissenschaften [Fundamental Princi- 486-45352-9.
ples of Mathematical Sciences], 115 (2nd ed.),
Berlin, New York: Springer-Verlag, ISBN 978-3- von zur Gathen, J.; Gerhard, J. (2003), Mod-
540-09434-0, MR 551496. ern Computer Algebra, Cambridge University Press,
ISBN 0-521-82646-2.
Hewitt, Edwin; Ross, Kenneth A. (1970), Abstract
harmonic analysis. Vol. II: Structure and analy-
sis for compact groups. Analysis on locally compact 16 External links
Abelian groups, Die Grundlehren der mathematis-
chen Wissenschaften, Band 152, Berlin, New York: Earliest Uses: The entry on Convolution has some
Springer-Verlag, MR 0262773. historical information.
Hrmander, L. (1983), The analysis of linear par- Convolution, on The Data Analysis BriefBook
tial dierential operators I, Grundl. Math. Wis-
senschaft., 256, Springer, ISBN 3-540-12104-8, http://www.jhu.edu/~{}signals/convolve/index.
MR 0717035. html Visual convolution Java Applet
http://www.jhu.edu/~{}signals/discreteconv2/
Kassel, Christian (1995), Quantum groups, Gradu-
index.html Visual convolution Java Applet for
ate Texts in Mathematics, 155, Berlin, New York:
discrete-time functions
Springer-Verlag, ISBN 978-0-387-94370-1, MR
1321145. Lectures on Image Processing: A collection of 18
lectures in pdf format from Vanderbilt University.
Knuth, Donald (1997), Seminumerical Algorithms Lecture 7 is on 2-D convolution., by Alan Peters
(3rd. ed.), Reading, Massachusetts: Addison
Wesley, ISBN 0-201-89684-2. https://archive.org/details/Lectures_on_
Image_Processing
Reed, Michael; Simon, Barry (1975), Methods of
modern mathematical physics. II. Fourier analy- Convolution Kernel Mask Operation Interactive tu-
sis, self-adjointness, New York-London: Academic torial
Press Harcourt Brace Jovanovich, Publishers, pp.
Convolution at MathWorld
xv+361, ISBN 0-12-585002-6, MR 0493420
Freeverb3 Impulse Response Processor: Open-
Rudin, Walter (1962), Fourier analysis on groups, source zero latency impulse response processor with
Interscience Tracts in Pure and Applied Mathemat- VST plugins
ics, No. 12, Interscience Publishers (a division of
John Wiley and Sons), New YorkLondon, ISBN Stanford University CS 178 interactive Flash demo
0-471-52364-X, MR 0152834. showing how spatial convolution works.
Sobolev, V.I. (2001), Convolution of functions, in A video lecture on the subject of convolution given
Hazewinkel, Michiel, Encyclopedia of Mathematics, by Salman Khan
Springer, ISBN 978-1-55608-010-4.
17.2 Images
File:Commons-logo.svg Source: https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg License: PD Contributors: ? Origi-
nal artist: ?
File:Comparison_convolution_correlation.svg Source: https://upload.wikimedia.org/wikipedia/commons/2/21/Comparison_
convolution_correlation.svg License: CC BY-SA 3.0 Contributors: Own work Original artist: Cmglee
File:Convolution3.svg Source: https://upload.wikimedia.org/wikipedia/commons/7/79/Convolution3.svg License: CC BY-SA 3.0 Con-
tributors: Own work Original artist: Krishnavedala
File:Convolution_of_box_signal_with_itself2.gif Source: https://upload.wikimedia.org/wikipedia/commons/6/6a/Convolution_of_
box_signal_with_itself2.gif License: CC BY-SA 3.0 Contributors:
Convolution_of_box_signal_with_itself.gif Original artist: Convolution_of_box_signal_with_itself.gif: Brian Amberg
File:Convolution_of_spiky_function_with_box2.gif Source: https://upload.wikimedia.org/wikipedia/commons/b/b9/Convolution_
of_spiky_function_with_box2.gif License: CC BY-SA 3.0 Contributors:
Convolution_of_spiky_function_with_box.gif Original artist: Convolution_of_spiky_function_with_box.gif: Brian Amberg
File:Halftone,_Gaussian_Blur.jpg Source: https://upload.wikimedia.org/wikipedia/commons/d/d7/Halftone%2C_Gaussian_Blur.jpg
License: Public domain Contributors: Interbellic newspaper
Own work Original artist: Anonymous
Alex:D
File:Wiktionary-logo-v2.svg Source: https://upload.wikimedia.org/wikipedia/commons/0/06/Wiktionary-logo-v2.svg License: CC BY-
SA 4.0 Contributors: Own work Original artist: Dan Polansky based on work currently attributed to Wikimedia Foundation but originally
created by Smurrayinchester