Open tstenner opened 4 years ago
Are you certain that the markerstream under option 3 has the same jitter as the datastream? Would the following approach to align a marker of type 3 with the data work?
for marker, tstamp in zip(marker["time_series"], marker["time_stamps"]:
idx = np.argmin(np.abs(tstamp-data["time_stamps"]))
even if the data stream is dejittered and synchronized, the sample-index should not be affected as long as data arrived in order.
I do it similarly here: https://github.com/agricolab/xdf-Python/blob/sync_timestamps/pyxdf/pyxdf.py#L864 or
Some devices (case in point: the BrainAmps) record a digital trigger alongside the EEG data and offer three options to send the markers:
int8
/int16
/string
stream with the same sampling rate as the EEG streamint8
/int16
/string
streamThe procedure is as follows (pseudocode, but probably also valid python):
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.