Faculdade de Ciˆ
encias
Departamento de F´ısica
Embedded Platform for Neural Recording and
Real-Time Template Matching
C´
elia Cristina Pereira Fernandes
Orientadores
Prof. Dr. Timothy Constandinou, Centre for Bio-Inspired Technology, Department of Electrical and Electronic Engineering, Imperial College London, United Kingdom
Prof. Dr. Alexandre Andrade, Instituto de Biof´ısica e Engenharia Biom´edica, Departamento de F´ısica da Faculdade de Ciˆencias da Universidade de Lisboa, Portugal
Mestrado Integrado em Engenharia Biom´edica e Biof´ısica
Perfil em Engenharia Cl´ınica e Instrumenta¸c˜ao M´edica
Dissertac
¸˜
ao
Faculdade de Ciˆ
encias
Departamento de F´ısica
Embedded Platform for Neural Recording and
Real-Time Template Matching
C´
elia Cristina Pereira Fernandes
Orientadores
Prof. Dr. Timothy Constandinou, Centre for Bio-Inspired Technology, Department of Electrical and Electronic Engineering, Imperial College London, United Kingdom
Prof. Dr. Alexandre Andrade, Instituto de Biof´ısica e Engenharia Biom´edica, Departamento de F´ısica da Faculdade de Ciˆencias da Universidade de Lisboa, Portugal
Mestrado Integrado em Engenharia Biom´edica e Biof´ısica
Perfil em Engenharia Cl´ınica e Instrumenta¸c˜ao M´edica
Dissertac
¸˜
ao
O c´erebro humano constitui uma das estruturas organizadas mais complexas de que se tem conhecimento, sendo por isso alvo de um interesse crescente no sentido de atin-gir uma maior compreens˜ao acerca das suas m´ultiplas fun¸c˜oes. Os progressos obti-dos ao longo obti-dos ´ultimos anos na perce¸c˜ao funcional do c´erebro s˜ao devidos essencial-mente `a an´alise da atividade el´etrica neuronal obtida atrav´es de m´etodos como o EEG, ECoG, MEG e medi¸c˜oes intracorticais. Os sinais el´etricos obtidos atrav´es de t´ecnicas como EEG, ECoG, MEG correspondem a vers˜oes atenuadas de LFP que apesar de fornecerem importantes informa¸c˜oes sobre o comportamento coletivo de um certo agre-gado de neur´onios, pouco nos permitem saber sobre a atividade unit´aria dos neur´onios que geram o sinal. Em alternativa, as medi¸c˜oes intracorticais permitem obter n˜ao s´o LFP mas tamb´em informa¸c˜ao sobre a atividade unit´aria de cada neur´onio, sendo por isso um m´etodo com interesse crescente na comunidade cient´ıfica.
Durante a aquisi¸c˜ao de sinais extracelulares, cada el´etrodo regista o sinal originado em v´arios neur´onios simultaneamente. Para aplica¸c˜oes como a investiga¸c˜ao no ˆambito da neurociˆencia, o processo de Spike Sorting ´e crucial para o processamento de sinais neu-ronais. Esta t´ecnica permite obter a atividade el´etrica de cada neur´onio individualmente e classificar os potenciais de a¸c˜ao registados de acordo com os neur´onios a partir dos quais s˜ao origin´arios.
Os algoritmos de Spike Sorting implementados em hardware tˆem de ser precisos, au-tom´aticos, permitirem uma performance em tempo-real e serem simples em termos com-putacionais de forma a serem compat´ıveis com as limita¸c˜oes de potˆencia impostas pelo hardware.
Neste projeto foi desenvolvida uma plataforma para a aquisi¸c˜ao de dados neuronais e realiza¸c˜ao de Spike Sorting em tempo real. A identifica¸c˜ao dos potenciais de a¸c˜ao detetados tem por base uma t´ecnica que procede `a compara¸c˜ao destes sinais com modelos pr´e-defnidos e armazenados no sistema, i.e Template Matching. O sistema apresentado ´
e constitu´ıdo por trˆes componentes: (i) uma placa de aquisi¸c˜ao de sinais neuronais, (ii) uma interface gr´afica para proceder `a extra¸c˜ao dos templates a partir de sinais
neuronais e apresentar a identifica¸c˜ao dos potenciais de a¸c˜ao em tempo real, e ainda (iii) um firmware baseado no microcontrolador KL26Z que procede `a classifica¸c˜ao dos potenciais de a¸c˜ao em tempo real. Todos os sub-blocos foram integrados para que o sinal neuronal adquirido fosse processado em tempo real e os potenciais de a¸c˜ao detetados fossem identificados durante as medi¸c˜oes recorrendo a Template Matching.
O sistema descrito fornece uma ferramenta importante para a investiga¸c˜ao funcional do c´erebro, uma vez que apresenta uma placa de amplifica¸c˜ao para a aquisi¸c˜ao de sinais neuronais que permite medir n˜ao s´o a componente de alta frequˆencia dos sinais neuronais, i.e. potenciais de a¸c˜ao, mas tamb´em a componente de baixa frequˆencia, i.e. LFP. O circuito de amplifica¸c˜ao apresenta um ganho decimal de 250 e ´e constitu´ıdo por dois estados, sendo o primeiro estado um amplificador de baixo ru´ıdo, com ganho de 100, e o segundo estado respons´avel pela amplifica¸c˜ao e filtragem do sinal com um ganho de 2.5 e uma largura de banda de 1Hz a 11kHz ou 300Hz a 11kHz dependendo da necessidade do utilizador.
Devido `a reduzida amplitude caracter´ıstica dos sinais neuronais, o design do amplificador neuronal atendeu a um requisito fundamental: ser uma plataforma de baixo ru´ıdo de forma a permitir a resolu¸c˜ao de potenciais de a¸c˜ao com baixas amplitudes. Um aspeto importante utilizado para minimizar o ru´ıdo prende-se com o facto do primeiro estado ter um ganho suficientemente alto de forma a tornar negligenci´avel as contribui¸c˜oes do segundo estado. O circuito de amplifica¸c˜ao deve ainda utilizar acoplamento capacitivo de forma a eliminar o deslocamento do sinal devido `a interface el´etrodo-tecido. As-petos como apresentar uma boa linearidade, i.e. TDH<1%, e uma largura de banda suficiente s˜ao tamb´em de extrema importˆancia para evitar a deforma¸c˜ao ou perda das caracter´ısticas dos potenciais de a¸c˜ao. Durante a fase de testes ao sistema comprovou-se que este apresentava um baixo n´ıvel de ru´ıdo, 5.2µVRMS, e uma boa linearidade uma vez que o valor de THD obtido foi de 0.47%.
Depois do sinal ser amplificado e filtrado na placa de aquisi¸c˜ao ´e necess´ario proceder `a sua convers˜ao de anal´ogico para digital que ocorre no microcontrolador.
No que diz respeito ao software do sistema, este pode ser dividido em dois blocos: uma interface gr´afica constru´ıda recorrendo ao software MATLAB que permite a extra¸c˜ao dos templates e apresenta a identifica¸c˜ao dos potenciais de a¸c˜ao em tempo real, e ainda um firmware baseado no microcontrolador KL26Z que procede `a classifica¸c˜ao dos potenciais de a¸c˜ao em tempo real.
A interface gr´afica consiste numa ´unica janela que permite ao utilizador controlar o funcionamento do sistema. Numa primeira fase ´e necess´ario proceder `a sua calibra¸c˜ao de forma a extrair os templates e obter o limiar de dete¸c˜ao. Para isso s˜ao adquiridos
dois segundos de sinal neuronal que s˜ao processados usando a t´ecnica de Template Matching. Os potenciais de a¸c˜ao encontrados s˜ao agrupados mediante a forma da onda que apresentam, correspondendo a onda m´edia de cada conjunto aos v´arios templates. Estes s˜ao depois exibidos na interface gr´afica e sujeitos `a avalia¸c˜ao do utilizador que pode escolher quais os templates devem ser guardados no sistema e rejeitar sinais que correspondam a picos ocasionais de ru´ıdo.
Depois de terminada a calibra¸c˜ao, os templates e o limiar de dete¸c˜ao s˜ao enviados para o microcontrolador KL26Z onde ocorre a identifica¸c˜ao dos potenciais de a¸c˜ao em tempo real. A identifica¸c˜ao ´e realizada recorrendo uma vez mais `a t´ecnica de Template Matching, em que os potenciais de a¸c˜ao detetados s˜ao comparados com os templates guardados no sistema. Os resultados desta opera¸c˜ao s˜ao enviados e exibidos em tempo real na interface gr´afica. Este m´etodo ´e autom´atico e apresenta baixa complexidade computacional, sendo por isso adequado para a implementa¸c˜ao em hardware.
O sistema foi testado utilizando dados neuronais simulados de forma a poder analisar a performance do sistema. A sensibilidade de dete¸c˜ao apresentada foi de 92%, sendo que apenas 2% dos potenciais de a¸c˜ao detetados n˜ao foram identificados. Note-se que no futuro, de forma a verificar se o sistema mant´em esta performance, ´e necess´ario proceder a testes com dados neuronais reais.
Palavras-Chave: Spike Sorting em tempo real, Template Matching, Amplificador de sinais neuronais, Baixo ruido, Microcontrolador KL26Z, MATLAB GUI.
The analysis of electrical signals recorded from the brain has been a major force behind the progress in our understanding of this organ. Intracortical neural recording has been experimentally proved to be effective for providing information about the cooperative actions of neurons since it provides not only the experimenter with LFP measurements but also with unit activity of neurons. In this method, a single electrode often receives electrical signals from multiple neurons simultaneously. For applications such as neural prosthetics and neuroscience research spike sorting is a critical step in neural signal processing. This technique allows us to obtain single-unit activity and classify recorded action potentials according to the neurons from which they originate and therefore, greatly reduce the required data bandwidth without loose critical info about neural spikes.
This project is aimed at developing an Embedded Platform for Neural Recording and Real-Time Template Matching. The overall system is based on MATLAB software and KL26Z platform and has three different sub-blocks: (i) Front-end amplification circuit board for neural signal recording; (ii) a MATLAB Graphical User Interface for template building and real-time spike display; and (iii) A firmware based on KL26Z microcon-troller platform for real-time spike sorting. All sub-blocks were integrated together to record neural signal and perform on-line template matching during measurements.
This system provides an important tool for further spike sorting research since it presents a front-end amplification circuit board for neural signal recording that allows measuring not only spikes but also LFP. Due to the small amplitude range of neural signals the amplifier design was done very carefully in order to meet specific requirements such as low noise and a good linearity. These aspects were met since the amplifier presents a low input referred noise of 5.2µVRMS and the THD value of 0.47%.
The template matching algorithm is used in this system to extract templates from filtered and amplified neural data using MATLAB software and to perform on-line spike sorting in KL26Z platform. This method is automatic, only requires user intervention for a final validation in calibration stage where templates are extracted, and presents low
computational complexity which makes it suitable for hardware implementation. The system is very user-friendly and high accurate with detection sensitivity of 92%, based on the simulated extracellular datasets that were tested.
Keywords: Real-time Spike Sorting, Template Matching, Neural Amplifier, Low Noise, KL26Z microcontroller, MATLAB GUI
Firstly, I would like to express my deeply gratitude to my supervisor, Dr. Timothy Constandinou, whose expertise, understanding and patience have guided my experience in Imperial College London. I am really grateful for the opportunity to go abroad, for all support given and for this challenging project.
A special thanks to Dr. Yan Liu who was so patient to teach me even thought he was busy with his work, he always found time for me. His dedication and expertise added considerably to my project.
I must also thank Deren Barsakcioglu and Dr. Song Luan for their help and suggestions that improved my work.
I would also like to thank very much all the members of the Bio-Inspired group from Imperial College London who so well received me. I am really glad to have met them and to have had the opportunity to work with them. I must also thank to Izabela Wojcicka-Grzesiak whose kindness and patience have facilitated my experience in Imperial College London.
A special thanks goes out to Professor Alexandre Andrade who was always available to any question. I am thankful for his guidance and encouragement.
I would also like to express a very special thanks to my laboratory partner, Francisco, whose companionship, patience and generosity have facilitated my life. I am also grateful to Nadia, who together with Francisco made our flat a home away from home. I must also thank Filipa and Jo˜ao whose friendship made me enjoy much more my stay in London.
Finally, I would like to express my truly and deeply gratitude to my family. There are no words to describe how grateful I am to my parents Maria and Manuel, my brother H´elder, my sister-in-law Sara and my little niece Matilde who always supported me and were by my side.
Resumo i
Abstract v
Acknowledgements vii
List of Tables xiii
List of Figures xv
Abbreviations xvii
1 Introduction 1
2 Background 5
2.1 Neuroanatomy and Neurophysiology . . . 5
2.1.1 Cerebral Cortex . . . 6
2.1.1.1 Somatosensory Cortex . . . 7
2.1.1.2 Motor Cortex . . . 7
2.1.2 Neural Cells . . . 8
2.1.2.1 Physiology . . . 9
2.1.2.2 Properties of Neural Cells . . . 11
2.1.2.3 Action Potential . . . 12
2.2 Neural Activity Recording . . . 14
2.2.1 Electroencephalography . . . 14 2.2.2 Magnetoencephalography . . . 15 2.2.3 Electrocorticography . . . 15 2.2.4 Extracellular Recordings . . . 16 2.2.4.1 Recorded Signals . . . 16 2.2.5 Intracellular Recordings . . . 20 2.2.6 Microelectrode Model . . . 20 2.2.7 Noise Sources . . . 22
3 State-of-the-Art of Neural Spike Sorting 25 3.1 Analogue Front-End and Data Conversion . . . 26
3.2 Spike detection . . . 28
3.2.1 Positive threshold . . . 28
3.2.2 Absolute Value . . . 29
3.2.3 Nonlinear energy operator . . . 30 ix
3.2.4 Stationary-Wavelet-Transform Product . . . 30 3.3 Spike Sorting . . . 31 3.3.1 Alignment . . . 31 3.3.2 Feature Extraction . . . 32 3.3.3 Clustering . . . 33 3.3.4 Template Matching . . . 34
3.4 Simulated Extracellular Recordings . . . 36
4 Front-End Amplification Circuit Board for Neural Signal Recording 39 4.1 Amplifier Design Parameters . . . 39
4.1.1 Low noise Pre-amplifier . . . 40
4.1.2 Post-amplifier and Filter . . . 42
4.2 Neural Amplifier Analysis . . . 43
4.2.1 Transient and Steady State Responses . . . 44
4.2.1.1 Impulse Response . . . 44
4.2.2 Frequency Response . . . 45
4.2.3 Noise Analysis . . . 47
4.3 Custom PCB Design and Prototyping . . . 49
4.3.1 PCB Design Rules . . . 50
4.3.2 Overall Board Design and Components Choice . . . 51
4.3.2.1 Power Management Circuit . . . 52
4.3.2.2 VDD Divider Circuit . . . 52
4.3.2.3 Amplification, Filtering Circuit and RESET Circuit . . . 53
4.3.2.4 Input/Output Board Connectors . . . 54
4.4 Neural Amplifier Board and KL26Z Compatibility . . . 55
4.5 Analogue-to-Digital Conversion . . . 56
4.6 Board’s Performance Testing and Results . . . 57
4.6.1 THD Analysis . . . 57
4.6.2 Noise analysis . . . 59
5 Software Development 61 5.1 MATLAB Graphical User Interface . . . 61
5.1.1 Calibration . . . 62
5.1.2 On-line Template Matching . . . 64
5.2 Firmware based on KL26Z microcontroller platform for real-time spike sorting . . . 65
6 Overall Recording System 69 6.1 Communication between Recording Platform and Computer . . . 69
6.2 System Assembling . . . 71
7 Conclusion 75 References 79 A MATLAB Code 89 A.1 Graphical User Interface Code . . . 89
B Microcontroller Code 107 B.1 Main Function Code . . . 107 B.2 UART Protocol Code . . . 115
3.1 Summary of clustering algorithms characteristics. . . 34
3.2 Distance measures used in Template Matching . . . 35
4.1 First stage selected components values. . . 42
4.2 Second stage selected components values. . . 43
2.1 Locations of body sensation and motor related areas. . . 6
2.2 Somatotopic representation of (a) sensory and (b) motor outputs in the cortex. . . 8
2.3 Anatomical diagram from neuron. . . 10
2.4 Membrane electrical circuit model. . . 12
2.5 Illustration of the change in membrane potential during a typical intra-cellular recorded action potential. . . 13
2.6 Neural activity recording methods. (a) Electroencephalography. (b) Elec-trocoticography. (c) Extracellular recordings using multielectrode arrays. . 15
2.7 Variation in the observed extracellular action potential profile from a pyramidal cell with spatial position. . . 17
2.8 Extracellular recording illustration. . . 18
2.9 Illustration of the volume conductor theory. . . 19
2.10 Simultaneous intracellular and extracellular recording from a pyramidal cell. . . 20
2.11 Electrical equivalent circuit of the cell-electrode interface. . . 22
3.1 Illustration of Spike sorting process. . . 26
3.2 Trade-off between Power & GBP and power & input-referred noise for different neural amplifiers. . . 27
3.3 Schematic of a typical neural amplifier. . . 28
3.4 (a) Ten seconds of a continuous recoding from the medial temporal lobe of a human subject. (b) The same recording after band-pass filtering and amplitude threshold representation. . . 29
3.5 Representation of three different detection methods. (a) absolute value; (b) NEO; (c) SWTP . . . 31
3.6 Alignment methods. . . 32
3.7 Trade-off between accuracy and normalized computational cost related to Feature Extraction and Detection Process . . . 33
3.8 Example results from clustering 30s of real data. . . 34
3.9 Block diagram of the Spike Sorting – Template Matching process. . . 35
3.10 Overview of the synthetic data simulation method. . . 37
4.1 Architecture of the Analogue Front-End (AFE), consisting of a low noise amplifier (LNA), post amplifier and filter. . . 41
4.2 Pre-amplifier schematic. . . 42
4.3 Post-amplifier schematic. . . 43
4.4 Neural amplifier schematic. . . 44
4.5 Output system when the input is a sinewave with amplitude of 4mVpp. . . 45
4.6 Impulse response analysis. (a) Simulated circuit; (b) Input signals:
Rect-angular Impulse; (c) System Output. . . 46
4.7 Impulse response analysis. (a) Simulated circuit with active reset state; (b) Input signals: Rectangular Impulse and system Output. . . 47
4.8 Bode Plots: magnitude response and phase response. . . 48
4.9 Input voltage-noise density based on OPA322 noise model. . . 49
4.10 Board layers and PCB design rules. . . 50
4.11 Board illustration. . . 51
4.12 Linear Voltage Regulated Circuit schematic. . . 52
4.13 Power source illustration. . . 53
4.14 VDD divider circuit schematic. . . 53
4.15 One-channel schematic. . . 54
4.16 (a) Voltage Reference is defined by the VDD divider circuit. (b) Voltage Reference is defined by the user. . . 55
4.17 Board Pins . . . 56
4.18 Pins compatibility of Recording, Stimulation Systems and KL26Z micro-controller. . . 57
4.19 Amplifier output. . . 58
4.20 Single sided amplitude spectrum in Vrms. . . 59
4.21 Representation of noise amplitude. . . 60
4.22 Single sided amplitude spectrum in Vrms from noise signal. . . 60
5.1 Graphical User Interface for template builder and real-time spike display. 62 5.2 (a) Pop-up menu to choose the channel. (b) Modal dialog box to choose the reset mode state. . . 62
5.3 Calibration algorithm. . . 64
5.4 Graphical User Interface where can be seen templates and the spikes identification provided by the microcontroller. . . 65
5.5 Template matching algorithm used to perform on-line spike sorting in KL26Z platform. . . 67
5.6 Real-time template matching results. . . 68
6.1 Data transfer representation. . . 70
6.2 USB RS232 cable. . . 71
6.3 Components that constitute the Embedded Platform for Neural Record-ing and Real-Time Template MatchRecord-ing. . . 71
6.4 PCB board illustration. (a) PCB board before soldering. (b) Final PCB board. . . 72
6.5 Global recording system consisting of the front-end board and the Kl26Z platform. . . 73
ADC Analog-to-Digital Converter AFE Analogue Front-End
CNS Central Nervous System DD Discrete Derivative
DWT Discrete Wavelet Transform ECoG Electrocorticography
EEG Electroencephalography FFT Fast Fourier Transform FP False Positives
GBP Gain-Bandwidth Product
GND Ground
GUI Graphical User Interface IC Integrated Circuit IT Integral Transform LFP Local Field Potentials LNA Low Noise Amplifier LSB Least Significant Bit M1 Primary Motor Cortex MEA Multielectrode Arrays MEG Magnetoencephalography MUA Multi-Unit Activity
NEO Nonlinear Energy Operator
OTA Operational Transconductance Amplifier PCA Principal Component Analysis
PCB Printed Circuit Board
S1 Primary Somatosensory Cortex SAR Successive Approximation Register SMD Surface Mounted Devices
SUA Single-Unit Activity
SWTP Stationary-Wavelet-Transform Product THD Total Harmonic Distortion
TP True Positives USB Universal Serial Bus
Introduction
Brain research progressed tremendously over recent decades, but understanding how cortical networks encode and decode information is still an open issue. Extracellular recording of brain activity is an important method for examining the nervous system. The recorded signals typically consist of action potentials from several neurons adjacent to the electrode tip. However, the signal is often contaminated by noise from distant neuron activities, as well as from the signal recording system [1]. Isolate spikes from the background noise and perform proper classification of action potentials from extracellular recordings is essential for making an accurate study of neuronal behavior. This process, known as Spike Sorting, is the grouping of spikes into clusters based on the similarity of their shapes and the end result of it is the determination of which spike corresponds to which neuron. By looking at brain activity at the neuron level, researchers can link brain activity to behaviour and create neuronal maps describing flow of information through the brain. For example, Boraud et al. report the use of single-unit recordings to determine the structural organization of the basal ganglia in patients with Parkinson’s disease [2].
Another topic of large interest to the neuroscience community is how to develop a real time spike sorting platform. The ability to record and sort in real time would enable new real time control and bio-feedback applications such as neural prosthetics.
Traumatic lesions of the central nervous system as well as neurodegenerative disorders continue to inflict devastating, and so far irreparable, motor deficits in large numbers of patients. Paralysing disorders severely limit independence, mobility and communication.
Restoring motor function can be possible when movement-related areas of the brain are still intact. As has been demonstrated in several studies arm movement is well represented in populations of neurons recorded from the motor cortex [3], so a neural interface system could restore mobility and independence for people with paralysis by translating neuronal activity directly into control signals for assistive devices.
The core of neural prosthetics systems relies on the detection and processing of brain activity involved in the planning and execution of movement intentions [4]. A first and crucial step in any neuroprosthetic system is to obtain reliable recordings from the particular area of interest. The interfaces for such recordings are constantly under de-velopment to provide long lasting recordings of good quality signals. Then, the recorded signals are processed using spike sorting algorithms, which allows the identification of the spikes of individual neurons. The activity of these neurons, in turn, provides the input to the decoding algorithm, which processes this data to send the information of the desired movement intention to the robotic arm.
This research is aimed at developing an Embedded Platform for Neural Recording and Real-Time Template Matching, providing an important tool for further neuroscience research once the system presents a front-end amplification circuit board for neural signal recording that allows to measure not only spikes but also Local Field Potentials. In this project a Template Matching implementation is also presented. This method consists of selecting a characteristic spike shape for each neuron and then classifying the remaining spikes of the signal according to the similarity of the spikes shape. This algorithm is automatic, i.e does not need human supervision, and presents low computational complexity which makes it suitable for hardware implementations. This technique is used in this system to extract templates from filtered and amplified neural data and to perform on-line spike sorting.
The overall system is based on MATLAB software and KL26Z platform and has three different sub-blocks: (i) Front-end amplification circuit board for neural signal recording; (ii) a MATLAB Graphical User Interface (GUI) for template building and real-time spike display; and (iii) A firmware based on KL26Z microcontroller platform for real-time spike sorting. All sub-blocks were integrated together to record neural signal and perform on-line template matching during measurements.
This dissertation is organized in the following way. Chapter 2 provides background information about neuroanatomy, neurophysiology and neural activity recording. These chapters focus not only on the neuron structure and the organization of the motor cortex, but also on the propagation of the action potentials. The attributes of all the signals that are present in extracellular recordings and methods that can be used to observe activity in the brain are also defined. In Chapter 3 a state of the art of spike sorting process is presented. Algorithms, circuits and systems used in neuroscience research designed specifically for extracellular recordings are reviewed. Chapter 4 describes the front-end amplification circuit board for neural signal recording and Chapter 5 refers to the software development. In Chapter 6, the overall recording system is shown. Chapter 7 contains a few concluding remarks.
Background
The basic signaling unit of the nervous system is the neuron which processes and trans-mits information. The interactions between these electrically excitable cells enable peo-ple to think, move, maintain homeostasis, and feel emotions.
The analysis of electrical signals recorded from the brain has been a major force behind the progress in our understanding of this organ. Depending on the recording method used, i.e. EEG, ECoG, extracellular recordings, the level of resolution and invasiveness varies. Usualy the resolution increases with the invasiveness.
In this Chapter the brain’s anatomy, neuron physiology and properties of these cells will be described. The recording methods used to measure the electric activity of the brain and the possible noise sources of this measurements will be also reported.
2.1
Neuroanatomy and Neurophysiology
The Central Nervous System (CNS) is responsible for processing information received from all parts of the body. It consists of two parts: the brain and the spinal cord. As this thesis is focused on brain recordings only brain’s anatomy will be briefly described. Neuron properties will be also reported in this section.
2.1.1 Cerebral Cortex
The cerebral cortex is the layer of the brain, often referred to as gray matter, which covers the outer portion of the cerebrum. It consists of folded bulges called gyri that create deep fissures called sulci [5]. The folds in the brain are quite convenient since they increase its surface area and thus increase the amount of gray matter and the quantity of information that can be processed.
The cerebral cortex is divided into right hemisphere and left hemisphere, and although many functions, such somatic sensitivity, are represented bilaterally, some functions, such as language, are often lateralized in one of the hemispheres (the left one in the case of language). The cerebral cortex is also divided in lobes which are roughly responsible for specific subsets of functions. The Frontal lobe is responsible for decision-making, problem solving and planning. The Temporal lobe is involved with memory, hearing, emotion and language. The occipital lobe is related with vision function and the Parietal Lobe is associated to the reception and processing of sensory information from the body [5].
The cerebral cortex is also divided into different areas according to the Brodmann’s map of cytoarchitectonics. Brodmann [14] assigned numbers to various brain regions by analyzing each area’s cellular structure starting from the central sulcus.
In order to control motor prosthesis using extracellular recordings a couple of neural cortex areas are particularly important: Primary Somatosensory Cortex and Motor Cortex. Figure 2.1 illustrates the sensory and motor areas that will be briefly described in this section.
2.1.1.1 Somatosensory Cortex
Primary somatosensory cortex (S1), illustrated in Figure 2.1 as areas 3,1,2, is located in the Parietal Lobe in a structure called the post central gyrus [15] . This region of the brain usually receives nerve signals from the sense of touch, processing it to provide a cohesive perception of the body and the physical environment [16].
There is other area called the secondary somatosensory cortex, Brodmann area 40, which receives input from the senses and is located in the lower parietal lobe [14].
Information from both sections goes to the somatosensory association cortex, areas 5 and 7, located in the superior parietal lobe [14]. In these areas associations between different senses are often processed. Damage results in inability to discriminate the properties of tactile stimuli or to identify objects by touch [17].
2.1.1.2 Motor Cortex
The motor cortex comprises three different areas of the frontal lobe, immediately anterior to the central sulcus.
The primary motor cortex (M1), area 4, is in the precentral gyrus. Like the somatosen-sory cortex, the primary motor cortex is somatotopically organized as is illustrated in Figure 2.2. The M1 does not usually control individual muscles directly, but rather appears to control individual movements or sequences of movements that require the activity of multiple muscle groups. This area is responsible for the force, direction and speed of movement. It also encodes the extent of movement [18].
The premotor cortex, area 6, is located immediately anterior to the motor cortex and sends information to the primary motor cortex as well as to the spinal cord directly [19]. It performs more complex, task-related processing than primary motor cortex. The premotor cortex is involved in the selection of appropriate motor plans for voluntary
Figure 2.2: Somatotopic representation of (a) sensory and (b) motor outputs in the cortex. Extracted from [5].
movements, whereas the primary motor cortex is involved in the execution of these voluntary movements.
The supplementary motor area, superiomedial part of area 6, is a part of the premotor cortex that extends onto the medial side of hemisphere. This area becomes active before movement and is involved in the planning of complex movements and in coordinating two-handed movements [20]. Lesions of this area can cause inability to initiate motions, called abulia [21].
2.1.2 Neural Cells
There are two distinct classes of cells in the Nervous System, neural cells, most known as neurons, and glial cells [5]. Neurons are electrically excitable cells which process and transmit information. The interactions between these cells enable people to think, move, maintain homeostasis, and feel emotions.
Glial cells are categorized as microglia and macroglia [5, 15]. Microglia are phagocytic cells which are mobilized after injury, infection, or disease. They are derived from macrophages and are unrelated to other cell types in the nervous system. The three types of macroglia are oligodendrocytes, astrocytes, and Schwann cells. The oligodendrocytes and Schwann cells form the myelin sheaths that insulate axons and enhance conduction of electrical signals along the axons. Apart from the described functions, Glia cells have an important role in nervous system, they are support elements, providing structure and separating and insulating groups of neurons.
In this section the neuron physiology and properties of these cells will be described.
2.1.2.1 Physiology [5]
Figure 2.3 shows the diagram of a typical neuron where the three main parts can be identified: cell body, or soma, which contains the nucleus of the cell and keeps the cell alive; dendrite which collects information from other cells and send it to the cell body; and the axon, a long segment fiber which transmits information from the cell body to the terminals buttons where the information is transmitted to other cells (neurons or to the muscles and glands).
Axon
The outgoing signal to other neurons flows along the axon. To improve the speed of their communication, and to keep their electrical charges from shorting out with other neurons, axons are often surrounded by a myelin sheath. The myelin sheath is a layer of fatty tissue surrounding the axon of a neuron that both acts as an insulator and allows faster transmission of the electrical signal. Axons branch out toward their ends, and at the tip of each branch is a terminal button. These structures contain neurotransmitters that are the chemical medium through which signals flow from one neuron to the next at chemical synapses.
Dendrites
Some neurons have hundreds or even thousands of dendrites, and these dendrites may themselves be branched to allow the cell to receive information from thousands of other
cells. When they are stimulated they generate electric signals that flow to the cell body.
Synapses
Synapses are connections between neurons through which information flows from one neuron to another. The communication between two neurons can be accomplished by the movement of electrical or chemical signals across the synapse, thus there are two different classes of synapses: 1. Electrical synapses and 2. Chemical synapses. At elec-trical synapses, two neurons are physically connected to one another through protein structures called gap channels. Gap junctions permit changes in the electrical properties of one neuron to effect the other, and vice versa, so the two neurons essentially behave as one. At chemical synapses, the presynaptic neuron and the postsynaptic neuron are physically separated by the fluid-filled synaptic cleft. The arrival of an action poten-tial in the presynaptic neuron causes it to release neurotransmitter. Neurotransmitter diffuses across the cleft and binds to receptors on ion channels. This causes the ion chan-nels to open. The influx of ions causes a synaptic potential in the postsynaptic neuron. Chemical neurotransmission requires neurotransmitters to act as chemical messengers linking an action potential in one neuron with a synaptic potential in another.
2.1.2.2 Properties of Neural Cells
The plasma membrane separates the neural cell from its external environment, con-sisting of a phospholipid bilayer and associated proteins. Some of these proteins are the constituents of pumps and channels that exchange ions between intracellular and extracellular space.
In this section a brief explanation for the origin of neural cells electrical properties will be done.
Membrane
The plasma membrane not only has selective permeability to individual neurons but also has the ability to rapidly increase or decrease the permeability selectively by means of channels gates which respond to the presence of electric fields or to certain ligands. Ion movement across the membrane is subject to both diffusion and electric field forces [7].
Ion Channels and Pumps in the membrane
Ion channels and pumps play a central role in the transmission of electrical signals along the membranes of neurons and other excitable cells. Channels allow the flow of each ion type down its concentration gradient. On the other hand pumps are active processes that move ions against the concentration gradient spending energy in this process.
In 1952 a huge improvement in neural cells electrical properties knowledge was achieved by Hodgkin and Huxley [8]. Through in vivo experiments on a squid giant nerve fiber, they introduced a statistical description of the neural cell membrane. As can be seen in the Figure 2.4, each component of the plasma membrane was represented by an electric component accordingly their real behavior. Cm represents the lipid bilayer, Vm is the
transmembrane potential, gk, gN a, and gCl are the voltage-dependent ion channels from
K+, Na+ and Cl− respectively and Ek, EN a and ECl represents the electrochemical
gradient (Nernst potential). This model was crucial to understand action potentials and allowed to mathematically define them propagation as is described is the next section.
Figure 2.4: Membrane electrical circuit model. Extracted from [7].
2.1.2.3 Action Potential
An action potential is a series of sudden changes in the electric potential across the plasma membrane of excitable cells such as neurons, with duration of approximately 1ms [5]. Action potentials allow long-distance signaling in the Nervous System.
Resting State
When a neuron is in the resting state, the electric potential across the membrane is approximately -70mV [9] where the inside is negative relative to the outside. This value results from the concentration of positively and negatively charged ions. In resting state, the plasma membrane of the neuron is semipermeable, being highly permeable to K+ and slightly permeable to Cl− and Na+. In the extracellular fluid there is a high
concentration of Na+ and a high concentration of Cl−, as well as small quantities of impermeant anions such as bicarbonate, phosphate, and sulfate can be found. In the cytoplasm, K+ concentration is high. The sodium-potassium pump tends to operate at a steady state rate and despite its slow working rate, maintains the concentration differences of Na+ and K+ between extracellular and intracellular space [7].
Osmotic balance is also maintained between the extracellular fluid and the cytoplasm by movement of water through the plasma membrane when the total concentration of particles on one side is not equal to that on the other.
Active State
The influx and outflux of ions, that occur through ion channels during neurotransmission, will make the inside of the target neuron more positive, hence depolarized. For example, when the cell is depolarized by excitatory synaptic input, the Na+channels are activated and, due to concentration gradient, this ions rush into the cell. This influx causes to become the membrane even more depolarized and more Na+channels are opened. When this depolarization reaches a point of no return called the threshold, a large electrical signal is generated.
After the membrane reaches the depolarization peak, about 40mV [7], Na+ channels are closed and K+ flow out of the cell along the concentration gradient. At this stage, membrane begins to repolarize and continues until the cell return to its resting potential.
Typically the repolarization phase of an action potential results in hyperpolarization, the membrane potential became more negative than the resting potential. Hyperpolarization occurs because some of the K+channels remain open to allow the Na+ channels to reset, since these channels are slow. This excessive amount of K+ causes hyperpolarization so the Na+ channels open to bring the potential back up to resting potential.
After each action potential, there is a period when no action potential can be induced [7]. This period is the refractory period and it fixes a limit to the maximum spiking rate.
Figure 2.5: Illustration of the change in membrane potential during a typical intra-cellular recorded action potential. Adapted from [13].
Hodgkin and Huxley [8] developed an equation model for action potential initiation and propagation along the nerve which was based on a circuit model of cell membrane (Figure 2.4). Their model describes the total membrane current per unit area Im as the
sum of the ionic currents Iionic and capacitive current Ic(Equation 2.1).
Im(t) = Iion(t) + IC(t) (2.1) Iion(t) = X In(t) = IN a(t) + IK(t) + IL(t) (2.2) In(t) = gn(t, Vm) × (Vm(t) − En) (2.3) IC(t) = Cm dVm(t) dt (2.4)
Iion can be calculated by the sum of the currents through each of the ion channels, as it
is represented in Equation 2.2, where IN aand IK represent current through sodium and
potassium channels and IL is the leakage current which represents the current though
less significant ion channels. As can be seen in Equation 2.3, each of ionic currents can be calculated from the conductance of the ionic channel and the potential difference between membrane potential Vm and Nernst Potential En. The capacitive current Ic
represents the change of charge inside the cell and is given by Equation 2.4.
2.2
Neural Activity Recording
The brain has been a matter of interest since ever. In order to investigate the electric activity of the brain numerous recording methods emerged in the last century such as Electroencephalography (EEG), Electrocorticography (ECoG), Magnetoencephalogra-phy (MEG), extracellular recordings using Multielectrode Arrays (MEA) and intracel-lular recordings. These methods will be briefly described in this section.
2.2.1 Electroencephalography
Electroencephalography is one of the oldest and most widely used methods to record neural activity. It was discovered by the German psychiatrist Hans Berger in 1929
Figure 2.6: Neural activity recording methods. (a) Electroencephalography [24]. (b) Electrocoticography [25]. (c) Extracellular recordings using multielectrode arrays [26]. These methods resoluton increases with invasiveness.
[27] and represents a historical innovation in this field providing a new neurologic and psychiatric diagnostic tool at the time. Nowadays it is still important in the diagnostic of seizures [28], brain tumors [29], degenerative brain changes [30], and other diseases. In this method electrodes are placed on the scalp and record activity occurring on the surface of the brain. The measured activity is a spatiotemporally smoothed version of the Local Field Potential (LFP). The spatial resolution is severely affected by the distortion and attenuation effects of the tissue between current source and the recording electrode [31].
2.2.2 Magnetoencephalography
In the case of magnetoencephalography (MEG), recording probes are also placed near the scalp. This method uses superconducting quantum interference devices (SQUIDS) to measure small magnetic fields outside of the skull from currents generated by neurons. MEG is a non-invasive method and has a relatively high spatiotemporal resolution ( 1 ms, and 2–3 mm) [33].
2.2.3 Electrocorticography
Electrocorticography (ECoG) was pioneered in the early 1950s by Wilder Penfield and Herbert Jasper during research to identify epileptogenic zones [35].
ECoG records electric activity directly from the exposed surface of the cerebral cortex, avoiding the signal distortion and attenuation from the skull and the intermediate tissue.
An advantage of ECoG over MEG and scalp EEG is that intracranial recordings are not so susceptible to artifacts from muscle movements and eye blinks, which regularly impair the quality of MEG and EEG recordings, especially during language production.
2.2.4 Extracellular Recordings
Extracellular recordings consist of neural signal recorded from implanted microelectrodes into the brain cortex. These multielectrode arrays are responsible for recording and conducting neural signals from neurons in the cortex with high speed and spatiotemporal resolution. This makes it possible to record single-unit activity of neurons. Thereby it is possible to assess the relationship between brain structure, function, and behaviour. By looking at brain activity at the neuron level, researchers can link brain activity to behaviour and create neuronal maps describing flow of information through the brain. Over the past decade, extracellular recording has been used in medical technologies for the treatment of disorders such as paralysis [38], epilepsy [39] and cognitive and memory loss [40].
Signals provided by extracellular recordings are used in this thesis. For that reason these signals will be briefly described in this section.
2.2.4.1 Recorded Signals
Three types of neural signal can be recorded: Multi-Unit Activity (MUA), Single-Unit Activity (SUA) and Local Field Potentials (LFP). MUA and SUA can only be recorded using extracellular recordings. All the others methods described above are smoothed versions of Local Field Potentials. This work is focused on signals from extracellular recordings, thus the composition of the recorded signal using extracellular electrodes will be described.
Single-Unit Activity
In the presence of a microelectrode the action potential can be recorded. This activity is referred as Single-Unit Activity and corresponds to the electrical activity from individual
neurons. The signal-to-noise ratio is good enough to distinguish the activity of each single unit for neurons located approximately 100 µm from the electrode tip [42].
In order to obtain this component from the extracellular recording, the signal should be bandpass-filtered with a low cutoff frequency of 300Hz and a high cutoff frequency of 5kHz [43, 45].
Extracellular recorded action potentials are also called Spikes. The shape of each spike is normally considered to be constant for a give neuron. It depends on some cell proprieties such as the cell type and the cell geometry, as well as the distance of the electrode from cell and position of the recording electrode relative to the cell [43, 45]. In Figure 2.7 the variation in the extracellular action potential profile with spatial position of the electrode is shown. As can be observed the amplitude of the recorded spikes is reduced by the distance and varies between 25µV and 1mV [42].
The research presented in this thesis focuses on extracting single-unit activity from extracellular recordings in real time.
Figure 2.7: Variation in the observed extracellular action potential profile from a pyramidal cell with spatial position. Extracted from [41].
Multi-Unit Activity
For more distant neurons, up to approximately 150µm from the electrode tip [41], spikes can be detected but the difference in their shapes is masked by the noise and they are grouped in multi-unit activity.
Since the frequency range of MUA is similar to SUA, they cannot be removed from the recorded signal using filtering techniques. However, their amplitude is much lower than SUA amplitude. With this in mind is possible to identify this type of signal.
Figure 2.8: Extracellular recording illustration. For neurons located approximately 50–100µm from the electrode tip, the signal-to-noise ratio is good enough to distinguish single unit activity. For more distant neurons, up to approximately 150µmm from the tip, spikes can be detected but the difference in their shapes is masked by the noise and they are grouped together in a ‘multi-unit’ cluster. Spikes from neurons further away from the tip cannot be detected and contribute to the background noise. Extracted from [42].
Local Field Potentials
Local Field Potentials are the low-frequency part of the electrical potential recorded by an extracellular electrode into the brain. This component frequency range is 0.5Hz to 300Hz and their amplitude varies between 50µV and 3mV [45]. The neural origin of recorded LFP is still not fully understood, however it is believed that LFPs derive from the superposition of the electric field from all ionic processes but synaptic input and
the associated return currents dominate cortical LFP [42, 43]. LFP biophysical origin is described by the volume conductor theory [48], in which the extracellular medium is treated as three dimensional continuum. In this theory the contribution to the extra-cellular potential φ(re,t) from the activity of an N-compartment neuron model varies
according to the following fundamental formula:
φ(re, t) = 1 4πσ N X n=1 In(t) |re− rn| (2.5)
In this equation In(t) is the transmembrane current in compartment n positioned at rn.
|re-rn| is the distance between the compartment and the electrode positioned at re. σ is
the extracellular conductivity which value is around 0.3-0.4Sm−1 [74] for cortical grey matter.
Figure 2.9: Illustration of the volume conductor theory. Extracted from [50].
Extracellular recorded LFPs provide information about the collective behavior of aggre-gates of neurons, and it has thus been used to investigate network mechanisms involved in sensory processing, motor planning and higher cognitive processes such as memory, attention and perception.
2.2.5 Intracellular Recordings
Intracellular recording is the measurement of voltage or current across the membrane of a cell. It typically involves an electrode inserted in the cell and a reference electrode outside the cell. Hodgkin and Huxley used that recording technique to develop their quantitative theory of the action potential based on voltage-dependent ionic currents [8], for which they were awarded the Nobel Prize for physiology or medicine in 1963.
Figure 2.10 shows that the extracellular unit waveform resembles the first derivative of the intracellular action potential [37].
Figure 2.10: Simultaneous intracellular and extracellular recording from a pyramidal cell. Extracted from [37].
2.2.6 Microelectrode Model
The knowledge about the cell-electrode interface, for example how the electrode con-tributes to the environment noise, is essential to the design of the neural amplifier, therefore an electrical model of the cell-electrode [51] is briefly explained in this section.
The electrode is the interface between the human body and the prosthetic device used for electrophysiological research. The fundamental process occurring at the electrode-electrolyte interface is charge transduction between electrons of the metallic electrode and ions of the electrolytic species.
The microelectrode model represented in Figure 2.11 describes the electrical equivalent circuit of the cell-electrode interface. The cell membrane model consists of a capacitance CM in parallel with a resistance RM. VM is the electrical potential in the cell and Chd
represents the cell membrane-electrolyte interface capacitance. The extracellular space is also modelled by a set of resistors, RS1, RS2, RS3, which sum represent the spreading
resistance from the electrode out into the solution:
Rspread= RS1+ RS2+ RS3∼=
ρs
4Rel
(2.6)
Where Rel is the radius of a circular disk electrode and ρs is the resistivity of the
electrolyte. In case the electrode is sealed by the cell the resistance between the cleft and the solution, the sealing resistance Rseal, is equal to RS2 and described by:
Rseal= RS2∼=
ρ
θπd (2.7)
Where d is the average distance between the cell and the electrode and θ is a geometry related correction factor. RS3 and RS1 are neglected in this model once the electrolyte
solution is considered to be constant and Rel d and thus Rseal Rspread. The model
of the electrode includes a charge transfer resistance Rctin parallel with constant-phase
angle impedance ZCP A, which symbolizes the interface capacitance. VS is the potential
that is sensed by the amplifier which input impedance is represented by Zload.
The relation between the intracellular voltage Vm and the voltage that is measured by
the amplifier VS is described by the following transfer function:
H(j, ω) = RsealZload
RsealZm+ (Rseal+ Zm) + (Zel+ Zload)
(2.8)
Where Zm is the membrane impedance and Zel is the electrode impedance. As can be
observed in Equation 2.8 electrode-electrolyte impedance is one of important charac-teristic for neural recording applications due to its influence on the signal/noise ratio
and signal distortion. The neural amplifier’s input impedance, Zload, is an important
parameter that should be taken into account in the design process.
Figure 2.11: Electrical equivalent circuit of the cell-electrode interface. Extracted from [51].
2.2.7 Noise Sources
The neural signal that a neural recording system detects is an attenuated and noisy signal. During neural amplifier’s design it is required to understand the noise sources in order to develop a strategy to minimize its effects. There are several noise sources as is described below. One of most important noise source is the thermal noise generated by the electrode-tissue which is described by the Johnson-Nyquist thermal noise relation [52, 53]:
V rms =p4kT RelB (2.9)
Where k is Boltzmann’s constant, T the absolute temperature, Rel the microelectrode
resistance that is the real part of the effective electrode impedance and B the signal bandwidth. As can be deduced by the Equation 2.9 the thermal noise is proportional to electrode impedance that is determined by the material characteristics and the electrode
surface area. Metal electrodes generally have better noise performance than glass mi-cropipette electrodes [54], once the impedance of a metal electrode is largely capacitive [55], resulting in a smaller resistance to generate thermal noise.
In case the electrodes are chronically implanted, the electrode surrounding tissue forms a low-conductivity encapsulation in response to the foreign body. This biological reaction increases the electrode-tissue interface impedance and thus increases the thermal noise [56].
Biological noise is also a noise source which is due to the electrical activity of other cells around the recording electrode, mainly due to action potentials of distant cells but also ionic activity [54].
The electronic circuits themselves generate noise that adds up to the total recording noise, thus the neural amplifier should be designed in order to minimize it. Besides the additional noise of power-line interference should be taken into account.
State-of-the-Art of Neural Spike
Sorting
As mentioned in previous chapters, this work intends to present an embedded platform for neural recording which goal is to amplify and process single neuron activity in order to obtain timing and spatial information about each neuron.
Measuring the activity of individual neurons accurately can be difficult due to large amounts of background noise and the difficulty in distinguishing the action potentials of one neuron from others in the local area. In order to achieve this goal, the recorded signals are processed using spike sorting algorithms. The final purpose of this process is matching the waveform of each measured spike with the neuron where the spike was generated.
In a conventional system, the analogue front-end provides the signal amplification, fil-tering and digitization. The extracellular data is first band-pass filtered to remove Low Field Potentials and high-frequency noise and then this data is sent to the signal-processing chain summarized in Figure 3.1. This procedure starts with the continuous data and finishes with the classified spike shapes.
In this Chapter a bibliographic review will be done, where each step of spike sorting process will be described.
Figure 3.1: Illustration of Spike sorting process. Step i) The continuous raw data is band-pass filtered, between 300 Hz and 3000 Hz, and the digital conversion is performed. Step ii) Spikes are detected, usually using an amplitude threshold. Step iii) Relevant features of the spike shapes are extracted, thus giving a dimensionality reduction. Step iv) These features are the input of a clustering algorithm that performs the classification. Adapted from [62].
3.1
Analogue Front-End and Data Conversion
Neural signals recorded extracellularly have small amplitudes consequently the signal must be amplified before can be digitized and processed. To perform proper amplification the neural amplifier must [63]:
1. be low noise to resolve small spikes.
2. have high gain to amplify the signal sufficiently for posterior signal processing.
3. filter the signal according to the frequency bands of interest
4. have good linearity (THD<1%) to avoid distortion of the spikes.
5. block dc-offset introduced by the electrode-tissue interface.
6. have higher input impedance than the electrode-tissue interface.
Significant progress has been made in neural amplifiers. These systems intend to main-tain gain and bandwidth and reduce the input referred noise and the power consumption. Figure 3.2 illustrates a trade-off between power and Gain-Bandwidth Product (GBP) and power and input-referred noise for different amplifiers. As can be observed the input referred noise reports values between 1.66µVRMS and 20.6µVRMS [67].
As previously mentioned, there are several topologies available for the front-end ampli-fier [66] many of which are based on the R. Harrison design [60, 61] that will be described
Figure 3.2: Trade-off between Power & GBP and power & input-referred noise for different neural amplifiers. Extracted from [67].
in detail. He reported a neural signal amplifier, illustrated in Figure 3.3, where a capac-itive coupling design is presented in order to eliminate the dc-offset introduced by the electrode-tissue interface and the midband gain of the amplifier is defined by C1 and C2.
AM = −
C1
C2
(3.1)
This design is based around an operational transconductance amplifier (OTA) and in-troduced the use of pseudoresistors (MOS-bipolar element). These components have a particularly large resistance (> 1012Ω) enabling the neural amplifier to record very low-frequency signals (i.e. LFP). The lower cutoff low-frequency and the upper cutoff low-frequency are determined by the Equation 3.2 and Equation 3.3 respectively.
fL= 1 2πR2C2 (3.2) fH = Gm 2πCLAM (3.3)
Where R2and C2are the components from the feedback circuit, Gmis the OTA
transcon-ductance, AM is the midband gain and finally CL corresponds to the load capacitance.
The input referred noise of the amplifier is strongly dependent on the OTA input referred noise as is evidenced in the following equation:
Vnoise,amp =
C1+ C2+ Cin
C1
Where Cinrepresents the input capacitance of the OTA and vnoise,OT Ais the OTA input
referred noise.
Figure 3.3: Schematic of a typical neural amplifier. Extracted from [64].
Concerning data conversion, the most used analogue-to-digital converter (ADC) topol-ogy is the successive approximation register (SAR) [78]. Most neural recording systems use sampling rates between 16-32kS/s with resolutions of 8-12 bits [79].
3.2
Spike detection
The goal of the spike detection is to search for action potentials on the filtered data or a signal derived from the filtered data. This process can be implemented either in the analogue or digital domain. In this thesis only the digital domain will be described.
Action potentials are characterized by localized high frequencies and increase of instan-taneous amplitude, thus spike detection algorithms usually involve application of an amplitude threshold. Alternatively the signal is preprocessed using activity enhancing operators in order to highlight the spike features relative to background noise.
3.2.1 Positive threshold
In this method the threshold is directly applied in the filtered signal as can be observed in Figure 3.4. The threshold can be set manually, e.g. as a multiple of the standard
deviation of the signal [82], as done in most on-line spike detection, however an automatic threshold is desirable. An unsupervised method was proposed by R. Q. Quiroga et al. [83] and the threshold was set to:
T hr = 4σn , σn= median
|x|
0, 6745 (3.5)
Where x is the filtered signal and σn is an estimate of the standard deviation of the
background noise. Slightly variations on the threshold (3-5σn) generate similar results
[85].
Figure 3.4: (a) Ten seconds of a continuous recoding from the medial temporal lobe of a human subject. (b) The same recording after band-pass filtering and amplitude threshold representation. Extracted from [84].
3.2.2 Absolute Value
The absolute value method is similar to the positive threshold however it simultaneously thresholds the positive and the negative part of the signal. The threshold is set as described before to the Positive Threshold method.
3.2.3 Nonlinear energy operator
An algorithm that is very often used to process the data before the application of the threshold is NEO, Nonlinear energy operator [80]:
N EO[x(t)] = dx(t) dt 2 − x d 2x(t) dt2 (3.6)
Where x(t) is the sample of the waveform at time t. In discrete time NEO is described as:
N EO[x(n)] = x(n)2− x(n + 1).x(n − 1) (3.7)
The output of the NEO is proportional to the product of the instantaneous amplitude and frequency of the input signal, thus this method highlights the action potential peak and provides a better performance for spike detection than simple thresholding. Spikes are then identified in NEO output signal using the following threshold:
T hr = C 1 N N X n=1 N EO[x(n)] (3.8)
Where N is the number of samples in the signal and C=8 by experiments described in [62].
3.2.4 Stationary-Wavelet-Transform Product
The Stationary-Wavelet-Transform Product (SWTP) is used for the detection of signals with noise and it is now applied to spike detection [81]. The SWTP is calculated at 5 consecutive dyadic scales and then the scale 2jmax with the largest sum of absolute values is calculated. jmax = argmax j{3,4,5} N X n=1 |W (2j, n)| ! (3.9)
After that the point-wise product P(n) between SWT at this scale and the SWT at the two previous scales is found and is then, to remove false peaks, it convolved with a Barlett window ω(n). jmax = jmax Y j=jmax−2 |W (2j, n)| (3.10)
Spikes are then identified in the SWTP output signal using the threshold stated below. Where N is the number of samples in the signal and C=2 by experiments described in [62]. T hr = C 1 N N X n=1 ω(n) ∗ P (n) (3.11)
Figure 3.5: Representation of three different detection methods. (a) absolute value; (b) NEO; (c) SWTP. Extracted from [88].
3.3
Spike Sorting
Spike sorting has become an important tool to study neural activities and brain functions in neuroscience research and, for example, in cortically-controlled neuroprosthetics for disability people. The traditional process consists in three main steps: alignment, feature extraction and clustering. These algorithms are complex and thus are not suitable for hardware implementation, so in this section it is also presented an alternative process to perform spike sorting which is a template matching technique.
3.3.1 Alignment
After detection, a window is applied and the spike waveform is stored. At this stage, each spike is aligned by the detection point (i.e. the point where the threshold crossed the signal) however there is a great possibility of the maximum and minimum of similar spikes are mismatched which could jeopardize spike classification. Therefore recorded spikes should be aligned to a common reference.
There are two common methods to perform temporal alignment: 1. Align each spike to the absolute maximum spike amplitude point [1]. 2. Align to the point of maximum slope [87].
Figure 3.6: Alignment methods. (a) Alignment to maximum amplitude. (b) Align-ment to maximum slope. Extracted from [88].
3.3.2 Feature Extraction
In order to better separate spikes from each other, spikes are transformed to a feature space. Feature extraction involves simplifying the amount of resources required to de-scribe a large set of data accurately. This process emphasizes the difference between waveforms and reduces the dimensionality of these differences, which serve as input to clustering.
Feature Extraction simplifies the sorting process of spikes by selecting the features that best describe them. Some basic features include the peak amplitude, width and energy. However, it has been shown that such features are not optimal for differentiating spike shapes in general [83].
The Discrete Wavelet Transform (DWT) [83], the Integral Transform (IT) [89], Discrete Derivatives (DD) [90] and Principal Component Analysis (PCA) [91] are some examples of the analytical methods used for feature extraction.
This step saves computational time and it is mandatory for some clustering algorithms that cannot handle too many inputs in a reasonable time. Figure 3.7 illustrates the trade-off between accuracy and normalized computational cost related to Feature Extraction methods.
Figure 3.7: Trade-off between accuracy and normalized computational cost related to Feature Extraction and Detection Process. Adapted from [62].
3.3.3 Clustering
Finally, the extracted features of the recorded action potentials are passed through clustering and are grouped into clusters.
The spikes are grouped into clusters based on the similarity of their shapes. Each neuron tends to fire spikes with a particular shape [84], so the resulting clusters correspond to the activity of different neurons. The end result of spike sorting is determining which spike corresponds to which of these neurons.
The clusters can be delimited manually by drawing polygons in 2-dimensional projections of the spike features [92], however this is a very time consuming method and introduces errors.
To execute this process automatically some unsupervised clustering algorithms like super-paramagnetic clustering (SPC) [93], k-means clustering [94], Valley-Seeking clus-tering [95] and OSORT clusclus-tering [96] can be used. The characteristics of these methods are summarized in the Table 3.1.
In a traditional neural recording system, spike sorting applied to the filtered data is performed offline in software, thus the utilization of this method has to be improved in order to be suitable for bio-feedback applications.
Table 3.1: Summary of clustering algorithms characteristics. Adapted from [88].
MANUAL K-MEANS VALLEY-SEEKING SPC OSORT
Nonparametric NO NO YES YES NO
Automatic NO NO YES YES YES
Real Time NO NO NO NO YES
Adaptive NO NO NO NO YES
Accuracy LOW 0.90 0.74 0.85 0.74
Complexity - LOW HIGH HIGH LOW
Figure 3.8: Example results from clustering 30s of real data (human entorhinal cortex) using three different clustering methods. Extracted from [88].
3.3.4 Template Matching
Neuroscience usually requires robust and accurate spike sorting, although for brain-machine interfaces it is important not only accurate but also fast and autonomous spike sorting for data compression and online decoding. One possible implementation of an online spike sorting system is using template matching. In Figure 3.9 the whole system to perform spike sorting template matching is represented.
This simple strategy to perform spike sorting consists of selecting a characteristic spike shape for each cluster and then assign the remaining spikes using template matching. This method was pioneered by Gerstein and Clark [97], who implemented an algorithm in which the user selects the templates and the spikes are assigned based on a mean square distance metric.
Figure 3.9: Block diagram of the Spike Sorting – Template Matching process.
In Table 3.2 different metrics that can be used to perform Template Matching are stated.
Table 3.2: Distance measures used in Template Matching [85].
Measure Form
Squared Euclidean Distance d =
n X i=1 (yi− Ti)2 Norm 1 d = n X i=1 |yi− Ti|
Norm Infinite d = max(|yi− Ti|)
Mahalanobis1 d = (~y − ~T )TS−1(~y − ~T )
1 S is the covariance matrix of the templates
The Squared Euclidean distance provides the best relationship performance-complexity [85]. To perform online Spike Sorting Template Matching it is mandatory that the method used has low computational complexity therefore it is suited for hardware im-plementation. With this in mind, despite the fact of Norm 1 is less robust to noise, it can be a good choice since it requires very low computational complexity.
3.4
Simulated Extracellular Recordings
Real recordings without any ground truth are naturally the aim of every spike sorting algorithm. However, when testing this method, it is important to have full knowledge of the data composition in order to compare the algorithm outcome with the original spike label and quantify the performance of these methods.
Neural data can be easily generated by adding spikes to Gaussian noise [68]. However that implementation misses crucial features of the real neural data such as: the presence of non-Gaussian distribution of clusters, multi-unit activity and spectral similarity be-tween noise and spikes. In order to improve the simulated neural data detailed models of extracellular waveforms can be used, although it can be too computationally intensive when simulating extracellular recordings generated by a large number of neurons. R. Q. Quiroga et al. have reported a technique to develop easy simulations that reproduce relevant real features of extracellular recordings [83]. These simulated datasets will be briefly described in this section since they were used in this project to test and evaluate the performance of the presented system.
The synthetic extracellular signal was generated by overlaying three main components: (i) background noise, (ii) multi-unit activity and (iii) single-unit activity. In order to simulate the background noise, the contribution of distant neurons was modeled by superimposing millions of spike shapes, which waveforms were created using a database with 594 different averaged spike shapes, taken from real recordings in monkey neocortex and basal ganglia. The frequency and amplitude distribution is modulated by the neuron distance to the recording electrode as illustrated in Figure 3.10. It is important to notice that these datasets do not reproduce LFP, i.e. low frequency activity.
Multi-unit activity was generated by mixing the activity of 594 spike shapes using ampli-tudes uniformly distributed between 0.5 and 1.5 times the level of the detection thresh-old, which value was 4 times the estimation of the standard deviation of the noise. The distribution of amplitude values for multi-unit activity was chosen according to real data and the multi-unit firing rate was 20 Hz.
The single-unit activity was created by using spikes of different shapes added to the background noise using amplitudes distributed between 1.5 and 4 times the detection threshold. The firing rate was randomly selected between 0.5 and 5Hz.