本文整理汇总了Python中EEGsynth.initialize_online_filter方法的典型用法代码示例。如果您正苦于以下问题:Python EEGsynth.initialize_online_filter方法的具体用法?Python EEGsynth.initialize_online_filter怎么用?Python EEGsynth.initialize_online_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEGsynth
的用法示例。
在下文中一共展示了EEGsynth.initialize_online_filter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import EEGsynth [as 别名]
# 或者: from EEGsynth import initialize_online_filter [as 别名]
for i in range(0,len(left)):
if f_shift == 'linear':
left_f[i] = f_offset * (i + 1)
else:
left_f[i] = f_offset * 2**i
if sideband == 'usb':
highpass = left_f[i]
lowpass = None
elif sideband == 'lsb':
highpass = None
lowpass = left_f[i]
else:
highpass = None
lowpass = None
left_b[i], left_a[i], left_zi[i] = EEGsynth.initialize_online_filter(hdr_output.fSample, highpass, lowpass, f_order, dat_output)
for i in range(0,len(right)):
if f_shift == 'linear':
right_f[i] = f_offset * (i + 1)
else:
right_f[i] = f_offset * 2**i
if sideband == 'usb':
highpass = right_f[i]
lowpass = None
elif sideband == 'lsb':
highpass = None
lowpass = right_f[i]
else:
highpass = None
示例2: print
# 需要导入模块: import EEGsynth [as 别名]
# 或者: from EEGsynth import initialize_online_filter [as 别名]
print("read ", window, "samples in", (time.time()-start)*1000, "ms")
# Online filtering
highpassfilter = patch.getfloat('processing', 'highpassfilter', default=None)
if highpassfilter != None:
highpassfilter = EEGsynth.rescale(highpassfilter, slope=scale_highpass, offset=offset_highpass)
lowpassfilter = patch.getfloat('processing', 'lowpassfilter', default=None)
if lowpassfilter != None:
lowpassfilter = EEGsynth.rescale(lowpassfilter, slope=scale_lowpass, offset=offset_lowpass)
change = False
change = show_change('highpassfilter', highpassfilter) or change
change = show_change('lowpassfilter', lowpassfilter) or change
if change:
# update the filter parameters
b, a, zi = EEGsynth.initialize_online_filter(hdr_input.fSample, highpassfilter, lowpassfilter, filterorder, dat_output, axis=0)
if not(highpassfilter is None) or not(lowpassfilter is None):
# apply the filter to the data
dat_output, zi = EEGsynth.online_filter(b, a, dat_output, axis=0, zi=zi)
if debug>1:
print("filtered ", window, "samples in", (time.time()-start)*1000, "ms")
# Downsampling
if not(downsample is None):
dat_output = decimate(dat_output, downsample, ftype='iir', axis=0, zero_phase=True)
window_new = int(window / downsample)
if debug>1:
print("downsampled ", window, "samples in", (time.time()-start)*1000, "ms")
else:
window_new = window