#
# Simplistic convolution function.
# x and y must be vectors...
# No error checking.
#

conv = function( x , y )
{
  local( X , Y , n, tmp );

  n = x.n + y.n - 1;
  X = fft( x, n );
  Y = fft( y, n );

  tmp = ifft( X .* Y );
  if( type(x) == "real" && type(y) == "real") { tmp = real(tmp); }

  return tmp;
};
