def convolve_many(arrays):
    """
    Convolve a list of 1d float arrays together, using FFTs.
    The arrays need not have the same length, but each array should
    have length at least 1.
    """
result_length = 1 + sum(len(array) - 1 for array in arrays)
rows = numpy.zeros((len(arrays), result_length))
for i, array in enumerate(arrays):
    rows[(i), :len(array)] = array
fft_of_rows = numpy.fft.fft(rows)
fft_of_convolution = fft_of_rows.prod(axis=0)
convolution = numpy.fft.ifft(fft_of_convolution)
Faster convolution of probability density functions in Python