Delay between parallel port trigger and sound.
We are switching our EEG lab's installation to Python.
We are mainly interested in recording EEG activity during presentation of sounds. However, we have a still unsolved problem concerning the delays between the triggers sent to the recorder and the actual starting time of the sounds : we don't manage to have millisecond accuracy.
The distribution of delays looks like that :
The jitter is definitely not < 1 ms, it is more around 3 ms. Furthermore, this is a weird looking bimodal distribution ... And it gets even weirder when you look at the delays individually, trial by trial :
We have no explanation for this pattern. Do you have any ideas on why we see this trend across trials ? It kinda looks like an aliasing pattern for me, like if somehow two clocks were running at slightly different speeds and slowly desynchronzying ...
Here are the details :
1. We record the delays between the triggers and the sound using a small electrical montage that take (a) the actual sound output as the left channel and (b) the parallel port output pin as the right channel. The two signals are the two channels of a jack cable that is plugged to another computer that records.
2. We are using Expyriment and the xpy.stimuli.Audio.present() method. We have also tried pyAudio with the stream.write(data) method.
3. We have disable synchronization with the screen (xpy.control.defaults.open_gl=False).
4. We have tried to launch the trigger before and after the xpy.stimuli.Audio.present() method. It doesn't affect the results.
Thanks a lot for your help !