Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recorded mock #13

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Recorded mock #13

wants to merge 5 commits into from

Conversation

moan0s
Copy link
Contributor

@moan0s moan0s commented Nov 30, 2021

This adds the option to use a pre-recorded xdf file to mock EEG data. It does not support marker streams.

It was tested with EEGO, BrainvisionRDA, and Spongebob data

@moan0s
Copy link
Contributor Author

moan0s commented Dec 7, 2021

It is possible that a recording of this stream has no clock offset saved which leads to the following issue: sccn/xdf#23

if time_diff > 0:
time.sleep(time_diff)
else:
time.sleep(0.001)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sleep in line 188/190 exhibits a bias, as you do not account for time spent in lines 182 to 186. One option is to measure this time spent, and reduce the time slept by this time, see re.g. Clock.sleep_debiased from Pyreiz:

https://github.com/pyreiz/pyreiz/blob/master/reiz/time.py#L83-L93

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, sleep has an inherent positive bias, that adds up over repeated calls. Consider a self-correcting scheduler implementation, e.g. https://gist.github.com/agricolab/1f35cecea25c3e251d40057f2221f831#file-periodic_self_correcting-py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants