當前位置: 首頁>>代碼示例>>Python>>正文


Python StreamInlet.time_correction方法代碼示例

本文整理匯總了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 """
開發者ID:bcimontreal,項目名稱:bci_workshop,代碼行數:33,代碼來源:exercise_02.py


注:本文中的pylsl.StreamInlet.time_correction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。