Chapter 2 Material and Method
2.3 Methods of Data Analysis
2.3.2 Power Spectrum Analysis
Analysis of changes in spectral power and phase can characterize the perturbations in the oscillatory dynamics of ongoing EEG. Applying such measures to the activity time courses of separated independent component sources can avoid the confounds caused by misallocation of positive and negative potentials from different sources to the recording electrodes, and by misallocation to the recording electrodes activity that originates in various and commonly distant cortical sources. The spectral analysis for each ICA component decomposed from multi-channel of the EEG signals.
The time-frequency analysis, or alternatively short-time Fourier transform (STFT), which is a Fourier-related transform used to determine the sinusoidal frequency and phase content of local sections of a signal as it changes over time. The FFT processes for each ICA component data decomposed from multi-channel of the EEG signals and the processes are described as following Fig. 2-6.
Fig. 2-6 shows the diagram of moving-average power spectral analysis [32] for a Each 32-point window was extended to 64 points by zero-padding to calculate its power spectrum by using a 64-point fast Fourier transform (FFT), resulting in power-spectrum density estimation with a frequency resolution near 1 Hz. Then we averaged the power spectrum of all the subepochs within each epoch. Previous studies [33]
[34] show that the transient amplitudes of EEG power spectrum involved in wake-sleep regulation are very different. The cortex produces low amplitude and fast oscillations during waking, and generates high-amplitude, slow cortical oscillations during the onset of sleep. Their reports also showed that the EEG spectral amplitudes correlated with the wake-sleep transition more linearly in the logarithmic scale than in the linear scale. The previous study [35] based on the same task and empirical results also confirm this phenomenon. Therefore, the averaged power spectrum of each epoch was normalized to logarithmic scale to linearize these multiplicative effects. The resultant power-spectrum time series of single ICA component consisted 25 frequency bins (from 0.98 to 39.1 Hz) stepping at 2 seconds time intervals.
Fig. 2-6: Diagram of moving-average power spectral analysis
3 Chapter 3
Hardware Frameworks of Portable Data Acquisition
3.1 Introduction
In our experimental environment, a portable acquisition system is used to record EEG signals of human and to transmit the data to PC via Bluetooth wireless(Fig. 3-1). The hardware framework of portable data acquisition is divided into four parts as (1) four-channel front-end circuits, (2) analog to digital converter, (3) digital controller, and (4) wireless transmission to achieve the portability and facility.
Fig. 3-1: Diagram of wireless and portable module
3.2 Portable Data Acquisition System
The portable data acquiring system has been used to demonstrate the feasibility of building the BCI system. The functions of the BCI system include amplifier, filter, analog-to-digital converter, wireless controller, and data encoding. The total gain is about 5000 times and the bandwidth is 1~50Hz in this system, which depend on the feature of EEG signal,
EEG Signal
Battery-powered and wearable module
resolution of analog-to-digital converter and the range of operating voltage. The diagram of the portable front-end circuit system is shown as Fig. 3-2 and Fig. 3-3 shows the demo board of portable data acquisition system.
Fig. 3-2: Diagram of portable front-end system
Fig. 3-3: Photo of portable front-end system
3.2.1 Four-Channel Front-End Circuits
The function of this front-end system in the analog part is to amply the EEG signal which can be converted to digital signal operatively. So the gain of this system is set to 5,000 times. First, the EEG signal was operated by Instrumental Amplifier which is regarded as preamplifier, and the output signal is operated by two operational amplifiers which are regarded as band-pass filter, finally, the EEG signal is operated by an operational amplifier which is regarded as gain amplifier.
a. Preamplifier:
Instrumental Amplifier (IA) is a differential amplifier and which has a high common-mode rejection ratio (CMRR). A high CMRR is important in applications where the signal of interest is represented by a small voltage fluctuation superimposed on a (possibly large) voltage offset, or when relevant information is contained in the voltage difference between two signals. Thus, AD620 is chosen as the Instrumental amplifier, and it also can provide the function of gain. The IA circuit design is shown in Fig. 3-4. The R1 decides the gain of preamplifier, and the gain is set to 10 times.
Fig. 3-4: Circuits of preamplifier b. Band-Pass Filter
In this thesis, it designs to use two operational amplifiers to achieve the function of band-pass filter, and OPA4137 was chosen to be the amplifier. OPA4137 can be supplied by single (+4.5V to +36V) or dual (±2.25 to ±18V) power. In the high-pass filter, the cutoff frequency is 1Hz and was decided by passive components R2, R3, C1
and C2, and the 3dB cutoff frequency
2 3 1 2
1
L 2 f
R R C C
= π .
Fig. 3-5: High-pass filter circuits
For a band-pass filter, the low-pass filter is designed as shown in Fig. 3-6. The passive components R7, R8, C3, and C4 decide the 3dB cutoff frequency
7 8 3 4
1
H 2 f
R R C C
= π and thinking about the effect of AC 60Hz and the frequency range of EEG signals which this research want to observe, the 3dB cutoff frequency is set to be 50Hz. It combines the high-pass and low-pass filter to be a band-pass filter, and their simulation results of circuits are shown as Fig. 3-7
Fig. 3-6: Low-pass filter circuits
Fig. 3-7: Simulation results of band-pass filter c. Gain Amplifier
This part is to amplify the analog signal to attend the range which ADC can convert. This amplifier also chooses OPA4137 to be the operating amplifier, and the gain of gain amplifier is 50 times which was decided by R6 and R7 shown in Fig. 3-8.
Fig. 3-8: Circuits of gain amplifier -3dB
46.895Hz 1.000Hz
Fig. 3-9: Analog acquisition module
3.2.2 Analog to Digital Converter
In this system, by passing the signal through wireless, it needs an analog to digital converter to convert the continuous signal to discrete number. To suit with the filtered and amplified signal from front-end circuit, AD7575 was chosen to be an ADC converter on this data acquisition system. The AD7575 is a high speed 8-bit ADC with a built-in track/hold functions. The successive approximation conversion technique is used to achieve a fast conversion time of 5 ms, while the built-in track/hold allows full-scale signals up to 50 kHz (386 mV/ms slew rate) to be digitized, the specification of AD7575 is shown as Table 3. The AD7575 is designed for easy interfacing to all popular 8-bit microprocessors using standard microprocessor control signals (CS and RD) to control starting of the conversion and reading of the data. It provides two kinds of fast digital interface to allow the AD7575 to interface easily to the fast versions of most microprocessors. The interface timing diagram used in this thesis is shown as Fig. 3-10.
Table 3: Specification of ADC
Fig. 3-10: Timing diagram of AD7575
3.2.3 Digital Controller
For the data acquisition system, it needs a controller to organize the working of ADC and encode the digital data to wireless transmission which received from ADC. Complex Programmable Logic Device (CPLD) was a programmable logic device with complexity between that of PALs and FPGAs. The building block of a CPLD is the macro cell, which contains logic implementing disjunctive normal form equations and more specialized logic operations. In this research, EPM7128STC100-7 [36] which is a product of ALTERA was selected as the main controller of this system. It provides high-performance, EEPROM-based programmable logic devices (PLDs) based on
second-generation MAX® architecture. It has Built-in JTAG boundary-scan test (BST) circuitry with 128 macro cells. Complete EPLD family with logic densities 2,500 usable gates. EPM7128STC100-7 can supply 5ns pin-to-pin logic delays with up to 175.4MHz counter frequencies (including interconnect) and PCI-compliant devices.
Fig. 3-11: Digital controller
3.3 Wireless Transmission
For a portable device, wireless communication is an important issue to resolve great inconvenience of using with wire transmission. Bluetooth is a wireless protocol utilizing short-range communication technology to facilitate data transmission over short distances from fixed and/or mobile devices. The intent behind the development of Bluetooth was the creation of a single digital wireless protocol, capable of connecting multiple devices and overcoming issues arising from synchronization of these devices. This thesis chooses BM0203 to be Bluetooth module; BM0203 is an integrated Bluetooth module to ease the design gap and uses CSR BuleCore4-External [37] as the major Bluetooth chip. CSR BlueCore4-External is a single chip radio and baseband IC for Bluetooth
2.4GHz systems including enhanced data rates (EDR) to 3Mbps. It interfaces to 8Mbit of external Flash memory. When used with the CSR Bluetooth software stack, it provides a fully compliant Bluetooth system to v2.0 of the specification for data and voice communications. All hardware and device firmware of BM0203 is fully compliant with the Bluetooth v2.0+EDR specification.
Fig. 3-12: Photo of Bluetooth Module
3.4 Data Processing Platform
In this data processing platform, the selected core processor is ADSP-BF533 (Blackfin 533) developed by Analog Devices Inc. [38].
The system diagram of the board we designed is shown in Fig. 3-13 and the photo of the board is shown in Fig. 3-14. The Blackfin processor provides both microcontroller (MCU) and DSP functionality in a unified architecture, allowing flexible partitioning between the needs of control and signal processing. If the application demands, the Blackfin processor can act as 100% MCU (with code density on par with industry standards), 100% DSP (with clock rates at the leading edge of DSP technology), or a combination of the two. The maximum high performance of BF533 processor can be up to 500MHz. It has two 16-bit MACs, two 40-bit
ALUs, four 8-bit video ALUs, and 40-bit shifter. One of its features is RISC-like register and instruction model for ease of programming and compiler-friendly support. The board is designed to support the development and porting of open-source μClinux applications and includes the full complement of memory along with serial and network interfaces. Besides an ADSP-BF533 500 MHz Blackfin processor, the board includes:
16 MB SDRAM (64M x 16 bits) and 4 MB FLASH memory:
RS-232 serial interface
6 Keypads and 240*320 pixels LCD
JTAG interface for debug and FLASH programming Bluetooth transmitting/ receiving module
Fig. 3-13: System diagram of the board
Fig. 3-14: Photo of the board (upside and downside)
4 Chapter 4
Real-Time ICA Signal Processing
4.1 Introduction
In this chapter, it was to describe why EEG signals use ICA, what kind of ICA was implemented, and how to approach real-time and window-based signal process on the EEG-based BCI system (Fig. 4-1).
First, checking if window-based ICA method is correct is needed and at the same time makes sure window-based ICA does achieve real-time.
For the real-time ICA implementation, both the iteration and the convergence tolerance of training weights have to be limited through the following methods. Finally, it will obtain the execution time and iteration running on DSP, and the information of execution time and iteration will help to find out the boundary of setting in real-time operation.
Fig. 4-1: Diagram of wireless signal processing
4.2 EEG Data for ICA
It considers electrical recordings of brain activity as given by an electroencephalogram (EEG). The EEG data recorded by electrical
Window-based and Real-time Signal
potentials on the scalp consists of many signals in different locations.
These signals are presumably generated by mixing some underlying components of brain activity, so if want to monitor the physiology state of subject, the corresponding component will be found (Fig. 4-2). This situation is similar to the cocktail-party problem: If there are some microphones were put around the place, and the voice which was recorded by microphones will be the mixed signal which maybe mix with the conversation of people, jazz music and so on. So the observed signal from microphone is like to the EEG signal recorded by electrode, and the target was to separate the observed signal into several independent components, such as conversation, music and so on in the cocktail-party;
and component in the brain which have physiology pattern, such as the reaction of visual stimulus, sensorymotor stimulus, drowsiness and attention focus. In order to find out the original components of brain activity, ICA can resolve the problem of blind source separation, and can also reveal interesting information on brain activity by its independent components.
As shown in Fig. 4-3 the brain activity recorded at one electrode on the scalp is the mixture of electrical potentials from many different locations in the brain.
Fig. 4-2: Functions of brain’s area
Cocktail Party
Fig. 4-3: EEG signal was recorded at one point which is a mixed signal
CSF
EEG
4.3 Information Maximization ICA
Information Maximization ICA is also called Infomax ICA.
Information maximization theory is an optimization principle for neural networks and other information processing systems. First, Jeanny Herault and Christian Jutten [39] proposed a feedback architecture for independent component analysis from neural network in 1986, and ICA was most clearly stated by Pierre Comon [24] in 1994. Infomax-based ICA was described by Bell and Sejnowski [40] in 1995, they derived a new self-organizing learning algorithm that maximizes the information transferred in a network of nonlinear units. The algorithm does not assume any knowledge of the input distributions, and is defined here for the zero-noise limit.
Single layer feed-forward neural network in Fig. 4-4, was proposed by Bell and Sejnowski [40] to learn the separating matrix W by minimizing the mutual information between components of y(t)=g(u(t)), where g is a nonlinear function approximating the cumulative density function (CDF) of the sources. They formulated blind source separation algorithms in terms of information maximization.
Fig. 4-4: Blind separation network for two-source mixtures.
Information maximization is how to maximize the mutual information
that the output y of a neural network processor and with its input vector x. Where H[y] is the entropy of equation 4-2 can be differentiated as follows, with respect to a parameter, w, involved in the mapping from x to y:
)
The joint entropy of the outputs is
)]
Weights can be adjusted to maximize H(y). As before, they only affect the E[ln |J|] term above:
The resulting learning rules are familiar in equation 4-5.
T
T y x
W
W ∝ [ ] 1 + (1− 2 )
Δ − (4-5)
But this learning rule is too complex to calculate because of the inverse matrix. Multiplied by WTW change the rescale of the rule, the new learning rules as follow:
Thus, the simplification much uncomplicated than before, and this learning rule is suitable to separate blind sources. The update rule for W
in discrete time t ← t+1 defined in equation as follows: The flowchart of Infomax ICA is shown as
Fig. 4-5. Centering the data can simplify the ICA algorithm, and the mean can be added back to the data. Whitening means that we remove any correlations in the data, i.e. the different channels are forced to be uncorrelated. Then initialize the weight, and after random permutation, find the maximization entropy output. If the weight change is smaller than the desired weight change then the training is stopped.
Centering
Fig. 4-5: Flowchart of Infomax ICA training
4.4 Real-Time Signal Processing
4.4.1 Window-Based ICA
Real-time signal processing is convenient to embedded BCI system;
it makes the system to give some information in time. For common use of ICA in signal processing, it gathers a period of data, from several minutes even to an hour to get ICA components. In that way, it shows the system can not get instant results. And this type of using wastes the time, the quantity of data was too large to real time process. The more data to run ICA, the more time will the processor execute. So the window-based and real-time ICA processing was proposed; it will improve the facility and efficiency of portable embedded BCI system.
For window-based signal processing, it uses a concept of window and overlap on ICA algorithm to shorten the execution time in one time of ICA algorithm running on embedded BCI system, and keeps the previous information in present ICA training that will make ICA components still hold on the order. There are more data to execute with ICA algorithm, it takes more time to get ICA components; but if there is less data, it would not decompose the observed signal well to get clear source. So the time length of ICA window is set to five seconds, the time length of overlapping is three seconds, in this manner, every two seconds will get ICA components on time. Fig. 4-6 displays the different of window-based and common-use ICA method (which is called offline ICA in this thesis).
Fig. 4-6: Method of window-based and offline ICA
4.4.2 Verification of Window-Based ICA
To verify the method proposed in this thesis, it uses four mixed signals which randomly mixed three super-Gaussian signal and one random signal. Fig. 4-7 shows the original signal for verification of window-based ICA. The four random mixed signals were displayed on Fig. 4-8. The sample rate of these mixed and original signals is 64Hz, and the total time length of them is 1 minute. These mixed signals are the input of ICA algorithm which was separately executed on a PC platform using an offline method and a window-based method; and on an embedded BCI system platform using window-based method. Fig. 4-10, Fig. 4-12 and Fig. 4-14 show the ICA components obtained from the PC platform, offline and window-based, and from the DSP platform with window-based, respectively. In the figures it also shows the corresponding power spectrum to ICA components. And the total length of ICA components is displayed in Fig. 4-9, Fig. 4-11 and Fig. 4-13, respectively.
Every 2s updates ICA result 2s
5s 3s
Fig. 4-7: Original signals for ICA verification
Fig. 4-8: Mixed signals for ICA verification
Fig. 4-9: Result of offline ICA component performed on PC platform
Fig. 4-10: Result of offline ICA component and spectrum performed on PC platform.
Fig. 4-11: Result of window-based ICA component performed on PC platform.
Fig. 4-12: Result of window-based ICA component and spectrum performed on PC platform.
Fig. 4-13: Result of window-based ICA component performed on DSP platform
Fig. 4-14: Result of window-based ICA component and spectrum performed on DSP platform
Table 4 : Correlation table of window-based and offline ICA Correlation Different type Different platform
platform PC PC and DSP
Type window-based and offline window-based
Domain Time Frequency Time
Component 1(red)
0.1621 0.9632 0.8761 Component
2(pink)
-0.0769 0.9799 0.9998 Component
3(green)
-0.2791 0.999 0.9995 Component
4(yellow)
0.5746 0.9536 0.9998
For window-based ICA, the window concept is applied and that is different with offline ICA. The results of ICA components will not change in offline ICA (Fig. 4-9), because it only has one window to process. But also in window-based ICA, the ICA components will not change each other by the window updated (Fig. 4-11 and Fig. 4-13).
The verification of window-based ICA and offline ICA is in the same platform, there is not high correlation between window-based ICA and offline ICA running on the PC platform in time domain (Table 4), but in the Fig. 4-10 and Fig. 4-12, it shows that property of signal is decomposed and it is easy to identify the four signals, and the responding correlations are above 95% in frequency domain (Table 4). Because of cutting the window and fewer information of data, it makes the component have a negative sign different between window-based and offline processing. The figures also exhibit the corresponding power spectrum to ICA components, it presents that they have similarity
between their spectrum analysis of window-based and offline ICA running in PC platform. On the comparison of different platform, the
between their spectrum analysis of window-based and offline ICA running in PC platform. On the comparison of different platform, the