cortex-lab / Rigbox

A MATLAB toolbox for running behavioral neuroscience experiments and managing data
GNU General Public License v3.0
33 stars 16 forks source link

first stimulus flip in photodiode sometimes late relative to signals stimulus onset time #302

Open synapticlee opened 4 years ago

synapticlee commented 4 years ago

Hi, I am still working on adding details but wanted to flag this first (initially flagged on #rigbox-signals channel in the cortexlab slack).

In a fair amount of trials, it seems that the the first flip of the photodiode is >100ms late of the signals-intended onset of the stimulus. It's unclear whether it could be a photodiode issue, but if true would suggest that the actual stimulus onset is 100ms later than the intended onset. In an example session with a good photodiode trace, this still occurred in 10% of trials, with some trials experiencing even 200-400ms delay (see histogram below). The flip is apparently always late or on time, and never early.

This was also observed by @pipcoen and @petersaj who use different rigs and expdefs. It was suggested this might be because I also have a stimulus onset tone, and perhaps signals could "wait" for the tone before delivering the stimulus.

image

image

Will add more details about specific expdef and rigbox versions and timeline etc. soon and whether this is consistent across sessions with different expdefs I have.

This particular session is from expdef julieWorldQuiescent

synapticlee commented 4 years ago

I suggest this is a high priority issue because it means up to 100-200ms after stimulus onset, which is a typical area of integration for looking at stimulus-related activity, there might not be an actual stimulus on the screen.

synapticlee commented 4 years ago

the flip does respect the stim window update times (thanks lauren for the suggestion) though, so it's clear (?) the stimulus really was "late", but still unclear why blue - photodiode; black - stim window update times; orange- audio command (TL); red - stimulus onset time according to block structure image