Compute the linear convolution y[n] = (x * h)[n] for two finite-length discrete sequences. Visualize the result, explore properties, and master convolution — fundamental to signal processing, system analysis, and deep learning.
Convolution is a mathematical operation that combines two sequences (or functions) to produce a third sequence, expressing how the shape of one is modified by the other. In discrete time, it is defined as \((x * h)[n] = \sum_{k} x[k] \cdot h[n-k]\). It appears everywhere from digital filtering and image edge detection to neural networks (CNNs) and probability theory (sum of independent random variables).
? Convolution theorem (Fourier domain):
$$
\mathcal{F}\{x * h\} = \mathcal{F}\{x\} \cdot \mathcal{F}\{h\}
$$
This duality simplifies analysis: convolution in time becomes multiplication in frequency.
Given sequences \(x\) of length \(M\) and \(h\) of length \(N\), the convolution \(y\) has length \(L = M + N - 1\). Each element \(y[i] = \sum_{j=0}^{i} x[j] \cdot h[i-j]\) where indices outside bounds are treated as zero (zero‑padding). This calculator implements the direct O(MN) method — robust for typical classroom and prototyping sequence lengths.
For example, with \(x=[1,1,1], h=[1,1]\): \(y[0]=1*1=1\), \(y[1]=1*1+1*1=2\), \(y[2]=1*1+1*1=2\), \(y[3]=1*1=1\) → result [1,2,2,1]. The bar chart highlights overlapping areas.
| Field | Application Example |
|---|---|
| Audio Engineering | Reverberation simulation: convolving dry signal with an impulse response of a hall. |
| Image Processing | Edge detection using Sobel kernels (2D convolution) — our 1D tool is a foundation. |
| Control Systems | Computing output of an LTI system given input and impulse response. |
| Probability | Distribution of sum of two independent discrete random variables: PDF convolution. |
| Deep Learning | Convolutional layers apply learnable kernels to feature maps. |
A financial analyst uses a 3‑point moving average kernel \(h = [1/3, 1/3, 1/3]\) on daily price changes. Convolving price changes with this kernel reduces noise and highlights trends. Using our calculator, you can test any kernel length — a critical tool before live deployment.