elephant.spike_train_generation.spike_extraction(signal, threshold=array(0.) * mV, sign='above', time_stamps=None, interval=(array(- 2.) * ms, array(4.) * ms))[source]

Return the peak times for all events that cross threshold and the waveforms. Usually used for extracting spikes from a membrane potential to calculate waveform properties.


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’

time_stampspq.Quantity, optional

If spike_train is a pq.Quantity array, time_stamps provides the time stamps around which the waveform is extracted. If it is None, the function peak_detection is used to calculate the time_stamps from signal. Default: None

intervaltuple of pq.Quantity

Specifies the time interval around the time_stamps where the waveform is extracted. Default: (-2 * pq.ms, 4 * pq.ms)


Contains the time_stamps of each of the spikes and the waveforms in result_st.waveforms.