Discrete Convolution Calculator
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 (lists of numbers), and it returns their convolution sequence along with the numerical values for each index.
Discrete Convolution Formula and Notation
We will use standard bracket notation for sequences. Let:
a[n]be the first sequence (Sequence A).b[n]be the second sequence (Sequence B).y[n]be their convolution:y[n] = (a * b)[n].
The discrete convolution of two sequences is defined by
In words: to compute y[n], you sum the products a[k] · b[n − k] over all indices k where both a[k] and b[n − k] are defined. Because the calculator treats your inputs as finite sequences that are zero outside their entered indices, the sum is effectively taken only over the overlapping part of the two sequences.
If Sequence A has length N and Sequence B has length M, the convolution result always has length
length(y) = N + M − 1.
How to Use the Discrete Convolution Calculator
The calculator is designed for quick, small-scale convolutions that you might otherwise do by hand. You can use it for digital signal processing homework, probability mass function convolutions, or checking manual calculations.
- Step 1: In Sequence A, enter your first sequence as comma-separated numbers, for example
1, 2, 3. - Step 2: In Sequence B, enter your second sequence, for example
4, 5. - Step 3: Click the button to compute the convolution. The output sequence
y[n]with lengthN + M − 1will appear below the form.
Order matters: in general a * b and b * a are equal numerically for finite sequences, but in many applications (such as interpreting time indices, shifts, or causal systems) you will want to treat one sequence as the input and the other as the impulse response. Use the A and B fields consistently with how you interpret your problem.
Input Format and Assumptions
The calculator expects inputs that follow these simple rules:
- Separators: Use commas between values. Spaces before or after numbers are fine (for example,
1, -2.5, 3). - Number types: Integers and decimal numbers are supported, including negative values (for example,
-1.5). - Finite sequences: Only the values you type are considered non-zero. Outside these indices, the sequences are assumed to be zero.
- Indexing convention: The first entered value is treated as index 0, the next as index 1, and so on. The output
y[n]therefore starts atn = 0and ends atn = N + M − 2. - Length recommendations: The calculator is intended for short to moderate sequences that are practical for educational and demonstration purposes. Very long lists may be slow or difficult to read.
- Invalid input handling: If any entry cannot be interpreted as a number (for example, letters or special symbols), the calculator will show an error message and will not compute the convolution until the input is corrected.
Worked Example: Step-by-Step Convolution
Consider the example where
a[n] = [1, 2, 3](Sequence A)b[n] = [4, 5](Sequence B)
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:
- n = 0: Only
a[0]andb[0]overlap.y[0] = a[0] · b[0] = 1 · 4 = 4
- n = 1: Overlap between
a[0], a[1]andb[1], b[0].y[1] = a[0] · b[1] + a[1] · b[0] = 1 · 5 + 2 · 4 = 5 + 8 = 13
- n = 2: Overlap between
a[1], a[2]andb[1], b[0].y[2] = a[1] · b[1] + a[2] · b[0] = 2 · 5 + 3 · 4 = 10 + 12 = 22
- n = 3: Only
a[2]andb[1]overlap.y[3] = a[2] · b[1] = 3 · 5 = 15
The final convolution result is
y[n] = [4, 13, 22, 15].
This is exactly what the calculator will display if you enter 1, 2, 3 for Sequence A and 4, 5 for Sequence B.
Applications in Signal Processing and Probability
Discrete convolution appears in many areas. Here are two of the most common ways you might use this calculator.
Digital Signal Processing (DSP)
In DSP, convolution models the response of a linear time-invariant (LTI) system to an input signal:
a[n]is a finite-length input signal or sequence.b[n]is the system’s impulse response (filter coefficients).y[n]is the system output.
For example, a simple three-point moving average filter has impulse response b[n] = [1/3, 1/3, 1/3]. Convolving this with a noisy signal smooths sudden variations.
Discrete Probability
In probability, convolution combines probability mass functions (PMFs). If a[n] and b[n] are PMFs of independent discrete random variables, their convolution gives the PMF of their sum. For instance, you can represent the distribution of two dice, coins, or other discrete outcomes as sequences and use the calculator to obtain the distribution of the sum.
Comparison: Signal vs Probability Use
| Aspect | Signal Processing View | Probability View |
|---|---|---|
| Sequences | a[n] is an input signal, b[n] is an impulse response or filter. |
a[n] and b[n] are probability mass functions (PMFs). |
Interpretation of y[n] |
Output signal of an LTI system at time index n. |
Probability that the sum of two random variables equals value corresponding to index n. |
| Typical values | Any real numbers, including negatives and decimals. | Non-negative numbers that sum to 1 (if normalized PMFs are used). |
| What convolution models | How a system filters or shapes an input sequence. | How independent random variables add together. |
| When to use this calculator | To check hand calculations for small FIR filters or study discrete-time convolution of sequences. | To compute distributions of sums for small discrete random variables. |
Limitations and Assumptions of This Calculator
This tool focuses on clarity and educational use, and it makes several assumptions:
- Finite, one-dimensional sequences only: It does not support infinite, symbolic, or multi-dimensional convolutions.
- Numeric values only: All entries must be numeric (integers or decimals). Complex numbers are not supported.
- Implicit zero-padding: Values outside the entered index range are treated as zero, which corresponds to standard linear convolution of finite-length sequences.
- No frequency-domain methods: The conceptual explanation here is based on direct time-domain convolution, not FFT-based acceleration, although FFT is a common method for very long signals.
- No automatic PMF normalization: When using probability applications, you are responsible for ensuring that your sequences represent valid PMFs if that is required for your use case.
Within these assumptions, the calculator gives reliable results for manual convolution steps, homework checks, and small exploratory problems.
Frequently Asked Questions
How is discrete convolution different from continuous convolution?
Discrete convolution works with sequences indexed by integers (for example, n = 0, 1, 2, ...) and uses sums. Continuous convolution works with functions of a real variable (for example, t) and uses integrals instead of sums. The calculator on this page handles only discrete convolution of finite-length sequences.
What is the length of the output sequence?
If Sequence A has length N and Sequence B has length M, the convolution result has length N + M − 1. The first element corresponds to index n = 0, and the last element corresponds to n = N + M − 2.
Can this calculator handle time shifts or negative indices?
The internal indexing starts at 0 for the first value you enter. To represent shifts or negative indices, you can insert leading zeros. For example, to model a sequence that is zero up to index 3 and then equals 1, you could enter 0, 0, 0, 1. This approach lets you mimic time shifts even though the displayed indices start at 0.
When should I use this calculator?
Use this calculator when you need fast, accurate discrete-time convolution of finite-length signals or sequences without doing every manual step yourself. It is helpful for learning, checking homework, designing or analyzing small filters, and exploring the convolution of discrete probability distributions.
