convConvolution or polynomial multiplication
w = conv(u, v)u and v are vectors or scalars. Each of u and v can be real or complex.w is the result of convolving u and v.u and v contain coefficients of polynomials w contains the coefficients of the product 💡 When representing a polynomial by a vector
p,p(1)andp(end)are the highest and zeroth order term coefficients, respectively.
w = conv(u, v, shape)shape should be either 'full', 'valid' or 'same'.
'full': It is the same as w = conv(u, v).'same': It gives a vector of length length(u), taken from the middle part of the full convolution w = conv(u, v).'valid': It returns the section of the full convolution w = conv(u, v) which was computed without the zero-padded edges. The output w has the length of max(length(u)-length(v) + 1, 0).deconv gives back u = [1 2 3];
v = [4 5 6];
w = conv(u,v)
d = deconv(w,v);
d
u
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
conv(u,v,'shape') with shape equal to full, same and valid.u = 1:5;
v = 6:9;
w = conv(u,v,'full')
w = conv(u,v,'same')
w = conv(u,v,'valid')
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