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

ListCorrelate

ListCorrelate
forms the correlation of the kernel ker with list.
ListCorrelate
forms the cyclic correlation in which the k^(th) element of ker is aligned with each element in list.
ListCorrelate
forms the cyclic correlation whose first element contains and whose last element contains .
ListCorrelate
forms the correlation in which list is padded at each end with repetitions of the element p.
ListCorrelate
forms the correlation in which list is padded at each end with cyclic repetitions of the .
ListCorrelate
forms a generalized correlation in which g is used in place of Times and h in place of Plus.
ListCorrelate
forms a correlation using elements at level lev in ker and list.
  • With kernel and list , ListCorrelate computes , where the limits of the sum are such that the kernel never overhangs either end of the list.
  • For higher-dimensional lists, ker must be reversed at every level.
{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
Correlate a kernel with a list of data:
Make a cyclic correlation 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 correlation:
Correlate a kernel with a list of data:
In[1]:=
Click for copyable input
Out[1]=
 
Make a cyclic correlation 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 correlation:
In[1]:=
Click for copyable input
Out[1]=
Use exact arithmetic to compute the correlation:
Use machine arithmetic:
Use 24-digit precision arithmetic:
Correlation of complex data:
Two-dimensional correlation:
Cyclic two-dimensional correlation:
Two-dimensional correlation with maximal overhangs and zero padding:
Use functions f and g in place of Plus and Times:
Use functions f and g in place of Plus and Times with maximal overhangs and zero padding:
Use functions f and g in place of Plus and Times with maximal overhangs and empty padding:
Smooth data with a weighted running average:
Normalized Gaussian profile for averaging weights:
Gaussian smoothing of an image:
Gaussian kernel with a 5×5 pixel stencil:
Smooth the image:
Edge detection in an image:
Correlate with a Laplacian filter kernel:
Use a Laplacian of a Gaussian filter kernel:
Generate Pascal's triangle:
Additive cellular automata:
Apply a finite difference formula to a uniformly sampled function:
Show the error for different numbers of grid points:
Show the error for different numbers of grid points for a second derivative approximation:
ListCorrelate is equivalent to ListConvolve with the kernel reversed:
Cyclic correlation is equivalent to multiplication in the discrete Fourier transform domain:
New in 4