本文整理匯總了Python中pylsl.StreamInlet.time_correction方法的典型用法代碼示例。如果您正苦於以下問題:Python StreamInlet.time_correction方法的具體用法?Python StreamInlet.time_correction怎麽用?Python StreamInlet.time_correction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pylsl.StreamInlet
的用法示例。
在下文中一共展示了StreamInlet.time_correction方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from pylsl import StreamInlet [as 別名]
# 或者: from pylsl.StreamInlet import time_correction [as 別名]
help='channel number to use. If not specified, all the channels are used')
args = parser.parse_args()
""" 1. CONNECT TO EEG STREAM """
# Search for active LSL stream
print('Looking for an EEG stream...')
streams = resolve_byprop('type', 'EEG', timeout=2)
if len(streams) == 0:
raise RuntimeError('Can\'t find EEG stream.')
# Set active EEG stream to inlet and apply time correction
print("Start acquiring data")
inlet = StreamInlet(streams[0], max_chunklen=12)
eeg_time_correction = inlet.time_correction()
# Get the stream info, description, sampling frequency, number of channels
info = inlet.info()
description = info.desc()
fs = int(info.nominal_srate())
n_channels = info.channel_count()
# Get names of all channels
ch = description.child('channels').first_child()
ch_names = [ch.child_value('label')]
for i in range(1, n_channels):
ch = ch.next_sibling()
ch_names.append(ch.child_value('label'))
""" 2. SET EXPERIMENTAL PARAMETERS """