ENHANCED ACTIGRAPHY

This white paper has been produced to provide a technical overview of the development of enhanced
actigraphy features in the Garmin Health SDK. Part of this paper was presented during the Garmin HealthResearch Webinar on July, 19, 2023 by Justin Baird, technical lead software engineer at Garmin Health. A linkto the full recording can be found in the reference section of this paper.

ENHANCED ACTIGRAPHY

TABLE OF CONTENTS
SUMMARY .............................................................................................................................................................. 1
INTRODUCTION – ACTIGRAPHY AND GARMIN ................................................................................................. 1LEGACY ACTIGRAPHY ......................................................................................................................................... 1
Legacy Actigraphy – Zero Crossings ............................................................................................................. 1
Legacy Actigraphy – Energy............................................................................................................................ 2
Legacy Actigraphy – Examples ....................................................................................................................... 2
Legacy Actigraphy Improvement – Deadband ............................................................................................... 3
Legacy Actigraphy Improvement – Examples ............................................................................................... 3
ENHANCED ACTIGRAPHY ................................................................................................................................... 4
Introduction ....................................................................................................................................................... 4
Enhanced Actigraphy – Filter Paths ............................................................................................................... 4
Enhanced Actigraphy – Filter Path Comparison............................................................................................ 5
Enhanced Actigraphy – Zero Crossings......................................................................................................... 5Enhanced Actigraphy – Energy ....................................................................................................................... 6
Enhanced Actigraphy – Time Above Threshold ............................................................................................ 6
Enhanced Actigraphy – Summary................................................................................................................... 7
CONCLUSION ........................................................................................................................................................ 7
REFERENCES ........................................................................................................................................................ 7

ENHANCED ACTIGRAPHY

SUMMARY•••

Legacy zero crossings and energy
support activity classification, but arecomplex and susceptible to noise
The addition of a configurable
deadband to legacy zero crossings
removes noise susceptibility
Enhanced actigraphy provides activity
classification that is simple incalculation and highly configurable todifferent actigraphy use cases

INTRODUCTION –ACTIGRAPHY ANDGARMINAn actigraph, a diminutive wearable device
commonly positioned on the wrist, functions as arecording instrument that captures bodily activity
through the detection of physical motion. Its principal
application pertains to the evaluation of sleep
duration and quality. Evidently, Garmin watches
serve as exemplars of actigraphs, providing metrics
such as step counts, activity detection and sleep
tracking, all of which are conveniently accessible
through the Garmin Health software development kit(SDK) [1].
However, it is imperative to recognize that these
metrics are not comprehensive in addressing the full
spectrum of potential actigraphy applications. In an
ideal scenario, researchers would have unrestricted
access to complete accelerometer datasets, thereby
enabling customized analytical procedures. In
addition, practical limitations, including constrictions
in data storage capacity and bandwidth, impose
substantial constraints on such endeavors. For
instance, a Garmin vívosmart 5 device, as anillustrative example, is capable of retaining
approximately one day's worth of uninterrupted raw
acceleration data [2], necessitating approximately atwo-hour interval for complete retrieval via
BLUETOOTH connectivity.
While Garmin is actively engaged in augmenting bothstorage capacity and bandwidth capabilities, it isevident that long-term data logging remains an
impractical proposition in numerous instances. Thissignificant challenge is what drove the creation and

1 of 7development of enhanced actigraphy features aspart of the Garmin Health SDK.

LEGACY ACTIGRAPHY

Legacy actigraphy, known as “accelerometer sum ofzero axis crossings” or “zero crossings” or just
“ZCROSS,” logs to metrics in configurable intervalsof 30 seconds or longer. The first metric, zerocrossings, counts the number of times that the signal
crossed the zero, indicating a frequency of motion.
The second metric, energy, takes the integral ofacceleration in the interval, indicating magnitude ofmotion.

Legacy Actigraphy – ZeroCrossings

Zero crossing calculation starts with three axis
accelerometer data at 25 hertz. The magnitude of 3axis accel is computed as the two norm and one G issubtracted to remove gravity. The magnitude is thenhigh-pass filtered with a 0.5 hertz cutoff frequency
implemented by subtracting the 2-second average
acceleration.
A zero crossing is counted when the filteredmagnitude crosses zero; that is, when the signchanges.
•3-axis acceleration @ 25Hz•

𝑎𝑎 = �𝑥𝑥 2 + 𝑦𝑦 2 + 𝑧𝑧 2 - 1•

𝑎𝑎′ = 𝑎𝑎 − 𝑎𝑎𝑎𝑎𝑎𝑎2𝑠𝑠𝑠𝑠𝑠𝑠 (𝑎𝑎)••𝒛𝒛𝒛𝒛𝒕𝒕 =𝟎𝟎, 𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕 ) ==𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕−𝟏𝟏 ))�𝟏𝟏, 𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕 ) ≠𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕−𝟏𝟏 ))••0.5Hz high-pass filter

Sample zero crossing𝒛𝒛𝒛𝒛𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 = ∑𝒕𝒕∈𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 𝒛𝒛𝒛𝒛𝒕𝒕•Window zero crossing

ENHANCED ACTIGRAPHY

Figure 1, Legacy Zero Crossings

Figure 3, Legacy Energy

Legacy Actigraphy – Examples

Figure 4 below shows the legacy metrics for a nightof rather restless sleep, gathered using a Garmin
Venu 2 Plus and the Health SDK. Zero crossings
clearly show the noise issue: They float around 350
the whole night with little indication of motion. Energy
appears to provide a good summary of motion.

Figure 2, Legacy Zero Crossings: NoiseA major limitation of legacy zero crossings that canbe seen in Figure 1 and Figure 2 is that accel noisecauses zero crossings even when stationary. This
causes zero crossings to be unintuitively higher
when stationary than when in motion.

Legacy Actigraphy – Energy

The second metric, energy, is computed as 8-secondroot mean square of normalized acceleration
updated every 2 seconds. Window energy is the sumof 2-second energy over the window.
•3-axis acceleration @ 25 Hz•𝑎𝑎 = �𝑥𝑥 2 + 𝑦𝑦 2 + 𝑧𝑧 2 - 1••𝒆𝒆𝒕𝒕 = 𝑹𝑹𝑹𝑹𝑹𝑹𝟖𝟖𝟖𝟖𝟖𝟖𝟖𝟖 (𝒂𝒂𝒕𝒕 )•Sample energy•

Note: Energy is updated every 2seconds

𝒆𝒆𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 = ∑𝒕𝒕∈𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 𝒆𝒆(𝒕𝒕)•2 of 7

Window energy

Figure 4, Sleep Legacy Zero Crossings and Energy

Figure 5 shows a walk dataset. The walk stands out
clearly in energy and appears as a reduction in zerocrossings. With the walking segment identified withthe energy metric, zero crossings can then be used
to determine the frequency of motion. One-hundred
zero crossings in 30 seconds gives around a 3-step
per second cadence.

ENHANCED ACTIGRAPHY

Figure 5, Walk Legacy Zero Crossings and Energy

Figure 6, Legacy Zero Crossings with Deadband

Legacy Actigraphy Improvement– Deadband

Legacy Actigraphy Improvement– Examples

In surveying actigraphy literature about zerocrossings, we found that zero crossings are typically
implemented as threshold crossings with thethreshold set above the accel noise floor, acting as adeadband. The Health SDK has added such aconfigurable threshold parameter to legacy zerocrossings. This new threshold will default to 50 milliG,
which is a common noise floor in Garmin device
sensors and is applied as follows. For a zero crossing
to be counted, the sign of the accel must change andthe absolute value of the accel must exceed thethreshold. Figure 6 shows how this improves zerocrossing behavior and makes it behave much moreintuitively to track motion.
•3-axis acceleration @ 25 Hz•

𝑎𝑎 = �𝑥𝑥 2 + 𝑦𝑦 2 + 𝑧𝑧 2 - 1••Figure 7, Sleep Legacy Deadband Zero Crossings and Energy

𝑎𝑎′ = 𝑎𝑎 − 𝑎𝑎𝑎𝑎𝑎𝑎2𝑠𝑠𝑠𝑠𝑠𝑠 (𝑎𝑎)In the walk data set (Figure 8), the zero crossing
value during the walk is unchanged, indicative of step
𝒛𝒛𝒛𝒛𝒕𝒕 =rate, but now goes to zero with energy during the𝟎𝟎, 𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕 ) ==𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕−𝟏𝟏 ) or |𝒂𝒂′ 𝒕𝒕 | < 𝜽𝜽)
stationary section.
�𝟏𝟏, 𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕 ) ≠𝒔𝒔𝒔𝒔𝒔𝒔𝒔𝒔(𝒂𝒂′ 𝒕𝒕−𝟏𝟏 ) and |𝒂𝒂′ 𝒕𝒕 | ≥ 𝜽𝜽)•••

Figure 7 shows the sleep data set again with a 50
milliG zero crossing deadband applied. Now bothzero crossings and energy have a high correlation
with motion.

𝜽𝜽 = 𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕

Sample zero crossing

𝒛𝒛𝒛𝒛𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 = ∑𝒕𝒕∈𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘𝒘 𝒛𝒛𝒛𝒛𝒕𝒕•Window zero crossing

Figure 8, Walk Legacy Deadband Zero Crossings and Energy

3 of 7

ENHANCED ACTIGRAPHY

This improvement goes a long way toward improving
the usefulness of legacy zero crossings in the Health
SDK, but legacy actigraphy still remains too rigid andtoo arbitrary to be useful for a large number ofactigraphy use cases.

•3-axis acceleration @ 25 Hz•

Filter path: FMPOST•••

ENHANCED ACTIGRAPHYIntroduction

Enhanced actigraphy adds a new set of activity
metrics to the Garmin Health SDK that address thelimitations of legacy actigraphy. These new metrics
are based on the analysis found in Maczák et al. [3].
The overall theme of the new metrics isconfigurability. This give researchers the ability totune the metrics to their purposes rather than trying
to find a one-size-fits-all approach. To that end, theHealth SDK is adding three new independently
configurable actigraphy data sources. These sources
have a shorter minimum processing window, down to1 second, for higher granularity. They have also a setof configurable parameters that give two choices offilter path, providing different acceleration behaviors,
and an IIR filter with parameters for 2-second ordersections to allow for custom high-, low- and bandpass filtering. These parameters can easily begenerated in SciPy or MATLAB. Finally, each source
computes three metrics: zero crossings, energy andtime above threshold, each with independently
configurable thresholds.

•𝑎𝑎 = �𝑥𝑥 2 + 𝑦𝑦 2 + 𝑧𝑧 2𝑎𝑎′ = 𝑓𝑓1 (𝑓𝑓0 (𝑎𝑎))𝑓𝑓𝑖𝑖 () = configuration-defined IIRfilter

Filter path: FMPRE•••••𝑓𝑓𝑖𝑖 () = configuration-defined IIRfilter
𝑥𝑥 ′ = 𝑓𝑓1 (𝑓𝑓0 (𝑥𝑥))𝑦𝑦 ′ = 𝑓𝑓1 (𝑓𝑓0 (𝑦𝑦))𝑧𝑧 ′ = 𝑓𝑓1 �𝑓𝑓0 (𝑧𝑧)�

𝑎𝑎′ = �𝑥𝑥 ′ 2 + 𝑦𝑦 ′ 2 + 𝑧𝑧 ′ 2𝒙𝒙′ = 𝒇𝒇𝟏𝟏 (𝒇𝒇𝟎𝟎 (𝒙𝒙))𝒚𝒚′ = 𝒇𝒇𝟏𝟏 (𝒇𝒇𝟎𝟎 (𝒚𝒚))𝒛𝒛′= 𝒇𝒇𝟏𝟏 (𝒇𝒇𝟎𝟎 (𝒛𝒛))𝒂𝒂′= �𝒙𝒙′ 𝟐𝟐 + 𝒚𝒚′ 𝟐𝟐 + 𝒛𝒛′ 𝟐𝟐

Enhanced Actigraphy – Filter
Paths

Enhanced actigraphy calculation starts with 25 hertz
3-axis accel. For the first filter path, “FMPost,” themagnitude is taken as the two-norm and the IIR filter
is applied to produce filtered magnitude. In the plot,a fourth order Butterworth high-pass filter was usedwith a 0.25 hertz cutoff frequency. For the other filter
path, “FMPre,” the IIR filter is applied to each axis
independently, and the magnitude is taken as thetwo-norm of the filtered axes. The same fourth orderfilter was applied for this plot. As shown in Figure 9and Figure 10, FMPre produces an absolute value
magnitude rather than the signed magnitude ofFMPost.

Figure 9, Acceleration Magnitude, FMPOST

Figure 10, Acceleration Magnitude, FMPRE

4 of 7

ENHANCED ACTIGRAPHY

Enhanced Actigraphy – Filter
Path Comparison

Figure 12 shows the pros and cons of the different
filter paths in dataset where the user is tapping thescreen of their phone at 1-2 Hz. The individual taps
are much more visible relative to noise in FMPre, but
at the cost of loss of directionality information in thesignal. The added sensitivity of FMPre will potentiallybe very useful for sleep studies.
•••𝑧𝑧𝑧𝑧𝑡𝑡 =0, 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠(𝑎𝑎′ 𝑡𝑡 − 𝜃𝜃) ==𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠(𝑎𝑎′ 𝑡𝑡−1 − 𝜃𝜃))
�1, 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠(𝑎𝑎′ 𝑡𝑡 − 𝜃𝜃) ≠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠(𝑎𝑎′ 𝑡𝑡−1 − 𝜃𝜃))•••𝜃𝜃 = 𝑡𝑡ℎ𝑟𝑟𝑟𝑟𝑟𝑟ℎ𝑜𝑜𝑜𝑜𝑜𝑜

Sample zero crossing

𝑧𝑧𝑧𝑧𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 = ∑𝑡𝑡∈𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑧𝑧𝑧𝑧𝑡𝑡•

Window zero crossing

FMPRE:•

Increased sensitivity to small
motion•Removesdominant
gravityacceleration before 2-norm

FMPOST:•Maintains directional information

Figure 12, Enhanced Actigraphy Zero Crossings, FMPOST

Figure 11, Filter Path Comparison: Finger Tap (Cell Phone Use)

Enhanced Actigraphy – ZeroCrossings

In enhanced actigraphy, zero crossings are counted
when the sign of the acceleration magnitude minus
the threshold crosses zero. In the referenced article,
it was shown that positive-only threshold produced
comparable results to a positive and negative
threshold band, so a positive-only threshold is used
for simplicity. Note that the lack of directionality in theFMPre filter path produces a reduction in zerocrossings during sustained motion as seen in Figure
14.
•3-axis acceleration @ 25 Hz•

Filter path: FMPRE/FMPOST•

5 of 7a’ = filtered accel

Figure 13, Enhanced Actigraphy Zero Crossings, FMPREENHANCED ACTIGRAPHY

Enhanced Actigraphy – Energy

Sample energy is the absolute value of filteredmagnitude, or zero if below the threshold. Thissimplifies energy greatly compared to the rolling
window RMS of legacy energy. The FMPre energy
looks similar but larger due to the absolute value
magnitude.
•3-axis acceleration @ 25 Hz•

Filter path: FMPRE/FMPOST••𝑒𝑒𝑡𝑡 = �••a’ = filtered accel
0, |𝑎𝑎′𝑡𝑡 | < 𝑡𝑡ℎ𝑟𝑟𝑟𝑟𝑟𝑟ℎ𝑜𝑜𝑜𝑜𝑜𝑜|𝑎𝑎′𝑡𝑡 |, |𝑎𝑎′𝑡𝑡 | ≥ 𝑡𝑡ℎ𝑟𝑟𝑟𝑟𝑟𝑟ℎ𝑜𝑜𝑜𝑜𝑜𝑜
Sample energy

𝑒𝑒𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 = ∑𝑡𝑡∈𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑒𝑒𝑡𝑡•

Window energy

Enhanced Actigraphy – Time
Above Threshold

Time above threshold (TAT) is a new metric inenhanced actigraphy. Sample time above thresholdis the sample period of 1/25 of a second when thesample is above the threshold and zero otherwise.
For FMPre note that TAT values that areapproximately doubled compared to FMPost due tothe absolute value magnitude. Analysis of actigraphy
data will need to be tuned to the filter path and scaling
behavior, but this should be an acceptable trade-off
for the adaptability the filter paths will provide.
•3-axis acceleration @ 25 Hz•

Filter path: FMPRE/FMPOST••

0, 𝑎𝑎′𝑡𝑡 < 𝑡𝑡ℎ𝑟𝑟𝑟𝑟𝑟𝑟ℎ𝑜𝑜𝑜𝑜𝑜𝑜
𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 = �1
�25 , 𝑎𝑎′𝑡𝑡 ≥ 𝑡𝑡ℎ𝑟𝑟𝑟𝑟𝑟𝑟ℎ𝑜𝑜𝑜𝑜𝑜𝑜••

a’ = filtered accel

Sample time above threshold𝑡𝑡𝑡𝑡𝑡𝑡𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 = ∑𝑡𝑡∈𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡•Window time above threshold

Figure 14, Enhanced Actigraphy Energy

Figure 15, Enhanced Actigraphy Time Above Threshold6 of 7

ENHANCED ACTIGRAPHY

Enhanced Actigraphy – Summary

CONCLUSION

Figure 18 shows all of the activity metrics andconfiguration available on Garmin devices via theGarmin Health SDK as of the addition of enhanced
actigraphy. Putting all of these knobs and switches in
the hands of researchers will enable Garmin devices
to be capable actigraphy platforms able to be tuned
to fit many actigraphy use cases, or to match thebehavior of reference actigraph devices.

Actigraphy
SourceFigure 16, Sleep Actigraphy All Metrics

Activity
MetricLegacy ZeroCrossings

Configuration
Interval (≥ 30 seconds)

ZeroCrossings

Deadband (mG)

EnergyEnhanced
Actigraphy(3 channels)

Interval (≥ 1 second),
Filter Path (FMPRE, FMPOST),IIR Filter Parameters (2-secondorder sections)Figure 17, Walk Actigraphy All Metrics

Figure 17 shows the various metrics both legacy andenhanced actigraphy sources provide, plotted
together on the sleep and walk datasets. New
metrics are plotted with both filter paths and set to 1second windows, but remember that the actigraphy
in enhanced category can be set to any length ofwindow in increments of 1 second. These settings
provide a high level of variation in behavior for finetuning.
For example, one actigraphy channel may beconfigured for high sensitivity, using the FMPRE filter
path, a high-pass filter and low thresholds to capture
minute motions during sleep. At the same time,
another channel may be configured to detect only
large motions, using the FMPOST filter path, a bandpass filter and high thresholds to capture only active
behavior. The combination of these two metrics canprovide a full picture of the users daily activity, atdown to a 1-second granularity or in epochs as large
as desired.

7 of 7ZeroCrossings

Threshold (mG)

EnergyThreshold (mG)Time AboveThreshold

Threshold (mG)

Figure 18, Actigraphy Configuration Summary

REFERENCES[1] https://developer.garmin.com/healthsdk/overview/[2] https://www.garmin.com/p/782585[3] Maczák B, Vadai G, Dér A, Szendi I, Gingl Z(2021) Detailed analysis and comparison of different
activity metrics. PLOS ONE 16(12): e0261718.
https://doi.org/10.1371/journal.pone.0261718[4] Webinar Recording*Vivosmart and Venu are registered trademarks ofGarmin Ltd.
**The Bluetooth word mark and logos are registeredtrademarks owned by Bluetooth SIG, Inc. and any
use of such marks by Garmin is under license.