Toolvito

Calculates on this device. File exports run online.

Convolution Calculator

Type two sequences such as 1, 2, 3 and 1, 1, 0.5 to get their convolution with the sum of products for every value. You can also work out the circular convolution of N points with the convolution theorem, convolve a matrix with a kernel, or find the convolution integral of two signals with a picture of each step.

Enter your values

Your values

Numbers separated by commas or spaces, such as 1, 2, 3.

For a filter: its impulse response.

More options

Where x starts, such as −1 for a sequence centred on n = 0.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

Convolution checked on the server

Convolution checked on the server

Uses the question of the result above. The server works it out by other methods (NumPy with an FFT check, the FFT route of the convolution theorem, SciPy's convolve2d, adaptive quadrature for the integral) and draws it.

The calculator above works on your device. When you run a task in this section, Toolvito receives the values and result you submit to make the file or run the check. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How to use the convolution calculator

  1. Choose what to convolve: two sequences, two sequences, circular, a matrix and a kernel or two signals (the integral).
  2. Type the numbers separated by commas or spaces. For a matrix put each row on its own line.
  3. For two signals choose each one from the list (rectangle, triangle, exponential, step, ramp, half sine or impulse) and give its height, start and width.
  4. Press Calculate. The table shows the working; the box under the result works it out again on the server and draws it.

The formulas

  • Discrete: y[n] = Σ x[k] h[n − k]. The result has Lx + Lh − 1 values and starts at the sum of the two start indices.
  • Circular (N points): y[n] = Σ x[k] h[(n − k) mod N]. Its DFT is the product of the DFTs (the convolution theorem). It equals the linear convolution when N ≥ Lx + Lh − 1.
  • 2-D: each output is the sum of the matrix values under the kernel turned round by 180°.
  • Integral: y(t) = ∫ x(τ) h(t − τ) dτ: turn h round, slide it by t and take the area under the product.
  • The sum (or area) of a convolution is the product of the two sums (or areas).

Worked example

x = 1, 2, 3 and h = 1, 1, 0.5 give y = 1, 3, 5.5, 4, 1.5. For example y[2] = 1 × 0.5 + 2 × 1 + 3 × 1 = 5.5. The sum 15 is 6 × 2.5.

A pulse of height 1 and width 2 s convolved with e^(−t) rises as 1 − e^(−t), reaches 1 − e^(−2) = 0.8647 at t = 2 s and then decays.

Limits you should know

  • Real numbers only. Sequences up to 5,000 values (2,048 for circular), matrices up to 200 × 200 with kernels up to 25 × 25.
  • The integral takes the signals of the list only; it is worked out numerically to about 15 digits.

Related tools