DSP 101
M3 · Lab
Hands-on lab
Convolve, one lag at a time

Convolve a 5-sample boxcar with a 4-tap moving average in the sandbox, and predict every output sample before you read it off the screen.

The convolution sum
y[n] = \sum_{k} x[k]\,h[n-k]

Convolution is the one operation the rest of DSP is built on. If you can flip, shift, multiply and sum by hand, filtering, correlation and the FFT all become the same move.

1 / 7
DSP 101
M3 · Lab
Set it up
Two sequences

Open the sandbox and set the two sequences to these exact values. They are the demo's opening state, so a Reset gets you here too.

Set these values
x = [1, 1, 1, 1, 1] h = [0.25, 0.25, 0.25, 0.25]

Then drag the lag control n from left to right and watch the arithmetic line under panel 1.

2 / 7
DSP 101
M3 · Lab
Step 1 of 3
The first output

Set n to 0. Only one tap of h overlaps x. Predict y[0], then read it.

Expected

Panel 2 shows y[0] = 0.25 — the single product x[0]·h[0] = 1·0.25.

3 / 7
DSP 101
M3 · Lab
Step 2 of 3
The peak

Move n to 3. Now all four taps of h sit on ones. Predict y[3], then read it.

Expected

Panel 2 shows y[3] = 1 — four taps of 0.25 each land on a 1, so the sum is full overlap.

4 / 7
DSP 101
M3 · Lab
Step 3 of 3
How long is the output?

Drag n to the end. Predict how many samples y has, then read the length readout.

Expected

The output is 8 samples long: len(x) + len(h) - 1 = 5 + 4 - 1 = 8.

5 / 7
DSP 101
M3 · Lab
Your turn
Open the sandbox

Everything above is waiting in the sandbox. Build your own x and h, then step the lag and watch where every number comes from.

6 / 7
DSP 101
M3 · Lab
Wrap-up
What you did
  • Read y[0] = 0.25 off a single overlapping product
  • Found the peak y[3] = 1 at full overlap
  • Confirmed the length law len(x)+len(h)-1 = 8
  • Every value you predicted is the demo's own arithmetic, not a picture
7 / 7
1 / 8 muted