{
  "id": "convolution",
  "title": "Convolution",
  "lang": "en",
  "source_lang": "en",
  "summary": "Convolution combines functions or sequences through shifted products, linking mathematical analysis, probability, signal processing, and neural networks.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "convolution product"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/convolution/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/convolution/",
      "json": "https://aiwiki.page/zh/convolution.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Convolution is a mathematical operation that combines two functions into a third by integrating or summing their products over relative shifts. Unlike pointwise multiplication, it combines values at different arguments. It provides a common framework for describing the response of linear systems, calculating distributions of sums of independent random variables, and implementing spatial filters. Its continuous and discrete forms share the same underlying structure. (dlmf.nist.gov)"
    },
    {
      "heading": "Definition and interpretation",
      "text": "For functions \\(f\\) and \\(g\\) on the real line, the usual continuous convolution is\n\n\\[(f*g)(x)=\\int_{-\\infty}^{\\infty}f(t)\\,g(x-t)\\,dt,\\]\n\nwhenever this integral exists. The functions may take real or complex values. In Euclidean space \\(\\mathbb R^d\\), the same definition applies with integration over all \\(d\\) coordinates. Some references incorporate a normalization factor into convolution, so formulas involving integral transforms must be read with their conventions in mind. (math.mit.edu)\n\nGeometrically, \\(g(x-t)\\) is obtained by reflecting \\(g(t)\\) about the origin and then shifting it by \\(x\\). Multiplying this reflected, shifted function by \\(f(t)\\) and integrating measures their weighted overlap. Repeating the calculation for different shifts produces the output function. Equivalently, convolution adds shifted copies of one function, weighted by values of the other. (ocw.mit.edu)\n\nFor sequences indexed by integers, discrete convolution replaces the integral with a sum:\n\n\\[(f*g)[n]=\\sum_{k=-\\infty}^{\\infty}f[k]\\,g[n-k].\\]\n\nFinite sequences are commonly extended by zeros outside their recorded ranges. If their lengths are \\(N\\) and \\(M\\), the full output contains \\(N+M-1\\) positions. For example, the sequences \\((1,2)\\) and \\((3,4)\\), both starting at index zero, produce \\((3,10,8)\\): the middle value is \\(1\\cdot4+2\\cdot3\\). (numpy.org)"
    },
    {
      "heading": "Existence and algebraic properties",
      "text": "Existence requires appropriate assumptions; arbitrary functions need not have a well-defined convolution. A standard setting is the L^1 space of absolutely integrable functions. If \\(f,g\\in L^1(\\mathbb R^d)\\), their convolution exists almost everywhere, belongs to \\(L^1\\), and satisfies\n\n\\[\\|f*g\\|_1\\leq \\|f\\|_1\\|g\\|_1.\\]\n\nThis estimate is a case of Young’s convolution inequality. (math.mit.edu)\n\nUnder suitable convergence assumptions, convolution is commutative, associative, and distributive:\n\n\\[f*g=g*f,\\qquad (f*g)*h=f*(g*h),\\]\n\n\\[f*(g+h)=f*g+f*h.\\]\n\nIt is linear in each argument separately. Consequently, fixing \\(g\\) makes \\(f\\mapsto f*g\\) a linear map, whereas treating both arguments as variable gives a bilinear operation. These properties allow convolution expressions to be regrouped and decomposed without changing their values. (ocw.mit.edu)\n\nConvolution also interacts with differentiation. For instance, if \\(f\\) is continuous with compact support and \\(g\\) is smooth with compact support, derivatives can be transferred to \\(g\\):\n\n\\[\\partial_j(f*g)=f*(\\partial_jg).\\]\n\nConvolution with a suitable smooth kernel therefore produces a smooth function. Such kernels, called mollifiers, are used in mathematical analysis to approximate less regular functions by smooth ones. For continuous, compactly supported functions, appropriately rescaled mollifiers yield uniform convergence to the original function. (math.mit.edu)"
    },
    {
      "heading": "Fourier transforms and computation",
      "text": "The convolution theorem connects convolution with the Fourier transform. Using the convention\n\n\\[\\widehat f(\\xi)=\\int_{\\mathbb R^d} f(x)e^{-2\\pi i x\\cdot\\xi}\\,dx,\\]\n\nthe theorem states\n\n\\[\\widehat{f*g}(\\xi)=\\widehat f(\\xi)\\widehat g(\\xi).\\]\n\nThus an operation that combines many shifted products becomes pointwise multiplication in the frequency domain. Other Fourier conventions introduce different constant factors. (dlmf.nist.gov)\n\nThis identity supports efficient numerical algorithms using the fast Fourier transform: transform the inputs, multiply corresponding transform values, and apply an inverse transform. Discrete Fourier multiplication naturally corresponds to circular convolution, in which indices wrap periodically. To recover ordinary finite linear convolution, sufficient zero-padding must prevent this wraparound from mixing output values. (numpy.org)\n\nSoftware commonly distinguishes three output modes. “Full” retains the entire convolution; “same” selects a centered portion matching a specified input size; “valid” retains only positions that do not depend on zero-padding. Boundary conventions therefore affect both output dimensions and edge values. Direct summation and Fourier-based methods are alternative implementations of the same operation. (scipy.github.io)"
    },
    {
      "heading": "Probability",
      "text": "In probability theory, convolution describes the distribution of a sum of independent random variables. If \\(X\\) and \\(Y\\) have probability density functions \\(p_X\\) and \\(p_Y\\), then \\(Z=X+Y\\) has density\n\n\\[p_Z(z)=\\int_{-\\infty}^{\\infty} p_X(t)p_Y(z-t)\\,dt.\\]\n\nFor integer-valued variables, the corresponding probability mass functions are combined by discrete convolution. Independence is essential: it allows the joint probabilities or densities to factor into products of marginal quantities. (statproofbook.github.io)\n\nThe operation adds the random variables, not their probabilities pointwise. For example, convolving two independent Poisson distributions with parameters \\(\\lambda_1\\) and \\(\\lambda_2\\) gives a Poisson distribution with parameter \\(\\lambda_1+\\lambda_2\\). (web.stanford.edu)"
    },
    {
      "heading": "Signals, images, and neural networks",
      "text": "In signal processing, the zero-state output of a linear time-invariant system is the convolution of its input with its impulse response. Linearity permits an input to be decomposed into weighted impulses, while time invariance makes each shifted impulse produce a correspondingly shifted response. Their superposition yields the convolution formula. In image processing, the same framework describes spatially invariant blur. (ocw.mit.edu)\n\nConvolutional neural networks use learned kernels that combine local input values, often across multiple channels. Terminology requires care: PyTorch’s two-dimensional convolution layer computes cross-correlation rather than mathematical convolution, omitting the kernel reversal. Its stride controls sampling intervals, padding controls boundary extension, and dilation controls spacing between kernel positions. These choices determine how local neighborhoods contribute to the output. (docs.pytorch.org)"
    }
  ],
  "links": [
    "mathematical-function",
    "integral",
    "real-number",
    "complex-number",
    "euclidean-space",
    "integer",
    "lp-space",
    "almost-everywhere",
    "linear-map",
    "mathematical-analysis",
    "uniform-convergence",
    "convolution-theorem",
    "fourier-transform",
    "algorithm",
    "fast-fourier-transform",
    "probability",
    "statistical-independence",
    "random-variable",
    "probability-density-function",
    "probability-mass-function",
    "poisson-distribution",
    "signal-processing",
    "linear-time-invariant-system",
    "impulse-response",
    "image-processing",
    "convolutional-neural-network"
  ],
  "sources": [
    {
      "title": "dlmf.nist.gov/1.14",
      "url": "https://dlmf.nist.gov/1.14"
    },
    {
      "title": "math.mit.edu/~dyatlov/18.155/155-notes.pdf",
      "url": "https://math.mit.edu/~dyatlov/18.155/155-notes.pdf"
    },
    {
      "title": "ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/5…",
      "url": "https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/5578d343aefc2a4f8e22f3f52f25c953_convolution.pdf"
    },
    {
      "title": "numpy.org/doc/stable/reference/generated/numpy.convolve.html",
      "url": "https://numpy.org/doc/stable/reference/generated/numpy.convolve.html?highlight=numpy+c_"
    },
    {
      "title": "scipy.github.io/devdocs/reference/generated/scipy.signal.convolve.html",
      "url": "https://scipy.github.io/devdocs/reference/generated/scipy.signal.convolve.html"
    },
    {
      "title": "statproofbook.github.io/P/pdf-sumind.html",
      "url": "https://statproofbook.github.io/P/pdf-sumind.html"
    },
    {
      "title": "web.stanford.edu/class/archive/cs/cs109/cs109.1206/lectureNotes/LN12_independen…",
      "url": "https://web.stanford.edu/class/archive/cs/cs109/cs109.1206/lectureNotes/LN12_independent_rvs.pdf"
    },
    {
      "title": "ocw.mit.edu/courses/6-003-signals-and-systems-fall-2011/resources/lecture-8-con…",
      "url": "https://ocw.mit.edu/courses/6-003-signals-and-systems-fall-2011/resources/lecture-8-convolution/"
    },
    {
      "title": "docs.pytorch.org/docs/stable/generated/torch.nn.modules.conv.Conv2d.html",
      "url": "https://docs.pytorch.org/docs/stable/generated/torch.nn.modules.conv.Conv2d.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}