Report Respiratory Rate Estimation Using Embedded Sys

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

SEMINAR (SUB CODE: 18ECS84)


ON
CURRENT TRENDS IN TECHNOLOGY

RESPIRATORY RATE ESTIMATION ON EMBEDDED SYSTEM


Submitted in partial fulfillment of the requirements for the award of degree

BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING

BY
STUDENT NAME
USN

Vidyayāmruthamashnuthe

Department of Electronics and Communication Engineering

B.N.M. Institute of Technology


An Autonomous Institution under VTU, Approved by AICTE, Accredited as Grade A Institution by NAAC.
All Eligible UG branches – CSE, ECE, EEE, ISE & Mech.Engg. Accredited by NBA for academic years 2018-19 to 2021-22 & valid upto 30.06.2022
Post box no. 7087, 27th cross, 12th Main, Banashankari 2nd Stage, Bengaluru- 560070, INDIA
Ph: 91-80- 26711780/81/82 Email: principal@bnmit.in, www.bnmit.org

2023 - 2024
1
B.N.M. Institute of Technology
An Autonomous Institution under VTU, Approved by AICTE, Accredited as Grade A Institution by NAAC.
All Eligible UG branches – CSE, ECE, EEE, ISE & Mech. Engg. Accredited by NBA for academic years 2018-19 to 2021-22 & valid upto 30.06.2022
Post box no. 7087, 27th cross, 12th Main, Banashankari 2nd Stage, Bengaluru- 560070, INDIA
Ph: 91-80- 26711780/81/82 Email: principal@bnmit.in, www.bnmit.org

Department of Electronics and Communication Engineering

Vidyayāmruthamashnuthe

CERTIFICATE

This is to certify that the Seminar (Sub Code -18ECS84) on Current Trends entitled
‘Respiratory Rate Estimation on Embedded System’ is carried out by, Ritika
Jadhav (1BG20EC074) a bonafide student of VIII semester in partial fulfillment of
the requirements for the degree of Bachelor of Engineering in Electronics and
Communication Engineering of the Visvesvaraya Technological University, Belagavi,
during the year 2023-24. All corrections/suggestions indicated during Internal
Assessment have been incorporated in the report deposited in the department Library.
The report has been approved as it satisfies the academic requirements in respect of
Seminar on Current Trend prescribed for the said degree.

Mrs. Sarala T Dr. Priya R Sankpal Dr. Yasha Jyothi M. Shirur


Assistant Professor Associate Professor Professor and Head
Dept. of ECE, BNMIT Dept. of ECE, BNMIT Dept. of ECE, BNMIT

2
ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of the current trend
seminar would be incomplete without mentioning the names of the people who made it possible.

I am greatly indebted to our Prof. T.J. Rama Murthy, Director, Dr. S. Y. Kulkarni,
Additional Director, Prof. Eishwar N. Maanay, Dean, Dr. Krishnamurthy. G.N, Principal,
B.N.M Institute of Technology, Bangalore, and Dr. Yasha Jyothi M. Shirur, Professor and
Head of Department, Electronics and Communication, for giving me an opportunity to carry out
the current trend seminar. I am really indebted to our great institute BNMIT, which has provided
me an opportunity to get a better degree in B.E. with the state-of-the-art facilities, and an
impeccable environment.

It is with a deep sense of gratitude and great respect, I owe my indebtedness to my guide
Mrs. Sarala T, Assistant Professor. I thank her for his/her constant encouragement during the
execution of this seminar and also I thank my Seminar coordinator Dr. Priya R. Sankpal for
making the conduction of this seminar successful.

I thank my parents, without whom none of this would have been possible. Their patience and
blessings have been with me at every step of this Seminar. I would express my thanks to all my
friends and all those who have helped me directly or indirectly for the successfulcompletion of the
seminar.

RITIKA JADHAV
1BG20EC074

i
ABSTRACT
Our study introduces an algorithm for estimating respiratory rate (RR) using infrared (IR)
photoplethysmography (PPG) signals, aiming for wearable applications. Initially developed in Python
using synthetic and publicly available data, the algorithm leverages respiratory-induced frequency,
intensity, and amplitude variation. We designed a graphical user interface for data processing and vital
sign display. Subsequently, the algorithm was implemented on an MSP432P401R microcontroller for
wearable integration. Results demonstrate promise, with the proposed Fourier Product (FP) method
achieving a Mean Absolute Error of 4.1 using 16-second windows of IR-PPG signals. This approach
offers a feasible solution for real-time RR estimation in wearable devices, potentially facilitating
continuous monitoring of respiratory health. The use of IR-PPG signals provides a non-invasive and
convenient means of measuring RR, enhancing accessibility and comfort for patients. Additionally, the
portability of the algorithm to a microcontroller enables its deployment in resource-constrained
environments, expanding its applicability beyond clinical settings. The incorporation of a graphical user
interface facilitates user-friendly data processing and visualization, enhancing the usability of the
system. By leveraging both synthetic and real-world data during algorithm development, we ensure
robustness and generalizability across diverse scenarios. Furthermore, the utilization of Fourier analysis
techniques enables efficient extraction of respiratory features from PPG signals, contributing to accurate
RR estimation. Overall, our study demonstrates the feasibility and effectiveness of employing IR-PPG
signals for RR monitoring in wearable devices, offering a potential solution for remote health monitoring
and early detection of respiratory abnormalities. Future research may focus on further validation of the
algorithm in diverse populations and environments, as well as exploration of additional physiological
parameters for comprehensive health monitoring.

ii
TABLE OF CONTENTS

Sl. No. Title Page No.


1. Abstract i
List of Figures iii
List of Tables iii
2. CHAPTER 1
INTRODUCTION
1.1 Introduction 1
1.2 Motivation 3
1.3 Objectives 4

3. CHAPTER 2
LITERATURE SURVEY
2.1 Related Work 5
2.2 Previous Work 7
4. CHAPTER 3
METHODOLOGY AND IMPLEMENTATION
3.1 Methodology 8
3.2 Datasets 16
3.3 Software Requirements 17
3.4 Implementation 18
5. CHAPTER 4
RESULTS AND DISCUSSION
4.1 Results 19
4.2 Post – Imputation Prediction 22
6. CHAPTER 5
CONCLUSION 24
7. REFERENCES 25

LIST OF FIGURES

iii
Sl. No. Description Page No.
1.1 EHR System view 1
1.2 HER Technology 2
1.3 EHR Implementation Lifecycle 3
3.1 kNN (K Nearest Neighbors) 8
3.2 Equations used in kNN approach 9
3.3 MissForest Method 9
3.4 Equations used in MissForest approach 10
3.5 MICE 10
3.6 Equations used in MICE approach 11
3.7 NAA 11
3.8 Equations used in NAA approach 12
3.9 Equations used in I-NAA approach 13
3.10 I-NAA training methodology 13
3.11 GAN 13
3.12 Equations used in GAIN approach 14
3.13 Equations used in I-GAIN approach 15
3.14 I-GAIN training model 15

LIST OF TABLES

Sl. No. Description Page No.


4.1 Imputation results (Mean± STD of NRMSE) regarding the 21
framingham heart study dataset for various missing rates.
4.2 Imputation results (Mean± STD of NRMSE) regarding the 21
stroke dataset for various missing rates.
4.3 Imputation results (Mean± STD of NRMSE) regarding the 21
physionet heart disease for various missing rates.
4.4 . Imputation results (Mean± STD of NRMSE) regarding the 22
UCI heart disease for various missing rates.
4.5 Post imputation accuracy (F1-score) for all four datasets. 22

iv
Respiratory Rate Estimation on Embedded System

CHAPTER 1
INTRODUCTION
1.1 Introduction
PHOTOPLETHYSMOGRAPHY (PPG) stands as a cornerstone in contemporary medical monitoring,
harnessing the properties of red and infrared light to trace alterations in blood volume within human
tissue. By scrutinizing fluctuations in reflected light, PPG offers a noninvasive means to gauge crucial
physiological parameters such as blood oxygen saturation level (SpO2) and heart rate (HR),
conventionally quantified in beats per minute (bpm). This methodology, marked by its simplicity and
accessibility, presents a pivotal advancement in healthcare technology, enabling clinicians and
individuals alike to monitor vital signs swiftly and efficiently without subjecting patients to invasive
procedures, thereby fostering enhanced patient comfort and compliance.

One of the most promising applications of PPG lies in its potential to estimate respiratory rate (RR), a
pivotal metric in assessing respiratory health. However, the acquisition of PPG signals introduces several
intricacies, encompassing variations due to diverse factors including skin pigmentation, age, gender,
body composition, environmental conditions, and the pressure exerted at the measurement site. Tackling
these complexities is paramount for ensuring the reliability and accuracy of PPG-derived measurements
across diverse populations and environmental settings, driving ongoing research initiatives to refine
signal acquisition techniques and mitigate potential confounding factors.

Fig 1.1: Working principle of PPG sensors

While electrocardiography (ECG) remains a gold standard for precise RR estimation, its integration into
wearable devices encounters practical challenges, notably discomfort arising from electrode placement.
To surmount this obstacle, researchers are exploring innovative avenues such as leveraging deep learning

B.E., Dept. of ECE, BNMIT 1 2023-24


methodologies to extract RR estimates from PPG signals with remarkable precision. Yet, integrating such
advanced techniques into low-resource microcontrollers poses formidable obstacles, as these approaches
necessitate substantial computational resources and may compromise device autonomy. Nonetheless,
concerted efforts are underway to develop tailored processing algorithms compatible with low-power
embedded systems, aiming to unlock the potential of PPG-based RR monitoring in wearable devices
while preserving energy efficiency and operational autonomy. Through these endeavors, the landscape
of remote health monitoring stands poised for transformative advancements, empowering individuals
with accessible and accurate tools to safeguard their well-being proactively.

1.2 Problem Statement


Despite the strides made in estimating respiratory rate (RR) using photoplethysmography (PPG) signals,
there persists a significant challenge in seamlessly integrating accurate and efficient RR monitoring into
wearable devices. The intricacies surrounding factors such as skin color variations, age, gender
disparities, ambient light conditions, and the influence of applied pressure during measurement pose
formidable hurdles that can compromise the reliability of RR estimates. Moreover, the implementation
of sophisticated RR estimation techniques, notably those leveraging deep learning methodologies, within
low-resource embedded systems presents inherent computational and energy efficiency challenges.
Consequently, there exists a critical imperative to devise tailored processing algorithms and hardware
solutions adept at precisely estimating RR from PPG signals in real-time, all while ensuring optimal
energy efficiency and operational autonomy in wearable devices. Addressing these multifaceted
challenges holds the potential to not only augment the utility of wearable health monitoring devices but
also to catalyze advancements in respiratory health assessment and intervention strategies, thereby
significantly enhancing patient care and outcomes.

1.3 Motivation
Respiratory rate (RR) estimation on embedded systems holds immense promise in revolutionizing
healthcare delivery by offering continuous and nonintrusive monitoring of respiratory health in real-time.
By leveraging photoplethysmography (PPG) signals and embedded processing capabilities, wearable
devices can provide individuals with timely insights into their respiratory status, enabling early detection
of abnormalities and facilitating proactive intervention. This capability is particularly valuable in contexts

2
where continuous monitoring is essential, such as during sleep, physical activity, or in clinical settings
where patient mobility is crucial.

Moreover, embedding RR estimation within wearable devices enhances accessibility to healthcare


monitoring, empowering individuals to take charge of their well-being and enabling healthcare providers
to remotely monitor patients' respiratory health. This is especially beneficial for individuals with chronic
respiratory conditions, elderly populations, and patients recovering from respiratory illnesses, as it allows
for personalized and proactive management of their health outside traditional clinical settings.

Fig 1.2: Wearable vital signs monitoring device

Furthermore, integrating RR estimation on embedded systems addresses practical challenges associated


with traditional monitoring methods, such as discomfort and inconvenience. By providing a seamless and
unobtrusive monitoring experience, wearable devices equipped with RR estimation capabilities promote
long-term adherence to monitoring protocols, thereby fostering continuous health surveillance and
improving patient outcomes.

Overall, the motivation for respiratory rate estimation on embedded systems lies in its potential to
democratize healthcare monitoring, enhance early detection of respiratory abnormalities, improve patient
engagement, and ultimately contribute to more effective and efficient healthcare delivery.

3
1.4 Objectives
1. Accuracy and Reliability: The primary objective of respiratory rate estimation on embedded systems
is to develop algorithms and hardware solutions that can accurately and reliably measure respiratory rate
from photoplethysmography (PPG) signals. Ensuring the precision of respiratory rate measurements is
crucial for effective health monitoring and early detection of respiratory abnormalities.

2. Real-Time Monitoring: Another key objective is to enable real-time respiratory rate monitoring using
embedded systems. By processing PPG signals swiftly and efficiently, wearable devices can provide
immediate feedback on respiratory rate variations, allowing for timely intervention and adjustment of
treatment plans as needed.

3. Energy Efficiency: It is essential to optimize the energy consumption of embedded systems during
respiratory rate estimation to prolong device battery life and enhance user experience. Developing
energy-efficient algorithms and hardware architectures enables continuous monitoring without frequent
recharging, ensuring uninterrupted health surveillance.

4. Low-Cost Implementation: Achieving cost-effective solutions for respiratory rate estimation on


embedded systems is imperative for widespread adoption and accessibility. By leveraging low-cost
components and minimizing computational resources, the objective is to develop affordable wearable
devices that can cater to diverse user populations.

5. User-Friendly Design: Designing user-friendly interfaces and wearable form factors is essential to
encourage long-term adoption and compliance with respiratory rate monitoring. Ensuring comfort, ease
of use, and discretion in wearable device design promotes user engagement and facilitates seamless
integration into daily routines.

6. Integration with Healthcare Ecosystem: Establishing interoperability and integration with existing
healthcare systems and platforms is a critical objective. Seamless data exchange between embedded
systems and healthcare providers' systems enables comprehensive health data analysis, facilitates remote
patient monitoring, and supports informed clinical decision-making.

7. Scalability and Adaptability: Building scalable and adaptable solutions allows for the deployment of
respiratory rate estimation on embedded systems across various settings, from personal wellness
monitoring to clinical environments. The objective is to develop flexible solutions that can accommodate
diverse user needs and evolving healthcare requirements.

4
CHAPTER 2

LITERATURE SURVEY

2.1 Literature Survey

[1] Jiajing Fan, Siqi Yang, Jiahao Liu, Zhen Zhu, Jianbiao Xiao, Liang Chang, Shuisheng Lin and
Jun Zhou, described that the respiratory rate is widely used for evaluating a person’s health condition.
Compared to other invasive and expensive methods, the ECG-derived respiration estimation is a more
comfortable and affordable method to obtain the respiration rate. However, the existing ECG-derived
respiration estimation methods suffer from low accuracy or high computational complexity. In this work,
a high accuracy and ultra-low power ECG-derived respiration estimation processor has been proposed.
Several techniques have been proposed to improve the accuracy and reduce the computational complexity
(and thus power consumption), including QRS detection using refractory period refreshing and adaptive
threshold EDR estimation. Implemented and fabricated using a 55 nm processing technology, the
proposed processor achieves a low EDR estimation error of 0.73 on CEBS database and 1.2 on MIT-BIH
Polysomnographic Database while demonstrating a record-low power consumption (354 nW) for the
respiration monitoring, outperforming the existing designs. The proposed processor can be integrated in
a wearable sensor for ultra-low power and high accuracy respiration monitoring.

[2] Ruixuan Dai, Chenyang Lu, Michael Avidan, Thomas Kannampallil, have reported a physiological
signal for respiratory rate (RR) that is vital for many health and clinical applications. This paper presents
RespWatch, a wearable sensing system for robust RR monitoring on smartwatches with
Photoplethysmography (PPG). We designed two novel RR estimators based on signal processing and
deep learning. The signal processing estimator achieved high accuracy and efficiency in the presence of
moderate noise. In comparison, the deep learning estimator, based on a convolutional neural network
(CNN), was more robust against noise artifacts at a higher processing cost. To exploit their
complementary strengths, we further developed a hybrid estimator that dynamically switches between
the signal processing and deep learning estimators based on a new Estimation Quality Index (EQI). We
evaluated and compared these approaches on a dataset collected from 30 participants. The hybrid
estimator achieved the lowest overall mean absolute error, balancing robustness and efficiency.
Furthermore, we implemented RespWatch on commercial Wear OS smartwatches. Empirical evaluation
demonstrated the feasibility and efficiency of RespWatch for RR monitoring on smartwatch platforms.

5
[3] D. Uguz, reported that Photoplethysmography (PPG) is a widely used, low-cost optical method for
the assessment of peripheral cardiovascular health. By using a photodetector and a light source, blood
volume changes in the tissue can be acquired. Different properties of pulse wave can be further analyzed
for the estimation of several vital parameters. The vast application area of PPG also demands different
aspects of measurement techniques to be utilized such as the use of motion sensors, different wavelengths
of light sources and skin temperature monitoring. With the ongoing improvements in semiconductor
devices and increasing demand for long-time monitoring, a need for a multipurpose PPG sensor
addressing different requirements of different applications exist. In this sensor system, a motion sensor
and a temperature sensor should be ready to assist PPG measurements, whereas PPG measurements can
be conducted with different operation parameters depending on the application. Our approach to answer
this challenge is the development of a multipurpose sensor system, SmartPPG which can answer the
requirements of different applications. This paper represents so far achieved hardware design, its
produced first prototype and evaluation of first measurements by challenging existing applications of
photoplethysmography in clinical medicine. Tests of prototype were conducted via microcontroller
MSP432P401R with a user interface designed on MATLAB.

[4] Leonardo Martınez Hornak, Isabel Morales, Alfredo Solari, and Julian Oreggioni, suggested that
monitoring vital signs is a basic need in healthcare institutions. Due to the limited capacity of these
facilities, wearable devices have emerged aiming to aid ambulatory monitoring and doctors’ daily
activities. This work presents the proof of concept of a wearable device for non-invasive real-time vital
signs monitoring. The prototype comprises an MSP432P401R microcontroller, an HC-06 Bluetooth
module, and an SEN-15219 biometric sensor board. This device acquires and wirelessly transmits
photoplethysmography signals, heart rate, and blood oxygen saturation level, featuring an autonomy of
almost 40 hours.

[5] Peter H Charlton, Timothy Bonnici, Lionel Tarassenko, David A Clifton, Richard Beale, Peter J
Watkinson, have proposed over 100 algorithms to estimate respiratory rate (RR) from the
electrocardiogram (ECG) and photoplethysmogram (PPG). As they have never been compared
systematically it is unclear which algorithm performs the best. Our primary aim was to determine how
closely algorithms agreed with a gold standard RR measure when operating under ideal conditions.
Secondary aims were: (i) to compare algorithm performance with IP, the clinical standard for continuous
respiratory rate measurement in spontaneously breathing patients; (ii) to compare algorithm performance
when using ECG and PPG; and (iii) to provide a toolbox of algorithms and data to allow future

6
researchers to conduct reproducible comparisons of algorithms. Algorithms were divided into three
stages: extraction of respiratory signals, estimation of RR, and fusion of estimates. Several
interchangeable techniques were implemented for each stage. Algorithms were assembled using all
possible combinations of techniques, many of which were novel. After verification on simulated data,
algorithms were tested on data from healthy participants. RRs derived from ECG, PPG and IP were
compared to reference RRs obtained using a nasal-oral pressure sensor using the limits of agreement
(LOA) technique. 314 algorithms were assessed. Of these, 270 could operate on either ECG or PPG, and
44 on only ECG. The best algorithm had 95% LOAs of -4.7 to 4.7 bpm and a bias of 0.0 bpm when using
the ECG, and -5.1 to 7.2 bpm and 1.0 bpm when using PPG. IP had 95% LOAs of -5.6 to 5.2 bpm and a
bias of -0.2 bpm. Four algorithms operating on ECG performed better than IP. All high-performing
algorithms consisted of novel combinations of time domain RR estimation and modulation fusion
techniques. Algorithms performed better when using ECG than PPG. The toolbox of algorithms and data
used in this study are publicly available.

7
CHAPTER 3

METHODOLOGY AND IMPLEMENTATION

3.1 Hardware Components


The hardware components used in the study include:

1. SEN-15219 Board from Sparkfun: This board is responsible for acquiring data related to heart rate
(HR), blood oxygen saturation level (SpO2), and photoplethysmography (PPG) signals. It serves as a
vital component for collecting physiological data required for respiratory rate estimation.

Fig 3.1.1: SEN-15219 Pulse Oximeter & Heart Rate Sensor

2. MSP432P401R Microcontroller from Texas Instruments: This microcontroller, based on the ARM
Cortex-M4F architecture, serves as the core of the embedded system. It handles data processing,
algorithm execution, and communication with other components of the system.

Fig 3.1.2: Texas Instruments MSP432P401R Microcontroller

8
3. HC-06 Bluetooth Module: This module facilitates wireless transmission of PPG signals,
including both infrared (IR) and red (R) channels, to external devices such as a personal computer
(PC) for real-time visualization and analysis.

Fig 3.1.3: HC-06 Bluetooth Module

These components collectively form the hardware infrastructure for the embedded system designed to
estimate respiratory rate from PPG signals. The microcontroller serves as the central processing unit,
interfacing with the sensor board for data acquisition and the Bluetooth module for data transmission.
This setup enables the real-time monitoring of respiratory rate and other vital signs in a compact and
portable manner, paving the way for potential integration into wearable health monitoring devices.

3.2 Software Workflow


Here's a breakdown of the software workflow:

1. System Initialization: Configures the SEN-15219 board and microcontroller peripherals.


2. Low Power Mode (LPM0): The device enters this mode to conserve energy.
3. Periodic Tasks (every 40 ms): Obtains PPG (IR and R), HR, and SpO2 samples from the SEN-
15219 board.
4. PPG Transmission (every 200 ms): Sends the PPG signal values to the BT module for real-time
visualization on a PC.
5. Data Transmission (every 1 s): Acquires and sends HR, SpO2, and temperature to the PC.

9
Fig 3.2.1: Embedded Software Workflow

3.3 Algorithm

Fig 3.3.1: Algorithm

10
The algorithm depicted in the image is titled "RR estimation algorithm using RIV" [1]. It estimates the
respiratory rate (RR) based on variations in blood perfusion intensity induced by PPG
(photoplethysmography).

Here's a breakdown of the algorithm:

1. Input: The algorithm takes raw PPG signal values (IRRawSamples) as input.
2. Output: The algorithm outputs the estimated respiration rate (RR).
3. While loop: The algorithm runs continuously until a termination condition is met
(RRAlgorithmEnded = 0).
4. Data Preprocessing:

 IRSamples Standardization: The raw PPG signal values (IRRawSamples) are standardized.
 Sampling Window Band-Pass Filtering: The standardized PPG signal is filtered using a
band-pass filter to remove noise outside the expected respiratory rate frequency range
(typically 0.1 to 0.5 Hz).

5. Peak detection (WindowCounter < 16):

 If the window counter (WindowCounter) is less than 16, the algorithm calculates peaks (PA)
within the current sampling window.
 An adjustment is made to the time of the detected peaks (AdjustTime).

6. Anomaly filtering (WindowCounter >= 16):

 If the window counter is greater than or equal to 16, the algorithm performs anomaly filtering
on the previously detected peaks (PA) to remove outliers.

7. Resampling and FFT analysis:

 The anomaly-filtered peaks (PIA) are resampled to a fixed rate (4 Hz) using the
ResampleTo4Hz function.
 A Fast Fourier Transform (FFT) is performed on the resampled peaks (PIA4) using the FFT
function.

11
8. RIV calculation and RR estimation:

 The algorithm calculates the "respiratory induced intensity variation" (RIV) based on the FFT
analysis results (PIA4FFT).
 The respiratory rate (RR) is estimated by multiplying 60 by the frequency corresponding to
the maximum value in the RIV spectrum (Max (RIV)).

9. Area of Interest (AOI) determination:

 The algorithm determines the Area of Interest (AOI) within the FFT results (PIA4FFT). This
step might be crucial for further processing or analysis but the purpose of AOI is not explicitly
explained in the image.

10. End of Algorithm:

 The RR estimation loop terminates (RRAlgorithmEnded=1).

Overall, the algorithm aims to extract respiratory rate information from PPG signals by filtering the raw
signal, detecting peaks corresponding to breathing cycles, and analyzing the frequency spectrum of the
peaks to identify the dominant respiratory rate.

Fig. 2. RR algorithm running in MSP432 processing synthetic PPG signals using


RIIV as the estimator. A 16-s window of IR PPG samples (standardized and filtered).

12
Fig. 2. RR algorithm running in MSP432 processing synthetic PPG signals using
RIIV as the estimator. Detected peaks at the corresponding signal intensity value and
the interpolation.

Fig. 2. RR algorithm running in MSP432 processing synthetic PPG signals using


RIIV as the estimator. Frequency response of the 4-Hz resampled intensity variability
signal. The maximum corresponds to the RR estimation.

3.4 Working Prototype

The hardware setup consists of the SEN-15219 board from Sparkfun, responsible for acquiring data
related to heart rate (HR), blood oxygen saturation level (SpO2), and photoplethysmography (PPG). The
core of the device is the MSP432P401R microcontroller from Texas Instruments, which operates in low
power mode 0 (LPM0) to conserve energy during communication with the SEN-15219 board and in
active mode at 48 MHz. The device wirelessly transmits IR and R PPG signals via an HC-06 Bluetooth
module. The embedded software, following a Function-Queue-Scheduling architecture, periodically

13
obtains PPG, HR, and SpO2 samples from the SEN-15219 board, sending PPG signal values to the
Bluetooth module for real-time visualization on a PC. Additionally, it acquires and sends HR, SpO2, and
temperature data to the PC every second. A graphical user interface (GUI) running on Windows 10,
developed using Pybluez, facilitates receiving, storing, processing, and analyzing sensor data, along with
displaying raw and processed data from the PPG sensor's R and IR channels, and configuring alarms for
future wearable devices.

Fig 3.4: Device prototype, consisting of an embedded system and a GUI.

14
CHAPTER 4

RESULTS AND DISCUSSIONS

4.1 Experimental Results

In the experimental setup, the algorithm's performance was assessed using a controlled environment. The
software module responsible for receiving data from the SEN-15219 board was replaced by a Test Double
module, which provided data directly from the microcontroller's memory. Various calculation methods
were evaluated to determine the most effective respiratory rate (RR) estimator. These assessments were
conducted on 10,000 randomly selected 16-second windows of samples from the BIDMC dataset.

To calculate the mean absolute error (MAE), we consider

where n is the number of aleatory samples taken from all 53 patients of the BIDMC dataset, is our RR

estimation, and is the dataset RR measured at 1 Hz.

Three primary RR estimation methods were considered: Respiratory-Induced Frequency Variation


(RIFV), Respiratory-Induced Amplitude Variation (RIAV), and Respiratory-Induced Intensity Variation
(RIIV). Additionally, the Mean of these estimators and a Fourier Product (FP) method were evaluated.
The FP method, which involved taking the maxima of the Fourier transforms of RIFV, RIAV, and RIIV,
yielded the best Mean Absolute Error (MAE), while the Mean estimator showed the best Standard
Deviation (STD) of absolute error. Notably, the proposed approach yielded comparable results to a
previous study while avoiding sample discarding.

Further analysis involved testing the algorithm on specific patients from the BIDMC dataset using both
Python (on a PC) and C (on the microcontroller). The absolute errors of these experiments remained
below 4 rpm, indicating the algorithm's accuracy. Implementation on the microcontroller required 93.3kB
of flash memory and 13.5 kB of RAM, with an execution time of approximately 22ms at 48MHz.

15
Table 4.1 Performance Comparison of RR Estimation Methods

Table 4.2 RR Estimation Results and Implementation Details

Table I summarizes the performance of different methods for respiratory rate (RR) estimation. The
Fourier Product (FP) method exhibits a superior Mean Absolute Error (MAE), while the Mean method
achieves the best Standard Deviation (STD) of absolute error. Our approach yields results comparable to
a reference method [11], with the advantage of not discarding any samples. Additionally, Table II
presents results from specific patients using our algorithm implemented in both Python (PC) and C
(microcontroller), with absolute errors below 4 rpm. The microcontroller implementation consumes 93.3
kB of flash memory and 13.5 kB of RAM, with an execution time of approximately 22 ms at 48 MHz.
Furthermore, energy consumption analysis reveals that the SEN-15219 board is the most power-hungry
component, followed by the Bluetooth module and microcontroller. Autonomy, based on a CR2032
battery, is 5.5 hours in continuous mode and 18.2 hours in intermittent mode.

16
4.2 State-Of-Art Comparison

Table III shows that implementations with high-complex techniques can estimate the RR using PPG with
reasonable precision [5], [7]. However, it is not feasible to incorporate these techniques in a low-resource
microcontroller and achieve high autonomy. On the other hand, the proposals that use feasible low-power
embedded system processing techniques [10], [11], [12] are not so precise. The estimator proposed in
[11] is the mean value of RIFV, RIAV, and RIIV when its STD is less than 4 rpm (discarding the rest).
Our implementation of [11] achieves a good STD; however, more than 30% of the samples were
discarded. Finally, [10] achieves the best MAE; however, the memory required to process a 32-s window
is inadequate for a low-resource embedded system.

Table 4.3 Comparison of RR Estimation Techniques

The absolute error for various respiratory rate (RR) estimators is evaluated over 10,000 samples, as
discussed in reference [13]. The estimators considered are RIFV, RIAV, and RIIV, corresponding to
different methodologies for RR estimation. These estimators are crucial components of the embedded
software architecture, which is designed to process data acquired from the SEN-15219 board and
MSP432P401R microcontroller.

The software workflow involves periodic acquisition of PPG (IR and R), HR, and SpO2 samples from
the sensor board, followed by transmission of PPG signal values to a PC via a Bluetooth module for real-
time visualization. Additionally, HR, SpO2, and temperature data are acquired and transmitted to the PC
every second. The performance evaluation of these RR estimators is integral to assessing the efficacy and
accuracy of the embedded system in monitoring respiratory health.

17
Fig. 5. Absolute error for different RR estimators over 10 000
samples from [13]. Left to right: RIFV, RIAV, and RIIV

The estimators under examination include those proposed by Karlen et al. [11], Mean, and FP (Fourier
Product). These estimators play a pivotal role in the embedded software framework, which orchestrates
the acquisition and processing of physiological data from the SEN-15219 board and MSP432P401R
microcontroller. The software operates through a Function-Queue-Scheduling architecture, periodically
gathering PPG (IR and R), HR, and SpO2 readings from the sensor board. Subsequently, the acquired
data, including PPG signal values, are wirelessly transmitted to a PC for real-time visualization via a
Bluetooth module. Furthermore, HR, SpO2, and temperature metrics are transmitted to the PC every
second. The assessment of these RR estimators' performance is crucial for evaluating the embedded
system's accuracy and effectiveness in monitoring respiratory parameters in real-time scenarios.

Fig. 6 Absolute error for different RR estimators over 10 000


samples from [13]. Left to right: Karlen et al. [11], Mean, and FP

18
CHAPTER 5

CONCLUSION

5.1 Conclusion

This research has showcased the potential of deploying an algorithm for respiratory rate (RR) estimation
within the constraints of an MSP432 microcontroller. Initial assessments indicate that combining various
estimators such as Respiratory-Induced Intensity Variation (RIIV), Respiratory-Induced Amplitude
Variation (RIAV), Respiratory-Induced Frequency Variation (RIFV), along with the proposed Fourier
Product (FP) method, can yield reasonable estimations of RR. However, the accurate determination of
RR from photoplethysmography (PPG) signals remains an intricate challenge. Even sophisticated
methodologies, which may not be suitable for microcontroller integration, struggle to achieve exemplary
outcomes. Despite this, the FP method emerges as a straightforward yet effective approach, offering
satisfactory performance. Nonetheless, RIIV emerges as a particularly promising alternative, given its
relative ease of implementation while still delivering commendable results.

However, it's worth noting that accurately estimating RR solely from PPG signals remains an ongoing
challenge in the field. Even with advancements in technology, the quest for an optimal solution persists.
The simplicity and viability of the FP method provide a glimmer of hope, demonstrating that acceptable
results can be achieved with straightforward approaches. In contrast, RIIV presents itself as a more
accessible option, offering a balance between implementation simplicity and estimation accuracy. These
findings underscore the complexity of RR estimation from PPG signals and highlight the need for
continued research and innovation in this domain. As technology evolves and methodologies mature, it
is expected that more effective and efficient approaches will emerge, paving the way for enhanced
respiratory health monitoring in various applications, from wearable devices to clinical settings.

19
REFERENCES

[1] J. G. Webster, Design of Pulse Oximeters. Boca Raton, FL, USA: CRC Press, 1997.

[2] J. Fine et al., “Sources of inaccuracy in photoplethysmography for continuous cardiovascular


monitoring,” Biosensors, vol. 11, no. 4, p. 126, 2021.

[3] J. Fan et al., “A high accuracy & ultra-low power ECG-derived respiration estimation processor for
wearable respiration monitoring sensor,” Biosensors, vol. 12, no. 8, p. 665, 2022.

[4] P. H. Charlton, T. Bonnici, L. Tarassenko, D. A. Clifton, R. Beale, and P. J. Watkinson, “An


assessment of algorithms to estimate respiratory rate from the electrocardiogram and
photoplethysmogram,” Physiol. Meas., vol. 37, no. 4, p. 610, 2016.

[5] D. Bian, P. Mehta, and N. Selvaraj, “Respiratory rate estimation using PPG: A deep learning
approach,” in Proc. Int. Conf. IEEE Eng. Med. Biol. Soc. (EMBC), 2020, pp. 5948–5952.

[6] V. Ravichandran et al., “RespNet: A deep learning model for extraction of respiration from
photoplethysmogram,” in Proc. Int. Conf. IEEE Eng. Med. Biol. Soc. (EMBC), 2019, pp. 5556–5559

[7] P. Osathitporn et al., “RRWaveNet: A compact end-to-end multiscale residual CNN for robust PPG
respiratory rate estimation,” 2022, arXiv:2208.08672.

[8] R. Dai, C. Lu, M. Avidan, and T. Kannampallil, “RespWatch: Robust measurement of respiratory
rate on smartwatches with photoplethysmography,” in Proc. Int. Conf. Internet-Things Design
Implement., 2021, pp. 208–220.

[9] T. Iqbal, A. Elahi, S. Ganly, W. Wijns, and A. Shahzad, “Photoplethysmography-based respiratory


rate estimation algorithm for health monitoring applications,” J. Med. Biol. Eng., vol. 42, no. 2, pp. 242–
252, 2022.

[10] M. A. F. Pimentel et al., “Toward a robust estimation of respiratory rate from pulse oximeters,”
IEEE Trans. Biomed. Eng., vol. 64, no. 8, pp. 1914–1923, Aug. 2017

20
[11] W. Karlen, S. Raman, J. M. Ansermino, and G. A. Dumont, “Multiparameter respiratory rate
estimation from the photoplethysmogram,” IEEE Trans. Biomed. Eng., vol. 60, no. 7, pp. 1946–1953,
Jul. 2013.

[12] D. Uguz, “Design of a multipurpose photoplethysmography sensor to assist cardiovascular and


respiratory diagnosis,” in Proc. 21th Int. Student Conf. Elect. Eng., vol. 21, 2017, pp. 1–7.

[13] A. Goldberger et al., “BIDMC PPG and respiration Dataset, PhysioBank, PhysioToolkit, and
PhysioNet: Components of a new research resource for complex physiologic signals,” Circulation, vol.
101, no. 23, pp. e215–e220, 2021. [Online]. Available: https://physionet.org/content/ bidmc/1.0.0/

[14] “CMSIS-DSP software libray version 1.8.0.” ARM. Jun. 2022. [Online]. Available:
https://github.com/ARM-software/CMSIS_5

[15] L. Martinez-Hornak, I. Morales, A. Solari, and J. Oreggioni, “Wearable device prototype for vital
signs monitoring,” in Proc. 12th Congreso Argentino Sistemas Embebidos, UNLP, 2022, pp. 70–72

[16] D. E. Simon, “Survey of software architectures,” in An Embedded Software Primer. Boston, MA,
USA: Addison-Wesley Prof., 1999, pp. 115–136.

[17] Karulis. “Pybluez: Python extension module allowing access to system Bluetooth resources.” Aug.
2021. [Online]. Available: https://pybluez. github.io/

[18] G. Meszaros, XUnit Test Patterns: Refactoring Test Code. London, U.K.: Pearson Educ., 2007

21

You might also like