# Sleep/Wake Detection Using Actiwatch 2 and Vivosmart 4

With Philips discontinuing its wrist-worn wearables for clinicians and researchers —including its popular Actiwatch devices—many researchers have been scrambling for alternatives. To see whether consumer-grade smartwatches can effectively replace medical-grade actigraphic devices, we reverse-engineered the algorithm for the Actiwatch 2 and found that we could replicate its results with affordable consumer wearables, such as the Garmin Vivosmart 4.

Nov 2, 2022
By Drs. Francis Hsu, Han-Ping Huang and Andrew Ahn

## Abstract

Actiwatch 2 (Phillips-Respironics, Bend, Oregon) is a popular actigraphic device that can detect nighttime sleep/wake patterns and derive sleep parameters based on acceleration (ACC) signals. However, in October 2022, Philips announced that it is “discontinuing offering wrist-worn products in the clinician and research markets”, making all Actiware, Actiwatch 2, Actiwatch PRO, and Actiwatch Plus products unavailable for purchase after Dec. 29, 2022.

To evaluate whether an affordable consumer smartwatch, Vivosmart 4(Garmin, Olathe, Kansas), can effectively replace Actiwatch 2, we reverse-engineered the algorithm for Actiwatch 2 and applied the same algorithm to the raw-ACC data obtained from Vivosmart 4. The Vivosmart 4 does not routinely provide raw ACC data, but through our partnership with Garmin, a customized SDK was created to extract raw ACC signal from Vivosmart 4 and used to reproduce the sleep analysis obtained from Actiwatch 2.

This post introduces the signal processing method of detecting nighttime sleep/wake patterns based on the acceleration signal. As described here, we found the sleep/wake patterns derived from Vivosmart 4 consistent with that of Actiwatch 2. In the following two posts, we will explore how Actiwatch 2 derives sleep parameters from sleep/wake patterns, and compare the performance between Actiwatch 2 and Vivosmart 4 with more sleep data.

## 1. Experiment Setup

Our experiment setup is shown in Figure 1. Actiwatch 2 and Vivosmart 4 were worn simultaneously during sleep for comparison. Actiwatch 2 is a piezoelectric accelerometer with a sampling rate of 32 Hz. Vivosmart 4 is a 3-axis MEMS accelerometer with a sampling rate of 25 Hz.

## 2. From Acceleration Signal to Sleep/Wake Detection

### 2.1 Signal Processing

Figure 2 illustrates the signal processing method for deriving sleep/wake patterns. The general idea of the method can be referred to the reference [1-2].

Figure 2(a) illustrates the acceleration signal from Vivosmart 4 in terms of $a'(t)=\sqrt{a_x^{'2}(t)+\;a_y^{'2}(t)+a_z^{'2}(t)}$. In the equation, $a_x'(t)$ is the raw x-axis acceleration subtracting its moving average of window length 9 to eliminate the low-frequency variation. And  $a_y'(t)$, $a_z'(t)$ are derived the same way.

Figure 2(b) illustrates the activity count time series labeled as AC(n), where n is the epoch index with an epoch length of 30 sec. The process of deriving AC(n) consists of three steps. First, the max $a'(t)$ in every second is extracted. Then, the values in $a'(t)$ below the noise level are set to 0. Finally, $a'(t)$ in every 30s epoch is summed up and then divided by 35 to represent the activity count in the epoch.

Figure 2(c) illustrates the total activity count labeled as TAC(t), which is derived from AC(n) as TACn=0.04∙ ACn-4+0.04 ∙ ACn-3+0.2 ∙ ACn-2+0.2∙ ACn-1+2∙ ACn++0.2∙ AC(n+1)+0.2∙ AC(n+2)+0.04∙ AC(n+3)+0.04∙ AC(n+4) [3].

Finally, the epochs with TAC(t) below and above 40 are detected as sleep and awake period, respectively. The value 40 is the default sleep/wake threshold set in the Actiwatch software, which can also be set as 20 or 80. Accordingly, Figure 2(d) illustrates the sleep/wake patterns.

### 2.2 Comparison between Actiwatch 2 and Vivosmart 4

As can be seen in Figure 2(d), the sleep onset to offset time is 2:02 to 10:08 with an interval of 488 mins. Table 1 lists the consistent and inconsistent results between Actiwatch 2 and Vivosmart 4. Treating the result from Actiwatch 2 as a standard, the sensitivity (to detect sleep) of Vivosmart 4 is near 1.00, and the specificity is 0.87.

## 3. Conclusion

We reverse-engineered the full algorithm utilized in the Actiwatch 2 to derive nighttime sleep/wake patterns from the raw acceleration signal. The sleep/wake patterns derived from Vivosmart 4 are consistent with that of Actiwatch 2. In the following two posts, we will explore how Actiwatch 2 derives sleep parameters from sleep/wake patterns, and compare the performance between Actiwatch 2 and Vivosmart 4 with more sleep data.

### Get the Entire Actigraphy Collection!

Enter your email to access Labfront’s entire actigraphy collection in PDF format.

## 4. References

[1] K. Y. Chen and D. R. Bassett, “The technology of accelerometry-based activity monitors: current and future,” Med. Sci. Sports Exer., vol. 37, pp. S490–S500, Nov. 2005.

[2] CamNtech, “The MotionWatch 8 and MotionWare User Guide

[3] Respironics, “Instruction manual of Actiwatch Communication and Sleep Analysis Software." Instruction manual.

Last medically reviewed on
Dr. Francis Hsu, PhD

Francis is a research Lead at Labfront, responsible for data validation and analysis. He is interested in applying physics or math to medical research.

Dr. Han-Ping Huang, PhD