Automated Detection and Classification of Sleep Apnea Types Using Electrocardiogram (ECG) and Electroencephalogram (EEG) Features

1.1 Sleep and sleep disorders Sleep, which is defined as a passive period in organic physiology until the mid-20th century, is accepted to be an indispensable period of life cycle with today’s technological advances. While wakefulness is associated with the active excitation of Central Nervous System (CNS), sleep has been recognized as a passive period by the elimination of excitation. However, recent studies have shown that sleep is independent of wakefulness, generated by a sequence of changes in CNS, and a combination of five periods with clear boundaries. Sleep is not the disruption of daily life for a period of time or a waste of time. It is an active period which is important to renew our mental and physical health everyday and is covering one– third of our lives. Sleep activity is important for resting during the working period of basal metabolism of human body. The advances in technology enabling the measurement and quantification of brain activity make possible the micro and macro analysis of brain during both sleep and wakefulness states. With the studies investigating the CNS, it is observed the existence of some centrals causing the sleep by inhibiting the other regions of brain. As a result, sleep, which is an active and other state of consciousness, is a brain state of high coordination (Erdamar, 2007). Since breathing is established autonomously during sleep, it is affected by many anatomical and physiological parameters. Depending on this situation, various sleep disorders occur. There are more than eighty known sleeping diseases. Most of them cause person’s health to deteriorate and a decrease in life quality. As a result of the research carried out for many years, a list of sleep disorders, which are generally occurring, can be seen as in Table 1. Sleep disorders can be examined in two classes, parasomnia and dissomnia.

In 1997, ASDA (American Sleep Disorder Association) has defined obstructive sleep apnea syndrome as "A syndrome characterized by recurrent obstructions in upper respiratory tract (URT) during sleep and seen often with a decrease in oxygen saturation". The prevalence of the disease is 1-5%. Even generally knowing the risk factors during the beginning of this disease, which has no less than prevalence of Diabetes (Diabetes Mellitus) and Bronchial Asthma, the physiopathology of the obstructions are not totally explained. By a general evaluation, the stopping of breathing during sleep for at least 10 seconds is defined as 'sleep apnea'. Due to stopping of breathing during sleep, sleep qualities of such patients are disturbed since they often wake up at night. Additionally, they become sleepy during most of the day and have promoted degrees of pulmonary artery pressure and arterial PCO2. Sleep apnea is mostly observed amongst premature infants, adult males and post-menopausal women (Firat, 2003). The frequency of occurrence of apneas is high in obese and snoring individuals with narrow URT. Apneas can be observed in the stages of sleep other than rapid eye movement (REM) and non-REM (NREM) stages. The apnea types occurring during sleep and respiratory parameters related to these types can be defined as follows.

Sleep apnea and its types
In literature, there are three types of sleep apnea. These are listed as central, obstructive and mixed apnea. Obstructive sleep apnea (OSA) has the highest prevalence. Together with the absence of respiratory effort in the lungs, the absence of air flow inside the mouth and nose is defined as central sleep apnea. Despite the respiratory effort, the lack of air flow in the nose and mouth is obstructive sleep apnea. The situation starting with central sleep apnea and continuing as obstructive sleep apnea is defined as mixed sleep apnea. Mixed apnea patients can be treated by the methods applied to the patients with obstructive sleep apnea. Obstructive sleep apnea is the most common sleep apnea syndrome (Aydin et al., 2005). Obstructive sleep apnea is the state of absence of oral and nasal air flow despite the respiratory effort. Although the diaphragm and intercostal muscle activity continued, exchange of air through the nose and mouth stands (Aydin et al., 2005). In this case, it Is thought to be an obstruction at the URT of patient. In order to prevent the blockage, an intense activity in the chest and abdomen is observed. Central sleep apnea (CSA) is the state in the absence of both respiratory effort and air flow together. Central apneas grow by the corruption of the central regulation of respiration. Mixed sleep apnea is the state starting with central sleep apnea and continuing the absence of oral and nasal air flow when the respiratory effort begins. How the respiratory effort after the central sleep apnea starts is still a unresolved research topic. In the new terminology, mixed apneas are discussed as obstructive apneas.

Sleep respiratory parameters
There are a few basic definitions of sleep respiratory parameters in literature. Hypopnea is the 50% reduction of air flow during sleep for at least 10 seconds, 3% decrease in blood oxygen saturation or the staging of arousal. Arousal is defined as sudden sleep state transition to lighter sleep stages or wakefulness. Arousal terminates the apnea or hypopnea. Apnea Index (AI) is defined as the number of apneas per hour during sleep Apnea+Hypopnea Index (AHI) is defined as the number of apneas and hypopneas per hour during sleep. It is also called as Respiratory Distress Index (RDI). Respiratory Arousal Index (RAI) is defined as the number of arousals per hour during sleep. Obstructive Sleep Apnea is the situation AHI>5 during sleep. Obstructive Sleep Apnea Syndrome is the clinical situation that AHI>5 and major symptoms (snoring, witnessed apnea, excessive daytime sleepiness or drowsiness) met together. Central Sleep Apnea Syndrome is the situation where more than 50% of detected apneas are central type. The physician examining the patients with sleep respiratory parameters suggest the diagnosis of sleep apnea syndrome. Therefore, the scoring process performed over the PSG data obtained after sleep recording operations is extremely critical, specialized work, time consuming and inferential process (Roche et al. 1999;Firat, 2003;Aydin et al., 2005).

Previous studies for the detection and classification of sleep apnea
In sleep analyzing studies, there are a lot of approaches which are about detection and classification of sleep apnea. In recent years, the popular studies contain automated detection and classification of sleep apnea. The newly developed techniques have given an increased speed to the classification and detection of sleep apnea. However, these new techniques are usually built over the detection over a data scored by a health authority. Few works have tried to construct an automated system which will detect or classify the measured data and score by itself. Most of the automated systems developed in this manner have used only one bio-signal to detect or classify the apnea. However, a fusion of features extracted from the multiple bio-signals (ECG and EEG synchronization) can be expected to give better success rates for the detection and classification. Another interesting issue for the previously studied works is the classifier selection. Most of the works are designed to work on neural networks. Thoroughly, sleep EEG series recorded from patients are classified by using Feed Forward Neural Network (FFNN). The NN architecture has several numbers of neurons and hidden layers. This method shows that the degree of central EEG synchronization during night sleep is closely related to CSA and OSA (Aksahin et al., 2010). However, neural networks are very unstable structures when the design constraints are not selected carefully. In contrasting, very few of the works use wellknown stable classifier such as support vector machines (SVM). Additionally, it is possible to use a feature selection scheme to observe the effects of the features to the success rates. Khandoker et al. (Khandoker, 2009a) proposed an SVM based algorithm to identify Obstructive Sleep Apnea Syndrome (OSAS) over 125 patients by using their 8-hour-long ECG recordings. They achieved high success rates to classify OSAS and non-OSAS patients. Their method covers determining the class of a patient. However, they do not mention where the apnea occurs. In the same year, Khandoker et al. (Khandoker, 2009b) tried to differentiate between OSAS and hypopnea patient in a similar methodology. Mendez et al. (Mendez, 2008) have developed an autoregressive model to screen sleep apnea from a single ECG lead. They used RR intervals and the area of QRS complex as their features for the analysis. According to Xu et al. (Xu, 2009), it is possible classify the sleep apnea by monitoring the variations on heart rate variability (HRV) signal. Another approach to detect the OSAS patient is to use EEG signal as a source to generate features from Liu et al. (Liu, 2008) have proposed a neural network based detection method for OSAS and narcolepsy patients. They used the energy of EEG signal, theta and beta wave activities as features to detect patients correctly. In literature, there are no previous works combining the detection and classification procedures. In this context, an automated system can be constructed to detect apnea regions and classify them as obstructive, central or mixed apnea as a new approach. This shows it is a new area in biomedical engineering and it needs some good research to reveal the relationships between bio-signals and sleep apnea. In order to detect apnea, this chapter presents a methodology over ECG recordings, which contains time and frequency domain features. Moreover, EEG recordings are used to verify the detection of sleep apnea. The basic frequency domain features of ECG are very low frequency (VLF), low frequency (LF), high frequency (HF), the ratio of LF and HF (LF/HF) over HRV information. To obtain true HRV information, we will use Teager's energy operator to detect R-R durations. The Teager energy operator (Hamila et al., 1999) was first defined over real-valued signals and then defined for multidimensional continuous-domain signals and used for image demodulation. From the first appearance of the Teager energy operator, it has been used in several applications such as one dimensional (1-D) signal processing, image processing, and color image processing. There are previously very few works about Teager energy operator for detection of RR intervals. We will also use wavelet information to find the exact positions for P, Q-R-S and T complexes. In addition, TEO is used for other physiological signals (speech, EEG etc.). For EEG signals, short time period correlations and power spectral densities will reveal the apnea regions and help us to find the type of apnea. Power spectral densities are calculated by a few methods for example Pyulear, Welch, Burg (Stoica, 1997). These features will have valuable information for the classification of apnea types. In extent, the change in frequency features of HRV information will help us to detect the apnea regions. The consideration of this change can be determined by using statistical methods such as Annova-Mannova, and types of t-test (Gula et al., 2003). These analyze methods can be used over the considerable measurements. Their logical validation is determined by using the reliability consistency test which is a statistical analysis method and measures how much accurate is a measurement set. For example, if a scale can give the same result with the measurement process repeated n times and statistical reliability factor is close to the value α= 1, then we conclude that the measurements of the scale are reliable. The presence of the nonparametric variables in the physiological signals obtained from the patient shows the idea that the reliability test cannot be applied to these types of measurements.

Sleep recording and scoring
Sleep records began in the 1960s for the first time, took its final form with the addition of respiratory recordings and their final definition, which is still valid, is issued by Holland and his colleagues in 1974. Holland used the term polysomnography to indicate the simultaneous recording, analysis and interpretation of various physiological parameters during the sleep through the night.

Polysomnograph and recording system
Polysomnography is mainly investigating the structure and physiological changes of sleep during sleep. This investigation provides reviewing sleep structure, psychological, biological and pathological changes in sleep by relating them with the sleep stages. Furthermore, it enables to investigate the sleep changes in human physiology under the conditions of sleep itself. During these investigations, whether a physiological event can be addressed alone, or multiple event and their implications can be explicated (Aydın et al., 2005).By examining data collected during sleep, the turn-up form, characteristics, the process and the response to the treatment of various diseases can be examined. In Fig. 1, output records for a sample polysomnogram are shown.

Fig. 1. Output records for a polysomnogram
Simultaneous recording of the sleep parameters should be able to give sufficient information about both the sleep and breathing pattern in sleep. In order to do staging of sleep, at least 2-channel EEG, EOG, chin EMG, oro-nasal air flow, arterial oxygen saturation, respiratory effort and ECG or pulse recordings must be done. In many cases, the anterior tibial EMG recording can be useful to detect periodic motion disorder. Polysomnogram is used, in general, for the investigation, diagnosis and following up the treatment of sleep related breathing disorders.

Electrocardiogram (ECG) recordings
The technology interpreting the changes in electrical potential during heart activity is called as electrocardiography and the recorded by the device are called as electrocardiogram (ECG). Fig. 2 shows a normal ECG recording. The duration of P wave and QRS complex is 0.1 seconds while the average wave amplitude (peak R) is around 1 mV. This peak value rarely rises up to 5 mV. These nominal values can change from one person to another by the patient's heart and body size and body conductivity.

Electroencephalography (EEG) recordings
EEG is the system used to measure and record the electrical activity of the brain. The brain waves obtained from EEG system have delta, theta, alpha, and beta wave bands. Delta waves have 0.5-4 Hz frequency band with 20-400 μV amplitudes and are encountered in the situations of very low activity of brain, such as deep sleep and general anesthetic state. Theta waves have 4-8 Hz frequency band with 100-500 μV amplitudes and are encountered in the situations of low activity of brain, such as dreaming sleep and medium anesthetic state. Alpha waves have 8-13 Hz frequency band with 2-10 μV amplitudes and they are closest ones to the sinusoidal form between EEG waves. They are observed at awake individuals with closed eyes in a physically and mentally full resting condition. Fig. 2. QRS complex of a ECG signal (Köhler et al., 2002) Beta waves are observed at the frequencies higher than 13 Hz and their amplitudes change in the range of 1-5 μV. They are observed at focused attention, mental working states, and rapid eye movement stages of sleep. These waves correspond to the level of the highest activity of the brain waves (Pehlivan, 2004). By using EEG signals, sleep stages during the sleep period can be distinguished. These stages are divided into 5 classes. In general, as the sleep gets deeper, a frequency decrease in EEG signals. In sleep, there are two change stages following each other periodically. These are REM (Rapid Eye Movement -Paradoxical Sleep) and NREM (Non-Rapid Eye Movement) stages. The period between eyes shut to sleep and full sleep stage is called as the latent period of diving into sleep. After latent period, the exchange periods start. NREM sleep is occasionally divided into 5 phases based on the electroencephalographic changes occurring during the course of sleep. Phase 0 is wakefulness stage, Phase 1 and 2 is the shallow sleep period, Phase 3 and 4 are the periods of deep sleep. It is possible to observe high amplitude low frequency waves and spindles in EEG. In this stage, there is no eye movements, muscle tones are decreased, pulse and respiratory are slowed. In Table 2, the phases of NREM sleep and their characteristics are given (Park, 2000). REM sleep is the dream stage of sleep or the dreams seen in this stage can be remembered in wakefulness state. This stage is interspersed between the other phases of the sleep. It is connected with a large number of different features.

NREM Sleep Phases
Characteristics Phase 0 (Wakefulness) The stage before diving into sleep. Phase I The state one individual who is diving into sleep has faced. If the individual is forced to wake up in this phase of sleep, he will say he was usually awake even he was not aware of the events around him. Phase II In this phase of sleep, consciousness is in a state that he will be aware of he was in sleep when he was forced to wake up. EEG patterns can be seen. K-complex and sleep spindles are expected to be seen. Phase III and IV Low frequency deep sleep.

Other physiological measurement parameters
EMG (Electromyography) is the method of observing and recording of skeletal electrical activity. EMG signals contain very high frequency components ranging between 10 and 5000 Hz. EOG is the method of observing and recording of eye movements resulting from electrical activity of muscles.
Thermistor is the sensor detecting the air flow from the nose. With the help of thermistor, it is determined whether there is an obstruction at the upper respiratory tract or not. Microphone records the sound from the mouth. With the help of microphone, the recorded sounds of snoring can be examined. Thoracic respiratory signal, which is obtained from the expansion and narrowing of the chest, is recorded by wounding a special type of tape around the chest. The breathing can be examined through the recorded signal. SpO 2 is the signal showing the blood oxygen saturation. With the signal recorded through PPG device, amount of change of oxygen in the blood after breathing is analyzed.

The sleep apnea features based on electrocardiogram (ECG) and electroencephalogram (EEG) biosignals
Sleep apnea detection approach over ECG and EEG physiological signals taken from polysomnograph recently appears to be a popular study. The methods apart from the classical methods followed by the physician to detect sleep apnea is based on the examination of features correlated with the sleep apnea from ECG and EEG signals to construct an automatic decision support mechanism.

Sleep apnea features based on electrocardiogram biosignals
Heart rate variability (HRV) information takes the first place amongst the researchers conducted on ECG physiological signals. Heart rate variability is related to the nature and the presence of sleep apnea. While many commercial medical equipments measure the automatically, they cannot bring a fully automated approach on detection and diagnosis of disorders such as sleep apnea. Heart rate variability includes many features in both time and frequency domains and needs different methods in calculation of these features. ECG raw data, which is analyzed statistically in both time and frequency domains, is separated as short term and long term by the length of data (Camm et al., 1996).

Calculation of heart rate variability
In order to perform the calculation of heart rate variability from the ECG signal, first of all, R-wave detection needs to be done as much as possible. There are many approaches in detection of R-wave in the literature. Some of these methods are summarized in Table 3. For example, there are methods based on wavelet transform and digital filtering for R-wave detection. In order to remove noise from ECG signal, it is passed through a wavelet transform block and QRS complex is emphasized in contrast to P and T waves by the moving average based low pass filter given in Eq. 1. In Eq. 1, y1 is the output signal, x[n] is the input signal and M is regarded as the length of the filter. Later, the processed ECG signal, which is passed through a nonlinear amplifier, is applied to an adaptive thresholding block (Chen et al., 2006).
Teager energy operator is applied off-line over the signal on the basis of discrete time domain. Sampled at a particular frequency, ECG signal is applied to the discrete version of the Teager energy operator given below: Teager energy operator covering the three samples of the signal side by side, shows a very local feature of the signal (Kaiser, 1993). In Fig. 3, an exemplary sequence of the ECG signal and the corresponding output of the Teager energy operator is given. Before applying the Teager energy operator, ECG signal must be freed from noise. These noises are usually seen as baseline drift and motion artifact. In both time and frequency domains, there are algorithms used to eliminate these types of noises. For example, if there is a low frequency noise on ECG signal, a "moving average filter" in time domain (Rangayyan, 2002) or high-pass filters in frequency domain are applied. After the TEO algorithm is applied to ECG signal, a threshold value comparison should be made to determine the R-wave peak points. 60% of the maximum value of the output signal from TEO block can be chosen as the threshold value. If the output of TEO exceeds the threshold at time t0 and no greater value in the next 0.25 seconds is observed, t0 is marked as R-wave peak point (Erdamar, 2007). TEO output of a sample ECG signal and detected R wave peaks after the threshold comparison is shown in Fig. 4. Heart rate variability is defined as the time differences between the two consecutive R-wave peak points and are expressed in units of milliseconds or seconds. Heart rate variability data given in Fig. 5 is examined in both time and frequency domains. In case of missing R wave or finding extra R waves, we can observe upside or downside peaks on the HRV data. In order to eliminate this situation, an adaptive thresholding algorithm must be applied to detect R-wave peak points.   Table 4. Time domain features are calculated over 24 hours (long term) recordings and frequency domain features are calculated over 2-5 minutes (short term) recordings (Camm et al., 1996;Roche et al., 2002). The difficulty of the long term analysis is the impossibility of finding 24 hours noiseless raw data. In most studies, it is observed that the power spectral densities obtained from the signals containing the sleep apnea syndrome have more intense low frequency (LF) components than that of the normal signals. After the treatment of sleep apnea it is usually seen that low frequency density has decreased and converged to the nominal values of normal individuals (Roche et al., 1999). Table 5 exhibits the time and frequency domain feature values of a normal individual (Camm et al., 1996). On the other hand, it is possible to obtain different feature values over

RR beat number RR intervals (sec)
www.intechopen.com data gathered from different patient groups and different polysomnography devices. The reasons for these differences are the resolution of the device and patients having different characteristics of physiological parameters affecting AHI values. We suggest creating simultaneously a control group of healthy subjects as a reference in HRV analysis procedures.

Fig. 6. Power Spectral Density of HRV
Choosing the created control group as a reference and analyzing the other patient groups will be useful to obtain statistically significant results. Statistical methods, such as Anova-Manova, student's t test, multi variable regression and correlation, are used for scientific analysis of the features obtained from the spectral analysis of HRV. For instance, ANOVA test can be applied to show the statistical difference between groups of patients with sleep apnea. Within the scope of this test, it is clarified as a result that two groups are different when P<0.05 between the groups is achieved (Gula et al., 2001).

Variables
Units Normal Values (mean ± SD)  Another statistical methods based parameter is Form Factor. This parameter is a statistical value depending on the exchange of activity amongst one-second-long signals (Hjorth, 1973;Rangayyan, 2002). In form factor calculation, (activity-variance) and (variability) are used. In Eq. 4, the formula for variability and in Eq. 5, form factor formula is given.

The features based on electroencephalogram biosignals
EEG signals are another physiological signal type used in the detection and classification of sleep apnea. Due to the morphological properties separating from the ECG signals, they are applied to different analyses. Since sleep apnea is a ten second long event, they can usually be detected by an examination of epochs before and after sleep apnea. If the analyses cover 20-30 seconds part, they contain macro structure. The processes such as spindle scaling, slow wave activities, and arousal detection are included in macro structure analysis (Malinowska et al., 2006). In Fig. 7, a regular part of the respiratory system and the corresponding sub-band representation of the EEG signal in that epoch are shown. The horizontal axis represents the time and the vertical axis represents amplitude. In occurrence of sleep apnea, changes observed at the corresponding sub-band range.

Fig. 7. a) Thermistor signal b) EEG sub-bands
In Fig. 8, respiratory signal with apnea and the corresponding sub-bands of EEG signal are shown. In this representation, change in the sub-bands of the EEG section corresponding to the respiratory signal with apnea is observed. The existence and amount of this change can be proved by calculating power spectral density. The analyses are made over 10 second portions within the scope of micro structure (Erdamar, 2007). Some approaches are based on the EEG arousal detection of micro-structures. This is because the EEG signal of a patient diagnosed with OSA contains arousal structures during Delta Theta Alpha Beta 1 Beta 2 Fig. 8. a) Thermistor signal b) EEG sub-bands sleep apnea. In detection of arousal structures, data from EEG, pressure and temperature of thermistor, chin-EMG, and tibialis EMG are used. In order to detect the status that arousal response is longer than 3 seconds, the PSG data is examined in 1.28-second segments with a 0.4 Hz frequency resolution. Chin-EMG and tibialis EMG records are important for the detection of pathological events. Since arousal events inside the EEG signal generates rapid changes in all frequency components, direct analysis methods give no results (Sugi, 2008). In addition, the important alterations are observed on previous divisions of sleep apneas. In sleep apnea events, the most significant alternations are observed in alpha and beta waves. These alterations cannot be realized in whole EEG spectrum because of their sizes. Therefore, EEG signals can be analyzed by using short time fouirer transform of narrow windows (Erdamar, 2007).
The LF/HF rates calculated from HRV of these patients are shown in Table 6.  On the other hand, form factor (FF) calculation can be shown as a different approach for the detection of sleep apnea and different approach from literature. FF calculations made for a segment from 160 msec before to 240 msec after of each detected R-wave of the ECG signal can be thought as a determining factor for predicting the sleep apnea. In experimental works, a threshold FF value was determined in ECG recordings to identify apnea. In this context, apnea is appeared for 4 and upper FF values in ECG recordings. Fig. 9 corresponds to the FF series of an ECG recording with apnea. In Fig. 10, the thermistor signal with 256 Hz sampling frequency of non-apnea patient and corresponding FF values calculated on ECG signal are given. When a number of FF values obtained from apnea and non-apnea patient recordings with equal length are examined, a decrease in heart rate in case of apnea is found. In the ECG signal without apnea, more R-waves is found and as a result of that phenomena, it is understood that power spectral density of HRV has shifted to HF area. Thus, FF values are closely related to apnea events over ECG recordings.

Conclusion
Due to the fact that human physiology do not continuously respond in the same way to the same stimulus, both automated and adaptive analysis procedures over biosignals are limited. Thus, the sections, that have negative effect on variance and cause the algorithm to work inaccurately, are removed from the ECG signal and then the HRV analysis is done. W h e n a n a u t o m a t e d s y s t e m i s r e q u e s t e d , a general algorithm that can remove these corrupted fields from the ECG signal can be written at most. For this purpose, it is possible to find approaches in both time and frequency domains.
In detection and classification of sleep apneas, usage of support vector machines (SVM) instead of neural network based algorithms may be a better and more original approach. SVM, similar to neural networks, uses a part of the data for training purposes and the rest of data to testing purposes. On contrary, by its structure, it can present a more determined working strategy in contrast to neural networks. It is possible to obtain a very good HRV curve with the help of an algorithm that does not miss R-peaks as much as possible. In order to investigate the frequency domain attributes of HRV, the frequency characteristics are obtained from the HRV after the fast fourier transform (FFT) of it calculated. Thus, the features obtained from healthy patients and patients with sleep apnea can be easily differentiated.
With a quite smooth algorithm, the obtained HRV curves from the healthy patients fluctuate around a constant value in the amplitude range. In the fourier domain, we get the results in discrete time series. For the detection of QRS complex, finding many adaptive approaches are possible. From the output of Teager energy operator, 60% of the average of the magnitudes of previous detected consecutive n (<6) R-peaks can be used as the threshold value for the detection of current R-peak. Thus, it will be possible to detect signal with slowly changing magnitude threshold value will be adaptive to catch the magnitudes correctly. However, the signal loss due to the misplacement of electrodes on the surface of body cannot be recovered with this adaptive structure. Actually, there is possibly no way to get the signal from nothing. Another approach in design of an automated system can be a template matching algorithm. The basic requirement for this algorithm is the selection of a good clean QRS complex. There are numerous methods to decide a clean signal. If the cross correlation between the signal and the selected QRS complex, we get normalized outputs peaking at the R-peaks. In order to improve the results, this operation can be applied before the TEO operator and adaptive thresholding. This approach will give a more precise and an automated result. This operation is done by the normalized cross-correlation formulation given as: Normalized Cross Correlation Function = ∑ temp −temp * ecg −ecg ∑ temp −temp * ∑ ecg −ecg (6) temp= chosen template QRS complex ecg i = windowing of raw ECG (size of temp) ecg=raw data The critical point of this methodology is that the correct choice of the QRS template should be done automatically. Selections can lead to incorrect outputs with a wrong template, and this may lead other analyses converge to an erroneous point. During a decrease in the respiratory frequency, physiological systems of human body also reduce heart rhythm in order to provide homeostasis. In this way, oxygenated blood to spill all the biological system is more efficient.
A slowdown in heart rhythm causes observing the HRV power spectral density to shift to VLF-LF region. In the normal case, an opposite loop is provided, and the HRV power spectrum density increases towards HF band. Within the scope of sleep apnea detection processes, it is needed to use statistical analysis softwares to make sense in the scientific manner from the results. For example, for two different groups of independent samples, it is possible to prove that they different from each other in statistical sense by t-test. Pulse Transit Time (PTT), which will constitute the basis of the study, is thought to be a very strong microstructure for the detection of sleep apnea and obtained from ECG, EEG and PPG signals. PTT analyses can rarely be seen in the literature (Smith et al. 1999). PTT is the duration of arterial pulse pressure occurring during the instance of pumping of blood from aortic leaflet to peripherals (limbs). PTT can be detected by reference to R-peaks on ECG signals.
After the ventricle depolarization corresponding to a R-peaking, PTT can be taken as the time of transmission of blood pressure to the fingers. For this purpose, the PPG signal from the oxygen plethysmograph probe is needed. The PPG located inside the PSG system with the name PLETH provides this data. By looking at the average duration of PTT, we can make a correlation analysis on respiratory effort. As a result of this analysis, the features to detect sleep apnea can be obtained (Pitson et al., 1995).
The experimental studies show that HRV power spectral densities in patients with OSA and CSA shift towards the low frequency (VLF-LF) band while a dense nature in high frequency (HF) band is observed for normal patients. In this extent, the statistical analyses before and after uvulopalatofarengoplasti (UPPP) surgical operation, one of the methods used in treatment of sleep apnea, can be a good approach to measure the performance of the surgical operation. Another study conducted by our group is the evaluation of statistical analysis methods on the preoperative and postoperative sleep time and frequency domain parameters. It is thought that a prediction to sleep apnea and an implementation of indirect diagnosis system to help the physician are possible by investigating the cases called microstructures, which are impossible to see on ECG signals and EEG sub-bands, in the 1-2 epochs before and after the parts that contain sleep apnea in the EEG and ECG signals. This approach can provide more specific and original results.