A Mattress-Integrated ECG System for Home Detection of Obstructive Sleep Apnea Through HRV Analysis Using Wavelet Transform and XGBoost Classification

Keywords: Obstructive Sleep Apnea; Non-Contact ECG; Heart Rate Variability (HRV); Wavelet Transform; XGBoost Classification

Abstract

Obstructive Sleep Apnea (OSA) is a potentially life-threatening sleep disorder that often remains undiagnosed due to the complexity of conventional diagnostic methods such as polysomnography (PSG).  Currently, there is a lack of accessible, non-invasive diagnostic solutions suitable for home use. This study proposes a novel approach to automate OSA detection using single-lead electrocardiogram (ECG) signals acquired through non-contact conductive fabric electrodes embedded in a mattress, enabling unobtrusive monitoring during sleep. The main contributions of the proposed study are a mattress-embedded contactless ECG monitoring system eliminating the discomfort of traditional electrodes, and an advanced signal processing framework integrating wavelet decomposition with machine learning for precise OSA identification. ECG signals from 35 subjects (30 male, 5 females, aged 27-63 years) diagnosed with OSA were obtained from the PhysioNet Apnea-ECG database, originally sampled at 100 Hz and up-sampled to 250 Hz for consistency with experimental recordings from healthy volunteers tested in various sleep positions. Signals were recorded non-invasively during sleep in various body positions and processed using the Discrete Wavelet Transform (DWT) up to the third level of decomposition. The processing of ECG signals involved Heart Rate Variability (HRV) analysis, which was applied to extract information in the time domain, frequency domain, and non-linear properties. By analyzing HRV on the respiratory sinus arrhythmia spectrum, the respiration signal was obtained from ECG-derived respiration (EDR).  Feature selection was performed using ANOVA, resulting in a set of key features including respiratory rate, SD2, SDNN, LF/HF ratio, and pNN50. These features were classified using the XGBoost algorithm to determine the presence of OSA. The proposed system achieved a detection accuracy of 96.7%, demonstrating its potential for reliable home-based OSA diagnosis. This method improves comfort through non-contact sensing and supports early intervention by delivering timely alerts for high-risk patients

Downloads

Download data is not yet available.

References

D. J. Gottlieb and N. M. Punjabi, “Diagnosis and Management of Obstructive Sleep Apnea: A Review,” JAMA - Journal of the American Medical Association, vol. 323, no. 14, pp. 1380–1400, 2020.

S. Q. Ali and A. Hossen, “Identification of obstructive sleep apnea using artificial neural networks and wavelet packet decomposition of the HRV signal,” Journal of Engineering Research, vol. 17, no. 1, pp. 24–33, 2020.

Y. C. Lin, J. K. Chiang, C. M. Lu, and Y. H. Kao, “Association of Heart Rate Variability with Obstructive Sleep Apnea in Adults,” Medicina (Lithuania), vol. 59, no. 3, 2023.

G. Hou Loo MBBS, R. Rajan MBBS, A. Mohd Tamil BMedSc, and N. Ritza Kosai, “Prevalence of obstructive sleep apnea in an Asian bariatric population: an underdiagnosed dilemma,” Surgery for Obesity and Related Diseases, vol. 16, no. 6, pp. 778-783, 2020.

J. Vensel Rundo and R. Downey III, “Chapter 25-Polysomnography," Handbook of Clinical Neurology, Elsevier, pp. 381-392, 2019.

M. Sharma, M. Raval, and U. R. Acharya, “A new approach to identify obstructive sleep apnea using an optimal orthogonal wavelet filter bank with ECG signals”, Inform Med Unlocked, vol. 16, Jan. 2019.

A. Zarei, H. Beheshti, and B. M. Asl, “Detection of sleep apnea using deep neural networks and single-lead ECG signals”, Biomed Signal Process Control, vol. 71, 2022.

C. Song, K. Liu, X. Zhang, L. Chen, and X. Xian, “An Obstructive Sleep Apnea Detection Approach Using a Discriminative Hidden Markov Model from ECG Signals”, IEEE Trans Biomed Eng, vol. 63, no. 7, pp. 1532–1542, 2016.

N. F. Hikmah, R. Setiawan, and T. A. Putri, “Real-Time Detection of Premature Ventricular Contraction Using Discrete Wavelet Transform”, In: 2022 International Seminar on Intelligent Technology and Its Applications: Advanced Innovations of Electrical Systems for Humanity, ISITIA 2022 - Proceeding, Institute of Electrical and Electronics Engineers Inc., 2022, pp. 12–17. 2022.

N. F. Hikmah, A. Arifin, T. A. Sardjono, and E. A. Suprayitno, “A signal processing framework for multimodal cardiac analysis”, In: 2015 International Seminar on Intelligent Technology and Its Applications (ISITIA) 2015, IEEE, 2015.

T. Wang, C. Lu, and G. Shen, “Detection of Sleep Apnea from Single-Lead ECG Signal Using a Time Window Artificial Neural Network”, Biomed Res Int, vol. 2019, 2019.

N. F. Hikmah, R. Setiawan, and M. D. Gunawan, “Sleep Quality Assessment from Robust Heart and Muscle Fatigue Estimation Using Supervised Machine Learning”, International Journal of Intelligent Engineering and Systems, vol. 16, no. 2, pp. 319–331, 2023.

D. Padovano, A. Martinez-Rodrigo, J. M. Pastor, J. J. Rieta, and R. Alcaraz, “On the Generalization of Sleep Apnea Detection Methods Based on Heart Rate Variability and Machine Learning”, IEEE Access, vol. 10, pp. 92710–92725, 2022.

M. K. Moridani, “A Novel Clinical Method for Detecting Obstructive Sleep Apnea using of Nonlinear Mapping”, J Biomed Phys Eng, vol. 12, no. 1, pp. 31–34, 2022.

J. Boyle, N. Bidargaddi, A. Sarela, and M. Karunanithi, “Automatic detection of respiration rate from ambulatory single-lead ECG”, IEEE Transactions on Information Technology in Biomedicine, vol. 13, no. 6, pp. 890–896, Nov. 2009.

A. Espíritu Santo and C. Carbajal, “Respiration rate extraction from ecg signal via discrete wavelet transform”, In: 2010 2nd Circuits and Systems for Medical and Environmental Applications Workshop, CASME 2010, 2010.

Y. Zhao, J. Zhao, and Q. Li, “Derivation of respiratory signals from single-lead ECG,” in Proceedings - 2008 International Seminar on Future BioMedical Information Engineering, FBIE 2008, pp. 15–18. 2008.

Y. Alzaabi and A. H. Khandoker, “Investigating Phase Coherence between Respiratory Sinus Arrhythmia and Respiration in Depressed Patients with Obstructive Sleep Apnea across the Sleep Stages”, In: Computing in Cardiology, IEEE Computer Society, 2022.

M. R. Bonsignore, S. Romano, O. Marrone, and G. Insalaco, “Respiratory sinus arrhythmia during obstructive sleep apneas in humans”, J Sleep Res, vol. 4, pp. 68–70, 1995.

E. Özkaya and P. D. L. D. A. L. Kavlak Bozkurt, “Allergic contact dermatitis caused by self-adhesive electrocardiography electrodes: A rare case with concomitant roles of nickel and acrylates”, Contact Dermatitis, vol. 70, no. 2, pp. 121–123, 2014.

I. Sadek, E. Seet, J. Biswas, B. Abdulrazak, and M. Mokhtari, “Nonintrusive Vital Signs Monitoring for Sleep Apnea Patients: A Preliminary Study”, IEEE Access, vol. 6, pp. 2506–2514, 2017.

S. Majumder, L. Chen, O. Marinov, C. H. Chen, T. Mondal, and M. Jamal Deen, “Noncontact Wearable Wireless ECG Systems for Long-Term Monitoring”, IEEE Rev Biomed Eng, vol. 11, pp. 306–321, 2018.

S. Peng, K. Xu, and W. Chen, “Comparison of active electrode materials for non-contact ECG measurement”, Sensors, vol. 19, no. 16, 2019.

F. Bozkurt, M. K. Uçar, M. R. Bozkurt, and C. Bilgin, “Detection of Abnormal Respiratory Events with Single Channel ECG and Hybrid Machine Learning Model in Patients with Obstructive Sleep Apnea”, IRBM, vol. 41, no. 5, pp. 241–251, 2020.

S. Peng, K. Xu, S. Bao, Y. Yuan, C. Dai and W. Chen, "Flexible Electrodes-Based Smart Mattress for Monitoring Physiological Signals of Heart and Autonomic Nerves in a Non-Contact Way," in IEEE Sensors Journal, vol. 21, no. 1, pp. 6-15, 1 Jan.1, 2021, doi: 10.1109/JSEN.2020.3012697.

F. Shaffer and J. P. Ginsberg, "An overview of heart rate variability metrics and norms", Frontiers in Public Health, vol. 5, no. 258, 2017.

MikroElektronika, "Mikromedia 5 for STM32F4 Capacitive - MIKROE-3619." [Online]. Available: https://www.mikroe.com/mikromedia-5-for-stm32-capacitive. [Accessed: September 11, 2025].

A. L. Goldberger et al., “PhysioBank, PhysioToolkit, and PhysioNet Components of a New Research Resource for Complex Physiologic Signals”, Circulation, vol. 101, no. 23, 2000.

T. Penzel et al., "The Apnea-ECG Database", Computers in Cardiology, vol. 29, pp. 255-258, 2002.

F. Shaffer and J. P. Ginsberg, “An Overview of Heart Rate Variability Metrics and Norms”, Frontiers Media S.A. 2017.

A. Paul and J. R. Jacob, “Electrocardiographic lead reversals,” Indian Pacing and Electrophysiology Group. 2023.

M. Bahoura, M. Hassani, and M. Hubin, “DSP Implementation of Wavelet Transform for Real Time ECC Waveforms Detection and Heart Rate Analysis,” Elsevier Computer Methods Programs Biomedical, pp. 35-44, 1997.

J. P. Martinez, R. Almeida, S. Olmos, A. P. Rocha, and P. Laguna, “A Wavelet-Based ECG Delineator: Evaluation on Standard Databases,” IEEE Transactions on Biomedical Engineering, vol. 51, no. 4, 2004.

Task Force of the European Society of Cardiology and the North American Society of Pacing and Electrophysiology. Heart rate variability: standards of measurement, physiological interpretation, and clinical use. European Heart Journal. 1996;17(3):354-381.

D. C. Montgomery, "Chapter 3: Experiments with a Single Factor: The Analysis of Variance," Design and analysis of experiments, 8th ed., New York: John Wiley & Sons, pp. 65-120, 2012.

T. Chen and C. Guestrin, “XGBoost: A scalable tree boosting system,” in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 785–794, doi:10.1145/2939672.2939785.

H. Sharma and K. K. Sharma, “An algorithm for sleep apnea detection from single-lead ECG using Hermite basis functions,” Comput Biol Med, vol. 77, pp. 116–124, 2016.

C. Y. Lin, Y. W. Wang, F. Setiawan, N. T. H. Trang, and C. W. Lin, “Sleep apnea classification algorithm development using a machine-learning framework and bag-of-features derived from electrocardiogram spectrograms,” J Clin Med, vol. 11, no. 1, Jan. 2022.

X. Liang, X. Qiao, and Y. Li, “Obstructive Sleep Apnea Detection Using Combination of CNN and LSTM Techniques,” In: 2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC 2019). IEEE, 2019.

A. S. M. Shamsuzzaman, B. J. Gersh, and V. K. Somers, "Obstructive sleep apnea: implications for cardiac and vascular disease," JAMA, vol. 290, no. 14, pp. 1906-1914, 2003.

P. E. Peppard, T. Young, J. H. Barnet, M. Palta, E. W. Hagen, and K. M. Hla, "Increased prevalence of sleep-disordered breathing in adults," Am. J. Epidemiol., vol. 177, no. 9, pp. 1006-1014, 2013.

S. Tonekaboni, S. Joshi, M. D. McCradden, and A. Goldenberg, "What clinicians want: contextualizing explainable machine learning for clinical end use," Proc. Mach. Learn. Res., vol. 106, pp. 359-380, 2019.

Published
2025-10-16
How to Cite
[1]
N. Fitrieyatul Hikmah, R. Setiawan, R. Amalia, Z. B. Syulthoni, D. O. W. Nugroho, and M. A. Syakir, “A Mattress-Integrated ECG System for Home Detection of Obstructive Sleep Apnea Through HRV Analysis Using Wavelet Transform and XGBoost Classification”, j.electron.electromedical.eng.med.inform, vol. 7, no. 4, pp. 1272-1288, Oct. 2025.
Section
Medical Engineering