Abstract
Introduction
Cardiopulmonary resuscitation (CPR) is an emergency procedure for manually preserving brain function until further measures can be taken to restore spontaneous blood circulation and breathing in a person who is in cardiac arrest. CPR primarily consists of chest compressions (CCs) and rescue breathing. It is an important technique in hospitals, at home, and in the accident field. According to the 2010 American Heart Association (AHA) Guidelines for adults, high-quality CPR includes chest compressions of an adequate rate (at least 100 compressions/minute) and depth (at least 2 inches [51 mm]) that allow for full chest recoil after each compression and minimize interruptions during compressions. 1 The CC depth (CCD) and CC rate are important factors that are related to the survival rates of cardiac arrest. 1 –4
However, insufficient CC according to the current recommendation was observed during CPR in both out-of-hospital and in-hospital studies. 5,6 To avoid insufficient CC, healthcare workers and emergency medical participants periodically receive basic life support education. In addition, they use several devices that offer feedback for the CC rate and CCD. 7 –10 The feedback devices measure the CCD based on an accelerometer or pressure sensor. Several studies showed that feedback devices improve CCD in simulated cardiac arrest. 8 –10
Cardiac arrest often occurs outside of hospitals, where experienced rescuers or CCD feedback devices are unavailable. However, smartphones have enjoyed widespread use with 22% of the population worldwide. 11 Many smartphone applications (apps) have been developed and are available from the app market (e.g., Google Play Store), and smartphone sales are increasing. Several CPR-related apps are available from Google Play Store and App Store. Most of these apps only guide users in their CPR procedures via text and pictures or video. Among them, PocketCPR® for Android™ (Google, Mountain View, CA) offers a feedback function for CCD training. 12 –14 It estimates the CCD based on the built-in accelerometer in the smartphone. However, the app lacks a nominal specification or report on its accuracy of the CCD estimation.
Because the CCD cannot be directly measured using the accelerometer in a smartphone, errors in the estimation based on the acceleration signal are inevitable. Specifically, three-axis accelerometers may result in different errors depending on the grasping orientation of the smartphone. The rescuers may need to continue the CC in an oblique direction, such as in elevators. In oblique directional compression, the CCD estimation error may increase. For a pregnant patient in cardiac arrest, the 2010 AHA Guidelines recommend that the providers place the patient in a left-lateral tilt of 30° using a firm wedge to support the pelvis and thorax because the pregnant uterus can compress the inferior vena cava. 15,16 To evaluate the accuracy of the CCD, we must assess the gravity direction as well as the oblique directional compression.
In this study, we proposed a new concept of real-time CCD estimation algorithm (called “U-CPR”) using a smartphone with a built-in three-axis accelerometer and evaluated the accuracy of the algorithm in various grasping orientations and compression directions. This proof-of-concept study was conducted to describe the algorithm of the U-CPR and investigate the tolerability.
Materials and Methods
CCD ESTIMATION USING ACCELEROMETER
Three-axis accelerometers provide the accelerations in each axis [ax
(t), ay
(t), az
(t)] in m/s
2
. Equation 1 was used to calculate the distances of each axis from the accelerations. The accumulation of error due to the integration constant (Ca
, Cv
), which is the bias component in the accelerometer, is considerable and increases over time:
The simple integration to estimate the CCD alone may introduce an error. Some devices use an additional pressure switch to detect the starting point of each compression to solve this problem, which cannot be implemented with a smartphone.
17
To avoid the accumulation of error over time, we reset the integral constant to 0 at the start of each compression. To calculate the distance of the compression, we integrated only one period of the compression. One period can be defined as the positive peaks.
18
After determining the distance of each axis, we estimated the distance of moving in a three-dimensional space using the vector sum of the three axes as shown in Eq. 2. In Eq. 2, dx
, dy
, and dx are the calculated distance from the x-, y-, and z-axes of the accelerometer, respectively, where d is the distance of movement in three-dimensional space:
Real-Time Implementation for CCD Estimation
Figure 1 shows the flow chart used to determine the distance of one axis. Normally, the signal from the accelerometer includes noise and bias in the gravity axis. To minimize this noise, we used the weighted smoothing technique as shown in Eq. 3, where β is 0.7.
19
We can obtain the velocity by integrating the filtered signal. The cumulative error is due to the bias, which is given by the integral constant Ca
. This error produces the drift effect on the vx
(t) waveform, as shown in Figure 1. We used the transient components emphasizing technique to reduce the slowly changing components, as shown in Eq. 4, where α is 0.9.
19
The velocity was integrated again to obtain the distance data. The drift effect is due to the integral constant, Cv
, as shown in the dx
(t) waveform of Figure 1. We used the transient components emphasizing technique again to reduce the drift components. We estimated the CCD as the difference of the positive peak and negative peak in the distance data
18
:

Flowchart of chest compression depth (CCD) estimation algorithm for one axis.
The raw data were sampled for every event, which fires whenever the Android OS determines that the input signal of the accelerometer has changed. Because of the varying activity loads of the OS, this event is not fired periodically. Because of the irregular acquisition, the conventional frequency selection filter cannot be used. To remove the noise, we applied the weighted smoothing technique, which has the role of a low-pass filter. To remove drift, we used the technique emphasizing transient components, which has the function of a high-pass filter.
For the real-time processing, the program calculates the distance for every event. Moreover, the program checks whether the current point is the peak. If the peak point is found, the data are saved until the next peak. We determined three peaks, and the CCD was calculated as in Eq. 5. In Eq. 5, peak [n] is the latest positive peak (the chest is fully decompressed), peak [n − 1] is the latest negative peak (the chest is fully compressed), and peak [n − 2] is the previous positive peak:
After we obtained the distance of each axis, we measured the CCD via the vector sum of the three axes, as in Eq. 2. Because the user can hold the smartphone in any orientation and the compression direction may be different in some conditions, we required the data from the three-axis accelerometer.
To be used as the feedback device for continuous CC, the depth should not be shown instantaneously. The rescuers should compress deeper or shallower according to the feedback value, and showing an average of previous compression depths is preferred to ensure a smoother change in depth. As shown in Eq. 6, our program shows the depth as the average of previous compressions with the current compression until the fifth compression. Furthermore, it shows the average depth of the previous four compressions with the current compression after the fifth compression:
Development Environment
A VEGA Racer (model IM-A760S; Pantech Co., Ltd., Seoul, Korea) smartphone with Android OS (Jellybean) was used to develop the CCD estimation algorithm. JAVA and Eclipse (Eclipse Foundation Inc., Ottawa, ON, Canada) with Android SDK 2.3.3 (Google) were used to implement the algorithm. To facilitate the built-in accelerometer of the smartphone, we used Android Sensor API. 20 In using API, we took TYPE_LINEAR_ACCELERATION to determine the linear acceleration excluding the acceleration of gravity and used SENSOR_DELAY_FASTEST to obtain as many samples as possible. The smartphone used in our study features a three-axis accelerometer and storage.
Experiment for the Accuracy Evaluation
To evaluate the accuracy of the algorithm, a linear variable differential transformer (LVDT) (model RDP-100S; Radian Co., Ltd., Seoul) was used as the reference measurement. The LVDT directly transduces the linear distance to voltage. As shown in Figure 2, the analog voltage that was obtained from the LVDT was acquired using NI-DAQ 920S with a sampling rate of 1 kHz. The signal can be monitored by the in-house program composed with LabVIEW version 9.0 software (National Instrument Co., Austin, TX). To compare the accuracy with PocketCPR for Android, two identical smartphones were stacked, as shown in Figure 2. PocketCPR was performed on one smartphone, and our algorithm, U-CPR, was performed on the other smartphone. When manually simulating the CC, two estimated depth data points from the smartphones and the reference depth data were simultaneously recorded.

Configuration of the experimental setting for evaluation. CCD, chest compression depth.
To evaluate the accuracy of CCD estimation, we defined the error with Eq. 7. The error was the difference between the estimated depth (d) and the reference measurement (d
LVDT):
While observing the depth via a PC monitor, we engaged in up-and-down movements to simulate CC in CPR. In each experiment, 200 CCs were performed, and the error for each compression was calculated. The mean and standard deviation (SD) of errors were calculated as the results.
The first experiment served to evaluate the accuracy at the various depths of CC. We divided CCD into three levels: insufficient compression (40–45 mm), adequate compression (50–55 mm), and excessive compression (60–65 mm), based on the AHA guidelines. In the first experiment, the patient is thought to be laid on the flat ground, as shown in Figure 3a; the smartphone is placed orthogonal to the ground, and the compressing direction is the same as the gravity direction.

The various grasping orientations and directions of compression. ax,y,z
is the acceleration signal from the smartphone, g is the direction of gravity, and
In the second, we designed four types of conditions, as shown in Figure 3. The conditions varied the grasping orientation of the smartphone (Fig. 3a–c) and compressing direction (Fig. 3d). Figure 3a is the condition recommended by PocketCPR. Figure 3b simulates that the smartphone is attached to the armband. Figure 3c simulates the possibility of any person partially grasping the smartphone. Figure 3d simulates compressing at an angle to the gravity direction, which simulates CPR for pregnant women or CPR in an elevator. In all cases, we compressed 200 times with an adequate level of CCD (50–55 mm).
Results
Table 1 shows the mean (SD) of errors (Eq. 7), which is the absolute value of the difference between the reference measurement and the smartphone-based CCD estimation at three levels of compression depths. In U-CPR, the mean (SD) errors for the insufficient case, adequate case, and excessive case were 1.24 (0.87) mm, 1.43 (1.00) mm, and 2.46 (1.38) mm, respectively. The mean (SD) errors in PocketCPR were 1.43 (0.75) mm, 1.01 (0.74) mm, and 2.46 (1.38) mm, respectively. At all depths, the mean absolute error did not exceed 3 mm, and the difference between U-CPR and PocketCPR was not significant.
Errors in Three Levels of Compression Depths
Data are mean (standard deviation) values.
Table 2 shows the mean (SD) errors of the absolute value of the difference between the reference method and the smartphone-based method for various grasping orientations and compression directions (from Fig. 3). When the compressing direction was the gravity direction, as shown in Figure 3a–c, the means (SD) of the absolute errors were 1.42 (1.04) mm, 2.21 (1.64) mm, and 2.16 (1.48) mm, respectively, for U-CPR, whereas the errors were 0.93 (0.84) mm, 3.54 (1.42) mm, and 1.57 (1.20) mm, respectively, for PocketCPR. When the compressing direction was tilted 30° from the gravity direction, as shown in Figure 3d, the mean of errors in U-CPR was 3.13 (1.88) mm, but the mean of errors in PocketCPR was 11.56 (1.29) mm. The error in PocketCPR is four times larger than the error in U-CPR.
Errors in Four Types of Conditions
Data are mean (standard deviation) values. Conditions (a), (b), (c) and (d) are shown in the respective panels of Figure 3.
Additionally, we tested the CCD estimation for a sudden change in the CCD. As shown in Figure 4, U-CPR followed the reference measurement more quickly than PocketCPR. In U-CPR, we showed the depth as an average of five compressions. In PocketCPR, the average requires more than eight to nine compressions.

Result of an experiment to observe the sudden change of chest compression depth. The linear variable differential transformer (LVDT) (○) is the reference measurement as a step function. U-CPR (×) follows faster than PocketCPR (Δ).
Discussion
In this study, we described the concept of a new real-time CCD estimation algorithm that was implemented on an Android smartphone. For evaluation of the algorithm, we analyzed the accuracy for various depths, grasping orientations, and compressing directions. As a result, the means of errors were below 2.5 mm for all conditions except the oblique compression, where the mean error was 3.13 mm. Because the 2010 AHA guidelines on CC for an adult patient recommend a compression that exceeds 2 inches (51 mm), 1 2.5 mm is 5% of the minimal recommended depth, and U-CPR underestimates this depth. This error is in the acceptable range to be used as a feedback device for CCD.
When the compressing direction was tilted 30° from the gravity direction as in Figure 3d, the mean error in U-CPR was 3.13 (1.88) mm, but the mean error in PocketCPR was 11.56 (1.29) mm. With the exception of this condition, the mean errors in U-CPR and PocketCPR were similar. PocketCPR seems to measure the depth in the gravity direction only (the portion of * in Fig. 3d). As explained in the Introduction, CCs for pregnant women should be performed in a direction oblique to the gravity direction. In a narrow space, such as an elevator, oblique compression is also necessary to continue CC without interruption. Because U-CPR is more accurate for oblique compressions, it may constitute an advantage over PocketCPR (Fig. 5a and c). However, U-CPR overestimates the actual CCD when the rescuer compresses the chest at angles other than a flat surface, as shown in Figure 5b. In this case, PocketCPR estimates the CCD more correctly because it estimates only the gravity direction component. According to the right CPR posture, the center of mass of the rescuer should be directly above the patient. The possibility of oblique compression is not high, and the difference in the angle from the gravity direction is not large. Thus, we prefer U-CPR.

Three cases of different chest compression (CC).
As shown in Figure 4, U-CPR follows the stepwise changes of depths more quickly than PocketCPR. When the rescuer uses the feedback device, he or she must change the depth when it shows an alarm. If the device shows the instantaneous depth, the rescuer may oscillate between insufficient and excessive compression. Therefore, U-CPR displays the depth as the average of the five previous depths. A delay should occur simultaneously. A detailed examination of Figure 4 indicates that an average of eight or nine compression results in a long delay for PocketCPR.
U-CPR suffers from some limitations. When the patient lies down on a foam mattress, U-CPR can overestimate the CCD because it also measures the compression of the mattress. 21 This problem is common in feedback devices that contain one sensor. The mattress compression can be reduced by using a backboard. 22 Increasing the CCD to at least 65 mm if the patient is lying on a mattress could also compensate for the mattress compression depth, as suggested by Handley. 23 In addition, the AHA guidelines for adult CPR recommend a full chest recoil after each compression, but U-CPR cannot detect whether the recoil was sufficient because it calculates the depth as the difference between the positive peak and the negative peak. This limitation is also caused by using an accelerometer. 24
In addition to the feedback function, many other helpful functions are necessary for CPR-related apps. To implement a completion app, we will validate the app with the mannequin for large numbers of rescuers. Future work includes the development of a useful app with a CCD feedback function to ensure its widespread use to save more people.
Conclusions
The error of the CCD estimation was tolerable for the algorithm to be used in a smartphone-based CCD feedback app to ensure a compression of more than 2 inches (51 mm), which is the 2010 American Heart Association Guideline for adult CPR.
Footnotes
Acknowledgments
This work was supported by National Research Foundation grant NRF-2013R1A1A4A01006381 funded by the Korean Government.
Disclosure Statement
No competing financial interests exist.
Y.S. and Y.C. conceived the study, designed the trial, and obtained research funding. Y.C. and Y.S. developed the algorithm. Y.C. and J.O. supervised the trial conduct and data collection. Y.S. drafted the manuscript, and all authors contributed substantially to its revision. Y.C. takes responsibility for the article as a whole.
