syncing events problem

173 views
Skip to first unread message

Anan moran

unread,
Jun 27, 2021, 9:46:42 AM6/27/21
to Open Ephys
Hi,
I am using NP to record cortical neurons with some stimulation for long hours using Open Ephys Gui (version  0.5.3.1). I am using the SMA of the NP as the source for syncing the NIDAQ board. All the 3 sync "lights" (AP, LFP and daq) turn green on the record node when I start acquisition. To align the times of the events with the spike times after Kilosort spike sorting I remove the zero time of the daq from the event times. The events are nicely aligned at the early time of the recording, but continuously lose the synchronization (see attached figure of PSTHs, each of which is 1 hour apart). How should I fix this? 

Thanks 
Anan   
drifting events.PNG

Pavel Kulik

unread,
Jun 28, 2021, 7:01:32 PM6/28/21
to Open Ephys

Hi Anan,


Neuropixels sample at roughly 30 kHz, but the actual sample rate can be slightly higher or lower and the clocks will drift by ~10s of ms per hour. You will either need to use the time values (in seconds) in the synchronized_timestamps.npy file generated for each stream (AP, LFP, NIDAQ) or you will need to compute a scaling factor for each probe manually to use the integer timestamps (in sample numbers).


The temporal offset between the start of the first sync pulses defines the shift between any device and the master clock. Once this is known, you can calculate the expected interval between the first and last sync pulse (given the expected sample rate of a device). The ratio of the actual interval to the expected interval defines the scaling factor for that device. Then, each non-master clock can be transformed by: aligned_timestamps = scaling .* original_timestamps + shift

Reply all
Reply to author
Forward
0 new messages