SpikeTimeHistogram

Spike time histogram of spike train data.

This class works with SpikeParams and SpikePlot to place a histogram of spikes under a raster plot (or by itself if the spike raster plot is not shown).

For detailed examples, see

EXAMPLES:

This example generates some random “spikes” and displays them.

import numpy
from neuronpy.graphics import spikeplot

spikes = []
num_cells = 10
num_spikes_per_cell = 20
frequency = 20

# Make the spike data. Use a simple Poisson-like spike generator 
# (just for illustrative purposes here. Better spike generators should 
# be used in simulations).
for i in range(num_cells):
    isi=numpy.random.poisson(frequency, num_spikes_per_cell)
    spikes.append(numpy.cumsum(isi))
    
# spikes is now a list of lists where each cell has a list of spike
# times. Now, let's plot these spikes with the default parameters.
sp = spikeplot.SpikePlot(sth_ratio=0.3, savefig=True)
sp.plot_spikes(spikes)

AUTHORS:

  • THOMAS MCTAVISH (2010-03-01): initial version, 0.1
  • THOMAS MCTAVISH (2010-12-17): Moved non-graphic functionality to spiketrain.
neuronpy.graphics.spiketimehistogram.hist_filter(iline, kernel=[1], origin=0)[source]

Convolve the 1d input with the kernel.

Parameters:
  • iline – is the 1d input signal, the discretized histogram vector.
  • kernel – is the filter to be applied. This should be a 1d vector that sums to 1.0. By default this is [1], which means that the output is a copy of the input.
  • origin – is the offset for the filter. If the filter was a linear decay, this may need to be set to either the head or tail of the filter (i.e. the kernel’s length - 1).

..note:

The time of the histogram bin that is filtered is the left edge and not
the center of the bin.

Previous topic

SpikeSum

Next topic

Math

This Page