from scipy.signal import butter, lfilter
# 带通滤波器
def butter_bandpass_filter(data, lowcut, highcut, fs, order):
low = lowcut * 2 / fs
high = highcut * 2 / fs
b, a = butter(order, [low, high], btype='bandpass')
y = lfilter(b, a, data)
return y
# 初始信号 data: NumPy Tensor (Sample, EEG Channels, Time Length)
data = np.ndarray([200, 20, 3840])
data = butter_bandpass_filter(data, 0.5, 50, 128, 4) # 0.5-50Hz 带通滤波
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net