elephant.spike_train_generation.threshold_detection

elephant.spike_train_generation.threshold_detection(signal, threshold=array(0.) * mV, sign='above')[source]

Returns the times when the analog signal crosses a threshold. Usually used for extracting spike times from a membrane potential.

Parameters:
signalneo.AnalogSignal

An analog input signal.

thresholdpq.Quantity, optional

Contains a value that must be reached for an event to be detected. Default: 0.0 * pq.mV

sign{‘above’, ‘below’}, optional

Determines whether to count threshold crossings that cross above or below the threshold. Default: ‘above’

Returns:
result_stneo.SpikeTrain

Contains the spike times of each of the events (spikes) extracted from the signal.