2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
Prototype Design of Low Cost Four Channels Digital Electroencephalograph for Sleep Monitoring Muhammad Salehuddin, Suprijanto, Farida I. Muchtadi Instrumentation & Control Research Group-Faculty of Industrial Technology, Bandung Institute of Technology-Indonesia
[email protected],
[email protected],
[email protected] Abstract—The electrical activity in brain or known as electroencephalogram (EEG) signal is being used in the diagnosis of sleep quality. Based on EEG signal, power of brain wave that related with a sleep quality could be obtained by analysis of power spectral density. The problem in developing countries, for example in Indonesia, EEG instrument is not widely available in each region of the country. This project designed and implemented four channels digital EEG, in which the design of hardware and software concepts was adopted from OpenEEG project. A four channels EEG amplifier operated by battery with average gain magnitude of 6100 times, bandwidth 0.05-60Hz and slope gradient of -60.00 dB/decade is developed. Digital board consists of AT-mega8 and serial interface with optocoupler is used to interface and viewed EEG signal on notebook. The prototype has successfully detected patterns of cardiac signal simultaneously with good SNR. In EEG measurement through monitoring the brain wave sleep, the data generated by PSD (Power Spectral Density) graph show the dominance of the brain signals at 7-9Hz (alpha) and 3-5Hz (theta). From several tests and measurements, this research concludes that the prototype of low cost EEG 4 channels is capable of acquiring satisfactory brain wave monitoring during sleep from healthy volunteer. Keywords-component; Sleep quality, digital EEG, brain wave
I.
INTRODUCTION
Quality of sleep is closely related with the quality of human life [1]. One of method to measure the quality of sleep is based on electrical signals from brain or called electroencephalogram (EEG). Through further processing, this EEG signals could be determined the power of brain wave, as source of information to identify the stages of human sleep [2, 3]. For research purpose, commercial digital EEG is relatively expensive and difficult to integrate with other system. In the paper, design and implementation of four channels digital EEG are presented by adopting hardware and software from OpenEEG project [4]. Detailed design for bio-amplifier, digital board, serial connection and open source software given as an international project to develop affordable EEG system and to support further development of EEG system application. Implemented EEG system that developed here can be used to transfer measured EEG signal from brain to the computer for further analysis, data transfer and data saving. Several modification and testing stages are carried out in order to ensure the EEG system can work optimally. In addition, it is important that this low-cost 4 channels EEG in one complete device as prototype that meets specification
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
standards. To find out how big an opportunity this instrument can be used to measure brain signals, some experiments directly on the human body, such as measuring heart rate (ECG) and measurement of brain waves in sleep state have been carried out as proving the reliability of prototype. II.
EEG & SIGNAL PROCESSING
A. Electroencephalogram (EEG) Electroencephalogram (EEG) is an electrical signal measurement system derived from brain activity. In 1929, Hans Berger discovered alpha-brain waves at 10 Hz for the first time. One hypothesis is that the potentials are produced through an intermittent synchronization process involving the neurons in the cortex, with different groups of neurons becoming synchronized at different instants of time. Another wave found in the following year and named in Greek alphabet [5]. In general, EEG signals have a range of 0.5 Hz - 100 Hz and divided into several sections according to the condition of brain activity with a specific pattern. However, for sleep monitoring, EEG signal in frequency range 0.5Hz-30Hz was focused to evaluate. On these ranges, EEG signal is divided into four wave groups (alpha, beta, theta, and delta). The characteristic of four brain wave group are shown on Table I. TABLE I. Wave Pattern
TYPE OF BRAIN WAVE Frequency
Voltage
Subjeck condition
Beta
14 – 30 Hz
10-20 µV
Activity, thingking
Alpha
8 - 13 Hz
Kids: 75 µV Adult: 50 µV
Relaks, closed eye
Theta
4 – 7 Hz
Kids: 50 µV Adult: 10 µV
Light sleep/ emosional stress
Delta
0,5 – 3 Hz
10 mV
Profound sleep
Genre
Electrical activity in brain is caused by the emergence of membrane potential and action potential. Action potential occurs when the minimum potential in the cells reached 15-30 mV and a positive feedback from the presence of membrane potential. However, potential order which can read by electrodes on the scalp is about 0.1 to 100 μV. This is caused by signal propagation and different impedances of each
188
2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
composition layer on head anatomy, starts from brain membrane-coated, soft tissue, and then skull bones. EEG signal can be viewed as non stationary signal since the signal frequency depended on the degree of activity of the cerebral cortex.
~ Pxx( p ) ( f ) =
The EEG signal is recorded by attaching two electrodes on certain position at the scalp and then measure the difference voltage between these two electrodes, this process is called bipolar EEG recording. On this experiment, the electrodes were placed based on international standard of electrode placement 10-20 [6] that can be seen on Figure 1.
X ( p ) ( f ) = T ∑ x ( p ) (k ) exp(− j 2πfkT )
2 1 X ( p) ( f ) UDT
(2)
on the frequency range − 1 / 2T ≤ f ≤ 1 / 2T ,where D −1 k =0
D −1
U = T ∑ w 2 (k )
(3)
k =0
The result of PSD estimation:
1 P −1 ~ PˆB ( f i ) = ∑ Pxx( p ) ( f ) P p =0
(4)
Next, the power of brain wave that related to the subject condition could be evaluated based on the obtained data on Pb(fi). III.
Figure 1. International Standard of Electrode Placements 10-20
In the experiment, mono polar electrodes where placed on C3, C4, P3 and P4 to measure EEG signal during volunteer sleep. B. Sleep Sleep is a dynamic situation which is characterized by changes in the level of electrical activity and up-down of stream from the chemical reaction to various areas in the brain, causing suspension of normal cognitive function and electrophysiology. The process of sleep begins from NREM (non-rapid eye movement) phase then REM (rapid eye movement) phase. NREM phase is divided into 4 stages and the highest stage indicates that patient is in very deep sleep state [6].
BASIC CONCEPT OF LOW COST DIGITAL EEG PROTOTYPE As we mention above, the raw EEG signal has a magnitude of about 0.1 to 100 μV. Before converting from analog to digital signal, a reasonably high gain, high quality EEG amplifier is needed. The basic concept of digital EEG was adopted from OpenEEG project, which consist of analog and digital board. The block diagram of analog board low cost EEG amplifier was shown in Figure 2. The bio potential activities of brain are detected by electrode. Then it will be forwarded to the protection circuit that serves to protect the equipment from electrostatic discharge (ESD) and limiting the current through a human body. After that, EEG signal will be amplified with gain 12 times in the first stage. In this stage, instrumentation amplifier with high CMMR was used to reject noise due to RF interference [8].
C. Brain Wave Processing The digital board that used to convert analog EEG signal using time sampling 128 Hz. Since we focused to evaluate EEG signal in range 0.5Hz-30Hz, the value of time sampling is quite adequate according to Nyquist theorem. To evaluate the power spectral density (PSD) of brain wave, digitized EEG signal could be processed using Periodgram Welch (Pwelch). Pwelch is one of algorithm for estimate PSD based on certain duration of digitized EEG signal [7]. Suppose digitized EEG signal represents with data x (0), x (1), ..., x (N-1), then data was divided with P segment along D, then shifting on each segment was done along S data (S ≤ D), resulting maximum P is (N-D) / S+1. Thus, data on each segment P is
x ( p ) (k ) = w(k )x(k + pS ), 0 ≤ k ≤ D − 1 where
(1)
0 ≤ p ≤ P − 1 . From those data will be obtained:
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
Figure 2. The block diagram of analog board
On the second and third stages, active low pass filter with gain 40 times and 16 times, successively, was used. The both active low pass filters are two poles filter with cut off 59Hz. Before amplify signal was entered to microcontroller, the low pass filter with cut off 59Hz was also installed on digital board. Therefore, the low pass filter viewed from microcontroller is
189
2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
designed to produce active low-pass filter 3 poles as the output with slope gradient 60 dB / decade. After EEG signal processed by the bio-amplifier, it is ready passed to the digital board then transferred to the computer by using serial communication. Digital board consists of ATmega8 as microcontroller system, isolating circuit and serial interface. The block diagram of digital board low cost EEG amplifier is shown in Figure 3.
•
For adding function of the address input channel, it can be done by reconstructing the pin-34 on the slave board.
•
Making VGND (virtual ground) manually, including the separation of ground plane on the casing.
•
Prevention from ground loops problem can be minimized by pooling together between ground points on the EEG prototype with building ground point so that there is only one ground that is connected with human body.
IV.
EXPERIMENTS AND ANALYSIS
A. Figure 3. The block diagram of digital board
In ATmega8, there are 6 pin slots for ADC, so this is the hint that prototype can be extended up to 6 channels. In addition, PWM system in microcontroller which can be used to generate a calibration signal to calibrate the output device of the measuring value displayed on computer. Calibration signal generated by a square signal with 250 μVpp and frequency 14 Hz. The sampling frequency is 256 Hz. RS232 used as serial connection as interface between device and computer. BrainBay, is open source software which used as the main software during the experiment and collecting data. This software was designed to retrieve data from EEG measurement and process them, so the result can be displayed and stored. The open design of low cost digital EEG is for 2 channels. However, with several modifications, the prototype of low cost EEG can be maximized up to 6 channels according with available slot pin on ATmega8.
Evaluation of characteristic spesification digital EEG To evaluate the performance of this low cost EEG 4 channels, then several testing and experiments needs to be done to determine the detail specifications and prove the reliability and functionality of the device to measure EEG signals. On the first test of bio-amplifier electrical circuit and it was interfacing system between bio-amplifier and computer that consist of (digital board and BrainBay). The frequency responds and stability interface between analog and digital board to computer, we used signal generator to generate weakness voltage in order µV with range frequency from 5Hz-1000Hz. Since the direct output from signal generator is in mV order, a voltage divider used to reduce the signal in µV order. The diagram block of testing procedure is shown in Figure 5.
The concept of expanding channels of low cost EEG into 4 channels can be seen in Figure 4.
Figure 5. Testing Procedure
The frequency respond from 4 channels as function gain was tabulated on Table 2. The outputs signals are monitored using brain-bay. Figure 4. Basic Concept of Low Cost EEG 4 Channels
Several steps were done to modify analog board, i.e. •
Separation of analog board function. One serves as a master board and another one as a slave board.
•
Use one Pin DRL (Driven Right Leg) on the master board and a few IC connected with DRL function on the slave board can be removed. Do wiring between pin COM in each analog board so that the slave board will connect with pin DRL on the master board.
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
Based on the results on Table 2, gradient slopes for CH-1 is -58.16 dB/decade, CH-2 is -57.64 dB/decade, CH-3 is -57.78 dB/decade, CH-4 is -57.28 dB/decade. All these values are close to the allowance of slope gradient on ideal third order low-pass filter, there is -60 dB/decade. The bode plots of 4 channels analog boards can be seen on Fig.6, Fig.7, Fig.8, and Fig.9. This filtering process has met the specification for ideal third order low-pass filter that designed to amplify EEG signal on frequency range 0.5 - 60 Hz. The amplifying process can also worked very well with gain amount 76.08 dB or magnified 5000 - 6000 times.
190
2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
TABLE II.
TESTING RESULTS
MASTER BOARD Frequency (Hz) 5 10 20 40 50 59 70 90 100 120 150 200 400 700 1000
SLAVE BOARD
CH-1 |Gain| (dB)
CH-2 |Gain| (dB)
CH-3 |Gain| (dB)
CH-4 |Gain| (dB)
76.08 76.08 75.78 75.50 75.29 72.89 72.14 72.00 71.58 67.41 62.83 56.06 42.18 23.82 13.42
76.08 76.08 75.78 75.50 74.01 73.27 72.14 71.77 71.58 67.41 62.28 56.06 43.92 25.04 13.94
76.08 76.08 75.78 75.50 75.29 73.49 72.19 71.95 71.72 68.38 63.30 56.06 43.47 24.14 13.94
76.08 76.08 75.78 75.50 74.31 73.21 72.19 72.00 71.72 68.38 63.30 56.06 44.50 25.73 14.44
frequency range of 0.5–30Hz, thus the specification of this low-cost EEG 4 channels is possible to measure EEG. B. Testing digital EEG to measure heart potential To find out the actual performance of this prototype, it is necessary to measure on human body directly, i.e. testing with the input bio-potential from heart, or electrocardiogram signal (ECG). This is caused by the characteristics of the ECG signal in periodic represents the electrical activity from heart rate. Then, the ECG signal has a minimum voltage in mV order, so performance evaluation of low cost EEG 4 channels in rejecting noise and interference can be done.
Figure 8. Results for each channel recording
Figure 6. Bode plot curve of bio-amplifier EEG test result for channel 1 (CH-1) and channel 2 (CH-2)
Figure 7. Bode plot curve of bio-amplifier EEG test result for channel 3 (CH-3) and channel 3 (CH-4)
This amplifying magnitude has met the specification to amplify EEG signal from µV order to mV order so it can be processed further. The specification of low cost 4 channels digital EEG is tabulated on Table 3. TABLE III.
SPECIFICATION OF LOW COST EEG 4 CHANNELS
Source ADC Resolution ADC Conversion Time Frequency Sampling Total Gain Anti-aliasing low-pass filter Calibration Signal Electrical Insulation Connection Baudrate Prize
Battery 12 V DC 10 bit ± 2 LSB 13 – 260 µs 128 Hz 6210,99 (after calibration) Besselworth orde 3 (-53,40dB/decade), fc = 59Hz Square Signal, 250µVpp, 14Hz Optocoupler (IC 6N139) Serial Connection RS232 57600 (1 start bit, 8 data bits, 1stop bit) USD 600
Figure 9. Results for all channels recording simultaneously
ECG measurement using a special electrode with AgCl which placed on the left arm (LA) as a positive channel, right arm (RA) as a negative channel, left leg (LL) as a ground channel. Recording session begins with the testing of each channel, after it is done simultaneously in the same lead. The results for each channel recording can be seen in Figure 8, while for all channels recording simultaneously can be seen in Figure 9. From data recording ECG signals, it can be proved that the prototype of low cost EEG 4 channels can record heart rate activity with signal to noise ratio (SNR) is relatively good on visual observation.
Based on the general features of the EEG signal, the prototype has potential difference value in µV order and
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
191
2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
Estimated PSD graph for EEG signals in sleep condition shown in Fig.12. It can be seen that the graph have dominant signal with a high PSD value in 8 Hz - 10 Hz. This is an area of the alpha wave that can be concluded that patient indeed in a state of relaxed before going into a light sleep state. In addition, the area that was quite dominant frequency is in 3 Hz - 5 Hz. This area is an area of theta wave so that it can be concluded that patient experiencing light sleep state. PSD value from theta to alpha has seen increase constantly, thus indicated patients not yet in deep sleep condition, but still in relaxed state despite being entered in a light sleep state or expected entry into second stadium NREM phase. Figure 10. EEG recording experiment
C. Testing digital EEG to measure brain potential To see the real performance of the prototype, then the EEG measurement needs to be done. EEG measurements focused on sleep monitoring and performed on a normal person who did not have sleep disorders. Point which used in this measurement is C3, C4, P3 and P4. The illustration of experiment was shown in Figure 10.
V.
CONCLUSION
In this experiment EEG system developed using bioamplifier design from open EEG project. Digital board had worked well to convert analog signal into digital signal and transferred this digital signal to the computer. Based on experiment results: 1) Improving the ability low cost EEG on multi channel enough to have the specifications needed to measure the EEG signal which has µV voltage order and frequency from 0.5 to 30 Hz. It can be seen from the results of test specifications that amplification of each channel more than 6000 times with the slope gradient more than 58 dB / decade is close to ideal conditions of third order low-pass filter.
Samples of EEG signal from 4 channels measurement results are shown in Figure 11.
2) Prototype of low cost EEG and BrainBay software has great potential for use as measure brain signals on small-scale laboratory and clinic, because the cost is relatively cheap and software is open source. 3) With four display patterns of ECG signals simultaneously in the same lead, this prototype already can be used as an application to measure heart rate at 4 different lead. 4) PSD graph for sleep monitoring, which result from EEG measurements using prototype low cost EEG 4 channels showing the frequency dominance under the beta wave (relaxed state), especially 8 Hz - 13 Hz (alpha waves) and 3 Hz - 5 Hz (theta waves).
Figure 11. Sample of EEG measurement from 4 channels recording
Evaluation of EEG signals patterns in sleep condition is based on the appearance of brain waves in the range 0.5 Hz - 8 Hz which is the dominant waves during sleep (delta waves and theta waves). For this purpose, the EEG signal in time function transformed in frequency domain to determine Power Spectral Density (PSD) using Pwelch method.
ACKNOWLEDGMENT The research was funded by Minister Research and Technology on incentive research programs 2011. REFERENCES [1]
[2] [3] [4] Figure 12. Graph PSD on EEG measurement of sleep condition
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
192
R. K. Bogan dan S.D. Youngstedt, “Sleep Laboratory” in Medical Devices and Instrumentation, Vol. 6, 2nd Edition, Encyclopedia of in Medical Devices and Instrumentation, J.G. Webster, New Jersey : Jhon Wiley and Sons, 2006, pp.208-224. J.G. Webster, “Medical Instrumentation : Application and Design”, 2nd Edition, USA : Jhon Wiley and Sons, 1992. A.P. Malvino. “Electronic Principles”. 5th Edition. Singapore : McGraw-Hill. 1993. The Open EEG Project - Creating Low Cost EEG Device : http://openeeg.sourceforge.net/
2011 2nd International Conference on Instrumentation Control and Automation 15-17 November 2011, Bandung, Indonesia
[5] [6]
J. R. Cameron dan J. G. Skfronik, “Medical Physics”. Singapore : Jhon Wiley and Sons. 1987. F.H. Martini. “Neural Tissue” in Fundamental of Anatomy and Physiology, (MyA&P Series), 7th Edition. San Fransisco : Pearson Education, Inc., 2006, pp. 380-383.
978-1-4577-1460-3/11/$26.00 ©2011 IEEE
[7]
[8]
193
John L. Semmlow, Biosignal and Biomedical Image Processing: MATLAB-Based Applications, (Signal Processing and Communications, 22), Marcel Dekker, Inc. 2004 D. Purves, “Sleep and wakefulness” in Neuroscience, 3rd Edition. Sunderland, USA : Sinauer Associates, Inc.