Discrete Convolution Calculator
Introduction
Discrete convolution looks abstract the first time you meet it, but the core idea is practical: you slide one finite sequence across another, multiply the overlapping entries, and add those products to get one output value at a time. That process shows up everywhere from digital filters and control systems to probability distributions for sums of independent random variables. If you have ever wanted to check a homework problem, verify a short finite impulse response filter, or combine two small probability mass functions without doing every overlap manually, this calculator is meant for that job.
This page focuses on finite sequences with the first entered value treated as index 0. You type Sequence A and Sequence B as short lists of numbers, then the calculator returns the linear convolution result in order. The explanation below is written to make the result easier to interpret, not just easier to compute. In particular, it clarifies what each input means, how the indexing works, why the result has length N + M − 1, and how to think about the output whether you are working in signal processing or in probability.
What Is Discrete Convolution?
Discrete convolution is a way to combine two finite sequences to produce a third sequence that shows how one sequence filters or modifies the other. In signal processing, this is called discrete-time convolution of sequences. If you think of one sequence as an input signal and the other as a filter or system response, their convolution gives the output signal.
On this page, the calculator performs the manual convolution steps for you. You enter two finite-length sequences, meaning short ordered lists of numbers, and it returns their convolution sequence along with the numerical values for each output index. That makes it useful both as a quick answer tool and as a way to confirm that your own hand calculation used the right overlaps.
Discrete Convolution Formula and Notation
We will use standard bracket notation for sequences. Let a[n] be the first sequence, b[n] be the second sequence, and y[n] be the convolution output. The output is often written as y[n] = (a * b)[n].
The discrete convolution of two sequences is defined by
In words, to compute one output sample y[n], you add together all products of the form a[k] · b[n − k] for the indices where both terms exist. Because this calculator treats the entered lists as finite sequences that are zero outside their typed range, the sum only includes the overlapping portion. That is why convolution is often explained as a slide-and-overlap process: each new shift creates a different overlap, and each overlap creates one number in the output.
A practical way to picture the formula is this: Sequence A stays fixed, Sequence B is conceptually reversed and shifted, and each shift produces one total. Early output indices have only a small overlap, middle indices usually have the largest overlap, and late indices shrink back down again. When both sequences are short, this structure is easy to see by hand. The calculator reproduces exactly that direct time-domain calculation.
If Sequence A has length N and Sequence B has length M, the convolution result always has length N + M − 1. The first output corresponds to n = 0, and the last output corresponds to n = N + M − 2. This length rule is one of the fastest ways to sanity-check whether a manual answer has the right number of terms.
How to Use the Discrete Convolution Calculator
The calculator is designed for quick, small-scale convolutions that you might otherwise do by hand. It is especially useful when you want the numerical answer quickly but still want a clear connection to the underlying formula.
Start by entering Sequence A as a list of numbers such as 1, 2, 3. Then enter Sequence B as another list such as 4, 5. After you click the button, the tool computes the linear convolution and displays the output sequence in order from index 0 upward. Each displayed number is one sample of y[n].
Although convolution of finite sequences is commutative in the numerical sense, so a * b and b * a produce the same output values, the interpretation often matters. In a signal-processing problem you may want Sequence A to represent the input and Sequence B to represent the impulse response. In a probability problem you may want A and B to represent two separate probability mass functions. Using the fields consistently helps the output remain meaningful in context.
Input Format and Assumptions
The calculator expects simple numeric input. Commas work well, and spaces are also accepted by the parser. Integers, decimals, and negative values are supported, so inputs such as 1, -2.5, 3 or 0 1 0 1 are fine. The tool assumes that only the values you type are nonzero and that every index outside the entered list is zero.
The indexing convention is important. The first entered value is treated as index 0, the next value as index 1, and so on. That means the output begins at n = 0. If you need to mimic a delayed sequence or represent a sequence that starts later, you can insert leading zeros. This is a simple way to model shifts even though the display does not show negative starting indices directly.
All entries must be numeric. If a token cannot be interpreted as a number, the calculator shows an error message instead of an answer. This is intentional, because a single invalid symbol would make the direct sum-of-products calculation ambiguous.
Worked Example: Step-by-Step Convolution
Consider the example
a[n] = [1, 2, 3]b[n] = [4, 5]
Here, N = 3 and M = 2, so the result will have length 3 + 2 − 1 = 4. We compute y[n] = (a * b)[n] for n = 0, 1, 2, 3.
For n = 0, only the first entries overlap, so y[0] = 1 · 4 = 4. For n = 1, there are two overlapping products: 1 · 5 + 2 · 4 = 13. For n = 2, the overlap shifts again, giving 2 · 5 + 3 · 4 = 22. Finally, for n = 3, only the last entries overlap, so y[3] = 3 · 5 = 15.
The final convolution result is therefore y[n] = [4, 13, 22, 15]. If you type 1, 2, 3 into Sequence A and 4, 5 into Sequence B, the calculator will display those same four output values. This is a good example of how the overlap grows, reaches a fuller middle region, and then tapers off at the end.
How to Interpret the Result
The numbers in the result area are listed in output-index order. The first value is y[0], the second is y[1], and so on. If you are using the calculator for signal processing, those values are the output samples of the system. If you are using it for probability, those values are the probabilities associated with the summed outcomes, assuming your inputs are valid probability mass functions.
It is also worth checking whether the shape of the output makes sense. For example, if both inputs are nonnegative, every output sample should also be nonnegative. If one sequence includes negative values, then positive and negative contributions can cancel, and some output samples may be smaller than expected or even negative. Looking at the result this way helps you catch data-entry mistakes quickly.
Applications in Signal Processing and Probability
Digital Signal Processing
In DSP, convolution models the response of a linear time-invariant system to an input signal. Sequence A can represent an input signal, Sequence B can represent a finite impulse response or filter kernel, and the result is the filtered output. A short moving-average filter, for instance, smooths sudden variations because each output sample blends nearby input samples according to the filter coefficients.
This is one reason convolution appears so often in introductory signals courses. It links a compact system description, the impulse response, to a concrete output sequence. Even when software does the arithmetic, understanding the direct convolution sum helps you reason about delay, smoothing, accumulation, and the effect of coefficient signs.
Discrete Probability
In probability, convolution combines probability mass functions of independent discrete random variables. If a[n] and b[n] are PMFs, then their convolution gives the PMF of the sum of those variables. For example, if you convolve the PMFs for two small dice-like experiments, the output tells you how likely each summed result is.
The same formula is doing the work in both contexts. The difference is interpretation. In one case you are adding weighted signal contributions over time. In the other, you are adding probabilities for combinations of independent outcomes that lead to the same sum.
Comparison: Signal vs Probability Use
| Aspect | Signal Processing View | Probability View |
|---|---|---|
| Sequences | a[n] is an input signal and b[n] is an impulse response or filter. | a[n] and b[n] are probability mass functions. |
Meaning of y[n] | Output signal of an LTI system at time index n. | Probability that the sum of two independent variables equals the outcome indexed by n. |
| Typical values | Any real numbers, including negatives and decimals. | Usually nonnegative values that sum to 1 when the PMFs are normalized. |
| What convolution models | How a system filters or shapes an input sequence. | How independent random variables add together. |
| When this calculator helps | Checking hand calculations for small FIR filters or studying discrete-time convolution directly. | Computing distributions of sums for small discrete random variables. |
Limitations and Assumptions of This Calculator
This tool focuses on clarity and educational use. It handles finite, one-dimensional numeric sequences only. It does not support symbolic expressions, complex numbers, infinite sequences, or multidimensional convolution. Very large lists are also outside its intended use, because the display is most helpful when the sequence is short enough to inspect comfortably.
The method discussed here is direct linear convolution in the time domain. For long real-world signals, fast Fourier transform methods are often used for efficiency, but the meaning of the result is the same. When using the calculator in a probability setting, remember that the tool does not automatically normalize your inputs, so you are responsible for making sure they represent valid PMFs when that matters.
Frequently Asked Questions
How is discrete convolution different from continuous convolution?
Discrete convolution works with sequences indexed by integers and uses sums. Continuous convolution works with functions of a real variable and uses integrals instead of sums. This calculator handles only discrete convolution of finite sequences.
What is the length of the output sequence?
If Sequence A has length N and Sequence B has length M, the output has length N + M − 1. The indices run from 0 through N + M − 2.
Can this calculator handle time shifts or negative indices?
The first entered value is treated as index 0. To mimic a shifted sequence, add leading zeros before the first nonzero term. This gives a practical way to model delayed starts without changing the calculator’s indexing convention.
When should I use this calculator?
Use it when you want a quick, reliable discrete convolution for short sequences, whether you are checking homework, exploring filter behavior, or combining small probability distributions.
Mini-Game: Convolution Sweep
This optional arcade mini-game turns the same slide-and-overlap idea into a quick skill challenge. You guide a reversed kernel across Sequence A, then lock the highlighted output sample before its timer expires. It does not change the calculator’s math at all; it simply gives you a more intuitive feel for how each shift creates one value of y[n].
Each successful lock corresponds to one output sample of the convolution sum. Fast runs help reinforce that changing the shift changes which products overlap, and that overlap determines the value of y[n].
