Contents Previous Next Subchapters

Convolution of Vectors (Mlmode)
Syntax y = conv(ab)
See Also conv , polmul

Description
Computes the convolution of two integer, real, double-precision or complex vectors a and b. The type of y is the type that results from coercion between the types of a and b. If na is the length of a and nb is the length of b, the return value has length na + nb - 1 and its i-th element is given by
      na
     ----                                   / 0   if k - i < 1
     >      a  * B           where B     = <  0   if k - i > nb
     ----    i    k - i             k - i   \ b   otherwise
     i = 1                                      k-i
This is equivalent to polynomial multiplication .

Example
If in Mlmode you enter,
     a = [ 1 , 1 , 1 , 1,  1];
     conv(a, a)
O-Matrix will reply
     [ 1 , 2 , 3 , 4 , 5 , 4 , 3 , 2 , 1 ]