Alternative class III distributed polysomnography system

Introduction: Impairment of sleep quality directly increases the risk of heart attack, obesity, and stroke, among other conditions, which makes polysomnography (PSG) an important public health tool. However, the inherent problems with PSG render the correct diagnosis of sleep diseases a difficult task. As a novel alternative to the class II PSG system, this work presents a distributed system composed of three modules, which together are capable of the simultaneous monitoring of environmental variables and patient signals. This system could reduce the distress of a PSG exam in certain cases, dismiss the need for an overnight sleep in a healthcare/sleep centre, and facilitate self-setup and internet-based diagnosis. Methods : Hardware and software capable of synchronously monitoring, processing and logging into a µSD card environmental parameters (temperature, humidity, visible light intensity and audible noise level) and directly measured patient signals (electrocardiogram, electrooculogram, and body and limb posture) were designed and implemented. Results : A novel alternative to the class III PSG system was demonstrated with independent boards capable of operating for more than 16 hours powered by a 750 mAh/3.7 V battery with 0.003% data loss during preliminary PSG exams. Additionally, a computer-based library capable of reading, decoding, estimating respiration through ECG, and calculating the heart rate was developed and described. Conclusion : This article contributes to PSG research through the development of a new PSG system and the improvement of patient comfort. All software and hardware developed are fully open source and available on GitHub.


Introduction
Many studies have correlated sleep diseases with chronic cardiovascular diseases, obesity, diabetes and depression (Grandner and Pack, 2011;Kawada, 2015;Ramos and Gangwisch, 2015).Even in patients without major sleep problems, the reduction in sleep quality alone may affect mood, concentration and learning (Müller and Guimarães, 2007).
In-laboratory polysomnography (PSG) is the gold standard exam for the diagnosis of sleep diseases and impairments (Jafari and Mohsenin, 2010).PSG equipment and procedures can be sorted into four classes originally created by the American Academy of Sleep Medicine (AASM) ranging from the most complex (class I) to the least complex (class IV) (American…, 2012a; Jafari and Mohsenin, 2010).
Class I or II PSG is characterized by the presence of an electroencephalogram (EEG) together with at least seven other sensors, such as electro-oculogram (EOG), electromyogram (EMG), respiratory flow and effort.This type of exam directly interferes with patient comfort and sleep quality, which are disturbed by the number of sensors, connectors and equipment placed on different locations of the body.Moreover, PSG class I requires an overnight stay at a sleep centre, which may trigger a syndrome known as the "first night effect" (Agnew et al., 1966).All of these issues have an important influence on the variable of interest: the sleep itself.Additionally, PSG class I or II is an expensive exam and is normally not easily accessible to the majority of the population, even in wealthy countries, resulting in long waiting lists (Escourrou et al., 2000;Flemons et al., 2004).However, the precision of class IV PSG is not sufficient to identify and diagnose most sleep diseases because it is composed of only one or two sensors.Class III is composed of four or more sensors, and an important class III feature is the absence of an electroencephalogram (EEG).This absence makes it impossible to discern between the internal non-rapid eye movement (NREM) stages (N1, N2 and N3).However, the presence of other biological markers makes it possible to distinguish among the sleep macrostructure phases of wakefulness (W), NREM and REM sleep.
According to the specialized literature, class III polysomnography must also be capable of detecting sleep apnea.To achieve this goal, the common recommendation is that oximeter and respiration signals should both be monitored.Although new portable devices have been proposed to acquire these signals, the discomfort caused by cables and sensors remains a problem (Cattrysse et al., 2014;Goodrich and Orr, 2009).To minimize discomfort, some studies have proposed the elimination of a specific respiration sensor with the use of ECG-derived respiration approaches (Penzel et al., 2000;Sharma and Sharma, 2018;Song et al., 2016).Moreover, Song et al. (2016) showed that it is possible to detect obstructive sleep apnea using ECG signal processing.
Several studies have noted a reduction in patient distress using two distinct approaches: the use of new sensor methods, i.e., Doppler radar (Lubecke and Boric-Lubecke, 2009) or a piezoelectric sensor attached to the bed and pillow (Lokavee et al., 2012), and the use of modular PSG solution, which is composed of smaller and possibly wearable modules (Chang et al., 2012).The use of actiography (ACTG) was stated as a promising alternative in a systematic review conducted by Van de Water et al. (2011) even though this technique tends to overestimate the sleep time in patients with low sleep quality, which diminishes its accuracy.
Nonetheless, the new sensor methods are not suitable for home-care use because they are expensive and are capable of monitoring only a few patient parameters, and together with relatively low accuracy, a less appropriate environment for diagnosis is created.Furthermore, the system presented by Chang et al. (2012) is not composed of specialized boards, which increases the system volume and patient distress.Furthermore, this setup does not monitor ambient parameters.
To this end, this paper proposes an alternative class III polysomnography method that acquires environment variables together with biological data from the patient, such as ECG, ECG-derived respiration (EDR), and EOG.
Environmental conditions do influence sleep quality (Halperin, 2014;Okamoto-Mizuno and Mizuno, 2012;Rosenthal et al., 1990), but they also influence other important parameters not directly related to sleep, such as cardiac autonomic response during sleep (Okamoto-Mizuno and Mizuno, 2012).
Thus, environmental and biological data allow a physician to infer whether one or more arousals was caused by physiological reasons (apnea or restless legs) or environmental reasons, thus improving treatment.This is the first report of a modular sleep monitor that meets the main class III PSG requirements and captures environmental variables such as temperature, humidity, visible light intensity and audible noise level.All of the software and hardware designed and developed in this study are available at the first author's Github page (Schneider, 2017).

Proposed modular system
The proposed system is divided into three modules denominated in this work as MD-EOG, MD-ECG and MD-ACC.The boards can acquire different signals from the patient and from the environment to compose a complete scenario.Thus, an expert physician can determine and distinguish among the W, REM and NREM sleep stages.
The MD-EOG (82×60 mm) is the only module that should not be placed on the patient's body, and instead, it should rest on the bedside.This approach is necessary because this module is responsible for acquiring environmental data.The MD-ECG (81 × 40 mm) is responsible for acquiring the ECG signal and the trunk posture and has the ability to acquire and store data from two external analog three-axis accelerometers and a commercial SpO2 module.The MD-ECG remains inside a pocket on an elastic strap, which is fastened on the patient's trunk just below the chest.This installation position allows the patient to turn over in bed during sleep.
The MD-ACC module (54×28 mm) is attached to the patient's right ankle with a strap similar to the one used in the MD-ECG and is responsible for acquiring and storing the patient's limb posture and movement using a triaxial accelerometer.
Only two constraints apply for the use of the boards.The first constraint is that the boards must be powered by batteries, since the actual hardware project does not cover the safety requirements presented in IEC-60601 and related standards for line-powered equipment.This first limitation is not necessarily a problem because the boards are powered by 750 mAh batteries (10.8×24.8×46.0mm) and supply at least 16 consecutive hours of sleep monitoring.This long operation period is achieved using low-power-consumption components and proper circuit design.The monitoring period could be amplified by placing the microcontrollers (µC) into deep-sleep mode and reducing the sampling frequency, but further research must be performed to evaluate the impact of these actions on the system performance.
The second constraint is that all of the boards must be synchronized prior to the start of data acquisition.The synchronization is achieved by wiring the three boards together and pressing a button placed on the MD-EOG board for 2 seconds.This type of wiring process is shown in Figure 1.
Any module can be removed from the system without harm to the functionality of the other modules.This is an important feature that enables a less intrusive sleep monitoring system if a system of this nature is needed.It is also possible to use boards similar to those presented in this work to monitor bioelectric patient signals such as the electromyogram (EMG) and EEG with restrictions.

Sensor features
The boards are equipped with 8-bit ATXMEGA microcontrollers (ATXMEGA128A1U in MD-ECG and MD-EOG and ATXMEGA128A4U in MD-ACC).The variables acquired by the complete distributed system shown in Figure 1 are summarized in Table 1 and described as follows: • Bipolar EOG and ECG: These measurements have an analog front end via the ADS1293 integrated circuit (IC), which is specialized for acquisition of bioelectrical signals from the human body with a 24-bit analog-to-digital converter (ADC) and dedicated circuits such as the right leg drive (RLD) that reduce the common mode noise.These signals are sampled at a rate of 400 Hz,  which is twice the minimum recommended by the American Association of Sleep Technologists (AAST) (American…, 2012b).Additionally, the EOG and ECG cables are electrically shielded and produced specially for this system to improve patient mobility and size reduction.A set of 1 kΩ patient protection resistors is placed in the boards to avoid use of the traditional box for connectors used in ECG cables; • Ambient sound noise level: To detect the levels and noise spikes in the audio signal that might disturb sleep, a circuit based on discrete components was developed to extract the envelope of the signal (smooth curve outlining the extremes of a signal).The audio signal is captured by an electret microphone and is amplified and passed through an amplitude demodulation stage to extract its envelope.The circuit used to achieve this goal is presented in Figure 2 and is explained in the ambient noise amplification and demodulation circuit (ANA) section; • Patient accelerometry: The presented system uses two three-axis accelerometers (ADXL335), placed on the trunk and on one ankle, with both running at a sampling rate of 40 Hz to enable the system to estimate patient posture and movement.These parts supply information that improves the sleep scoring and allows future correlation of sleep quality and body posture for a specific patient; • Ambient illuminance: This process uses an OPT3001 sensor and is sampled at 10 Hz.This component has spectral sensitivity similar to that of the human eye (Texas…, 2014); • Ambient humidity and temperature: This sensor uses a HDC1050 part and is sampled at 1 Hz; • Battery voltage: Via a resistor divider, the battery voltage is sampled at a rate of 1 Hz and prevents overdischarge of the battery and possible battery damages.
Management of different sampling rates and system coherence is assured by the use of a single high-priority microcontroller internal timer interruption and individual software pre-scalers.These features were also needed to assure that in the worst-case scenario, the sampling of all variables does not take longer than 2.5 ms.
For EOG and ECG, the resolution and maximum range were derived by comparing the sampled signal to a referenced signal.For ambient sound noise, the values were calculated after calibration (additional information is supplied in the ambient noise amplification and demodulation circuit (ANA) subsection).For patient posture (accelerometer) and ambient temperature/illuminance/ humidity, the values were calculated or directly extracted by referencing the respective component datasheets.
The OPT3001 and HDC1050 parts are fabric calibrated, and their datasheets supply equations to convert the raw data into their respective units of interest (Texas…, 2014;2015).A first-order three-point fit (-1 g, 0 g and 1 g) was conducted to calibrate each accelerometer axis.

Ambient noise amplification and demodulation circuit (ANA)
As previously mentioned, an ANA has been developed and is fully presented in Figure 2. The ANA circuit is divided into three stages; its functionality is now briefly described.
The first stage, known as the pre-amplifier, is responsible for feeding a DC bias current into the electret microphone's internal JFET.In the presence of sound waves, an AC current component is added to the DC, Figure 2. Ambient noise amplification and demodulation circuit.Res. Biomed. Eng. 2018 June;34(2): 127-137 131/137 and only the AC component passes through the 2.2 µF capacitor placed between the electret microphone and the inverting input of the operational amplifier (OPA).This component is pre-amplified by the first OPA, which also adds a voltage offset to the signal.This first stage was developed based on the one implemented by Caldwell (2015).
The second stage is the amplifier and is responsible for removing a portion of the initial offset and supplying an extra gain.All resistor values were adjusted while measuring the output port of the second OPA with the aim of reducing the DC offset in a relatively quiet office room and simultaneously avoiding saturation of the signal with the audio produced by close human conversation.
The third stage is the envelope-capture circuit and is responsible for rectifying the signal and extracting its envelope or energy.The analog-to-digital conversion pin (represented by ADC) is connected to this circuit through a resistor divider.This component is necessary because the ANA is powered by 6.6 V, which is twice the ADC voltage reference.Supply of the ANA with 6.6 V is required for correct operation of the electret microphone.Any single-supply and rail-to-rail operational amplifier with an appropriate frequency response could be selected to replace the OPA2333 presented in Figure 2. The full board circuit is available at the first author's Github page (Schneider, 2017).
After complete manufacture of the board, the calibration of the audio circuit was conducted with the aid of the decibel meter CR:162C, which was set up to operate with an 'A' attenuation curve.Both the decibel meter and the board were positioned equi-distant from the computer speakers in a quiet and closed room.The computer executed a script based on the Sox Software Audio Synthesizer (GitHub, 2013), which synthesizes a wide spectrum of white noise and changes its volume every 10 seconds from the lowest (30% of the sound system capacity) to the loudest (80%) setting in steps, i.e., 30%, 35%, 40%, etc. Between one step and the next, the value in decibels was noted.Notably, preliminary tests showed that volumes below 30% did not have sufficient intensity to sensitize the proposed circuit, and volumes above 80% saturated the system.
Calibration was conducted by comparing the sound level recorded by the CR:162C with a 7-second average of the signal recorded by the MD-EOG.A first-order polynomial was calculated by fitting the base 10 logarithm of the digital sound values read by the MD-EOG and the dBA values read out from the CR:162C.The fit has a maximum error of 0.75 dBA.The fitting equation and its characteristic coefficients (with 95% confidence bounds) are presented in (Equation 1): ( ) 1 2 log10 * : 1 24.05 1.1 2 3.005 3.36 where p and p (1) When implemented, this technique permits sampling of the signal by the µC at a low rate, more precisely, at 100 Hz instead of 44.1 kHz, which is a common sampling rate for audio signals.Such a high sampling rate demands much more memory and hardware processing capabilities, which are incompatible with the proposed hardware.Furthermore, using the signal envelope instead of the entire signal grants privacy to the patient.

Data storage features
The firmware implemented for each µC uses the FATFS library (version 0.11a), which is an open-source library written in C by Chan (2016) and is able to create, open and handle FAT32 files in flash storage devices while consuming less than 16 KB of µC flash memory, and in doing so, it dismisses the need for an additional datalogger board.
After the synchronous start of data collection, each board sends a package of data collected every second to its respective µSD card.Beyond the data, this package contains a header, an id number, and a 2-byte checksum that allows the descriptor program to identify package loss and data corruption.
Prior to the overnight tests, a benchmark of the FATFS library at the chosen µC architecture was constructed by writing generic packages with different sizes into the SD card.The library throughput varies from 625 Bps when a package size of 16 bytes is chosen to near 24 KBps when the system is configured for packages of 2 KB.
The amounts of data generated by the boards per second are 1694 (MD-EOG), 1926 (MD-ECG), and 246 bytes (MD-ACC).For these package sizes and using the worst matching system throughput, the process that saves the data acquired by the modules into the µSD card takes 8.5 ms, 9.6 ms and 5.6 ms, respectively.This process reduces the time needed to store the data, and a double buffering process and a microcontroller capable of handling multiple priority interruption ensures the system coherency.
The storage features include a theoretical limit of 9 patients monitored for a maximum of 99 hours without the need to download the data to a computer.Notably, the FAT32 protocol can handle up to 4 GB of data (for each module), and this is the upper limit for the data storage system described in this paper.

Computer-based library
Three MATLAB scripts, one for each module, were developed and compose the library, and they are responsible for conducting the following actions: • Read, interpret, scale, reorganize and graphically present the data saved by the Modular PSG into the µSD cards; • Identify package errors or losses (but the current library is not able to correct them); • Remove the baseline wander (BW) of the ECG and EOG signals by applying a second-order Butterworth high-pass filter with a cut-off frequency of 0.05 Hz, thus preserving the signal characteristics, as noted by Buendía-Fuentes et al. ( 2012); • Apply a 10 Hz second-order Butterworth low filter to the accelerometer data; • Estimate patient posture using a simple algorithm that analyses the trunk accelerometer signal to find the axis with the largest acceleration module (most aligned with the gravity) and analyse its signal to extract the patient posture; • Find the QRS peaks, calculate the heartbeat frequency, extract the respiratory signal, and estimate apnea events.These tasks are better explained in the next subsection.
Removal of the BW in a computational level is beneficial to the application because it saves microcontroller processing thus reducing power consumption.Moreover, this implementation allows an expert clinician to edit the filter process, thus facilitating the use of a non-linear filter such as that reported by Hao et al. (2011).
The use of this library is relatively simple and demands that the user copy and paste the files into the script's folder and change the variable that indicates the name of the file that will be read.A brief tutorial is available in the Github project.

Respiratory frequency and apnea detection algorithm
The ECG module's script is responsible for evaluating and detecting the apnea events.This goal is accomplished with the use of a three-step algorithm that estimates the EDR signal, calculates the respiratory frequency and detects apnea events.
Related to the first step, different techniques are applied to perform the EDR, i.e., the heart rate variability, which is the time interval between two R peaks (Drinnan et al., 1998).These techniques include use of principal component analysis (Sadr and De Chazal, 2016) and the R wave attenuation signal, which involves evaluation of the amplitude of the R peak (Huang et al., 2012).
The methodology used to estimate the EDR signal in this work consists of three steps: the ECG signal is read and filtered with a median filter, QRS wave detection is run using the algorithm developed by Pan and Tompkins (1985), and the R wave area technique is applied to estimate the respiration signal developed by Silva and Moody (2014).
To detect the respiration frequency and identify the apnea events, the frequency response of the EDR signal was analysed.According to Huang et al (2012) the signal is categorized by its frequency component, whereas normal breathing EDR can be categorized with a frequency response peak between 0.15 and 0.30 Hz (or 9 to 18 cycles per minute, cpm), and an apnea event could have a frequency response peak with frequencies as low as 0.01 Hz (0.6 cpm).
Following this methodology, the EDR frequency response was analysed.The fast Fourier transform (FFT) with window size of 2^15, which represents a resolution of 0.18 cpm -Physionet data and 0.73 cpm for the proposed system sampling rate.The FFT was performed in 60-second windows of the EDR signal.The window is moved to 12 seconds, and the FFT is recalculated.The DC component is discarded, the component with highest amplitude of the EDR frequency domain is found, and this peak is the respiratory frequency of that specific window.To detect apnea events, a threshold of 0.12 Hz (7.2 cpm) was applied, and this value was empirically determined after tests with five records randomly selected from the Physionet Database (Goldberger et al., 2000).
To test the apnea detection algorithm, 28 sleep intervals belonging to the different records of the Physionet database were selected.Each interval contained approximately 83 minutes of ECG with a sampling rate of 100 Hz.The final accuracy was 74.8%, the sensitivity was 75.6% and the specificity was 73.91%.In other words, the proposed system correctly classified approximately 62 out of the 83 minutes on average.Figure 3 illustrates the aforementioned process.

Results
To evaluate the system performance, bench tests and volunteer overnight sleep tests were conducted.Bench tests are necessary to evaluate the global safety, functionality, and coherence of the proposed system, whereas overnight sleep tests evaluate the system noise rejection, comfort, storage capabilities, and mechanical resistance (among other system features) during a natural night of sleep.
Importantly, these tests were performed with the module disconnected from the electric power grid.

Bench tests
To validate the system, a luminaire equipped with a 60 W incandescent lamp was positioned near the MD-EOG board, and its electrodes were connected to the face of one of the authors.The MD-ECG board was connected to the R&D Mediq HS-14 ECG simulator.Res. Biomed. Eng. 2018 June;34(2): 127-137 133/137 The test is described as follows, and the data collected from these stimuli are shown in Figure 4: • The data were collected simultaneously from the three boards in a similar manner as in a sleep test; • The ECG simulator was initially configured to generate a 2 Hz square wave, and after few seconds, its setup was switched to a 60 bpm ECG signal; • The author (volunteer) turned on the luminaire.As shown in Figure 4 (illum., temp., and hum.plots), the illuminance and board temperature increased, and the local relative humidity decreased.Additionally, the effects can be noted on the audio plot in the same figure, with a peak due to the switch click.The lamp was turned off near the 18th second; • The audio was tested with white noise generated by a small audio box, which remained on for approximately 7 seconds from the 10th to the 17th second, notably close to the MD-EOG.
The small audio box was subsequently pushed away from the MD-EOG, as can be observed in Figure 4 in the audio plot; • The EOG was tested with the use of disposable Ag/AgCl electrodes, and a solid KCl gel was positioned according to Silber et al. (2007).After turning on the lamp, the author completed two cycles by moving the eyes to the left, right, up and down.All of the movements are captured because of the electrode positions.The author held the eyes in a resting position and blinked three times naturally and one time forcefully.All of these actions were performed over 20 seconds according to Figure 4 and the EOG plot; • During nearly the entire test, the MD-ECG and MD-ACC boards maintained random movement, as shown in Figure 4 and plots Trunk Acc. and Ankle Acc.These plots were compared with the ECG plot (in the same figure) and showed evidence of the system robustness because no noise was exhibited in the ECG signal as a result of those movements.The non-specified units in the 'X' axis are seconds.
A specific test was conducted to evaluate the system synchronization.After one hour of data acquisition, the time difference between the modules was 0.1 seconds for the MD-ECG and MD-EOG and 5 seconds between the MD-ACC and the others.The clock difference can be removed by the computer application after the microcontrollers run the bare-metal code (without an operational system) that reduces the processing jitter to a negligible level.Once the system has proven its functionality, the next step is to evaluate its performance as a sleep test.

Sleep test
Three tests were performed with two healthy (without apparent sleep disorders) people (two of the three authors).Both people slept in their own houses and on their own beds.One person was monitored for 2 nights and slept for 8 hours per night.The other person was monitored during a single night over 8 hours.For both, the stored data had an approximate size of 107 MB per night.Neither of the volunteers reported arousals caused by possible discomfort related to the PSG system.
The ECG electrodes were placed following the Technical Guideline described by the AAST (American…, 2012a).The data directly acquired during a volunteer's third hour of sleep are exhibited in Figure 5 together with variables that are available after signal processing.
For the purpose of data comparison, 3 frames of EOG with a duration of 100 seconds were cut from different moments of a single night and are presented in Figure 6.The difference in the eye movement pattern is evident and indicates different sleep stages.

Discussion
To address the sleep classification performance of the proposed system, several authors have used data collected from alternative sensors to successfully classify the sleep macrostructure (wake, non-REM and REM sleep) or even its complete structure.For example, Kortelainen et al. (2010)     when a subject-dependent classifier was implemented, indicating that ECG alone is not a robust feature for classifying the sleep macrostructure in patients with breathing disorders.
Comparison of the clock of the three modules showed that the clock skew is constant among modules, enabling data re-sampling with no loss.In terms of data corruption, without the use of cyclic redundancy check (CRC) recovery algorithms, only six seconds (packets) of samples (approximately 0.003% of the total) had at least one byte corrupted.Such a low level of data corruption dismisses the need for on-board data check algorithms and reduces the processor power consumption.
Relative to the data security and privacy, this system saves the data using a particular protocol and organization, does not use any type of wireless communication, and does not record patient images, video, or audible sounds.Therefore, the system respects patient privacy and is secure for particular use.
The relative operational simplicity of the system, the increase in mobility and patient comfort, and the possibility of self-setup enables the patients to evaluate the quality of their sleep.Those facts mirror the international trends in the health care arena, such as wellness and healthiness.The possibility of removing or adding additional modules might result in better monitoring of sleep quality and cost reduction once the PSG system can be adapted to monitor only the parameters chosen as problematic by an expert physician, which can reduce the number of invasive sensors placed on the patient, thereby reducing patient discomfort.Moreover, it is also possible to monitor and evaluate the sleep environment before the patient goes to bed, which might improve further diagnosis and treatment.
Including all three boards, the electronic components and the cables, a total of 199.22 USD was expended to manufacture the presented system.This is a considerably low cost for this type of application.
This work should be viewed as a prototype with the aim of presenting and discussing a solution that increases patient autonomy and comfort during sleep monitoring and considers other variables (such as environmental variables that are not monitored in current commercial equipment) and may contribute to a more accurate diagnosis.To reach this point, the system must comply with the regulations in force.The apnea detection accuracy could be improved by introducing a device capable of measuring the blood oxygen saturation level or airway flow, but the tradeoff is the increase in patient distress: patients would have to wear a facemask or an ear clip to measure airway flow or SpO2, respectively.With respect to the system performance, future studies will need to compare the proposed system against a gold standard class I PSG commercial system.

Figure 1 .
Figure 1.Finished modules presented (left) from top to bottom: MD-EOG, MD-ECG and MD-ACC.The coin has a diameter of 25 mm.The red circle highlights the synchronization button.On the right, the prototype encapsulation and all wire connections must simultaneously start the data acquisition.

Figure 3 .
Figure 3. Example of QRS detection (red dots), ECG-derived respiration (EDR) extraction and apnea detection from Physionet's ECG signal.The red line in the respiratory frequency graph represents the threshold.A high level in the apnea detection means that an apnea event has occurred.The non-specified units in the 'X' axis are seconds.
used an Emfit sensor foil placed in the bed to extract the heartbeat interval and movement activity and to subsequently classify the sleep.Stepnowsky et al. (2013) used a single-channel

Figure 4 .
Figure 4. Result of one bench test.The light red and blue zones in the EOG graph indicate execution of the first and second eye movement cycles, the light grey zone indicates the natural eye blink and the dark grey zone indicates the forceful blink.The non-specified units in the 'X' axis are seconds.

Figure 6 .
Figure 6.EOG signal comparison of 100 seconds of sleep for a single individual and at different moments in the same night.The only signal processing applied to those shown in this figure is a movement average filter with a size of 11 (27.5 ms) and represents the mean removal.

Figure 5 .
Figure 5. Plot of all signals collected and processed by the system.The light red, blue and green zones in the truck acc.graph indicate that the patient is in left, dorsal and right decubitus, respectively.The non-specified units in the 'X' axis are seconds.

Table 1 .
Data acquisition main characteristics.