<div dir="ltr"><div class="gmail_default" style="color:#333399">Hi Ali, </div><div class="gmail_default" style="color:#333399"><br></div><div class="gmail_default" style="color:#333399">This process can be pretty tricky, and you're better off chatting with an engineer hardware specialist, since the millisecond precision synchrony of your experimental events in relation to the EEG recording are critical for valid results in your case.</div><div class="gmail_default" style="color:#333399">In situations where researchers seek extreme accuracy, they often rely on precision instrumentation and displays, as well as important things that allow accurate alignment of all signatures, ideally to to one main clock. Timing issues and hardware are not often discussed though, and in some cases sidestepped, so kudos to you. </div><div class="gmail_default" style="color:#333399"><br></div><div class="gmail_default" style="color:#333399">Psychtoolbox and other matlab and python based tools (see also Kothe's Lab Streaming Layer)</div><div class="gmail_default" style="color:#333399">all have extensive documentation where one can learn how to use them. One can also google for </div><div class="gmail_default" style="color:#333399">specific things like "Psychtoolbox code for synching with eeg amplifier", or similar searches. I think LSL might work well for you.</div><div class="gmail_default" style="color:#333399">Perhaps an easier alternative is to simply find a way to translate your "real clock time" into "EEG time" accurately. If you can just do that, load the translated beep times into your EEG after recording as new events.</div><div class="gmail_default" style="color:#333399">Here's perhaps something easier too: if your amp has the capability of adding a sensor into it's output, the plug in an audio sensor and record it with your amp. Your EEG recording software may also have an option for such an integration.</div><div class="gmail_default" style="color:#333399">Good luck with your EEG timing adventure. You may hear from some of the timing folks on the list soon too. </div><div class="gmail_default" style="color:#333399">When you have a solution, please share with the list so others can benefit from your adventure.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 20, 2018 at 11:01 AM, ali zahedi <span dir="ltr"><<a href="mailto:ali.zahedi.bham@gmail.com" target="_blank">ali.zahedi.bham@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Dear Tarik,<div dir="auto"><br></div><div dir="auto">Thank you very much for the information you have provided, and sorry for my late reply.</div><div dir="auto">Can you please give me the detail on how I can use psychtoolbox and sync it up with my EEG amplifier?</div><div dir="auto">(I am really new in working with EEG hardware...).</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">I tried to find GUI in psychtoolbox but I only found a demo to produce an audio.</div><div dir="auto">Actually I do not have any idea to work with psychtoolbox and use it to sync the beeps with my EEG data.</div><div dir="auto">My beep generator (written in c#) works in real clock time and I get the beep times in real clock time. However, my EEG data does not work with real clock time and it has its own timer starting from 0 anytime I start recording.</div><div dir="auto"><br></div><div dir="auto">I really appreciate your support and I would be very grateful if you could guide me to use psychtoolbox with more details.</div><div dir="auto"><br></div><div dir="auto">Thank you very much.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Ali</div><div><div class="h5"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, 10 Apr 2018, 00:14 Tarik S Bel-Bahar, <<a href="mailto:tarikbelbahar@gmail.com" target="_blank">tarikbelbahar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:#333399">Hello Ali, some thoughts below, best wishes.</div><div class="gmail_default" style="color:#333399"><br></div><div class="gmail_default" style="color:#333399"><br></div><div class="gmail_default" style="color:#333399">A simple method is to use an experimental software such as psychtoolbox, and have it "synch up" with your eeg amplifier, and generate events with each beep.</div><div class="gmail_default" style="color:#333399"><span style="color:rgb(51,51,153);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Another more principled/accurate way to do this is to have a audio sensor that picks up the sound and records it's time. Of course the sensor also needs to be fully aligned with eeg time.</span><br></div><div class="gmail_default" style="color:#333399"><span style="color:rgb(51,51,153);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="color:#333399"><span style="color:rgb(51,51,153);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If you trust your beep event times, and they are aligned with the EEG, then you might be good as you are, just import your event list into eeglab (into the eeg file).</span></div><div class="gmail_default" style="color:#333399"><br></div><div class="gmail_default" style="color:#333399"><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;color:rgb(51,51,153)">One thing to be careful of here is that your eeg and time signal are properly aligned (find a way to make sure that 0 time is 0 time in both the eeg record and the beep events record).</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;color:rgb(51,51,153)">Also watch out for jitter (e.g., inaccurate event timing info, unevenly spaced beeps), and for "uncoupling or drift" of your eeg time and beep time over the whole period of the recording.</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;color:rgb(51,51,153)"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;color:rgb(51,51,153)"><br></div><br></div><div class="gmail_default" style="color:#333399"><br></div></div>
</blockquote></div></div></div></div>
</blockquote></div><br></div>