def perform_fft(signal, rate, add_zeros=True):
    """Perform a fast fournier transformation on a given signal."""
    import numpy as np
    import scipy
    chn = len(signal.shape)
    if chn >= 2:
        signal = signal.sum(axis=1) / 2
    N = int(signal.shape[0])
    secs = N / float(rate)
    if add_zeros:
        signal = np.concatenate((signal, np.zeros(len(signal))), axis=None)
    trans_fft = abs(scipy.fft(signal))
    return N, secs, trans_fft
