Skip to content

Apply dejittering / sychronization to several streams at once #57

@tstenner

Description

@tstenner

Some devices (case in point: the BrainAmps) record a digital trigger alongside the EEG data and offer three options to send the markers:

  1. as an additional channel in the EEG stream converted to whatever data type the EEG data has
  2. as a continouous int8 / int16 / string stream with the same sampling rate as the EEG stream
  3. as a separate, irregular int8 / int16 / string stream

The procedure is as follows (pseudocode, but probably also valid python):

data, triggers, first_timestamp = device.get_chunk()
trigger_indices = triggers.find()
data_outlet.push(data, first_timestamp)
trigger1_outlet.push([data; triggers], first_timestamp)
trigger2_outlet.push(triggers, first_timestamp)
trigger3_outlet.push(triggers[trigger_indices], first_timestamp + trigger_indices / sampling_rate)

Both for resource usage and usability, 3 is the best option but irregularly sampled stream can't be dejittered so the markers aren't as reliable as they should be.

But, as seen in the example above, the timestamps have the same jitter and time offsets so if it were possible to copy dejitter / synchronization parameters from one stream to another the third option would be feasable for offline analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions