Python in Brain-Computer Interfaces (BCI) - IEEE Xplore

40 downloads 1314 Views 760KB Size Report
Python in Brain-Computer Interfaces (BCI):. Development of a BCI based on Motor Imagery. Luz Maria Alonso-Valerdi. School of Computer Science and ...
2011 3rd Computer Science and Electronic Engineering Conference (CEEC)

University of Essex, UK

Python in Brain-Computer Interfaces (BCI): Development of a BCI based on Motor Imagery Luz Maria Alonso-Valerdi

Francisco Sepulveda

School of Computer Science and Electronic Engineering University of Essex Colchester, Essex – United Kingdom [email protected]

School of Computer Science and Electronic Engineering University of Essex Colchester, Essex – United Kingdom [email protected] most noteworthy proposed technologies has been the BrainComputer Interfaces (BCI), which give rise to a communication means between individuals with severe motor disorders, and their external world via the measurement of the electroencephalographic (EEG) activity. In ideal conditions, a healthy person uses his/her nerves and muscles to elicit movements, and thus controlling his/her environment. In comparison, BCIs convert a user’s desires (encoding in a specific electro-physiological mechanism) into real actions proceeding in three steps. Firstly, a BCI system senses, amplifies and processes the user’s EEG signals; secondly, it highlights and extracts the useful electrophysiological mechanisms encoded in the signal; and finally, it converts these extracted features into logical control signals for managing the actions of a device of interest [3]. See Fig. 1. The adequate electrophysiological mechanism to control the device of interest can be brought by using one of two fundamental approaches: event-related potentials (ERPs) and oscillatory brain activity. In ERP approach, subjects perceive a set of stimuli displayed by the BCI system; and then, they can control their brain activity by focusing onto one specific stimulus (e.g. P300 and steady-state visual evoked potentials). In oscillatory brain activity approach, users control their brain activity by concentrating on a specific mental task. In this approach feedback signals are often used to let subjects learn the production of easily detectable patterns of neurophysiological signals. Motor imagery (MI) executions have become the most used mental task by the BCI community. MI executions trigger an event-related desynchronization (ERD), as well as an event-related synchronization (ERS). ERD reduces the amplitude of brain oscillations occurring on the contralateral hemisphere; whereas, ERS enhances the amplitude of brain oscillations occurring on the ipsilateral hemisphere. The concerned oscillations take place within α (812 Hz), and β (12-30 Hz) bands over the primary sensorymotor cortical area, from thence they are named sensorymotor rhythms [4]. MI-based BCI involves one adaptation phase (i.e., offline analysis) and one application phase (i.e., online analysis). The former refers to training processes of a machine to recognize different MI-patterns of the user, and the latter concerns the control of the device of interest via the trained machine.

Abstract—Brain-Computer Interfaces (BCI) give rise to a communication means between individuals with severe motor disorders, and their external world via the measurement of the electroencephalographic (EEG) activity. BCI users may control this activity by concentrating on a specific mental task. Motor imagery (MI) executions have become the most used mental task by BCI-groups. Despite a large number of references describing the theoretical framework of MI-based BCIs, there is not enough information related to the available computer software that could be suitable to develop a specific-purpose, efficient and straightforward BCI. Therefore, the aims of this paper are: (1) to develop a MI-based BCI system making use of Python programming language, and (2) to study MI signals of three users via the proposed BCI system in order to adapt a computer for posterior applications. The use of Python along with plug-ins for developing MI-based BCI systems is not only feasible, but also it is proficient. Moreover, the Python community provides extensive variety of tools to design compelling systems. Keywords - Brain-Computer Intefaces; Motor Imagery; EEG signals; Python programming language

I.

INTRODUCTION

Nowadays, there are several disorders which seriously disrupt the mechanism of the nervous system, provoking severe motor disabilities in the people who undergo one of them. Among the disorders that impair the neural pathways or the muscles themselves are: (1) Amyotrophic lateral sclerosis, which is a nervous system disease that impairs the neurons in the brain and the spinal cord; (2) brainstem stroke, that arises when the blood suddenly stops flowing through the brain; (3) brain or spinal cord injury, which occurs when the cord tissue is torn or pressed down on the nerve parts that carry signals; and (4) cerebral palsy, that is evoked when some areas of the brain that control movement do not develop correctly [1]. To date, these disorders do not have a cure, and eventually some of them increase the injury level in the patients. The recognition of the potential needs of these people has encouraged the scientific society to develop new interactive methods for enhancing the quality of life, and for healing socio-economic pitfalls. Motor-assistive technology usually makes use of the remaining movements, the undamaged peripheral electrical activity, or the brain signals for allowing motor handicapped people to function again [2]. One of the

978-1-4577-1301-9/11/$26.00 ©2011 IEEE

74

II.

DESINGING A MI-BASED BCI SYSTEM VIA PYTHON PROGRAMMING LANGUAGE

Our MI-based BCI system has been designed in accordance with an offline analysis phase, followed by an online analysis phase (Fig. 2). The system essentially carries out the same operations on both analyses having in mind that the online phase requires a control interface plus a device controller. The fundamental structure of the entire scheme is based on five modules: (1) acquisition of EEG data according to the current phase (i.e., offline or online analysis); (2) EEG signal conditioning; (3) feature extraction via band power estimation, (4) feature classification via support vector machines; and (5) plotting of spectral and/or temporal features of EEG signals. The system is completely written in Python2, and it is vitally supported by Numpy3 and Scipy3 (two of the most popular libraries for scientific computing) in addition to a very competent plotting library named matplolib4. The graphical user interface (GUI) of the system is programmed on PyGTK5 (rich binding for creating interfaces), and the machine learning process is fulfilled by means of the module LIBSVM6 (software for supporting vector classification). Having described the framework of the system, the milestones of the developed software is hereunder summarized.

Fig. 1. Functional Model of a BCI system. The user is the person who controls the device in the BCI system, sometimes modifying his/her brain state through a train of stimuli such as electric, auditory or visual parameters. The EEG system senses, amplifies, processes, displays, and storages the user’s brain signals. The feature generator removes the not natural phenomena from the electrical signal, emphasizes relevant signal features, and converts the neurological signal extracted from the user into feature values. The feature translator discriminates among a variety of mental states, and translates the result classification into control commands. The control interface/display and the device controller translate the control commands into appropriated semantic control signals for a particular device1.

Despite the large number of references [5]-[11] describing the theoretical framework of MI-based BCIs, there is not enough information related to the available computer software that could be suitable to develop a specific-purpose, efficient and straightforward BCI. Guger et al. [12] proposed an effective EEG-based BCI by using Matlab, Simulink, and RealTime Workshop (MathWorks, Inc.). Programming languages supplied by MathWorks are high performance languages conducted for mathematical, engineering, and science areas. Indeed, Matlab is an easy-to-use programming language that encompasses a library of general-purpose functions, and an extensive collection of toolboxes that are the most exploitable resources. The foremost drawback of this software is the cost. Although it is feasibly afforded by business environments, it may become a financial burden for the private sector. For instance, worldwide universities often purchase a limited number of licenses to deal with the cost; however, they seldom satisfy the demand. MathWorks usually suggests paying for a low-cost student edition in restricted budget cases, which is not often eligible. In the light of the above discussion, the aims of this paper are: (1) to develop a BCI system based on MI principles making use of open-source software, and (2) to study MI signals of three users via the proposed BCI system in order to adapt a computer for posterior applications. For developing a proficient MI-based BCI system, Python has been selected as programming language. Python has open-source license, it is multi-platforms, it has clean syntax, it has the ability to interact with a wide variety of programming languages, it has a large number of libraries and modules, the Python community is famous for delivering quick and useful responses, and a repository of categorized Python module is available [13]. Furthermore, Python has a large number of additional modules for specific tasks such as digital signal processing (DSP), machine learning (ML), and MATLAB commands replacement.

A. EEG Data Acquisition Module A bio-signal measurement system typically requires transducers, amplifiers, devices for analogue signal processing, analogue to digital converters, buffers, software for DSP and a display. In BCI research, the bioelectrical mechanism in study is the EEG activity, which is measured using BIOSEMI products at Essex BCIs. This company provides an EEG recorder named ActiveTwo, along with computer software programmed on LabView for display the current recordings. This software is named ActiView (Fig. 2). Besides the EEG-activity display, ActiView software saves EEG data as BDF-files (i.e., 24 bit version of the popular 16 bit EDF format), and it also provides a server for networkoriented communication. To request data delivery is necessary to program a client by means of a connection-oriented socket. This type of connection is established before communication can occur; hence it offers sequenced, reliable and nonduplicable delivery of data. The primary protocol that implements such connection type is the Transmission Control Protocol - TCP (guideline to communicate computers over a network), and because it uses the Internet Protocol (IP) to find hosts in the network, the whole system is called TCP/IP [14]. Accordingly, the offline analyzer employs MAT-files (previously converted from BDF-files using the library BioSig7) organized in three dimensions: channels, trials, and samples; and the online analyzer makes use of the TCP/IP server to acquire the ongoing user’s brain signals via a TCP/IP client developed by Python network programming.

2

http://www.python.org/ http://numpy.scipy.org/, http://www.scipy.org/ http://matplotlib.sourceforge.net/ 5 http://www.pygtk.org/ 6 http://www.csie.ntu.edu.tw/~cjlin/libsvm/ 7 http://biosig.sourceforge.net/index.html 3 4

1

Fig. 1 is based on the figure depicted by A. Bashashati, M. Fatourechi, R.K. Ward, and G. E. Birch [3]. Additionally, it makes use of icons available in http://www.veryicon.com/.

75

Fig. 2. Framework of the MI-based BCI system.  Offline Analysis Pathway – Before describing the offline analysis pathway, it will be useful to mention how the MI signals are acquired. The current user participates in a training session when he/she learns to control his/her brain activity by concentrating on kinaesthetic motor imagery executions of the left and the right hands. The learning process is carried out via stimulation computer software programmed on PyGTK. Along with the training session, the electro-cortical activity of the user is recorded via the ActiveTwo encephalograph. At the end of the session, ActiView software returns a BDF-file encoding all the electrical activity of interest, which is automatically read by the stimulation software for converting the BDF-file to individual MAT-files. Having MAT-files according to the MI tasks, the offline analysis is ready to be run. Firstly, the MAT-files are individually uploaded (EEG MAT-FILE UPLOAD module). Secondly, the type of spatial and/or spectral filter is selected (SIGNAL CONDITIONING module). Thirdly, the frequency bands of interest (i.e., theta, alpha, beta, and/or gamma bands) are activated followed by the adjustment of their bandwidth (FEATURE EXTRACTOR module). Fourthly, it is assigned a label to each MI task for identifying the SVM classes (FEATURE CLASSIFICATION module). Finally, four modes of plotting can be selected: a) spectrogram, temporal graph of the spectral components of the conditioned EEG signals; b) box-plot, feature distribution over the selected trials; c) histogram, feature distribution according to a specific frequency band over the selected trials; and d) ERD/ERS maps, time course of the event-related (de) synchronization (SPECTRO-TEMPORAL PLOTTING module). This offline analysis returns the best adapted SVM classifier.  Online Analysis Pathway – The goal of the online analysis is to make use of the adapted SVM classifier to discriminate ongoing MI tasks, and hence translate the classifier outcome into device control commands. An online session starts recording the EEG signals via the ActiveTwo. Afterwards the EEG signals are streamed to a TCP/IP client via the TCP/IP server of the ActiView (EEG DATA TRANSMISSION/RECEPTION modules). When the EEG data arrives at the online system, the signals are reconstructed and processed following the same offline technique. The outcome of the SVM classifier is converted to a generic control command and delivered to the DEVICE module via another TCP/IP client. In addition, the features that generate the current SVM outcome are plotted via xy plot, if the correspondent option was ticked at the moment of the system configuration.

There are two popular techniques for reducing the filtered noise. The first technique is to measure and eventually to subtract the undesired signals from the EEG signals. The second technique is the application of DSP methods. Spectral filtering has become the most useful DSP method because it reshapes the signal spectrum to one’s advantage by adjusting the bandwidth, the attenuation, and the order of a suitable filter [15]. Based on this fact, the spectral filtering technique has been implemented as an option of the signal conditioning module. This option is available in two modes: (1) 50HzRejection that is a Butterworth band-stop filter of 2nd order at an attenuation of -3dB, and (2) Bandwidth Selection that is Butterworth highpass filter of 4th order at -3dB attenuation, followed by Butterworth lowpass filter of 6th order at -3dB attenuation, both of them with selectable cut-off frequencies. In addition to the aforementioned noise sources, EEG scalp potential measurements are frequently superimposed owing to the large conductive medium (i.e., scalp, skull and other

B. Signal Conditioning Module Biomedical measurements are frequently modified by undesired signals (aka noise) that mainly have four different sources [15]. These are:  Physiological variability due to the interference of other electrophysiological fluctuations such as eye movements (EOG), blinks, cardiac activity (ECG), and muscle activity (EMG). Other mechanisms as respiration, tongue movements, tremor, and skin potentials also modify the signal of interest; however, they are less frequent.  Transducer artefacts appear when the electrodes respond to other energy modalities.  Electronic noise falls into two broad classes: thermal noise and shot noise that is related to voltage barriers associated with semiconductors.  Environmental noise comes from unknown external and/or internal sources of the human body.

76

layers) whereby they are transmitted. If the potential of interest is weak (such as the sensory-motor rhythms), then several spatial filtering techniques must be applied in order to obtain more localized electrical activity [16]. Due to the reliance of sensory-motor rhythms, the signal conditioning module includes three spatial filtering techniques: (1) bipolar filtering, which calculates a local voltage gradient where the influences of distant sources are attenuated; (2) Laplace filtering (small and large modes), which is estimated by subtracting the average of surrounding electrodes from each individual channel, and thus emphasising local EEG activity; and (3) Common Average Reference (CAR), which is acquired by removing the mean of all EEG channels from each individual channel. Although this technique diminishes the influence of far field sources, the artefacts from other channels could be added to the desired signal.

III.

EXPERIMENTAL PROCEDURE

Three untrained subjects (S1, S2, and S3), one female and two males, of ages 26-31 participated in a 50 minute session. They were right-handed students and did not report nervous abnormalities. The session was arranged in a 30-minute phase for mounting 64 channels, and a 20-minute phase for MI training purposes. A. Data Recording The acquisition of the electro-cortical activity was done by a bio-potential measurement system named ActiveTwo, and a LabView program named ActiView, both products of BIOSEMI Company. ActiveTwo system senses the electrocortical activity via 64 active electrodes, plus a Driven-LegRight electrode and a Common-Mode-Sense electrode; it processes the acquired signals within a 400Hz bandwidth; and it sends the data to a PC sampling at 2048Hz. ActiView displays the online EEG waveforms; it decimates the waveforms at 512Hz limiting the bandwidth to 104Hz; and it saves the EEG recordings as BDF-files (i.e., 24 bit version of the popular 16 bit EDF format). The BDF-files were translated to MAT-files by using an open-source library for biomedical signal processing named BioSig, which provides a Python version of the BDF converter.

C. Feature Extractor Module MI tasks decrease or increase the synchrony of certain neuronal populations in the sensorimotor area of the brain. These types of fluctuations are time-locked to the MI cue onset and may be detected by power signal analysis. One of the most used methods to estimate the power EEG signal has been proposed by Graz-BCI group, and it can be summed up in three steps [4]: (1) band-pass filtering of all event-related trials, (2) squaring of the amplitude samples to obtain power samples, (3) averaging samples over time segments usually of one-second length. This method is known as Band Power (BP) and it has been implemented as feature extractor method.

B. Training Protocol programmed on PyGTK The training phase lasts roughly 20 minutes and is organized in four runs. Each run has 40 trials divided equally in two classes: left and right hand motion; that is, 160 trials per class per session. Each trial lasts between 10 and 11 seconds, and it has six epochs: (1) warning sign from 0s to 2s; (2) cue onset plus a beep from 2s to 3s; (3) left or right hand imaginary motion from 3s to 7s; (4) idle state extraction from 7s to 10s, which is useful to identify non-MI execution; and (5) random inter-trial interval from 10s to 11s (Fig. 3).

D. Feature Classifier Module Brain signals depend on each user and on his/her mental state at the time of the system manipulation. Therefore, an optimal BCI system must be adapted to each user for each new session via ML. To date, ML tools have been fundamentally employed to implement classifiers that could identify different MI executions. Support Vector Machines (SVMs) have played an important role as classifier in the BCI community because it is an algorithm that projects the input feature vector to a high dimensional space where it is more likely to discriminate among different classes. Furthermore, SVMs are less susceptible to over-fitting problems compared to classical feed-forward networks and they require relatively smaller size of training samples. On this basis, SVM has been implemented as feature classifier method.

C. Offline Analysis MI and idle patterns were assembled using bipolar measurements of the channels FC3 – CP3, FCz – CPz, and FC4 – CP4 (according to the international 10/10 system), and following the next offline analysis configuration. Firstly, each trial of every mental state (i.e., left hand, right hand and idle state) was fragmented into seven intervals considering onesecond length and 50% overlapping. Secondly, each fragmented waveform was down-sampled to 256 Hz. Thirdly, each EEG interval was filtered within lower α (8-10Hz), upper α (10-12Hz), lower β (16-20Hz) and upper β (20-24Hz) bands; it was squared sample by sample; and it was averaged over time getting a value later transferred to logarithmic scale. In summary, each pattern was constructed by three EEG channels; each channel was characterized by four frequency bands; and each band was assembled by seven intervals (i.e., 84 features). Having assembled the patterns, forty trials per class were taken for modelling the SVM classifier, and sixty trials per class were taken for assessing the SVM performance. The idle class contributed with eighty trials per evaluation.

E. Plotting Modes The MI-based BCI system has five modes of plotting, four modes for offline analysis and one mode for online analysis. The offline modes are: a) spectrogram, temporal graph of the spectral components of the conditioned EEG signals; b) boxplot, feature distribution over the selected trials; c) histogram, feature distribution according to a specific frequency band over the selected trials; and d) ERD/ERS maps, time course of the event-related (de) synchronization. The online mode is the (x, y) plotting of the current features that generates the current SVM outcome.

77

SUBJECT 1

Fig. 3. Stimulation Protocol for the Training Phase – Each trial of the training phase is divided into six epochs. The epoch  is from 0 to 2 s, and it displays the warning sign via an upright person on a light orange background. The epoch  is from 2 to 3 s, it plays a beep, and it displays the cue that is a person pointing towards the required MI. The epoch  is from 3 to 7 s, and it is the ideal moment to find out MI executions. The epoch  is from 7 to 8 s, and it is a disregarded period to ensure a motionless mental state during the following period. The epoch  is from 8 to 10 s, and it shows an idle state useful to identify non-control commands. The epoch  is from 10 to 11 s, and it is a necessary random gap in between trials to avoid user’s familiarization.

IV.

(a)

(c)

(e)

(b)

(d)

(f)

(a)

(c)

(e)

(b)

(d)

(f)

(a)

(c)

(e)

(b)

(d)

(f)

SUBJECT 2

RESULTS

Configuring the offline analyzer according to the most reported scheme for estimating BP features (i.e., the method described in the section 3C), the analyzer recognized at least 60% of the MI patterns corresponding to three classes of three subjects (Table I). The results of the offline analyzer showed a noteworthy performance considering that the subjects have never undergone MI trainings and that only one session was run. In addition, the time course of ERD/ERS of the Subject 1 (S1), Subject 2 (S2), and Subject 3 (S3) are depicted on Fig. 4. Each subject analysis engages six subplots. Subplots (a) and (b) show the imaginary movement of the left hand, subplots (c) and (d) show the imaginary movement of the right hand, and subplots (e) and (f) show the idle state. Each graph involves four frequency bands: lower alpha (αL), upper alpha (αU), lower beta (βL), and upper beta (βU).

SUBJECT 3

TABLE I. CONFIGURATION AND ASSESSMENT OF THE MI-BASED BCI (OFFLINE MODE) Subject 1 Subject 2 Subject 3 Bipolar Spatial Channel 1 = FC3 – CP3 Filtering Channel 2 = FCz – CPz Channel 3 = FC4 – CP4 Left MI execution: 1 second Interval Right MI execution: 1 second Length Idle state: 0.5 second Overlapping 50% System Configuration Lower α 8 – 10 Hz Band Upper α 10 – 12 Hz Band Lower β 16 – 20 Hz Band Upper β 20 – 24 Hz Band Training 77.5% 68.75% 81.875% Accuracy System Results Testing 76.25% 60.625% 75.471% Accuracy

Fig 4. Time Course of ERD/ERS of Subject 1, Subject 2, and Subject 3. (a) Left MI on the ipsilateral hemisphere. (b) Left MI on the contralateral hemisphere. (c) Right MI on the contralateral hemisphere. (d) Right MI on the ipsilateral hemisphere. (e) Idle state extracted by electrode FC3, which is a sensor located on the right hemisphere. (f) Idle state extracted by electrode FC4, which is a sensor located on the left hemisphere.

78

V.

[8]

DISCUSSION

The use of Python programming language along with ML plug-ins for developing MI training sessions, and entire MIbased BCI systems is not only feasible, but also it is proficient. The offline MI-based BCI system successfully discriminated between 60% and 80% of MI-patterns of three untrained subjects, which is quite good to control an online system. It is important to point out that the present results are limited to one system-configuration; however, the parameters can be tuned in order to find out a more satisfactory human-machine adaptation. Furthermore, the offline analyzer has been implemented with a plenty of tools (such as ERD/ERS maps) to figure out the most suitable BCI parameters for the current user. Moreover, the Python community provides extensive variety of tools to design more complex systems. For example, it is strongly recommended to make use of Python(x,y) 8 that is interactive scientific software embedding worthwhile sources; as well as, it could be helpful to harness ML libraries such as Elephant9 (multi-purpose library for ML), Shogun10 (comprehensive ML toolbox), Orange11 (General-purpose data mining), PyML12 (ML in Python), MDP13 (modular data processing), or Hcluster14 (agglomerative clustering).

[9]

[10]

[11]

[12]

[13] [14] [15] [16]

ACKNOWLEDGMENT

[17]

This project would not have been possible unless the sponsor of the National Council of Science and Technology of Mexico (CONACyt), which grants a scholarship for Luz Maria Alonso-Valerdi.

[18]

REFERENCES [1]

[2]

[3]

[4]

[5]

[6]

[7]

[19]

M. F. Bear, B. Connors, and M. Paradiso, Neuroscience: Exploring the Brain, 3rd ed., Lippincott Williams & Wilkins, 2007, ch. 1–4 , 13–14, 19. J. R. Wolpaw, N. Birbaumer, D. J. McFarland, G. Pfurtscheller, and T.M. Vaughan, “Brain-computer interfaces for communication and control”, Clin. Neurophysiol., vol. 113, no. 6, Jun. 2002, pp. 767–791. S. G. Mason, G. E. Birch, “A general framework for brain-computer interface design”, IEEE Trans. Neural Syst. Rehabil. Eng., vol. 11, no. 1, Mar. 2003, pp 70–85. G. Pfurtscheller, and F. H. Lopes da Silva, “Event-related EEG/EMG synchronization and desynchronization: basic principles”, Clin. Neurophysiol., vol. 110, no. 11, Nov. 1999, pp. 1842–1857. R. Boostani, B. Graimann, M. H. Moradi, and G. Pfurtscheller, “A comparison approach toward finding the best feature and classifier in cue-based BCI”, Med. Biol. Eng. Comput., vol. 45, no. 4, Feb. 2007, pp. 403–412. G. Pfurtscheller, and C. Neuper, “Motor imagery and direct braincomputer communication”, P. IEEE, vol. 89, no.7, Jul. 2001, pp.1123– 1134. G. Pfurtscheller, C. Neuper, C. Guger, W. Harkam, H. Ramoser, A. Schlögl, B. Obermaier, and M. Pregenzer, “Current trends in Graz braincomputer interface (BCI) research”, IEEE T. Rehabil. Eng., vol. 8, no.2, Jun. 2000, pp. 216–219.

[20]

[21]

[22] [23]

[24] [25] [26] [27] [28]

8

http://www.pythonxy.com/ 9 http://elefant.developer.nicta.com.au 10 http://www.shogun-toolbox.org 11 http://www.ailab.si/orange 12 http://pyml.sourceforge.net 13 http://mdp-toolkit.sourceforge.net 14 http://code.google.com/p/scipy-cluster

[29] [30]

79

G. Pfurtscheller, C. Neuper, G. R. Müller, B. Obermaier, G. Krausz, A. Schlögl, R. Scherer, B. Graimann, C. Keinrath, D. Skliris, M. Wörtz, G. Supp, and C. Schrank, “Graz-BCI: state of the art and clinical applications”, IEEE Trans. Neural Syst. Rehabil. Eng., vol. 11, no. 2, Jun. 2003, pp. 1–4. J. R. Wolpaw, D. J. McFarland, and T. M. Vaughan, “Brain-computer interface research at the Wadsworth center”, IEEE T. Rehabil. Eng., vol. 8, no. 2, Jun. 2000, pp. 222–226. J. R. Wolpaw, N. Birbaumer, W. J. Heetderks, D. J. McFarland, P. H. Peckham, G. Schalk, E. Donchin, L. A. Quatrano, C. J. Robinson, and T. M. Vaughan, “Brain–computer interface technology: a review of the first international meeting”, IEEE T. Rehabil. Eng., vol. 8, no. 2, Jun. 2000, pp 164–173. A. Kübler, B. Kotchoubey, J. Kaiser, J. R. Wolpaw, N. Birbaumer, “Brain–computer communication: unlocking the locked in”, Psychol. Bull., vol. 127, no. 3, May 2001, pp. 358-375. C. Guger, A. Schlögl, C. Neuper, D. Walterspacher, T. Strein, and G. Pfurtscheller, “Rapid prototyping of an EEG-based brain computer interface (BCI)”, IEEE Trans. Neural Syst. Rehabil. Eng., vol. 9, no. 2, Jun. 2003, pp. 1–4. G. Lindstrom, “Programming with Python”, IEEE Computer Society, Oct. 2005, pp. 10–16. W. J. Chun, Core Python Programming, 2nd ed., Prentice Hall, 2007, ch. 16. J. L. Semmlow, Biosignal and Biomedical Image Processing, Signal Processing and Communication Series, 2004, pp. 10–172. G. Dornhege, J. R. Millan, T. Hinterberger, D. J. McFarland, and K. R. Muller, foreword by Terrence J. Sejnowski, Toward Brain-Computer Interfacing, 2007, pp. 207–216. F. Lotte, M. Congedo, A. Lecuyer, F. Lamarche, and B. Arnaldi, “A review of classification algorithms for EEG-based brain-computer interfaces”, J. Neural Eng., 4, 2007, R1–R13. C. W. Anderson, S. V. Devulapalli, and E. A. Stolz, “EEG signal classitifation with different signal representation”, Neural Networks for Signal Processing, IEEE Sevice Center. Available: http://mmspl.epfl.ch/webdav/site/mmspl/shared/BCI/publications/baztarr icadiplomaproject.pdf. J. A. Pineda, B. Z. Allison, and A. Vankov, “The effect of selfmovement, observation, and imagination on µ rhythms and readiness potentials (RP’s): toward a brain computer interface (BCI)”, IEEE Trans. Neural Syst. Rehabil. Eng., vol. 8, no. 2, Jun. 2000, pp. 219–222. R. Palaniappan, “Brain computer inteface using band powers extracted during mental tasks”, Proc. 2nd Int. IEEE EMBS Conf. Neural Engineering, Virginia, Mar. 2005, pp. 16–19. P. Wallisch, M. Lasignan, M. Benayoun, T. I. Baker, A. S. Dickey, N. G. Hatsopoulos, Matlab for Neuroscientists: An Introduction to Scientific Computing in Matlab, Academic Press, 2009, ch. 2–5. D. A. DeMarre, D. Michaels, Bioelectric Measurements, Prentice Hall 1983, pp. 120–130. L. Sörnmo, and P. Laguna, “Bioelectrical signal processing in cardiac and neurological applications”, Elsevier Academic Press, 2005, pp. 55– 90, 97– 103. C. M. Bishop, Pattern Recognition and Machine Learning, Springer 2006, ch. 1. S. K. Mitra, Digital Signal Processing: A Computer-Based Approach, 3rd ed., McGraw-Hill Int. Ed., pp. 51–56, 864–869. R. Shavi, Introduction to Applied Statistical Signal Analysis, Elsevier (Academic Press), 3rd ed., pp. 105–155. L. R. Squire, D. Berg, F. E. Bloom, Sascha du Lac, A. Ghosh, N. C. Spitzer, Fundamental Neuroscience, Academic Press, pp. 1199–1201. MATPLOTLIB: A powerf plotting tool in Python programming language. Available: http://matplotlib.sourceforge.net/examples/animation/index.html?highlig ht=animation. PyGTK 2.0 reference manual. Available: http://www.moeraki.com/pygtktutorial/pygtk2reference/index.html. PyGTK FAQ. Available: http://faq.pygtk.org/index.py?req=index.