- Spike shapes colored according to their assignment to different neurons (SUA). Data from macaque visual cortex [4]
- Principal Component Analysis of spike waveforms from three different neurons (SUA). Data from macaque visual cortex [4]
Spike sorting is a class of techniques used in the analysis of electrophysiological data. Spike sorting algorithms use the shape(s) of waveforms collected with one or more electrodes in the brain to distinguish the activity of one or more neurons from background electrical noise.
The raw data for spike sorting comes from electrodes inserted into the brain, where they measure the extracellular potential. These electrodes come in many forms of varying size and sophistication, from the simple tetrode array of four electrodes, to multielectrode arrays with hundreds of signals, to integrated multi-thousand count devices such as Neuropixels or Neuralink.
Neurons produce action potentials that are referred to as 'spikes' in laboratory jargon. Frequently this term is used for electrical signals recorded in the vicinity of individual neurons with a microelectrode (exception: 'spikes' in EEG recordings). In these recordings action potentials appear as sharp spikes (deviations from the baseline). Extracellular electrodes measure the field at the point of contact. This includes a slowly varying component, the local field potential or LFP, which is the sum of the activity of many neurons at varying distances. [1] Superimposed on this are short, sharp spikes, from the action potentials of the few nearest neurons. Since the LPF is slow and the spikes are fast, they are easily separated by filtering: highpass for spikes and low pass for the LFP.
Spike sorting refers to the process of assigning spikes to different neurons. The exact time course of a spike event as recorded by the electrode depends on the size and shape of the neuron, the position of the recording electrode relative to the neuron, and other factors. These electrodes, positioned outside of the cells in the tissue, however, often 'see' the spikes generated by several neurons in their vicinity. Since the spike shapes are unique and relatively reproducible for each neuron they can be used to distinguish spikes produced by different neurons, and separate the activity produced by each.
Technically this can be achieved based on different sizes of the spikes (a simple but inaccurate technique) or more sophisticated analyses which make use of the entire waveform of the spikes. These more complex techniques often use tools such as principal components or wavelet analysis. The scientific literature covers both the basics of the problem [2] and detailed papers outlining the state of the art as of 2025. [3]
If multiple electrodes are used, each will record different waveforms for each individual spike elicited by the neurons in the vicinity of the electrodes. The geometric configuration of the electrodes can then be used to analyze which spikes originated from which individual cell in the recorded population of cells. Thus spike sorting using multiple electrodes is better than sorting based simply on waveform shape.