({{, (RefLink[DiscreteConvolve, paclet:ref/DiscreteConvolve])[f,g,n,m] 
gives the convolution with respect to n of the expressions f and g. }, {, (RefLink[DiscreteConvolve, paclet:ref/DiscreteConvolve])[f,g,{(Subscript[n, 1]),(Subscript[n, 2]),…},{(Subscript[m, 1]),(Subscript[m, 2]),…}]
gives the multidimensional convolution.}})

OpenersNotesSection(Spacer1)Details and Options

The convolution (f⋆g)(m) of two sequences f(n) and g(n) is given by (∑_(n=-∞)^∞)f(n) g(m-n).

The multidimensional convolution is given by (∑_((Subscript[n, 1])=-∞)^∞)(∑_((Subscript[n, 2])=-∞)^∞)⋯f((Subscript[n, 1]),(Subscript[n, 2]),…) g((Subscript[m, 1])-(Subscript[n, 1]),(Subscript[m, 2])-(Subscript[n, 2]),…).

The following options can be given:

OpenersPrimaryExamplesSection(Spacer1)Examples  (17)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Convolve two sequences:

DiscreteConvolve[DiscreteDelta[n],Sin[n],n,m]

DiscreteConvolve[(1/2)^n UnitStep[n],Sin[n],n,m, Assumptions -> m >0]//FullSimplify

Use a typical impulse response h for a system:

h=(4/5)^n UnitStep[n];

DiscretePlot[h,{n,0,20}]

The step response corresponding to the same system:

DiscreteConvolve[h,UnitStep[n],n,m,Assumptions->m>0]

DiscretePlot[%,{m,0,20}]

OpenersExampleSection1(Spacer1)Scope  (4)

OpenersExampleSubsection0(Spacer1)Univariate Convolution  (3)

Convolution sums the product of translates:

f[n_]:=2 UnitBox[n/7]

g[n_]:=3 UnitBox[n/3+1]

GraphicsRow@Table[DiscretePlot[{f[x],g[x-i]},{x,-10,10},ImageSize->110,Ticks->None, 
PlotRange -> All], {i, -1, 2}]

DiscreteConvolve[f[n], g[n],n,m]

DiscretePlot[%,{m,-10,10}]

Convolution of elementary sequences:

DiscreteConvolve[1/(2n+1)^2, 1/(3n-1)^2, n, m]

Convolution of piecewise sequences:

DiscreteConvolve[4^(-n) UnitStep[n],7^n UnitStep[n] , n, m]

OpenersExampleSubsection1(Spacer1)Multivariate Convolution  (1)

DiscreteConvolve[UnitBox[m/4,n/7+1],m^2 +n,{m,n},{r,s}]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (1)

Multiplication by (RefLink[UnitStep, paclet:ref/UnitStep]) effectively gives the convolution over a finite interval:

DiscreteConvolve[2^n  UnitStep[n],n UnitStep[n],n,m]

Sum[2^n (m-n),{n,0,m}]

OpenersExampleSection3(Spacer1)Options  (2)

OpenersExampleSubsection2(Spacer1)Assumptions  (1)

Specify assumptions on a variable or parameter:

DiscreteConvolve[UnitStep[n]/3^n, 2^n UnitStep[-n], n, m, 
Assumptions -> m>0]

DiscreteConvolve[UnitStep[n]/3^n, 2^n UnitStep[-n], n, m, 
Assumptions -> m<0]

OpenersExampleSubsection3(Spacer1)GenerateConditions  (1)

Generate conditions for the range of a parameter:

DiscreteConvolve[E^(-a Abs[n]), 1, n, m, GenerateConditions -> True]

OpenersExampleSection4(Spacer1)Applications  (1)

Obtain a particular solution for a linear difference equation:

y[n]/.RSolve[{y[n]-2y[n-1]==n,y[0]==0}, y,n][[1]]

DiscreteConvolve[2^k UnitStep[k],k UnitStep[k],k,n,Assumptions->n>0]

OpenersExampleSection5(Spacer1)Properties & Relations  (7)

(RefLink[DiscreteConvolve, paclet:ref/DiscreteConvolve]) computes a sum over the set of integers:

DiscreteConvolve[1/(3n+1)^2,UnitStep[n],n,m,Assumptions -> m >0]

Sum[UnitStep[m-n]/(3n+1)^2,{n,-Infinity,Infinity}, 
  Assumptions->Element[m,Integers]&&m > 0]

Convolution with (RefLink[DiscreteDelta, paclet:ref/DiscreteDelta]) gives the value of a sequence at m:

DiscreteConvolve[f[n],DiscreteDelta[n],n,m]

Scaling:

DiscreteConvolve[a r[n],s[n],n,m]

DiscreteConvolve[r[n],a s[n],n,m]

Commutativity:

f[n_]:=2^n UnitStep[n]

g[n_]:=UnitStep[n]

DiscreteConvolve[f[n],g[n],n,m]

DiscreteConvolve[g[n],f[n],n,m]

Distributivity:

DiscreteConvolve[h[n]+i[n],j[n],n,m]

DiscreteConvolve[h[n],i[n]+j[n],n,m]

The (RefLink[ZTransform, paclet:ref/ZTransform]) of a causal convolution is the product of the individual transforms:

f[n_]:=2^n UnitStep[n]

g[n_]:=UnitStep[n]

ZTransform[DiscreteConvolve[f[n],g[n],n,m],m,z]

Simplify[ZTransform[f[n],n,z]ZTransform[g[n],n,z]]

Similarly for (RefLink[GeneratingFunction, paclet:ref/GeneratingFunction]):

GeneratingFunction[DiscreteConvolve[f[n],g[n],n,m],m,z]

GeneratingFunction[f[n],n,z]GeneratingFunction[g[n],n,z]

%%-%//Simplify

The (RefLink[FourierSequenceTransform, paclet:ref/FourierSequenceTransform]) of a convolution is the product of the individual transforms:

f[n_]:=3^(-n) UnitStep[n]

g[n_]:=2^(n)UnitStep[-n]

DiscreteConvolve[f[n],g[n],n,m]

Together[FourierSequenceTransform[%, m, w]]

Simplify[FourierSequenceTransform[f[n], n, w]
 FourierSequenceTransform[g[n], n, w]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Sum, paclet:ref/Sum])  ▪  (RefLink[Convolve, paclet:ref/Convolve])  ▪  (RefLink[ListConvolve, paclet:ref/ListConvolve])  ▪  (RefLink[ZTransform, paclet:ref/ZTransform])  ▪  (RefLink[GeneratingFunction, paclet:ref/GeneratingFunction])  ▪  (RefLink[FourierSequenceTransform, paclet:ref/FourierSequenceTransform])  ▪  (RefLink[DirichletConvolve, paclet:ref/DirichletConvolve])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Fourier Analysis, paclet:guide/FourierAnalysis])}, {▪(RefLinkPlain[Summation Transforms, paclet:guide/SummationTransforms])}, {▪(RefLinkPlain[Additive Number Theory, paclet:guide/AdditiveNumberTheory])}})}})