w = conv(u,v) returns
the convolution of
vectors u and v. If u and v are
vectors of polynomial coefficients, convolving them is equivalent
to multiplying the two polynomials.

w = conv(u,v,shape) returns
a subsection of the convolution, as specified by shape.
For example, conv(u,v,'same') returns only the
central part of the convolution, the same size as u,
and conv(u,v,'valid') returns only the part of
the convolution computed without the zero-padded edges.

Input vectors, specified as either row or column vectors. The
output vector is the same orientation as the first input argument, u.
The vectors u and v can be different
lengths or data types.

Data Types: double | single Complex Number Support: Yes

Subsection of the convolution, specified as 'full', 'same',
or 'valid'.

'full'

Full convolution (default).

'same'

Central part of the convolution of the same size as u.

'valid'

Only those parts of the convolution that are computed
without the zero-padded edges. Using this option, length(w) is max(length(u)-length(v)+1,0),
except when length(v) is zero. If length(v)
= 0, then length(w) = length(u).

The convolution of two vectors, u and v,
represents the area of overlap under the points as v slides
across u. Algebraically, convolution is the same
operation as multiplying polynomials whose coefficients are the elements
of u and v.

Let m = length(u) and n = length(v) .
Then w is the vector of length m+n-1 whose kth
element is

$$w(k)={\displaystyle \sum _{j}u}(j)v(k-j+1).$$

The sum is over all the values of j that
lead to legal subscripts for u(j) and v(k-j+1),
specifically j=max(1,k+1-n):1:min(k,m).
When m=n,
this gives