def highpass_cnt(data, low_cut_hz, fs, filt_order=3, axis=0):
"""
Highpass signal applying **causal** butterworth filter of given order.
Parameters
----------
data: 2d-array
Time x channels
low_cut_hz: float
fs: float
filt_order: int
Returns
-------
highpassed_data: 2d-array
Data after applying highpass filter.
"""
if (low_cut_hz is None) or (low_cut_hz == 0):
log.info("Not doing any highpass, since low 0 or None")
return data.copy()
b, a = scipy.signal.butter(filt_order, low_cut_hz / (fs / 2.0),
btype='highpass')
assert filter_is_stable(a)
data_highpassed = scipy.signal.lfilter(b, a, data, axis=axis)
return data_highpassed
评论列表
文章目录