Skip to main content

Convolve {1, 2, 1} and {1, 2, 3, 1}

Short answer

Use y[n]=x[n]*h[n] with x[n]={1,2,1}, h[n]={1,2,3,1} both origin at first sample. The convolution yields y[n]={1, 4, 8, 9, 5, 1} for n=0..5.

Convolve the signals x[n] = {1, 2, 1} and h[n] = {1, 2, 3, 1} (↑ at the first 1, i.e. h[0] = 1).

Given h[n]={1,2,3,1}h[n]=\{1,2,3,1\} with h[0]h[0] = first 1, so n=0..3n=0..3. No origin is marked for x[n]x[n], so take x[0]x[0] = first sample: x[n]={1,2,1}x[n]=\{1,2,1\}, n=0..2n=0..2.

Output: y[n]=∑kx[k]h[n−k]y[n]=\sum_k x[k]h[n-k], from n=0n=0 to 55 (length 3+4−1=63+4-1=6). Since x[n]=δ[n]+2δ[n−1]+δ[n−2]x[n]=\delta[n]+2\delta[n-1]+\delta[n-2], y[n]=h[n]+2h[n−1]+h[n−2]y[n]=h[n]+2h[n-1]+h[n-2].

Tabular method

n=0n=012345
h[n]h[n]1231
2h[n−1]2h[n-1]2462
h[n−2]h[n-2]1231
y[n]y[n]148951
y[2]=x[0]h[2]+x[1]h[1]+x[2]h[0]=3+4+1=8y[3]=x[0]h[3]+x[1]h[2]+x[2]h[1]=1+6+2=9\begin{aligned} y[2]&=x[0]h[2]+x[1]h[1]+x[2]h[0]=3+4+1=8\\ y[3]&=x[0]h[3]+x[1]h[2]+x[2]h[1]=1+6+2=9 \end{aligned}

Sum check: ∑y=28=(∑x)(∑h)=4×7\sum y=28=(\sum x)(\sum h)=4\times7.

Answer: y[n]={1, 4, 8, 9, 5, 1}y[n]=\{1,\ 4,\ 8,\ 9,\ 5,\ 1\} for n=0,…,5n=0,\dots,5 (↑ at the first 1). If x[n]x[n] were taken with origin at its middle sample (2), the same values would simply start at n=−1n=-1.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Signals and Systems chapter 6 questions →