sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

Questions about the synchronizetion between data time and markers time #326

Closed RanjitF closed 5 years ago

RanjitF commented 5 years ago

I want to ask a question about the synchronization of the data time and the markers showing time. How can I synchronize the data time with the markers time? Since the sampling frequency is very high( 5000Hz ), I think it is very difficult to locate the makers showing time from the data time. Is there any way to synchronize these two time perfectly? Thanks.

cboulay commented 5 years ago

Hi Ranjit. Can you tell us about the hardware you're using? If one of us is familiar with it then we may have specific recommendations. If not, we still need to know how the data (eeg?) is connected to the computer, and where the markers are coming from (software, hardware, etc). Many neurophysiology systems support analog or digital inputs so the neurophysiology system itself is responsible for creating the markers, and of course these are on the same clock as the 'data'. This is the best way to get marker times if your markers are generated by hardware (e.g., LEDs).

RanjitF commented 5 years ago

The amplifier I used is BrainAmp MR32 and the markers are coming from e-prime from another computer. My experiment is the left hand and right hand imagine. Another thing is that, the Apps corresponding to BrainAmpSeries can not change the sampling frequency, which is very inconvenient. Is there any way to change this sampling frequency?

cboulay commented 5 years ago

I just did a search for LSL and Eprime and I didn't find anything. Do you know if EPrime supports LSL? If it does then you don't need to do much more. You just need to stream data from the BrainAmp and from EPrime, and use LabRecorder to save the 2+ streams to the xdf file. With this setup you'll have ~msec-precision markers which is about as good as you're going to get with software markers. If you need to get any better than that then you'll have to put a photodiode on your monitor and run that into your amp.

If EPrime doesn't have LSL output, then you may have to use its parallel output then connect the parallel cable into the BrainAmp digital input somehow. I no longer have a valid account to download the manuals at BrainProducts so I can't look to see, but I think you might need a BrainAmp ExG MR. @dmedine can probably help.

By the way, because you're using the MR variant, I guess you're doing EEG-fMRI or EEG-TMS. Software markers are not good enough to time-lock artifact events for template-based subtraction. For EEG-fMRI you need to be sync'd to the fMRI system. For EEG-TMS, if it's possible then the EEG and TMS should share a clock, but either way you at least need the TMS system to output hardware triggers that you capture in the amp.

RanjitF commented 5 years ago

Thanks for your response. I think the EPrime supportd LSL because I think use LSL to read the time markers successfully. Now, my new question is that, do you know if there is any Matlab toolbox that can replace the EPrime to show the tasks, like the pictures, words and beep voice? My project is motor imagination and I want to use a Matlab GUI to show the tasks to the patients. At the same time, every 200ms I want to do classcification and show the patients if there are doing it right or not. I want to put both the tasks and the classification results in the same Matlab GUI. Do you know if there is any matlab toolbox that can help me achieve this? Thanks.

dmedine commented 5 years ago

PsychPhysics: http://psychtoolbox.org/

On 8/1/2018 3:29 PM, RanjitF wrote:

Thanks for your response. I think the EPrime supportd LSL because I think use LSL to read the time markers successfully. Now, my new question is that, do you know if there is any Matlab toolbox that can replace the EPrime to show the tasks, like the pictures, words and beep voice? My project is motor imagination and I want to use a Matlab GUI to show the tasks to the patients. At the same time, every 200ms I want to do classcification and show the patients if there are doing it right or not. I want to put both the tasks and the classification results in the same Matlab GUI. Do you know if there is any matlab toolbox that can help me achieve this? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/326#issuecomment-409574685, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7mhrR8O-4DhpZRSfkLnBYAYG3Dd6ks5uMa05gaJpZM4VmdQs.

tstenner commented 5 years ago

I just did a search for LSL and Eprime and I didn't find anything. Do you know if EPrime supports LSL?

E-Prime 3? Not that I know of, but I'll present a workaround in September.

PsychPhysics: http://psychtoolbox.org/

Seconded. You might also want to take a look at Psychopy.

RanjitF commented 5 years ago

@dmedine Thanks for your recommendation of PsychPhysics. It is such an useful toolbox for my experiment design.

RanjitF commented 5 years ago

@tstenner Yes, I think LSL supports E-Prime but my version is E-Prime 2.0 . Just as @cboulay said, you just need to stream data from the BrainAmp and from EPrime and use LabRecorder to read the data. By the way, PsychPhysics is such a wonderful toolbox to present your experiment, I strongly recommend this toolbox.

RanjitF commented 5 years ago

@dmedine Is it possible to use PsychPhysics to display the tasks and the feedback together in one screen? I want to show the subject the tasks, which are clenching left hand or right hand. At the same time, I want to collect the data every 200ms and do classification then, send feedback to the subject whether he is doing it right or not. Do you think it is possible to show these two things together? If yes, could you please tell me which demo can give me any instruction about this problem? Thanks.

dmedine commented 5 years ago

I'm afraid I cannot support your questions about psychphysics. It has its own forums. This is not an appropriate conversation on an LSL issues page.

On 08/03/2018 07:30 AM, RanjitF wrote:

@dmedine https://github.com/dmedine Is it possible to use PsychPhysics to display the tasks and the feedback together in one screen? I want to show the subject the tasks, which are clenching left hand or right hand. At the same time, I want to collect the data every 200ms and do classification then, send feedback to the subject whether he is doing it right or not. Do you think it is possible to show these two things together? If yes, could you please tell me which demo can give me any instruction about this problem? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/326#issuecomment-410148733, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7oDJkeOQlzMMxDri090m7ZILiKouks5uM9_mgaJpZM4VmdQs.

RanjitF commented 5 years ago

Sorry for asking too much unrelated. Thanks for your response! @dmedine