Event Synchronization

Source Code - Event Synchronization

Note that we recommend to use the new method SPIKE-synchronization instead of event synchronization. SPIKE-synchronization is based on the same adaptive coincidence detection used in event synchronization but it has a much nicer normalization with a more intuitive interpretation. This improved normalization also allows for a straightforward and consistent extension to the case of more than two spike trains.

SPIKE-synchronization is part of all three of our main software packages: SPIKY, PySpike and cSPIKE.

SPIKE-synchronization was proposed in this paper:

Kreuz T, Mulansky M, Bozanic N:

SPIKY: A graphical user interface for monitoring spike train synchrony

JNeurophysiol 113, 3432 (2015) [PDF]

For a detailed description of its mathematical properties please refer to:

Mulansky M, Bozanic N, Sburlea A, Kreuz T:

A guide to time-resolved and parameter-free measures of spike train synchrony

IEEE Proceeding Event-based Control, Communication, and Signal Processing (EBCCSP), 1-8 and arXiv [PDF] (2015) [PDF]

If you still would like to continue, a detailed description of event synchronization can be found here:

Quian Quiroga R, Kreuz T, and Grassberger P:

Event Synchronization: A simple and fast method to measure synchronicity and time delay patterns

Phys.Rev. E, 66, 041904 (2002) [PDF]

Matlab code to calculate the event synchronization and the delay asymmetry between two given spike trains:

[Event-Synchronization] Copyright: Thomas Kreuz

Function Event_sync.m:


Two spike trains (times of spikes)


Value of event synchronization and event delay

Example call:

x=[1:100]; % first spike train (completely periodic)

y=x+(rand(1,length(x))-0.5); % second spike train (first spike train with some random jitter)

[es,ed]=Event_sync(x,y); % es and ed give you the event synchronization and the event delay between spike train x and spike train y

Example output (timemode=1):

Example output (timemode=2):

Example output (timemode=3):

This is the version with the most simplest call (just two variables). Other parameters are set at the beginning of the program:

plotmode (0-no,1-yes) - whether or not you want to have a figure

numfig - number of that figure

printmode(0-no,1-yes) - whether or not you want to save the figure as a postscript-file

filename - name of that file

xy_name - Names of the two spike trains

xy_col - colors to display the two spike trains

precision - negative logarithm of sampling interval (i.e., 3 for dt = 0.001)

taumode - maximum allowed time lag (to consider to events still to be synchronous): 1-fixed, 2-adaptive

timemode - kind of presentation: 1-cumulative, 2-windowed, 3: cumulative normalized (see Examples above)

tau - maximum allowed time lag (for taumode=1)

window - window size (for timemode=2)

Please feel free to adapt the program according to your needs (e.g., by using more variables in the call,...).