brainpy.measure.unitary_LFP(times, spikes, spike_type='exc', xmax=0.2, ymax=0.2, va=200.0, lambda_=0.2, sig_i=2.1, sig_e=3.1500000000000004, location='soma layer', seed=None)[source]#

A kernel-based method to calculate unitary local field potentials (uLFP) from a network of spiking neurons 1.


This method calculates LFP only from the neuronal spikes. It does not consider the subthreshold synaptic events, or the dendritic voltage-dependent ion channels.


If you have spike data of excitatory and inhibtiory neurons, you can get the LFP by the following methods:

>>> import brainpy as bp
>>> n_time = 1000
>>> n_exc = 100
>>> n_inh = 25
>>> times = bm.arange(n_time) * 0.1
>>> exc_sps = bp.math.random.random((n_time, n_exc)) < 0.3
>>> inh_sps = bp.math.random.random((n_time, n_inh)) < 0.4
>>> lfp = bp.measure.unitary_LFP(times, exc_sps, 'exc')
>>> lfp += bp.measure.unitary_LFP(times, inh_sps, 'inh')
  • times (ndarray) – The times of the recording points.

  • spikes (ndarray) – The spikes of excitatory neurons recorded by brainpy monitors.

  • spike_type (str) – The neuron type of the spike trains. It can be “exc” or “inh”.

  • location (str) – The location of the spikes recorded. It can be “soma layer”, “deep layer”, “superficial layer” and “surface”.

  • xmax (float) – Size of the array (in mm).

  • ymax (float) – Size of the array (in mm).

  • va (int, float) – The axon velocity (mm/sec).

  • lambda (float) – The space constant (mm).

  • sig_i (float) – The std-dev of inhibition (in ms)

  • sig_e (float) – The std-dev for excitation (in ms).

  • seed (int) – The random seed.



Telenczuk, Bartosz, Maria Telenczuk, and Alain Destexhe. “A kernel-based method to calculate local field potentials from networks of spiking neurons.” Journal of Neuroscience Methods 344 (2020): 108871.