def subtract_signal(t, signal, fit_params=3):
    '\n\n    Returns the subtracted signal\n\n    '
    coef = np.polynomial.polynomial.polyfit(t, signal, (fit_params - 1))
    delta_signal = np.einsum('n,nj->j', coef, np.asarray([np.power(t, n) for n in range(fit_params)]))
    ht = (signal - delta_signal)
    return ht
Returns the subtracted signal
def subtract_signal(t, signal, fit_params=3):
    '\n\n    \n\n    '
    coef = np.polynomial.polynomial.polyfit(t, signal, (fit_params - 1))
    delta_signal = np.einsum('n,nj->j', coef, np.asarray([np.power(t, n) for n in range(fit_params)]))
    ht = (signal - delta_signal)
    return ht