Closed DominiqueMakowski closed 6 months ago
Please try using one of the xdf importers. Either pyxdf or xdf-Matlab. Those take care of the synchronization for you.
Note: do not use the timestamp in the header for synchronization. The time the inlet was opened does not tell you the time of the first sample.
This does look to me like the Muse integration that you're using is not using the default LSL clock (which reports local time) but the unix clock. There's another piece of software that does that too (OpenVibe). There is a thread that discusses a solution in the OpenVibe context, which is to place a config file in the respective app folder that's then used by liblsl and causes it to ignore the (non-default) time stamps that the client submits. This way, everything uses the same clock domain.
I do use pyxdf
to open the file (saved using the BIDS format in LabRecorder):
pyxdf.load_xdf("sub-P001/ses-S001/eeg/sub-P001_ses-S001_task-Default_run-001_eeg.xdf")
Do I need to add an option to synchronize the signals? Where will the synchronization "show", in the first timestamp of each stream?
Thanks @chkothe!
It seems like the stream
command from muse-lsl uses the Muse
constructor:
which in turns does have a time_func
parameter:
which is unfortunately not modifiable from stream()
. This time_func
is by default set to Python's base time.time()
, and I suspect that I should modify that to get the time from pylsl is that correct?
Ah sorry I’m travelling so I didn’t look closely. Christian is probably correct that the Muse integration is using the wrong clock. Do you have a link to there exact app that you downloaded and ran?
Oh you are ahead of me, crossed streams:). You are correct.
Yeah you can either just not pass in a time, or you can use pylsl.local_clock() for that if you want to explicitly pass it
Might make a PR to Barachant's repo, hopefully he merges it in!
@chkothe I can try to do that if you want :)
Done: https://github.com/alexandrebarachant/muse-lsl/pull/197
it seems to work, but I'll give it another try with LabRecorder and everything on Friday when I'm back at the lab. Don't hesitate to check the changelog in case I missed something obvious :) thanks!
Closing because there's nothing to do here -- upstream PR needs to be fixed.
First, thanks a lot for your work, I'm new to this system but I have been mindblown by the possibilities that it enables.
Now, I'm trying to stream from 2 different devices, a Muse-2 EEG system and a BITalino for physiological signals.
The Muse stream is sent via muse-lsl, and the Bitalino stream via the OpenSignals app.
I managed to select both streams in LabRecorder, and record some data.
Unfortunately, the timestamps appear different in the resulting xdf (here's the footer):
Muse 2 EEG
BITalino
The first one is in Unix time (since 1970) and the second one I suspect is in local machine time. My question is how to synchronize these signals? How to create the "0" initial onset time.
Question 2. Additionally, the value of the
first_timestamp
in the footer does not match the first timestamp in the timestamp vector:I would like to create a timestamp for all signals that start from 0 (onset of the signal) to the end of the recording in seconds, but I am not sure which value to "trust" from the recording onset.
Hope that makes sense, Thanks a lot for any pointers!