Skip to content

spikeDetectSingle_fast_()

jamesjun edited this page Dec 18, 2017 · 9 revisions

For each channel, detect spikes by searching for turning points that exceed a given threshold value (thresh1). Bipolar detection is enabled If P.fDetectBipolar==1, otherwise only negative-going spikes are detected. Set P.fInverse_file=1 to only detect positive-going spikes.

If P.nneigh_min_detect>0, spikes must have multiple consecutive samples exceeding the threshold (red points in the figure). For example, P.nneigh_min_detect==1 requires two samples to exceed the threshold and P.nneigh_min_detect==2 requires three samples to exceed the threshold value. The figure below has three consecutive points below the threshold, thus it will be detected if nneigh_min_detect==2 or nneigh_min_detect==1.

Syntax

[viTime1, vnSpk1, thresh1] = spikeDetectSingle_fast_(vrWav1, P, thresh1)

Input

  • vrWav1: filtered trace (nSamples_load x 1: int16) from a given channel
  • P: Parameters struct (P)
  • thresh1: Spike detection threshold (int16). This value is copied from vnThresh_site for a given channel.

Output

  • viTime1: Spike times
  • vnSpk1: Spike amplitudes (always negative)
  • thresh1: Spike detection threshold calculated from P.qqFactor if thresh1==[] is supplied.

Operation

  • find_peak_(): Find turning points (peak) that exceeds the threshold. Negative peaks are detected if P.fDetectBipolar==0, otherwise both peaks are detected.

See also

detect_()

Clone this wiki locally