This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

ListConvolve

ListConvolve
forms the convolution of the kernel ker with list.
ListConvolve
forms the cyclic convolution in which the k^(th) element of ker is aligned with each element in list.
ListConvolve
forms the cyclic convolution whose first element contains and whose last element contains .
ListConvolve
forms the convolution in which list is padded at each end with repetitions of the element p.
ListConvolve
forms the convolution in which list is padded at each end with cyclic repetitions of the .
ListConvolve
forms a generalized convolution in which g is used in place of Times and h in place of Plus.
ListConvolve
forms a convolution using elements at level lev in ker and list.
  • With kernel and list , ListConvolve computes , where the limits of the sum are such that the kernel never overhangs either end of the list.
  • The values of and in ListConvolve determine the amount of overhang to allow at each end of list.
  • Common settings for are:
{-1,1}no overhangs (default)
{-1,-1}maximal overhang at the right-hand end
{1,1}maximal overhang at the left-hand end
{1,-1}maximal overhangs at both beginning and end
  • With maximal overhang at one end only, the result from ListConvolve is the same length as list.
  • ListConvolve effectively lays down repeated copies of padlist, then superimposes one copy of list on them and forms a convolution of the result.
  • Common settings for padlist are:
ppad with repetitions of a single element
{p1,p2,...}pad with cyclic repetitions of a sequence of elements
listpad by treating list as cyclic (default)
{}do no padding
  • ListConvolve works with multidimensional kernels and lists of data.
  • ListConvolve forms the cyclic convolution whose element contains and whose element contains .
  • is taken to be equivalent to .
  • When a function h is specified to use in place of Plus, explicit nested h expressions are generated with a depth equal to the depth of ker.
  • ListConvolve works with exact numbers and symbolic data as well as approximate numbers.
Convolve a kernel with a list of data:
Make a cyclic convolution the same length as the original data:
Align element 2 in the kernel with successive elements in the data:
Pad with instead of using the data cyclically:
Two-dimensional convolution:
Convolve a kernel with a list of data:
In[1]:=
Click for copyable input
Out[1]=
 
Make a cyclic convolution the same length as the original data:
In[1]:=
Click for copyable input
Out[1]=
Align element 2 in the kernel with successive elements in the data:
In[2]:=
Click for copyable input
Out[2]=
 
Pad with instead of using the data cyclically:
In[1]:=
Click for copyable input
Out[1]=
 
Two-dimensional convolution:
In[1]:=
Click for copyable input
Out[1]=
"Slide" the kernel along the data, allowing no overhangs:
Maximal overhang at the beginning; none at the end:
Maximal overhang at the end; none at the beginning:
Maximal overhangs at both beginning and end:
Align element 1 of the kernel with the first element of the data:
Align element 2 of the kernel with the first element of the data:
Align element 3 of the kernel with the first element of the data:
Align the last element of the kernel with the first element of the data:
Align the first element of the kernel with both the first and last elements of the data:
Align element 2 of the kernel with the first element of the data:
Align element 2 of the kernel with the last element of the data:
Use padding :
Cyclically use a list of padding elements:
Allow no overhangs:
Align with the elements of the kernel and data:
The result has the same dimensions as the input data:
Give a different overhang in each dimension:
ListConvolve works with sparse arrays:
Use in place of Times:
Use in place of Plus:
Use and in place of Times and Plus, with empty data padding:
Find a moving average:
Or use the MovingAverage function:
Smooth noisy data:
Find the autocorrelation of a list:
Apply a simple image-processing filter:
Multiply polynomials by convolving coefficient lists:
Multiply numbers by convolving digit lists:
Pascal's triangle:
Additive cellular automaton in base 5:
Fast multiplication of high-degree polynomials:
Use ListConvolve with maximal overhangs and zero padding:
Cyclic convolution is equivalent to multiplication in the discrete Fourier transform domain:
Convolve with a single element:
A kernel of the same length as the data, with no overhangs, is like a reversed dot product:
Successive differences:
Align with successive elements:
Varying alignments:
Varying alignments, with padding:
By default, the output is not the same length as the input:
Use overhangs to make the output the same length as the input:
Use overhangs to do the same in 2D:
New in 4