Hardware Architecture for Neural Spike Sorting

by Sarah Gibson, Dejan Markovic, Department of Electrical Engineering, University of California, Los Angeles

Overview

Neural signal processing has many exciting applications today, including neuroscience research and neuroprosthetics. In such applications, spike sorting is a critical step in processing neural signals. Spike sorting has traditionally been performed in software. However, the growing demand for more recording channels and the need to transmit neural data wirelessly call for a hardware solution to perform spike sorting on-site and on-line. This article summarizes a real-time spike sorting architecture being developed using Synplify® DSP at the Department of Electrical Engineering at the University of California, Los Angeles.

When an electrode is inserted into the brain for neural recording, it typically detects signals from multiple different neurons. Each neuron exhibits spikes with distinct characteristics, such as amplitude and shape. Spike sorting is the process of using these characteristics to determine which neuron contributed a given spike. This is a critical step in the neural processing stream, especially for neuroprosthetic applications, in order to properly decode a patient’s intentions.

Currently, spike sorting is usually performed in software, whether online or offline, and most spike sorting techniques require supervision. This imposes limitations on the number of data channels that can be used, since it is computationally expensive to process 100 independent channels in software, especially in real time. In addition, neuroprosthetic applications will require wireless data transmission. Sampling 100 channels at 25 kSa/s using a wordlength of 12 bits amounts to a data rate of 30 Mbps [1]. Since it is currently not feasible to transmit wirelessly at this data rate, on-chip data reduction must be performed. This article describes an architecture that can perform both spike detection and feature extraction, which both reduces the data size to enable wireless data transmission and allows for clustering offline.

The first step in spike sorting, spike detection, is to discriminate between valid spikes and noise (e.g., background spikes from distant neurons, Johnson noise in the electrode/electronics [2]). This is done by determining a voltage threshold and by classifying any part of the waveform that crosses this threshold as a spike. In this design, the threshold was calculated by first calculating the median of a sample of points and then multiplying this value by a factor of 4.

Spikes are then aligned (e.g., to maximum amplitude or to maximum correlation) before the second step, feature extraction. In feature extraction, the shape of each spike is described in order to have a metric by which to compare spikes. Some common spike shape features to extract are maximum amplitude, peak-to-peak amplitude, width, or principal components.[3] The feature extraction method used in this design is based on discrete derivatives. [4] Three derivative waveforms per spike are calculated. The “first” derivative is calculated by taking the difference between every other point. The “second” derivative is calculated by taking the difference between every fourth point. Lastly the “third” derivative is calculated by taking the difference between every eighth point. (Note that these “first”, “second”, and “third” derivatives here are not first, second, and third derivatives in the calculus sense.) These derivative waveforms show the change in the spike over different periods of time, and are distinctly different for different neurons.

This particular feature extraction algorithm was chosen because the hardware implementation was very simple. The main components are delays, subtractors, and FIFOs (Fig. 1). To compute the first derivative, each sample of a spike beginning with the second is subtracted from the previous sample and the result stored in FIFO1. Similarly, to compute the second derivative, each sample of a spike beginning with the fourth is subtracted from the sample 3 clock cycles ago and the result stored in FIFO2. Finally to compute the third derivative, each sample of a spike beginning with the eighth is subtracted from the sample 7 clock cycles ago and the result stored in FIFO3. The outputs of this hardware block are these three derivative waveforms.

Figure 1.  Implementation of Feature Extraction portion of signal processing stream using Synplify DSP blocks.

The final step of spike sorting is to project the extracted features onto a given space and to cluster so as to minimize the within-cluster distance while maximizing the between-cluster distance (“k-means” clustering). This is where the identity of each spike is finally determined. This design does not include a clustering portion. However, clustering was performed in the following example in order to demonstrate the accuracy of the design.

In order to evaluate the accuracy of this algorithm and hardware implementation, data with known spike times and classes were generated using a neural recording simulator and inputted to the circuit. Figure 2A shows an example of two spikes (from two different neurons) with noise added to the signal. Figures 2B-2E show MATLAB plots of the output of the circuit. Figure 2B shows the output of the Spike Detection block, which consists of spikes added to a zero baseline waveform. In this example, the threshold was calculated to be 320. Figures 2C-2E show the outputs of the Feature Extraction block, each of which consists of a derivative waveform added to a zero baseline.

Figure 2. A, ~10 ms sample of the output of the neural recording simulator which is used as an input to the circuit. It contains two spikes. Notice that they are different shapes, i.e. they originate from different neurons. B, a sample of the output of the Spike Detection block, which shows the same two spikes shown in A. C, a sample of the first output of the Feature Extraction block (the “first” derivative waveform). D, a sample of the second output of the Feature Extraction block (the “second” derivative waveform). E, a sample of the third output of the Feature Extraction block (the “third” derivative waveform). Notice that different spike shapes yield vastly different derivative waveforms. In all figures, horizontal axis is time in samples and vertical axis is normalized amplitude.

These outputs were finally passed to a MATLAB script for clustering. Figure 3A shows the traces of all the detected spikes after they have been aligned to the threshold crossing. The three spike shapes shown in Fig. 1 are clearly visible, plus some noise waveforms which were just high enough to pass the threshold. Figure 3B shows the trajectories of all the spikes, that is, the mapping of each point in each spike’s derivative over (d1, d2, d3), before clustering. Figure 3D shows the scatter plot (the mapping of a single point of interest, point 7, in the derivative waveforms, over d1, d2, d3) after clustering has been performed on the extracted features. Now we can clearly see distinct clusters corresponding to different neurons. (The blue cluster is the noise cluster; the rest correspond to valid neurons.) Figure 3F shows the plot of the trajectories once again after they have been colored according to the results of the k-means clustering. Now we can clearly see the separation of trajectories corresponding to different neurons. Finally, Fig. 3E shows the plot of the traces again after they have been color-coded according to the results of clustering. Qualitatively we can tell that the spike sorting was a success.

Figure 3. Post-processing on output of circuit. A, superposition of all spikes found in the Spike Detection block. B, derivative waveforms of each spike plotted over (d1, d2, d3). C, 3-D scatter plot of the 7th point in each derivative waveform plotted over (d1, d2, d3). D, same plot as C but color-coded according to results of clustering. E, same plot as A but color-coded according to results of clustering. F, same plot as B but color-coded according to results of clustering.

References

[1]    A. Zviagintsev, Y. Perelman, and R. Ginosar. “Low-Power Architectures for Spike Sorting,” Proc 2005 Intl IEEE EMBS Conference on Neural Eng, Mar. 2005.

[2]    S. Shoham, M.R. Fellows, R.A. Normann. “Robust, automatic spike sorting using mixtures of multivariate t-distributions,” J Neurosci Methods, vol. 127, 111-122, 2003.

[3]    M.S. Lewicki. “A review of methods for spike sorting: the detection and classification of neural action potentials,” Network, vol. 9, R53-R78, 1998.

[4]    Z. Nadasdy, R. Quian Quiroga, Y. Ben-Shaul, B. Pesaran, D.A. Wagenaar, R. Andersen. “Comparison of unsupervised algorithms for on-line and off-line spike sorting,” Program No. 405.16. 2002 Abstract Viewer/Itinerary Planner. Washington, DC: Society for Neuroscience, 2002. Online.

From The Syndicated Q4, 2007, published quarterly by Synplicity, Inc., www.synplicity.com.
Copyright © 2007 Synplicity, Inc. All rights reserved.