GestureSynth.me

Music calculator

Discrete Convolution Calculator

Compute full discrete linear convolution of two finite real sequences with zero extension. See every output index, including the filter tail.

discrete convolution calculator

Discrete Convolution Calculator guide

Discrete convolution describes how a finite input combines with a finite impulse response. Enter the input and tap sequences in time order beginning at index zero. The result includes every sample from the first possible product through the complete tail, making it suitable for checking a short FIR calculation or a hand-worked exercise.

Play the instrument ↑
Default result
4 convolution samples

Calculation and units

For each pair of indexes i and j, multiply input x at i by tap h at j and add the product to output index i plus j. Equivalent sliding notation uses a flipped response inside the product sum. A length N input and length M response produce N plus M minus one output positions. Samples outside either supplied sequence contribute zero.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Two tap difference

Input sequence x = 1 2 3 · Impulse response h = 1 -1.

4 convolution samples. Full linear convolution with zero extension. First sample 1, last sample -3. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 1; 1, 1; 2, 1; 3, -3.

The first tap passes the current value and the second subtracts the previous one. The final negative output is the tail after the input ends.

Unit impulse identity

Input sequence x = 2 -1 4 · Impulse response h = 1.

3 convolution samples. Full linear convolution with zero extension. First sample 2, last sample 4. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 2; 1, -1; 2, 4.

A single unit tap returns the original sequence at the same indexes. This is a simple alignment check before trying a longer filter.

One sample delay

Input sequence x = 2 -1 4 · Impulse response h = 0 1.

4 convolution samples. Full linear convolution with zero extension. First sample 0, last sample 4. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 0; 1, 2; 2, -1; 3, 4.

The initial zero in the impulse response delays every input value by one index. Keep that leading zero when copying the output.

Two equal smoothing taps

Input sequence x = 2 4 6 · Impulse response h = 0.5 0.5.

4 convolution samples. Full linear convolution with zero extension. First sample 1, last sample 3. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 1; 1, 3; 2, 5; 3, 3.

The interior outputs average adjacent samples. At each boundary the missing neighbor contributes zero, which changes the first and last values.

Two rectangular pulses

Input sequence x = 1 1 1 · Impulse response h = 1 1 1.

5 convolution samples. Full linear convolution with zero extension. First sample 1, last sample 1. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 1; 1, 2; 2, 3; 3, 2; 4, 1.

As one rectangle slides across the other the overlap grows and then shrinks. The center peak counts three contributing products.

Signed impulse response

Input sequence x = 1 -2 1 · Impulse response h = 1 2.

4 convolution samples. Full linear convolution with zero extension. First sample 1, last sample 2. Inputs start at index zero. Table readings (Output index, Convolved sample): 0, 1; 1, 0; 2, -3; 3, 2.

A negative input contributes through both taps. Track each product to its summed index to distinguish cancellation from a missing term.

Interpreting the result

Check the first and last output before following an interior row. Each boundary has only one contributing pair. The center of the output can have several, including positive and negative terms that cancel. A leading zero in the response describes a delay and should be kept even if trimming it would appear to shorten the calculation.

Measurement and model limits

This is full linear convolution. A circular implementation wraps output indexes into a fixed block, and a same-length filtering function may discard the tail or start from a different alignment. Set both input origins to zero before comparing results. For physical impulse responses, confirm whether any sampling-interval scaling belongs to your chosen discrete model.

Answers before you play

Common questions

What happens if I swap the lists?

The full output is the same because the pairwise products enter the same index sums. The interpretation of which list represents the input or filter can still matter in your application.

Can I verify a moving average here?

Use equal tap weights adding to one. At the edges missing input is treated as zero, which differs from an average that shrinks its divisor there.

Why is there output after the input ends?

The last input sample continues contributing through later taps. Those delayed contributions form the finite tail.

How does this differ from correlation?

Convolution adds index positions and represents a system response. Correlation compares overlapping records at different relative shifts and reports a lag instead.