1 of 4
heart rate as measured by the RR interval (RR) and R-
peak envelope (RPE) derived from R-peak of ECG
waveform may significantly improve the detection of
sleep disordered breathing (SDB) from single lead ECG
recording. The method uses textural features extracted
from normalized gray-level co-occurrence matrices of
the time frequency plots of HRV or RPE sequences. An
optimum subset of textural features is selected for
classification of the records. A multi-layer perceptron
(MLP) serves as a classifier. To evaluate the performance
of the proposed method, single Lead ECG recordings
from 7 normal subjects and 7 obstructive sleep apnea
patients were used. With 500 randomized Monte-Carlo
simulations, the average training sensitivity, specificity
and accuracy were 100.0%, 99.9%, and 99.9%,
respectively. The mean testing sensitivity, specificity and
accuracy were 99.0%, 96.7%, and 97.8%, respectively.
Keywords— ECG, Heart Rate Variability, R-Peak
Envelope, Sleep Disordered Breathing, Time-Frequency Plots,
Co-occurrence Matrix, Textural Features, Artificial Neural
Networks, Multi-Layer Perceptron, K-Fold Cross-Validation
Abstract— We report that combining the interbeat
Sleep-Disordered Breathing (SDB) is estimated to have
a prevalence of 5% in middle-aged population . SDB has
been shown to affect the productivity and quality of life of
the patient, and to have a high correlation with obesity and
congestive heart failure (CHF). The population is widely
thought to be under diagnosed because the present method of
diagnosing SDB, nocturnal polysomnography (NPSG), is
relatively expensive and not readily accessible. Cost
effective and more accessible means to screen the at-risk
population for SDB are highly desirable.
Previous studies  have shown the possibility of
screening for OSA episodes using overnight ECG
recordings. Different algorithms have been developed to
extract reliable markers from ECG signals including heart
rate variability (HRV), R-wave attenuation, ECG-Derived
Respiration (EDR) and power spectral analysis of particular
frequency bands. The use of HRV is appealing, as it reflects
the autonomic response to apnea episodes. One study has
pointed to combining different temporal statistical features
from HRV and RPE to improve the detection rate, with
accuracy of about 90% . Different investigators have
qualitatively explored spectrograms of HRV for the
detection of OSA using ECG .
Our previous work have shown similar results in
detecting events of Sleep Disordered Breathing (SDB) when
combining cross-correlation and scatter plot features from
the Heart Rate Variability (HRV) and the R-Peak Envelope
(RPE) . In this paper, we examine the combination of
textural features extracted from the time-frequency plots of
both HRV and RPE. An MLP classifier is used to detect
apnea events from normal breathing patterns.
Subjects: Seven volunteers who had no known history
of SDB and seven positively diagnosed as having SDB were
recruited for the study. The subjects underwent a full night
(6 to 8 hours) of NPSG. The test were performed at Sleep
Consultants, Inc., Fort Worth, TX, an accredit sleep
laboratory. A certified sleep expert, blind to the aims of this
study, scored the NPSG data according to Rechtschaffen &
Kales standard. The severity of SDB was measured using
the apnea-hypopnea index (AHI). Table I summarizes the
subject population demographics.
SUBJECT DEMOGRAPHICS OF THE NORMAL AND OSA GROUPS
INCLUDING THE APNEA/HYPOPNEA INDEX
group (N) males/females (mean ± std)
NOR (7) 5/2 43.00 ± 8.60
OSA (7) 2/5 51.14 ± 9.75
Experimental Protocol: The physiological markers were
reordered during the NPSG study included ECG, EEG,
SaO2, and airflow. As part of the NPSG recording, ECG
Lead I was digitally recorded at 1 kHz sample rate. These
recordings were used to extract both the RR and RPE time
sequences . The data was parsed into epoch of 900
seconds (15 min) in length to capture very low RR variations
(~0.001Hz), as recommended by previous investigators .
Fifty six epochs were used, 4 epochs from each subject.
The RR and RPE were interpolated using cubic spline
technique, and the resulting function was uniformly sampled
at 1 Hz.
Image Construction: Short Time Discrete Fourier Transform
(STDFT) was separately performed on both the uniformly
sampled RR and RPE time series, resulting into
Number of Age BMI
(mean ± std)
24.70 ± 4.32
34.24 ± 6.99
(mean ± std)
4.43 ± 3.60
38.71 ± 18.85
Sleep Disordered Breathing Detection Using Heart Rate Variability and
R-Peak Envelope Spectrogram
Mohammad Al-Abed1, Michael Manry2, John R. Burk3, Edgar A. Lucas3, and Khosrow Behbehani1
1Bioengineering Department, University of Texas at Arlington and University of Texas Southwestern
Medical Center at Dallas. 2Electrical Engineering Department, University of Texas at Arlington.
3 Sleep Consultants, Inc. Fort Worth Texas.
spectrograms. Figure 1 shows a comparison between
spectrograms extracted from RR and RPE sequences for a
normal clip verses a clip containing SDB events. Visual
differences can be observed between normal and SDB clips
for both RR and RPE sequences.
Each spectrogram extracted from both the RR and RPE
sequences is encoded to produce four gray level intensity
images: First image is generated by finding the magnitude of
the complex spectrogram matrix, and quantizing it to 16
equally spaced gray levels (Ng=16) – darker shades
represents lower power intensities and brighter shades
represent higher power intensities. The second image was
generated using the same method for the first image, but
with 32 gray levels (Ng=32). Third image was generated by
computing the log of the magnitude of spectrogram
magnitudes before quantizing it to 16 gray levels (Ng=16).
Finally, the fourth image was constructed by finding the
histogram of the spectrogram magnitudes, then allocating
them to un-equal size quantization bins, so that each gray
shade would be represented in the image (Ng=16) .
0.50 .25 0
2 of 4
(a) Spectrogram from an RR sequence of a normal 15-min epoch
(b) Spectrogram from an RR sequence of an SDB 15-min epoch
(c) Spectrogram from an RPE sequence of a normal 15-min epoch
(d) Spectrogram from an RPE sequence of an SDB 15-min epoch
FIGURE 1 – comparison between spectrograms extracted from RR and RPE
sequences for a normal clip verses a clip containing SDB events. Visual
differences can be observed between normal and SDB clips for both RR and
RPE sequences. The described method aims at quantifying these visual
differences, and using these features for further classification.
Co-occurrence Matrices and Textural Features:
Normalized gray level co-occurrence matrices (NCM) 
were used to quantitatively analyze the resultant images.
Due to the significance of the lower range frequency in
reflecting apnea events (0-0.25Hz) , two NCMs (NCM-3
and -9) were calculated for the lower half of the images.
Ten NCMs were extracted from the four gray encoded
images described earlier . Here, d represents the distance
of the pairing of the pixels, and θ is the orientation. From the
first image, four NCMs were selected:
NCM-1 (d = 5, θ = 90º)
NCM-2 (d = 1, θ = 90º)
NCM-3 (d = 5, θ = 90º)
NCM-4 (d = 5, θ = 0º)
From the second image, three NCMs were selected:
NCM-5 (d = 5, θ = 90º)
NCM-6 (d = 3, θ = 90º)
NCM-7 (d = 1, θ = 90º)
From the third image, two NCMs were selected:
NCM-8 (d = 5, θ = 90º)
NCM-9 (d = 5, θ = 90º)
From fourth image, one NCM was selected:
NCM-10 (d = 5, θ = 90º)
Nine textural features [9–10] were computed from
these NCM’s. The Matrix Mean and Variance are defined as
Matrix variance (Eq.2) and the following textural
features were used for this study [9 –11]:
) , (
)) , (log() , (
Angular Second Moment:
2)() , (
)()() , (
) , (
) , (
0.50 .25 0
0.50 .25 0
0.50 .25 0
Inverse Difference Moment:
3 of 4
) , (
M i i
)), (2 log() , (2
where Ng is the number of gray levels used in the image, M
is an Ng×Ng gray level co-occurrence symmetric matrix with
M(i,j) as its ith, jth element for i = j = 1, 2, 3, …, Ng.
Optimum Feature Selection: For each of the 56 15-min
epochs, a total of 180 textual features were computed: 90
textural features were extracted from the RR sequence, and
90 textural features were extracted from the RPE sequence.
It is noted that 180 features are generated by computing the
textural feature (Eqs. 2 and 3-10, above) for each of the 10
NCM’s defined earlier. A Piecewise Linear Networks
(PLN) algorithm was used  to find the optimum feature
subset. The PLN utilizes piecewise linear orthonormal least
square procedure. It selects the feature subset that are
optimal for use with the MLP classifier in a computationally
efficient fashion, as it requires only one pass of the data. The
features extracted from the data are divided into an
appropriate number of clusters and auto- and cross-
correlation matrices are calculated only once. Then, it finds
combinations of features that have high potential for
classification of signal source . The training vectors for
the classifier will include only the optimum features
Multilayer Perceptron Classifier: A Multilayer Perceptron
network (MLP) is a form of a feed-forward neural network
(FFNN). Its simple structure allows for relatively easy
training, using conventional back-propagation (BP) training
algorithms. It has been shown that MLP classifiers are very
successful in image classification applications .
A classifier is constructed using a three-layer MLP
consisting of an input layer, hidden layer and an output
layer. The input layer has a number of nodes equal to the
input vector length. The output layer consists of one node,
accounting for a possibility of only 2 classes to be classified.
The number of nodes in the hidden layer, Nh, is selected by
an iterative training and validation scheme. Besides
changing the number of hidden nodes, each layer of a MLP
has two parameters that are selected to achieve maximum
detection: node transfer function and weight vector. Both
input and output nodes use linear transfer functions. The
hidden layer uses a hyperbolic tangent sigmoid function
Training and Validation: The epochs in the data set were
randomly divided into two sets: a Training Set and a Testing
Set. 70% of the epochs are used to train the MLP (39
epochs), while 30% (17 epochs) were kept separate to test
the performance of the classifier.
Furthermore, the training set is divided to 3 subsets (13
epochs each). A 3-fold cross-validation (k-fold XV) scheme
is used to find the optimum number of hidden nodes, Nh, and
the number of training iterations to achieve the maximum
Testing: Once the optimum topography of the MPL is
selected, the MLP is trained using all 39 training vectors.
Then, the MLP weights and bias vectors are fixed, and the
Testing Set of 17 vectors is run once to test the performance
of the classifier .
Sensitivity, Specificity, and Accuracy: The performance of
the system is described by
where OSAc is the number of correctly detected OSA clips
and NORc is the number of correctly detected NOR clips .
Monte Carlo Simulation: Since the optimization process
described above is partially dependent on the initial vector
assignment to Training and Testing Sets, a Monte Carlo
simulation method was devised to estimate the average
performance of the MLP classifier.
With the MLP topology fixed, the data set is randomly
divided into training and testing sets with a 70% to 30%
ratio, and the MLP is trained using the training set, then the
performance of the system is tested using testing set, not
seen by the NNFF. This process is repeated 500 times, and
the average training and testing sensitivity, specificity, and
accuracy are obtained.
Feature Selection: Using the PLN algorithm, the following
thirteen features comprise the optimal feature subset:
Nine textural features the RR sequence
ASM2; IDM4; COR4; ASM4;
ENT4; IND4; ENT8;IND9; ASM10
And four textural features from the RPE sequence
IDM2; IDM4; IDM5; IDM8
where the subscript indicates the NCM that the feature was
extracted from. A vector containing the above optimized
features was used as an input to the MLP classifier.
Training and Validation Results: Using a 3-fold cross
validation scheme, and using the Levenberg-Marquardt
(LM) training algorithm for the MLP, the optimum training-
validation MLP topology was one using 3-layer MLP, with
an input layer of 13 nodes, equal to the length of a training
vector, a hidden layer with 8 nodes, and an output layer with
one unit. An optimal validation is achieved when the MLP
is trained for 46 iterations.
Monte Carlo Testing Results: Table II shows summary of the
training and testing detection results after a 500-run Monte
AVERAGE SENSITIVITY, SPECIFICITY, AND ACCURACY OF
MULTILAYER PERCEPTRON CLASSIFIER FOR 500-RUN
4 of 4
By studying the images in Figure 1, it is evident that
there are notable differences in the power distribution of the
spectrograms of RR and RPE for normal epochs compared
to epochs containing SDB events. To quantify these
differences, image processing techniques were applied to
extract textural features from these spectrograms.
The IDM feature extracted from RPE spectrogram
images appears to be the major contributor for these
sequences, and might be useful in minimizing the calculation
cost when extracting further features for future clips.
Using 3-fold cross validation for the optimal MLP
topography produced a 3 layer MLP, with 8 hidden nodes in
the hidden layer. A Monte Carlo simulation involving
testing with the blind testing vector set for 500 runs have
produced a training accuracy of 99.9%, and a testing
accuracy of 97.8%. While these results are highly
encouraging, it is recognized that the method needs to be
further tested in a larger sample population.
The method described here can readily be implemented
for large scale screening of severe SDB cases, and adds an
important addition to health care providers in assessing the
need for early intervention for SDB patients without adding
financial burden on the health care system.
as inputs to an MLP classifier, higher accuracy classification
of normal and SDB event 15-minute epochs was achieved,
surpassing the accuracy achieved by RR optimal features
alone. Further study can focus on the classifying power of
RPE sequence extracted from Leads II, III, or the modified
This combination of the textural has proven to be very
useful in increasing the accuracy of the detection of SDB
events using a single ECG channel.
. T. Young, M. Palta, J. Dempsey, J. Skatrud, S. Weber, and S. Badr,
“The Occurrence of Sleep-Disordered Breathing among Middle
Adults”, New England Journal of Medicine, 328, pp. 1230-1235,
. T. Penzel, J. McNames, P. de Chazel, B. Raymond, A. Murray, and G.
Moody, “Systematic Comparison of Different Algorithms for Apnoea
Detection based on Electrocardiogram Recordings”, Medical and
Biological Engineering and Computing, 40, pp. 402-407, 2002.
. P. de Chazal, et al, “Automated Processing of the Single-Lead
Electrocardiogram for the Detection of Obstructive Sleep Apnoea”,
IEEE Transactions on Biomedical Engineering, 50 (6), pp. 686-696,
. M. A. Al-Abed, K. Behbehani, J. Burk, E. Lucas, and M. Manry,
“Cross correlation and scatter plots of the heart rate variability and R-
Peak Envelope as features in the detection of obstructive sleep apnea,”
Conference Proceedings, 30th Annual International Conference of the
IEEE EMBS, pp.3488 – 3491, 2008.
. S. Vijendra, K. Behbehani, E.A. Lucas, J.R. Burk, D.N. Burli, and
D.H. Dao, “The Use of R-wave morphology in the Detection of Sleep-
Disordered Breathing using the Electrocardiogram – A Comparison
between Leads,” Conference Proceedings, 26th Annual International
Conference of the IEEE EMBS, 2, pp.3881 - 3884 2004.
. M.F. Hilton, R.A. Bates, K.R. Godfrey, M.J. Chappell, and R.M.
Cayton, “Evaluation of Frequency and Time-Frequency Spectral
Analysis of Heart Rate Variability as a Diagnostic Marker of Sleep
Apnoea Syndrome”, Medical and Biological Engineering and
Computing, 37, pp. 760-769, 1999.
. M. A. Al-Abed, K. Behbehani, J. Burk, E. Lucas, and M. Manry, “A
method to detect obstructive sleep apnea using neural network
classification of time-frequency plots of the heart rate variability,”
Conference Proceedings, 29th Annual International Conference of the
IEEE EMBS, pp.6101 – 6104, 2007
. D. Clausi and R. Jobanputra “Texture Analysis Using Gaussian
Weighed Gray Level Co-Occurrence Probabilities,” First Canadian
Conference on Computer and Robot Vision, pp. 51-57, 2004.
. J. Shuttleworth, A. Todman, R. Naguib, B. Newman, “Colour Texture
Analysis using Co-occurrence Matrices for Classification of Colon
Cancer Images”, IEEE Canadian Conference on Electrical and
Computer Engineering, 2, pp.1134-1139, 2002.
. D. Clausi and Y. Zhao, “Grey Level Co-occurrence Integrated
Algorithm (GLCIA): a Superior Computational Method to Rapidly
Determine Co-occurrence Probability Texture Features”, Computers
& Geosciences, 29, pp. 837-850, 2003.
. K. S. R.M. Haralick, I. Dinstein, "Textural Features for Image
Classification," IEEE Transactions on Systems, Man, and Cybernetics,
vol. 3, pp. 610-619, 1972.
. M. Manry. Jiang Li, Pramod L. Narasimha, and Changhua Yu,
"Feature Selection Using a Piecewise Linear Network," IEEE
Transaction om Neural Netwrok, vol. 17, 2006
. K. Fukunaga, Introduction to Statistical Pattern Recognition. Boston:
Academic Press, 1990.
By combining optimal HRV and RPE textural features