Bayes optimal template matching for spike sorting – combining fisher discriminant analysis with optimal filtering
 3.2k Downloads
 35 Citations
Abstract
Spike sorting, i.e., the separation of the firing activity of different neurons from extracellular measurements, is a crucial but often errorprone step in the analysis of neuronal responses. Usually, three different problems have to be solved: the detection of spikes in the extracellular recordings, the estimation of the number of neurons and their prototypical (template) spike waveforms, and the assignment of individual spikes to those putative neurons. If the template spike waveforms are known, template matching can be used to solve the detection and classification problem. Here, we show that for the colored Gaussian noise case the optimal template matching is given by a form of linear filtering, which can be derived via linear discriminant analysis. This provides a Bayesian interpretation for the wellknown matched filter output. Moreover, with this approach it is possible to compute a spike detection threshold analytically. The method can be implemented by a linear filter bank derived from the templates, and can be used for online spike sorting of multielectrode recordings. It may also be applicable to detection and classification problems of transient signals in general. Its application significantly decreases the error rate on two publicly available spikesorting benchmark data sets in comparison to stateoftheart template matching procedures. Finally, we explore the possibility to resolve overlapping spikes using the template matching outputs and show that they can be resolved with high accuracy.
Keywords
Spike sorting Extracellular recording Signal processing Overlap Linear filtering Linear discriminant analysis Matched filtering1 Introduction
The detection and classification of voltage deflections in extracellular recordings caused by action potentials of neurons  called spikes  is known as spike sorting. It is necessary if single neuronal activities must be resolved from multineuronal firing activity. The assignment of spikes to neurons is only possible because the spike shapes of neurons differ due to their morphology, their spatial position with respect to the recording electrode(s), the intrinsic membrane properties of the neuron and the surrounding medium (CamuñasMesa and Quiroga 2013; Gold et al. 2006). Furthermore, at least to a first approximation, spikes from the same neuron have similar waveforms. It is, therefore, possible to group extracellular potentials based on their waveform assuming that spikes within one group were actually emitted by the same neuron.
In principle, extracellular recordings can be seen as having two different linearly added components, background activity (noise and small action potentials from far away neurons) and spikes of closeby cells (Buzsáki 2004; CamuñasMesa and Quiroga 2013). Therefore, for any given piece of data, spike sorting typically solves three problems (Einevoll et al. 2012; Lewicki 1998): First, spikes are detected in the noisy recording. Second, spikes are extracted from the data, aligned and their dimensionality is reduced using feature extraction. Third, spikes, which are now represented by a small number of features, are grouped into clusters of similar spike shapes that putatively originate from the same neuron. However, there is another option: Spikes can be assigned to neurons by using knowledge from a preceeding clustering step, which we refer to as spike classification. At first the classification problem seems to be redundant because spikes are assigned to putative neurons already during the clustering step. But there are several reasons why it is important to treat the classification problem separately from the clustering step. Among these, classification is usually much faster than clustering, an important advantage for online applications, where it might be desirable to use a fast classifier that was derived from an initial offline clustering for realtime spike sorting. Additionally, many clustering procedures scale poorly with the number of spikes and their application becomes infeasible for very long recordings. Then, only a subset of spikes can be clustered and the rest simply classified.
One way to build such a classifier is to calculate the average of all elements for each cluster. This cluster center is called the template. Each unclassified spike is then compared to each template and is subsequently assigned to the template that was most similar to it according to some appropriate similarity measure. This procedure is often referred to as template matching.
In the toy example in Fig. 1 three template matching procedures are illustrated and it can be seen that they respond differently to noise, artifacts (in this case a narrow band oscillation or “ripple”) and overlapping spikes. Convolution (Fig. 1b) has the advantage that noise on electrodes which are too far away to measure the activity of a neuron, and, thus, do not carry information about the presence of the neuron’s template, are suppressed (topmost electrode). Additionally, overlapping spikes produce detectable peaks in the output. However, an artifact or “ripple” may also lead to strong responses. If the noise and ripple characteristics are known, matched filters can be used instead, which have the potential to suppress unwanted signal components. The implementation in this case can be done by using the ripple on the seemingly useless electrode 2  on which the templates have nearly no energy  to cancel the ripple on electrodes 3 and 4 (marked with “in phase” and “out of phase” respectively). All three methods have the problem that setting the detection threshold is not straightforward.
Here, we show that template matching can be seen as a filtering operation and propose a finite impulse response (FIR) filter based online template matching procedure that is  under the additional assumption of Gaussian noise  optimal in a Bayesian sense. We derive its optimality (to discriminate spikes from different neurons and to detect the spikes in noisy recordings) from Fisher’s linear discriminant analysis (LDA) and show that this way the outputs of matched filters can be interpreted in a Bayesian sense. The proposed Bayes optimal template matching (BOTM) computes the linear discriminant functions by a convolution of FIR filters with extracellular data and solves both the detection and the classification problem. In contrast to the other methods, BOTM provides an optimal detection threshold analytically and does not require manual intervention. Using BOTM to simultaneously detect and classify spikes removes the need for spike alignment since the peak of the detector output is a robust estimate of the true position of the spike.
We evaluate our method on two previously published benchmark data sets and show that we can significantly improve template matching performance in both cases. Additionally, using BOTM as a postprocessing step after clustering can reduce the number of errors which occurred during the initial spike sorting step.
This framework is then extended to overlapping spikes. Detecting and resolving overlapping spikes is an important problem for spike sorting: waveforms of near coincident action potentials will interfere with each other, severely altering the individual waveforms and effecting their detection and classification. Approaches to solve this problem were suggested (Atiya 1992; Ekanadham et al. 2014; Franke et al. 2010; Lewicki 1994; Marre et al. 2012; Pillow et al. 2013; Prentice et al. 2011; Segev et al. 2004; VargasIrwin and Donoghue 2007; Wang et al. 2006; Zhang et al. 2004) but are in general computationally expensive. Here, we show that resolving overlapping spikes in the linear discriminant function space could provide a computationally efficient alternative.
Due to its computational simplicity BOTM is especially useful for online and realtime implementation in the context of closedloop experiments after the initial templates have been found (Einevoll et al. 2012; Franke 2011; Franke et al. 2010; Obeid et al. 2004; Rutishauser et al. 2006).
2 Method
2.1 Definitions
Spike sorting relies on the assumption that the action potentials of a single neuron lead to extracellular spikes with similar waveforms (Lewicki 1998). This is generally not true, since spikes of the very same neuron are known to vary, e.g., dependent on the recent firing history of the neuron (Fee et al. 1996) and slowly over time (Franke et al. 2010). Here we will assume nonvarying waveforms but, in principle, the filters could be adapted over time. We define the template of neuron i as ξ _{ i } = [ξ _{ i,1} ^{ T } , ξ _{ i,2} ^{ T }, …, ξ _{ i,N } ^{ T }]^{ T } where ξ _{ i,c } is the waveform for neuron i on electrode c and (·)^{ T } is the vector transpose. The single electrode waveforms are L samples long. Thus ξ _{ i } is a column vector with LN dimensions, where N is the number of recording electrodes, i.e., the single electrode waveforms are concatenated. We use an analogous definition for any piece of multielectrode data starting at time t: X(t) = [x(t)_{1} ^{ T }, x(t)_{2} ^{ T }, …, x(t)_{ N } ^{ T }]^{ T }, where x(t)_{ k } = [x(t)_{ k }, x(t + 1)_{ k }, …, x(t + L − 1)_{ k }]^{ T } represents L samples of recorded data on electrode k starting at time t. The output of a multielectrode FIR filter f = [f _{1} ^{ T }, f _{2} ^{ T }, …, f _{ N } ^{ T }]^{ T } applied to the recordings (which is usually denoted as \( y={\displaystyle \sum_k^N}\left({x}_k\star {f}_k\right) \) where ⋆ is the crosscorrelation between data of electrode k and the filter for electrode k) can now be expressed in terms of a vector multiplication: y(t) = X(t)^{ T } f. Note that ξ _{ i }, f and X(t) are all column vectors in the same LN dimensional vector space.
The noise covariance matrix (Pouzat et al. 2002) is given by: C = E[η(t)η(t)^{ T }] with η(t) being a piece of data where no spikes were detected. It characterizes noise from various sources, including small amplitude spikes from far away neurons. Thus C is of dimensions LN × LN and captures the complete spatiotemporal covariance (between electrodes and over time) that is induced by both, noise and undetected small amplitude spikes (Pouzat et al. 2002). Since we assume that the data was high pass filtered E[η(t)] = 0 holds.
2.2 Classical template matching
2.3 Template matching using the noise covariance matrix
where f _{ i } = C ^{− 1} ξ _{ i } is the matched filter (see the appendix for a more detailed explanation) for template ξ _{ i }. Figure 1 illustrates different template matching techniques applied to a toy example. We will refer to D _{ i } ^{ Euc } or D _{ i } ^{ Maha } as subtractive template matching since templates are subtracted from the data and the energy of the residual is used for spike detection and classification. Accordingly, D _{ i } ^{ XC } and D _{ i } ^{ Match } are referred to as convolutive template matching.
2.4 Bayes optimal template matching (BOTM)
BOTM computes matched filter outputs for each template (see Fig. 4 for an example with 10 templates). For each template a constant, which depends on the energy (ξ _{ i } ^{ T } C ^{− 1} ξ _{ i }) of the respective template and on the probability p(i) that the template occurs in the data, is added to the filter outputs to compute the final discriminant functions. Spikes are detected and classified by thresholding those discriminant functions (the BOTM output). For each detected peak, the template that has the maximal BOTM output in a small temporal window around the peak is assigned to the spike. The individual processing steps of the method are summarized in Fig. 2. Figure 3 shows a visual comparison of the results of BOTM and other template matching procedures applied to a spike sorting benchmark (Quiroga et al. 2004).
In summary, the method works as follows (Fig. 2): 1. Precomputed matched filters are convolved with the incoming data. 2. Discriminant functions are computed from the matched filter outputs by adding the respective constants. 3. The detection threshold is applied to all discriminant functions. 4. For each threshold crossing, the local maximum of all discriminant functions after the threshold crossing is detected (and before all discriminant functions fall again below the threshold). 5. The temporal position of the peak and the identity of the discriminant function define the identity and time point of the detected spike.
2.5 Resolution of overlapping spikes
If two neurons fire an action potential very close in time, their spike waveforms will overlap in the recording (Fig. 2, right). Overlapping spikes are difficult to detect and classify, since the overlap waveform might be very different from the individual spike waveforms. However, as long as the individual waveforms do not cancel each other in a way that the overlap waveform has virtually zero energy, the individual matched filters do still respond to the overlap. Thus, BOTM will assign the single template with the highest peak to an overlap (which could also be a template not participating in the overlap if the overlap waveform is coincidentally similar to that template) missing at least one of the spikes (Fig. 2, right, ‘BOTM’). To also detect and resolve overlapping spikes one could, in principle, construct all possible overlaps between all available templates with different temporal shifts and add those to the template set. This would, however, dramatically increase the number of templates and introduce two problems: First, with increasing number of templates, each waveform, including noise, can be described by a certain combination of templates. Second, this approach, in a naïve implementation, would be computationally prohibitive. Both problems will be addressed in the following.
where d _{ j } ^{ τ } (t) and ξ _{ j } ^{ τ } are the temporally shifted discriminant function and template of neuron j, respectively (see Fig. 2, right, ‘Option 1’ and eq. (10) in the appendix for the derivation). Depending on the number of spikes per overlap and their maximal temporal shift considered, this approach can still be computationally expensive.
Therefore, here, we employ a greedy approach. We assume that at least one of the singlespike BOTM outputs will cross the threshold for each overlap and that its peak is giving approximately the correct position of the template in the data. Then, we can subtract the expected influence of this spike from the other discriminant functions, a process which is also referred to as subtractive interference cancellation (SIC, see Fig. 2, right, ‘Option 2’ and eq. (12) in the appendix for the derivation). Fortunately, under the assumption that at least one singlespike discriminant function crosses the threshold for each overlapping spike, we only need to compute the overlap discriminant functions in temporal periods around threshold crossings of singlespike discriminant functions.
2.6 Noise Covariance Matrix
The noise covariance matrix C plays a crucial role for the Mahalanobis distance, the matched filter and BOTM as well as for some spike sorting procedures (Franke et al. 2010; Marre et al. 2012; Pillow et al. 2013; Pouzat et al. 2002; Shoham et al. 2003). In all cases its inverse is needed. However, the noise covariance matrix can be badly conditioned, i.e., it might have eigenvalues that are close to zero, which makes its inversion unstable. A standard procedure to invert ill conditioned covariance matrices is diagonal loading or shrinkage (Hiemstra 2002; Van Trees 2002): A target covariance matrix C _{ T }, often the identity, is added or merged to the original covariance matrix. We decided to chose the diagonal of C, C _{ D } = diag(C) as the target and blended it with the original matrix according to C _{ L } = α C + (1 − α)C _{ T }. We noticed that the choice of α influenced performance mainly through the temporal length of the resulting filter responses to spikes. With decreasing α the filters become more similar to a narrow bandpass filter which could lead to oscillating filter responses. Oscillations in the filter outputs were not a problem for benchmark 3 BOTM + SIC (see below, SIC iteratively subtracts the filter responses to spikes from the filter outputs, therefore removing all oscillations). We did not try to optimize diagonal loading but simply chose α = 0.5. For benchmark 3, BOTM + SIC we chose an α so that the maximal eigenvalue of C _{ L } divided by its minimal eigenvalue (i.e., the condition number of C _{ L }) was not larger than 10,000 to ensure that C _{ L } was invertible.
The noise covariance matrix can be either computed on pieces of noise, that is, periods of data where no spikes were detected (e.g., as in (Marre et al. 2012; Pouzat et al. 2002; Rutishauser et al. 2006)), or on residuals of the spikes after subtracting the templates (e.g., (Pillow et al. 2013; Shoham et al. 2003)). Since the residuals may contain additional variability, e.g., from misalignment of the templates (the correct template was subtracted at a wrong position), clustering errors (the wrong template was subtracted), or variability in the neuronal signal (the correct template does not fit perfectly with the occurring waveform), we chose to compute C on stretches of noise. This has the sideeffect that we do not run the risk of overfitting C to the spike waveforms.
where the blocks C _{ i,k } are the covariance matrices between electrode i and k with C _{ i,i } = C _{ i,i } ^{ T } and C _{ i,k } = C _{ k,i } ^{ T }. Each block is a Toeplitz matrix of the crosscorrelation function of electrode i and k. Therefore, we did not estimate C by directly computing the covariance matrix from T ⋅ N dimensional snippets of noise, where it would not be guaranteed that (C _{ i,k })_{ m,n } = (C _{ k,i })_{ n,m } and (C _{ i,k })_{ m,n } = (C _{ i,k })_{ m + 1,n + 1}, but by constructing C from the respective auto and crosscorrelation functions. This procedure reduces the number of free parameters that need to be estimated to T ⋅ N, which again reduces the risk of overfitting.
2.7 Evaluation metrics
We evaluated the spike detection and classification performance of the template matching procedures on two different data sets described below. Both were preprocessed in a similar way: The available ground truth information was used to cut true spikes from the recording and to construct the templates. This avoided the problem of aligning the spikes to compute the templates. The template matchers were evaluated for detection and classification performance separately.
where FP is the number of false positive noise detections and FN is the number of false negative misses. Then, the overlap of the template matching response distributions to noise and spikes was computed and, except for BOTM, the optimal threshold (which minimized the detection error) was estimated numerically. The alternative would have been to compare receiver operator characteristic curves, but BOTM directly provides a threshold. Therefore, we decided to compare its performance to the optimal performance of the other methods.^{1} To detect spikes in the BOTM output a prior probability to observe a spike needs to be chosen. Optimally, this probability is different for each neuron and depends on its firing rate. However, for the benchmarks used in this study, the performance was insensitive to the exact choice of the priors (see Fig. 5). Therefore, instead of choosing a prior for each neuron independently, we assumed them to be equal and set the prior for noise to 0.99 (i.e., we assumed it 100 times more likely to observe noise than a spike).

Benchmark 1 (Q): Evaluation on simulated data with full ground truth
 The proposed template matching was evaluated on the publicly available spike sorting benchmark data set described in (Quiroga et al. 2004) which we will refer to as benchmark 1 (Q). This data set was already used by other researchers for spike sorting evaluation (see, e.g., (Bestel et al. 2012; Ghanbari et al. 2009; Herbst et al. 2008)). The data set consists of 4 sub benchmarks labeled “Easy1” to “Diffcult2”. Every sub benchmark consists of 4 different data files (with the exception of “Easy1” which has 8) with decreasing signaltonoise ratios. All files contain 60s of a simulated single electrode extracellular recording with 24 kHz sampling rate and 3 simulated neurons. Templates and the noise covariance matrix were calculated using the available ground truth information. Short periods of simulated data of length L = 61 samples starting 15 samples before the given spike time points were cut and averaged to create the templates. In this benchmark, the groundtruth spike times do not indicate the position of the peak of the spike waveforms in the data but rather their onset. Therefore, we corrected the original spike times by shifting the complete spike train of each neuron by a constant number of samples. This shift yielded a ground truth that reflected the peak positions of the spikes in the data (a feature also a spike sorter without any knowledge of the ground truth could estimate), not their onset. The template matching outputs for the different template matching procedures were computed on the noisy spike waveforms present in the data that were aligned with the corrected ground truth information. Each spike was assigned to the template with the maximal response. Spikes that were correctly assigned were counted as TP while spikes assigned to the wrong template were counted as classification errors CN. The quantity CN relies on knowing the full ground truth, that is, the exact spike times for all neurons. We used the following quantities for the performance comparison:$$ \mathrm{Classification}\ \mathrm{Performance}=100\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{C}\mathrm{N}} $$
 We chose to weight detection and classification equally, combining them in a final performance score of:$$ \mathrm{Total}\ \mathrm{Performance}=\frac{\left(\mathrm{Sensitivity}+\mathrm{Classification}\right)}{2}. $$

Benchmark 2 (H): Evaluation on real recording with partial ground truth

This data set is the part of the hc1 data set described in (Henze et al. 2000) and publicly available under http://crcns.org/ and was already used for evaluation of spike sorting algorithms (see, e.g., (Ekanadham et al. 2014; Harris et al. 2000; SchmitzerTorbert et al. 2005)). The following files were used: d11221.002, d11222.001, d12821.001 and d14521.001. We chose the files depending on the quality of the intracellular recording, i.e., the ones where the intracellular recording showed clearly visible and easily detectable spikes during the whole recording. Each data file consists of several minutes of simultaneous intra and extracellular recordings in rat hippocampus with a sampling rate of 20 kHz. Ground truth information was available for only one single neuron, extracted from the respective intracellular recording. The extracellular recordings were high pass filtered at 300Hz.

Spike sorting using meanshift clustering (Marre et al. 2012) was performed in the space of the first 6 principal components after prewhitening to estimate the templates. The sorting was not optimized manually. The template of the cluster whose spikes best matched the ground truth was used to estimate the performance of the template matching procedures and will be referred to as the “target template”. For all data files the target template was very similar to the template that can be obtained by using only the spikes given by the ground truth, i.e., in all cases spikes from one of the clusters matched the ground truth well enough to get good template estimation.
 For the classification task, the template matching output was computed for all templates and all spikes of the ground truth neuron, as well as for all other spikes detected during the spike sorting. Spikes of the ground truth that were correctly matched to the target template were counted as true positives (TP). Since we do not have the full ground truth for this data set, the quantity CN from the previous benchmark cannot be computed for all neurons. We therefore counted spikes of the target neuron that were falsely assigned to a putative other neuron as CNt. Spikes which were found by the automatic spike sorting procedure which belong to putative other neurons and which were correctly not assigned to the target neuron were counted as true negatives (TN). Spikes not included in the ground truth that were assigned to the target template were counted as false positives (FP). How many of the spikes that actually belong to the target neuron were also classified correctly? This is the classification performance.$$ \mathrm{Classification}\ \mathrm{Performance}=100\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{C}\mathrm{N}\mathrm{t}} $$
 And of all putative spikes detected in the recording that do not belong to the target neuron, how many were correctly classified as noise or spikes from other neurons? This is the specificity (the performance in rejecting spikes that do not belong to the target neuron).$$ \mathrm{Specificity}=100\frac{\mathrm{TN}}{\mathrm{FP}+\mathrm{T}\mathrm{N}} $$
 Many different ways of combining the different performance measures into a final score are possible; however, here, we decided to combine them with equal weight into a final score, the total performance.$$ \mathrm{Total}\ \mathrm{Performance}=\frac{\left(\mathrm{Sensitivity}+\mathrm{Classification}+\mathrm{Specificity}\right)}{3} $$

Benchmark 3 (Q): Online template matching of full recording

To compare the performance of BOTM to the spike sorting performance reported in (Quiroga et al. 2004), we did not use the ground truth to cut perfectly aligned spikes (but the ground truth was used to compute the correct templates). Instead, BOTM was run on the whole data and spikes were detected in the template matching output.

We used the same data as in benchmark 1 (Q) to evaluate the performance of BOTM as a refinement tool for spike sorting procedures. For this, the performance of BOTM using the correct templates was compared to the performance of a clustering based spike sorting. We chose the spike sorter “wave_clus” described in (Quiroga et al. 2004). “wave_clus” detects spikes using a voltage threshold. The threshold is computed via the median absolute deviation (MAD) of the data which is, in the presence of spikes, a more robust way to estimate the standard deviation of the noise. Then, wavelet coefficients are computed for each spike. A subset of the wavelet coefficients is chosen which, putatively, carries most information about the identity of the spikes. Those coefficients are then clustered by using superparamagnetic clustering, a clustering method developed in the context of statistical mechanics and based on simulated interactions between each data point and its Knearest neighbors.

For BOTM, the correct templates and the noise covariance matrix were computed from the data using the available ground truth information. To be more specific, groundtruth spike trains were used to cut short pieces out of the data around the true locations of the spikes. These pieces were averaged to calculate the templates. Therefore, the (‘correct’) templates contain a realistic amount of noise due to the averaging process. Pieces of data in which no spikes were present were used to compute the noise autocovariance function from which the noise covariance matrix was estimated. As a consequence, also the noise covariance matrix was noisy due to the estimation process on a limited amount of noisy data. The optimal filters were computed and convolved with the whole extracellular recordings. The discriminant functions were then thresholded with the optimal threshold (see eq. (9) in the appendix). For each period during which at least one discriminant function was above the threshold, the peak of the maximal discriminant function was detected. The identity of the discriminant function was used as the neurons’ identity and the position of the peak as the time of the spike. This way, detection, alignment and classification were implemented in a single operation. To avoid a second detection of the same peak due to multiple peaks of the filter response, peaks within 8 samples (.33 ms) were compared and only the maximum was kept. Thus, overlapping spikes within this time window could not be resolved. The BOTM + SIC method was evaluated in the same way but, additionally, once a spike was found in the data and assigned to a neuron, the expected filter response to the neuron’s template was subtracted from the discriminant functions (eq. (10) in the appendix) and the detection step was repeated.
3 Results
3.1 Performance for individual spikes
The results suggest that subtractive template matching, in the way we used it here, is basically useless to detect spikes. The bad performance can be remedied to a certain degree by limiting the procedure to only templates with large amplitude and by reducing the dimensionality of the templates through either restricting the number of channels, e.g., to one, or shortening the templates. Reducing the dimensionality helps because the main reason for the low sensitivity is the influence of the high dimensional noise on the waveform which is overproportionally diminished by removing dimensions. However, there is an optimal way to reduce the influence of high dimensional noise and increase the signaltonoise ratio: the matched filter.
BOTM increases the average performance from below 60% to over 95% with respect to Euclidean distance template matching. If only the classification performance is considered, using Mahalanobis distance or BOTM increased the average performance with respect to Euclidean distance from 91.8% to 97.2% on benchmark 1 and from 91.8% to 93.9% on benchmark 2. We want to point out that these error numbers are not meant to reflect actual template matching performance and likely overestimate performance. In this benchmark only correctly aligned single spikes were used. A situation hardly realistic for real recordings, since noise and the presence of other spikes make a correct alignment difficult. Furthermore, except for BOTM, detection thresholds were set to optimize performance.
The difference between BOTM and D _{ i } ^{ Match } (t) is a templatedependent additive constant, which depends on the energy of the respective template and its prior probability. Adding this constant to the output of the matched filters allows for distinguishing between neurons by using a simple maximum operation (see Fig. 5c). While the decision boundary of a maximum operation on the matched filter output will cut through the clusters (Fig. 5c, dashed line), BOTM moves the coordinate system so that the identity becomes the optimal decision boundary, similar to what LDA would provide. This explains the increased specificity of BOTM as compared to D _{ i } ^{ Match } (t). However, to also provide high specificity, the matched filters need to distinguish signal from noise. Since all templates usually share similar characteristics, such as frequency content, the outputs between the different matched filters are correlated (elongation of clouds in Fig. 5c), which would not be necessarily expected from clusters in the subspace given by pure LDA.
We conclude that while convolutionbased template matching provides high sensitivity, distancebased template matching on well aligned spikes provides good classification performance. BOTM combines both advantages in a single operation, thus avoiding the problem of spike alignment. Furthermore, the performance of its analytical threshold is comparable to the optimal threshold of the other methods.
3.2 Effects of errors in the template set on BOTM performance
Another possible problem in the generation of the template set can be noise on the waveforms of the templates. Templates are averages of noisy single spike waveforms, and if not enough single spikes are available to build the template, the resulting waveform may be noisy. We therefore decreased the number of spikes used to compute each template. As Fig. 7b shows, the number of spikes used to compute a template has only a minor effect on classification performance and specificity as long as at least 30 spikes are averaged. Using less than 30 spikes will cause the resulting template to be noisy. The noise on the template will be similar only to the subset of spikes that were used to compute the template. Thus, template may be very well suited to detect exactly those spikes but will be bad in generalizing to other spike waveforms (with different noise) of the same neuron.
Interestingly, sensitivity is not affected by noise on the template. The spike detection threshold depends on the templates energy, the noise covariance matrix and the prior probability to observe a spike. Noise on the template increases the template’s energy while the noise covariance matrix and the spike prior probability remain unchanged. Therefore, the template matching will become more conservative: Noisy templates do not become more sensitive to noise but rather less sensitive to spikes.
3.3 Influence of number of templates on BOTM performance
As can be seen from Fig. 8, BOTM performance is negatively affected by adding templates, which reflects the fact that the spike sorting problem becomes more difficult when more templates have to be discriminated. However, the performance does not deteriorate strongly despite the fact, that the templates have similar waveforms. Additionally, the performance saturates for larger number of templates since each additional template is more likely to compete with one of the previously added templates rather than with one of the original three templates.
3.4 Influence of noise covariance matrix
We compared the performance using different noise covariance matrices, namely the original matrix C, only its diagonal and the diagonally loaded matrix. Performance was decreased on average if only the diagonal of C was used for BOTM, matched filtering and Mahalanobis distance. This is equivalent to assuming the noise to be uncorrelated. Thus, even though the noise in the benchmarks was not necessarily Gaussian, prewhitening did increase classification performance. In all cases D _{ i } ^{ Maha } (t) and BOTM had the highest classification (and rejection) performance while using D _{ i } ^{ Match } (t) and BOTM had the best sensitivity. We did not try to optimize the computation of the noise covariance matrix (e.g., assuming all electrodes to have a similar autocovariance like done in (Prentice et al. 2011) could be beneficial for multielectrode arrays) and it might be possible to reduce our error rates by a better choice. However, investigating the effect of C should be preferentially done on real recordings (and potentially for each recording modality individually).
The lower performance of the methods that ignore noise correlations shows that at least for the benchmark data considered here, modeling noise as correlated by taking the covariance structure into account is beneficial for template matching for both detection and classification. However, it should be noted that this is not necessarily true in general, particularly with data sets having strongly nonGaussian variability due to, e.g., high level multiunit activity, etc.
The threshold derived for BOTM is only optimal if the Gaussian noise assumption is valid, if there is no variation of the neurons’ spike shapes, and if there are no changes in its firing rate. To check if these assumptions are violated in a way which would influence the best detection threshold, we also computed the best threshold using the available ground truth in the same way as for the other methods as described in section “Evaluation metrics”. However, we did not find any significant improvement of performance.
We furthermore investigated, how far the assumption of Gaussian noise is fulfilled by the data. Since Benchmark 1 (Q) is simulated data (and thus the noise is artificial), we used the real data from benchmark 2 (H) to estimate in how far pieces of noise follow a Gaussian statistic. Short pieces of 55 samples length were cut out on all 4 channels (thus forming 220 dimensional vectors) in periods of the recordings when the automatic spike detection did not detect any spikes. We then followed the steps of the noise analysis in (Pouzat et al. 2002): First, we estimated the noise covariance matrix. To avoid over fitting we computed the covariance on one portion of the noise pieces and used it to prewhiten the other portion. Second, we computed the statistics of third moments for random triplets of the 220 dimensions and tested if they were different from 0. We found, in agreement with (Pouzat et al. 2002), that the distribution of energies of the prewhitened noise pieces follow a χ ^{2} distribution with 219 degrees of freedom, and that the third moment was not significantly different from zero. This indicates that the noise distribution is indeed adequately captured by the noise covariance matrix and the prewhitened noise pieces follow a multivariate normal distribution.
3.5 Resolution of overlapping spikes and iterative refinement of initial spike sorting
Performance increase by using BOTM after an initial spike sorting on benchmark 3 (Q)
Method:  Wave_clus  Correct templates + BOTM  Correct templates + BOTM + SIC  Wave_clus + BOTM + SIC  

Error type:  Det  Class  Total  Det  Class  Total  Det  Class  Total  Det  Class  Total  
Name  Noise  
Easy 1  0.05  921 (73.8)  1 (100.0)  922 (86.9)  76 (97.8)  2 (99.9)  78 (98.9)  13 (99.6)  4 (99.9)  17 (99.8)  11 (99.7)  2 (99.9)  13 (99.8) 
0.10  236 (93.3)  5 (99.9)  241 (96.6)  45 (98.7)  3 (99.9)  48 (99.3)  5 (99.9)  2 (99.9)  7 (99.9)  4 (99.9)  2 (99.9)  6 (99.9)  
0.15  374 (89.2)  5 (99.9)  379 (94.5)  59 (98.3)  5 (99.9)  64 (99.1)  5 (99.9)  0 (100.0)  5 (99.9)  8 (99.8)  0 (100.0)  8 (99.9)  
0.20  999 (71.2)  12 (99.7)  1011 (85.4)  61 (98.2)  9 (99.7)  70 (99.0)  9 (99.7)  3 (99.9)  12 (99.8)  9 (99.7)  3 (99.9)  12 (99.8)  
Easy 2  0.05  174 (94.9)  3 (99.9)  177 (97.4)  51 (98.5)  19 (99.4)  70 (99.0)  2 (99.9)  1 (100.0)  3 (100.0)  2 (99.9)  2 (99.9)  4 (99.9) 
0.10  193 (94.5)  10 (99.7)  203 (97.1)  39 (98.9)  21 (99.4)  60 (99.1)  7 (99.8)  1 (100.0)  8 (99.9)  6 (99.8)  2 (99.9)  8 (99.9)  
0.15  184 (94.6)  45 (98.7)  229 (96.6)  43 (98.7)  36 (98.9)  79 (98.8)  4 (99.9)  2 (99.9)  6 (99.9)  4 (99.9)  6 (99.8)  10 (99.9)  
0.20  637 (81.9)  306 (91.3)  943 (86.6)  85 (97.6)  93 (97.4)  178 (97.5)  6 (99.8)  2 (99.9)  8 (99.9)  6 (99.8)  7 (99.8)  13 (99.8)  
Difficult 1  0.05  274 (91.9)  0 (100.0)  274 (96.0)  37 (98.9)  17 (99.5)  54 (99.2)  3 (99.9)  17 (99.5)  20 (99.7)  2 (99.9)  18 (99.5)  20 (99.7) 
0.10  201 (94.2)  41 (98.8)  242 (96.5)  39 (98.9)  50 (98.5)  89 (98.7)  18 (99.5)  11 (99.7)  29 (99.6)  18 (99.5)  12 (99.7)  30 (99.6)  
0.15  217 (93.8)  81 (97.7)  298 (95.7)  46 (98.7)  132 (96.2)  178 (97.4)  11 (99.7)  17 (99.5)  28 (99.6)  9 (99.7)  17 (99.5)  26 (99.6)  
0.20  405 (88.1)  651 (80.9)  1056 (84.5)  45 (98.7)  278 (91.9)  323 (95.3)  19 (99.4)  10 (99.7)  29 (99.6)  20 (99.4)  10 (99.7)  30 (99.6)  
Difficult 2  0.05  183 (94.6)  1 (100.0)  184 (97.3)  45 (98.7)  34 (99.0)  79 (98.8)  9 (99.7)  8 (99.8)  17 (99.7)  8 (99.8)  9 (99.7)  17 (99.7) 
0.10  157 (95.5)  8 (99.8)  165 (97.6)  33 (99.0)  38 (98.9)  71 (99.0)  4 (99.9)  7 (99.8)  11 (99.8)  5 (99.9)  9 (99.7)  14 (99.8)  
0.15  193 (94.4)  443 (87.1)  636 (90.8)  51 (98.5)  153 (95.6)  204 (97.0)  5 (99.9)  8 (99.8)  13 (99.8)  8 (99.8)  9 (99.7)  17 (99.8)  
0.20  492 (85.9)  1462 (58.1)  1954 (72.0)  104 (97.0)  386 (88.9)  490 (93.0)  7 (99.8)  14 (99.6)  21 (99.7)  36 (99.0)  1124 (67.8)  1160 (83.4)  
Total  5840 (89.4)  3074 (94.4)  8914 (83.9)  859 (98.4)  1276 (97.7)  2135 (96.1)  127 (99.8)  107 (99.8)  234 (99.6)  156 (99.7)  1232 (97.8)  1388 (97.5) 
4 Discussion
We analyzed the performance of different template matching procedures. We showed that distance based template matching is not suitable to detect spikes while the performance of convolutionbased template matching for classifying spikes may be low depending on the templates in the data. For the case of colored Gaussian noise we use a Bayesian approach to derive an optimal template matching. The proposed BOTM algorithm we show to outperform the other methods on a number of benchmark data sets. The probabilistic framework provides a robust way to resolve overlapping spikes, even in the presence of a relatively large number of templates (see Fig. 4 where 10 templates are present). Since the BOTM procedure is fast and computationally simple it is also suitable for hardware implementation and potential realtime applications. BOTM can in principle be applied to all detection and classification problems which include linear separation of multiple transient signals. Furthermore, there is no need to align the spike waveforms before classification, a step that is usually errorprone.
The probabilistic approach and the solution derived here is related to earlier work (Pillow et al. 2013) but exhibits some important differences. Our approach shows the connection between LDA and matched filtering, and can be implemented by linear filters. This can be an important advantage for hardware implementations and closedloop experiments, since our method is onlinecapable. This allows for applying adaptive template matching strategies, where the templates and filters are gradually adapted over time depending on the previously found spikes. We did not attempt using an adaptive strategy in this study (see discussion below). The method presented in (Pillow et al. 2013) solves a global optimization problem, while we solve the overlap problem locally in time. Our approach could entail a slight increase in sorting errors in those cases where future spike classifications are important to make the correct decision (resolving an overlapping spike from the future backwards rather than from the past onwards), but it offers the advantage of having an online algorithm and faster classification. Furthermore, the locality reduces the dimensionality of the noise covariance matrix in the range of the template length, not the length of the recordings, which makes it feasible for us to estimate the noise covariance matrix on short periods of noise. The weights of the pros and cons of the methods largely depend, however, on the experimental context.
4.1 Nonstationary templates
Spike waveforms from neurons are known to vary on two different time scales: In the range of milliseconds (Fee et al. 1996), depending on the time between to spikes of the same neuron, and on a larger time scale owing to a movement of the neurons with respect to the electrodes (Franke et al. 2010). Both sources of variability, but prevailingly the movementinduced variability, can be addressed by using adaptive filters. The benchmarks used in this study are, due to a lack of strong waveform variability, however, not well suited to test an adaptive approach, so that further work will be necessary to investigate the potential of adaptive strategies.
4.2 Noise covariance matrix and gaussian noise assumption
BOTM assumes noise to be multivariate colored Gaussian. This was found to be a good description of real noise (Pouzat et al. 2002), but, other studies claim that the distributions of spike waveforms are better explained by tdistributions (Shoham et al. 2003). Neither of the data sets used in this study were constructed to follow this assumption. In fact, the noise in the benchmark data set from (Quiroga et al. 2004) was created by copying many templates with small amplitudes into the data, but it should be also noted that this dataset did not include multiunit activity, which is one of the main factors introducing deviations from Gaussian distributions. The data set from (Henze et al. 2000) are real recordings where noise is likely to contain small amplitude spikes from neurons that are further away from the electrodes but our analysis showed that the Gaussian assumption might be well justified. For both data sets using the colored Gaussian noise assumption significantly increased spike detection and classification performance. This is consistent with the observation that although in many classification problems the assumption of normality and of a common covariance matrix among clusters is often violated, linear classifiers assuming colored Gaussian noise still perform surprisingly well (Duda et al. 2001; Li et al. 2006).
Should the main variability of clusters be caused by the neurons, e.g., while bursting, and not by noise, the decision boundaries derived via the noise covariance matrix (and not the cluster covariance matrix) might be suboptimal. This could be remedied by using multiple templates per neuron, an approach especially promising for bursting neurons which can produce several distinct, sometimes even nonoverlapping clusters.
A question that remains open is in how far the noise statistics (and thus the noise covariance matrix) are stable during an experiment and how well they can be estimated, e.g., for artifacts and ripples (Fig. 1). This will depend strongly on the recording conditions and might vary from setup to setup. However, similar problems were already faced in radar applications (Melvin 2004) and it might be beneficial to determine if those solutions are applicable also to the analysis of extracellular recordings.
4.3 Resolution of overlapping spikes
Several approaches were recently developed to resolve overlapping spikes (Atiya 1992; Ekanadham et al. 2014; Franke et al. 2010; Lewicki 1994; Marre et al. 2012; Pillow et al. 2013; Prentice et al. 2011; Segev et al. 2004; VargasIrwin and Donoghue 2007; Wang et al. 2006; Zhang et al. 2004). Most of them are based either on a greedy iterative subtraction scheme to remove spikes and detect overlaps (e.g., (Marre et al. 2012; Segev et al. 2004)) or on searching the best fit in the space of all possible overlaps (e.g., (Pillow et al. 2013; Prentice et al. 2011)). Ekanadham and coauthors (2014) suggest to resolve overlapping spikes while performing clustering. The method we propose here is similar to several of the abovementioned approaches: the bruteforce (Option 1 in Fig. 2) and the iterative subtraction scheme (Option 2, SIC). In contrast to the other methods, however, BOTM performs the overlap resolution using the filter outputs of the matched filters instead of the original recorded data. This increases the discriminability of spike waveforms from different neurons and reduces the influence of noise. Although our method is computationally less expensive it still yields comparable results to (Ekanadham et al. 2014) on Benchmark 3.
Footnotes
 1.
Note that this overestimates the performance of the other methods, since in a real situation their optimal threshold is not known.
Notes
Acknowledgments
We thank Robin Ince, Robert Pröpper, Philipp Meier and Christophe Pouzat for helpful discussions and Wendelin Böhmer and Espen Hagen for feedback on a draft of this paper. This work was supported by DFG GRK 1589/1, the German Federal Ministry of Education and Research (BMBF) with the grants 01GQ0743 and 01GQ0410, by the European Community through the ERC Advanced Grant 267351, “NeuroCMOS”, and by the Engineering and Physical Sciences Research Council (EPSRC).
Conflict of interest
The authors declare that they have no conflict of interest
References
 Abeles, M., & Goldstein, M. H. (1977). Multispike train analysis. Proceedings of the IEEE, 65(5), 762–773. doi: 10.1109/PROC.1977.10559.CrossRefGoogle Scholar
 Atiya, A. F. (1992). Recognition of multiunit neural signals. IEEE transactions on biomedical engineering, 39(7), 723–9. doi: 10.1109/10.142647.CrossRefPubMedGoogle Scholar
 Bestel, R., Daus, A. W., & Thielemann, C. (2012). A novel automated spike sorting algorithm with adaptable feature extraction. Journal of Neuroscience Methods. doi: 10.1016/j.jneumeth.2012.08.015.PubMedGoogle Scholar
 Buzsáki, G. (2004). Largescale recording of neuronal ensembles. Nature Neuroscience, 7(5), 446–51. doi: 10.1038/nn1233.CrossRefPubMedGoogle Scholar
 Cambridge Electronic Design Limited. (2012). Spike 2 Version 7 Manual, page 15–8, point 3. http://www.ced.co.uk/img/Spike7.pdf
 CamuñasMesa, L. A., & Quiroga, R. Q. (2013). A detailed and fast model of extracellular recordings. Neural Computation, 25(5), 1191–212. doi: 10.1162/NECO_a_00433.CrossRefPubMedGoogle Scholar
 Choi, J. (2010). Optimal combining and detection. Cambridge: Cambridge University Press. doi: 10.1017/CBO9781139193535.CrossRefGoogle Scholar
 Duda, R. O., Hart, P. E., & Stork, D. G. (2001). Pattern classification. New York: Wiley.Google Scholar
 Einevoll, G. T., Franke, F., Hagen, E., Pouzat, C., & Harris, K. D. (2012). Towards reliable spiketrain recordings from thousands of neurons with multielectrodes. Current Opinion in Neurobiology, 22(1), 11–7. doi: 10.1016/j.conb.2011.10.001.CrossRefPubMedCentralPubMedGoogle Scholar
 Ekanadham, C., Tranchina, D., & Simoncelli, E. P. (2014). A unified framework and method for automatic neural spike identification. Journal of Neuroscience Methods, 222, 47–55. doi: 10.1016/j.jneumeth.2013.10.001.CrossRefPubMedCentralPubMedGoogle Scholar
 Fee, M. S., Mitra, P. P., & Kleinfeld, D. (1996). Variability of extracellular spike waveforms of cortical neurons. Journal of neurophysiology, 76(6), 3823–33. http://www.ncbi.nlm.nih.gov/pubmed/8985880. Accessed 11 September 2014
 Fisher, R. A. (1936). The use of multiple measurements in taxonomic problems. Annals of Eugenics, 7(2), 179–188. doi: 10.1111/j.14691809.1936.tb02137.x.CrossRefGoogle Scholar
 Franke, F. (2011). RealTime Analysis of Extracellular Multielectrode Recordings. Berlin: PhD Thesis, Technische Universität Berlin. http://opus.kobv.de/tuberlin/volltexte/2012/3387/
 Franke, F., Natora, M., Boucsein, C., Munk, M. H. J., & Obermayer, K. (2010). An online spike detection and spike classification algorithm capable of instantaneous resolution of overlapping spikes. Journal of Computational Neuroscience, 29(1–2), 127–148. http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=2950077&tool=pmcentrez&rendertype=abstract
 Friedman, D. H. (1968). Detection of Singals by template matching. Baltimore: Johns Hopkins Press.Google Scholar
 GERSTEIN, G. L., & CLARK, W. A. (1964). SIMULTANEOUS STUDIES OF FIRING PATTERNS IN SEVERAL NEURONS. Science (New York, N.Y.), 143(3612), 1325–7. http://www.ncbi.nlm.nih.gov/pubmed/14108312. Accessed 11 September 2014
 Ghanbari, Y., Spence, L., & Papamichalis, P. (2009). A graphLaplacianbased feature extraction algorithm for neural spike sorting. Conference proceedings/: … Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE Engineering in Medicine and Biology Society. Conference, 2009, 3142–5. doi: 10.1109/IEMBS.2009.5332571
 Gold, C., Henze, D. A., Koch, C., & Buzsáki, G. (2006). On the origin of the extracellular action potential waveform: a modeling study. Journal of Neurophysiology, 95(5), 3113–28. doi: 10.1152/jn.00979.2005.CrossRefPubMedGoogle Scholar
 Harris, K. D., Henze, D. A., Csicsvari, J., Hirase, H., & Buzsáki, G. (2000). Accuracy of tetrode spike separation as determined by simultaneous intracellular and extracellular measurements. Journal of neurophysiology, 84(1), 401–14. http://www.ncbi.nlm.nih.gov/pubmed/10899214. Accessed 4 September 2014
 Henze, D. A., Borhegyi, Z., Csicsvari, J., Mamiya, A., Harris, K. D., & Buzsáki, G. (2000). Intracellular features predicted by extracellular recordings in the hippocampus in vivo. Journal of neurophysiology, 84(1), 390–400. http://www.ncbi.nlm.nih.gov/pubmed/10899213. Accessed 30 April 2013
 Herbst, J. A., Gammeter, S., Ferrero, D., & Hahnloser, R. H. R. (2008). Spike sorting with hidden Markov models. Journal of Neuroscience Methods, 174(1), 126–34. doi: 10.1016/j.jneumeth.2008.06.011.CrossRefPubMedGoogle Scholar
 Hiemstra, J. D. (2002). Colored diagonal loading. In Proc. IEEE Radar Conf (pp. 386–390). doi: 10.1109/NRC.2002.999749
 Kay, S. M. (1998). Fundamentals of statistical signal processing Vol. 2  Detection theory. PrenticeHall.Google Scholar
 Keehn, D. G. (1966). An iterative spike separation technique. IEEE Transactions on Biomedical Engineering, BME13(1), 19–28. doi: 10.1109/TBME.1966.4502395.CrossRefGoogle Scholar
 Kim, S., & McNames, J. (2007). Automatic spike detection based on adaptive template matching for extracellular neural recordings. Journal of Neuroscience Methods, 165(2), 165–74. doi: 10.1016/j.jneumeth.2007.05.033.CrossRefPubMedGoogle Scholar
 Lewicki, M. S. (1994). Bayesian modeling and classification of neural signals. Neural Computation, 6(5), 1005–1030. doi: 10.1162/neco.1994.6.5.1005.CrossRefGoogle Scholar
 Lewicki, M. S. (1998). A review of methods for spike sorting: the detection and classification of neural action potentials. Network (Bristol, England), 9(4), R53–78. http://www.ncbi.nlm.nih.gov/pubmed/10221571. Accessed 11 September 2014
 Li, T., Zhu, S., & Ogihara, M. (2006). Using discriminant analysis for multiclass classification: an experimental investigation. Knowledge and Information Systems, 10(4), 453–472. doi: 10.1007/s101150060013y.CrossRefGoogle Scholar
 Marre, O., Amodei, D., Deshmukh, N., Sadeghi, K., Soo, F., Holy, T. E., & Berry, M. J. (2012). Mapping a complete neural population in the retina. The Journal of neuroscience : the official journal of the Society for Neuroscience, 32(43), 14859–73. doi: 10.1523/JNEUROSCI. 072312.2012.CrossRefGoogle Scholar
 Melvin, W. L. (2004). A STAP overview. IEEE Aerospace and Electronic Systems Magazine, 19(1), 19–35. doi: 10.1109/MAES.2004.1263229.CrossRefGoogle Scholar
 Moshavi, S. (1996). Multiuser detection for DSCDMA communications. IEEE Communications Magazine, 34(10), 124–136. doi: 10.1109/35.544334.CrossRefGoogle Scholar
 Obeid, I., Nicolelis, M. A., & Wolf, P. D. (2004). A multichannel telemetry system for single unit neural recordings. Journal of Neuroscience Methods, 133(1–2), 33–38. doi: 10.1016/j.jneumeth.2003.09.023.CrossRefPubMedGoogle Scholar
 Pillow, J. W., Shlens, J., Chichilnisky, E. J., & Simoncelli, E. P. (2013). A modelbased spike sorting algorithm for removing correlation artifacts in multineuron recordings. PLoS One, 8(5), e62123. doi: 10.1371/journal.pone.0062123.CrossRefPubMedCentralPubMedGoogle Scholar
 Plexon Inc. (2009). Plexon Offline Spike Sorter Manual, Ch. 5.6.2. http://www.plexon.com/sites/default/files/Offline Sorter v3 Manual.pdf
 Pouzat, C., Mazor, O., & Laurent, G. (2002). Using noise signature to optimize spikesorting and to assess neuronal classification quality. Journal of neuroscience methods, 122(1), 43–57. http://www.ncbi.nlm.nih.gov/pubmed/12535763. Accessed 11 September 2014
 Prentice, J. S., Homann, J., Simmons, K. D., Tkačik, G., Balasubramanian, V., & Nelson, P. C. (2011). Fast, scalable, Bayesian spike identification for multielectrode arrays. PLoS One, 6(7), e19884. doi: 10.1371/journal.pone.0019884.CrossRefPubMedCentralPubMedGoogle Scholar
 Quiroga, R. Q. (2004). Wave_clus 2.0, Unsupervised spike detection and sorting, Software. Internet.Google Scholar
 Quiroga, R. Q., Nadasdy, Z., & BenShaul, Y. (2004). Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering. Neural Computation, 16(8), 1661–87. doi: 10.1162/089976604774201631.CrossRefPubMedGoogle Scholar
 Roberts, W. M., & Hartline, D. K. (1975). Separation of multiunit nerve impulse trains by a multichannel linear filter algorithm. Brain research, 94(1), 141–9. http://www.ncbi.nlm.nih.gov/pubmed/1148860. Accessed 11 September 2014
 Rutishauser, U., Schuman, E. M., & Mamelak, A. N. (2006). Online detection and sorting of extracellularly recorded action potentials in human medial temporal lobe recordings, in vivo. Journal of Neuroscience Methods, 154(1–2), 204–24. doi: 10.1016/j.jneumeth.2005.12.033.CrossRefPubMedGoogle Scholar
 Salganicoff, M., Sarna, M., Sax, L., & Gerstein, G. L. (1988). Unsupervised waveform classification for multineuron recordings: a realtime, softwarebased system. I. Algorithms and implementation. Journal of neuroscience methods, 25(3), 181–7. http://www.ncbi.nlm.nih.gov/pubmed/3226145. Accessed 11 September 2014
 Sato, T., Suzuki, T., & Mabuchi, K. (2007). Fast automatic template matching for spike sorting based on DaviesBouldin validation indices. In Conference proceedings : Annual international conference of the IEEE engineering in medicine and biology society. IEEE engineering in medicine and biology society. Annual conference, 2007 (pp. 3200–3). doi: 10.1109/IEMBS.2007.4353010.CrossRefGoogle Scholar
 SchmitzerTorbert, N., Jackson, J., Henze, D., Harris, K., & Redish, A. D. (2005). Quantitative measures of cluster quality for use in extracellular recordings. Neuroscience, 131(1), 1–11. doi: 10.1016/j.neuroscience.2004.09.066.CrossRefPubMedGoogle Scholar
 Segev, R., Goodhouse, J., Puchalla, J., & Berry, M. J. (2004). Recording spikes from a large fraction of the ganglion cells in a retinal patch. Nature Neuroscience, 7(10), 1154–61. doi: 10.1038/nn1323.CrossRefPubMedGoogle Scholar
 Shoham, S., Fellows, M. R., & Normann, R. A. (2003). Robust, automatic spike sorting using mixtures of multivariate tdistributions. Journal of neuroscience methods, 127(2), 111–22. http://www.sciencedirect.com/science/article/pii/S016502700800246X. Accessed 11 September 2014
 Van Trees, H. L. (2002). Optimum array processing. New York: Wiley.CrossRefGoogle Scholar
 VargasIrwin, C., & Donoghue, J. P. (2007). Automated spike sorting using density grid contour clustering and subtractive waveform decomposition. Journal of Neuroscience Methods, 164(1), 1–18. doi: 10.1016/j.jneumeth.2007.03.025.CrossRefPubMedCentralPubMedGoogle Scholar
 Vollgraf, R., Munk, M., & Obermayer, K. (2005). Optimal filtering for spike sorting of multisite electrode recordings. Network: Computation in Neural Systems, 16(1), 85–113. doi: 10.1080/09548980500275378.CrossRefGoogle Scholar
 Wang, G.L., Zhou, Y., Chen, A.H., Zhang, P.M., & Liang, P.J. (2006). A robust method for spike sorting with automatic overlap decomposition. IEEE transactions on biomedical engineering, 53(6), 1195–8. doi: 10.1109/TBME.2006.873397.CrossRefPubMedGoogle Scholar
 Zhang, P.M., Wu, J.Y., Zhou, Y., Liang, P.J., & Yuan, J.Q. (2004). Spike sorting based on automatic template reconstruction with a partial solution to the overlapping problem. Journal of Neuroscience Methods, 135(1–2), 55–65. doi: 10.1016/j.jneumeth.2003.12.001.CrossRefPubMedGoogle Scholar
Copyright information
Open Access This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.