Convolution Calculator

Calculate discrete convolution of two sequences with step-by-step solutions

Calculate Discrete Convolution

First Sequence (a)

Current sequence: [1, 2, 3]

Second Sequence (b)

Current sequence: [4, 5, 6]

Convolution Results

Convolution: a * b

[4, 13, 28, 27, 18]
Result length: 5 terms

Step-by-Step Calculation

c0 = a0b0
c0 = 1 × 4 = 4
Terms used: a[0] × b[0] = 1 × 4 = 4
c1 = a0b1 + a1b0
c1 = 1 × 5 + 2 × 4 = 13
Terms used: a[0] × b[1] = 1 × 5 = 5, a[1] × b[0] = 2 × 4 = 8
c2 = a0b2 + a1b1 + a2b0
c2 = 1 × 6 + 2 × 5 + 3 × 4 = 28
Terms used: a[0] × b[2] = 1 × 6 = 6, a[1] × b[1] = 2 × 5 = 10, a[2] × b[0] = 3 × 4 = 12
c3 = a1b2 + a2b1
c3 = 2 × 6 + 3 × 5 = 27
Terms used: a[1] × b[2] = 2 × 6 = 12, a[2] × b[1] = 3 × 5 = 15
c4 = a2b2
c4 = 3 × 6 = 18
Terms used: a[2] × b[2] = 3 × 6 = 18

Convolution Formula

cn = Σk=0n ak × bn-k

For each term cn, we sum products where the indices add up to n.

Worked Example

Problem

Calculate the convolution of sequences [1, 2, 3] and [4, 5, 6]

Given:

Sequence a = [1, 2, 3]

Sequence b = [4, 5, 6]

Solution

c₀: 1 × 4 = 4 = 4

c₁: 1 × 5 + 2 × 4 = 5 + 8 = 13 = 13

c₂: 1 × 6 + 2 × 5 + 3 × 4 = 6 + 10 + 12 = 28 = 28

c₃: 2 × 6 + 3 × 5 = 12 + 15 = 27 = 27

c₄: 3 × 6 = 18 = 18

Final Result: [4, 13, 28, 27, 18]

Quick Actions

Convolution Properties

1

Commutative

a * b = b * a

2

Associative

(a * b) * c = a * (b * c)

3

Distributive

a * (b + c) = a * b + a * c

Applications

🔊

Signal Processing

Filter design, audio processing

🎯

Probability Theory

Sum of random variables

📷

Image Processing

Blurring, edge detection

🌊

Physics

Wave analysis, acoustics

Understanding Convolution

What is Convolution?

Convolution is a mathematical operation that combines two sequences to produce a third sequence. It's denoted by the star symbol (∗), so convolving sequences a and b is written as a∗b.

The Formula

cn = Σk=0n ak × bn-k

To get the nth term of the convolution, we compute products of terms whose indices sum to n, then add them together.

Step-by-Step Process

  1. For c₀: multiply a₀ × b₀
  2. For c₁: compute a₀×b₁ + a₁×b₀
  3. For c₂: compute a₀×b₂ + a₁×b₁ + a₂×b₀
  4. Continue this pattern for all terms

Key Applications

Signal Processing

Used to apply filters to signals. If you know a system's impulse response, convolution predicts the output for any input.

Probability Theory

The probability density function of the sum of two independent random variables is the convolution of their individual PDFs.

Image Processing

Convolution with different kernels can blur, sharpen, or detect edges in images.

Unit Element

The unit element (identity) for convolution is [1, 0, 0, 0, ...]. Convolving any sequence with this returns the original sequence unchanged.

Convolution vs. Other Operations

Convolution (∗)

Combines sequences by shifting and multiplying

c[n] = Σ a[k]b[n-k]

Output length: len(a) + len(b) - 1

Element-wise Product

Multiplies corresponding elements

c[n] = a[n] × b[n]

Output length: min(len(a), len(b))

Dot Product

Single scalar result

result = Σ a[i] × b[i]

Output: single number

Mathematical Properties

Commutativity

The order doesn't matter:

a ∗ b = b ∗ a

Associativity

Grouping doesn't matter:

(a ∗ b) ∗ c = a ∗ (b ∗ c)

Distributivity

Convolution distributes over addition:

a ∗ (b + c) = (a ∗ b) + (a ∗ c)