# brainpy.measure.cross_correlation#

brainpy.measure.cross_correlation(spikes, bin, dt=None)[source]#

Calculate cross correlation index between neurons.

The coherence 1 between two neurons i and j is measured by their cross-correlation of spike trains at zero time lag within a time bin of $$\Delta t = \tau$$. More specifically, suppose that a long time interval T is divided into small bins of $$\Delta t$$ and that two spike trains are given by $$X(l)=$$ 0 or 1, $$Y(l)=$$ 0 or 1, $$l=1,2, \ldots, K(T / K=\tau)$$. Thus, we define a coherence measure for the pair as:

$\kappa_{i j}(\tau)=\frac{\sum_{l=1}^{K} X(l) Y(l)} {\sqrt{\sum_{l=1}^{K} X(l) \sum_{l=1}^{K} Y(l)}}$

The population coherence measure $$\kappa(\tau)$$ is defined by the average of $$\kappa_{i j}(\tau)$$ over many pairs of neurons in the network.

Parameters
• spikes – The history of spike states of the neuron group.

• bin (float, int) – The time bin to normalize spike states.

• dt (float, optional) – The time precision.

Returns

cc_index – The cross correlation value which represents the synchronization index.

Return type

float

References

1

Wang, Xiao-Jing, and György Buzsáki. “Gamma oscillation by synaptic inhibition in a hippocampal interneuronal network model.” Journal of neuroscience 16.20 (1996): 6402-6413.