[TOC]

conv

Convolution or polynomial multiplication

Usage

w = conv(u, v)

💡 When representing a polynomial by a vector p, p(1) and p(end) are the highest and zeroth order term coefficients, respectively.

w = conv(u, v, shape)

Examples

Input
u = [1 2 3];
v = [4 5 6];
w = conv(u,v)
d = deconv(w,v);
d
u
Output
w =
 4.000   13.00   28.00   27.00   18.00

d =
 1.000   2.000   3.000

u =
 1.000   2.000   3.000
Input
u = 1:5;
v = 6:9;
w = conv(u,v,'full')
w = conv(u,v,'same')
w = conv(u,v,'valid')
Output
w =
Columns 1 through 5:
 6.000   19.00   40.00   70.00   100.0
Columns 6 through 8:
 94.00   76.00   45.00

w =
 40.00   70.00   100.0   94.00   76.00

w =
 70.00   100.0