def highpass1(y, dt, fc=3):
    ' \n    1st order high pass filter\n    '
    tau = (1 / ((2 * np.pi) * fc))
    alpha = (tau / (tau + dt))
    y_filt = np.zeros(y.shape)
    y_filt[0] = 0
    for i in np.arange(1, len(y)):
        y_filt[i] = ((alpha * y_filt[(i - 1)]) + (alpha * (y[i] - y[(i - 1)])))
    m0 = np.mean(y)
    m1 = np.mean(y_filt)
    y_filt += (m0 - m1)
    return y_filt
1st order high pass filter
def highpass1(y, dt, fc=3):
    ' \n    \n    '
    tau = (1 / ((2 * np.pi) * fc))
    alpha = (tau / (tau + dt))
    y_filt = np.zeros(y.shape)
    y_filt[0] = 0
    for i in np.arange(1, len(y)):
        y_filt[i] = ((alpha * y_filt[(i - 1)]) + (alpha * (y[i] - y[(i - 1)])))
    m0 = np.mean(y)
    m1 = np.mean(y_filt)
    y_filt += (m0 - m1)
    return y_filt