def applyFilter(x, y, filtDict):
    if (filtDict['name'] == 'Moving average'):
        return moving_average(y, n=np.round(filtDict['param']).astype(int))
    elif (filtDict['name'] == 'Low pass 1st order'):
        dt = (x[1] - x[0])
        return lowpass1(y, dt=dt, fc=filtDict['param'])
    elif (filtDict['name'] == 'High pass 1st order'):
        dt = (x[1] - x[0])
        return highpass1(y, dt=dt, fc=filtDict['param'])
    else:
        raise NotImplementedError('{}'.format(filtDict))
def applyFilter(x, y, filtDict):
    if (filtDict['name'] == 'Moving average'):
        return moving_average(y, n=np.round(filtDict['param']).astype(int))
    elif (filtDict['name'] == 'Low pass 1st order'):
        dt = (x[1] - x[0])
        return lowpass1(y, dt=dt, fc=filtDict['param'])
    elif (filtDict['name'] == 'High pass 1st order'):
        dt = (x[1] - x[0])
        return highpass1(y, dt=dt, fc=filtDict['param'])
    else:
        raise NotImplementedError('{}'.format(filtDict))