Skip to main content

Installation

Minimum Requirements

  • iOS 14.0 or later
  • Xcode 15.0 or later
  • Swift 5.9 or later

Installation

Swift Package Manager

Add the Autonomic Health SDK to your project using Swift Package Manager:

  1. In Xcode, select File > Add Package Dependencies
  2. Enter the repository URL:
    URL Endpoint coming soon
  3. Select the version you want to use
  4. Choose the products you need:
    • AHSDKCore (Required) - Core SDK and API client
    • AHSDKPolar (Optional) - Polar device support
    • AHSDKGarmin (Optional) - Garmin device support
    • AHSDKBLEHeartRate (Optional) - Generic Bluetooth heart rate monitors
    • AHSDKWatchKit (Optional) - Apple Watch support

Package.swift

dependencies: [
.package(
url: <url coming soon>,
from: "1.0.0"
)
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "AHSDKCore", package: "ah-sdk-ios"),
.product(name: "AHSDKPolar", package: "ah-sdk-ios"),
.product(name: "AHSDKBLEHeartRate", package: "ah-sdk-ios"),
]
)
]

Device Adapters

The SDK supports multiple wearable device types through modular, tree-shakable adapters. Each adapter handles device-specific Bluetooth protocols and data streaming.

Device AdapteriOS ModuleAndroid Module
PolarAHSDKPolarah-sdk-polar
GarminAHSDKGarminah-sdk-garmin
Generic BLEAHSDKBLEHeartRateah-sdk-ble-hr
Apple WatchAHSDKWatchKitN/A

Supported Wearables & Capabilities

The quality of ANS testing depends heavily on the capabilities of the heart rate monitor. Not all devices provide the same level of precision.

DeviceRR IntervalsAccelerometerGyroscopePPGData Quality
Polar H10✅ NativeExcellent
Polar Verity Sense✅ NativeExcellent
Polar OH1✅ NativeExcellent
Garmin HRM-Pro✅ NativeVery Good
Garmin HRM-Dual✅ NativeVery Good
Generic BLE HR❌ BPM onlyVariesVariesVariesFair
Apple Watch S4+❌ BPM onlyFair
Tree-Shakable Architecture

You only bundle the device adapters your app needs. If you only import AHSDKPolar, the Garmin, BLE, and Apple Watch SDKs won't be included in your app binary, keeping your app size minimal.

Understanding Data Quality & Sampling Resolution

RR Intervals (beat-to-beat timing in milliseconds) are the gold standard for ANS testing. They capture the precise timing variations between heartbeats that reveal autonomic nervous system activity.

Heart Rate (BPM) is a derived metric that reports average beats per minute at fixed sampling intervals (e.g., once per second for 1 Hz, or once every 5 seconds for 0.2 Hz). This averaging process loses critical information about beat-to-beat variability.

Impact of Low Sampling Frequencies

For devices that only report BPM instead of native RR intervals, the sampling frequency directly impacts the accuracy of ANS analysis:

The Fundamental Problem:

Lower sampling frequencies (1 Hz, 0.2 Hz, or even 5 Hz) inherently mute high-frequency heart activity, which is strictly parasympathetic (vagal tone). Here's why:

  1. High-Frequency Signal Loss: Heart rate variability contains information across multiple frequency bands. The high-frequency components (0.15-0.4 Hz) represent rapid, beat-to-beat changes driven by respiratory sinus arrhythmia—a direct measure of parasympathetic nervous system activity.

  2. Nyquist Sampling Limitation: To accurately capture a signal, you need to sample at least twice the frequency of the highest component. A 1 Hz sampling rate can only reliably capture signals up to 0.5 Hz, while a 0.2 Hz sampling rate (Apple Watch) can only capture up to 0.1 Hz. This completely misses the high-frequency parasympathetic band.

  3. Frequency Distortion: When high-frequency variations are sampled at low rates, the lost power doesn't disappear—it gets redistributed (aliased) into lower frequency bands, artificially inflating the power in those regions.

The Clinical Impact:

  • Underestimated RFa (Respiratory Frequency area): Parasympathetic activity appears artificially low because the high-frequency respiratory variations are not captured
  • Overestimated LFa (Low Frequency area): Sympathetic activity appears artificially high due to aliasing—power from high-frequency components incorrectly appears in the low-frequency band
  • Reduced Sensitivity: Subtle autonomic changes (early POTS, mild dysautonomia) may be missed entirely

The SDK's Solution:

The SDK automatically applies a high-frequency probabilistic reconstruction model when BPM-only devices are used. This algorithm:

  • Analyzes historical RR interval patterns from the user (if available from previous tests with native RR devices)
  • Leverages population-level HRV characteristics and respiratory rate norms
  • Estimates inter-beat timing distributions using statistical modeling
  • Reconstructs likely high-frequency components based on observed low-frequency patterns and motion data

Important Tradeoff:

While reconstruction enables ANS testing with consumer wearables like Apple Watch and generic BLE monitors, it reduces accuracy and personalization. The reconstructed high-frequency components are educated estimates, not true measurements, which means:

  • Individual variability is smoothed over population averages
  • Subtle autonomic signatures unique to the patient may be lost
  • Test-to-test reproducibility may be lower
  • Confidence intervals on P&S metrics will be wider

The SDK automatically detects device capabilities and applies appropriate reconstruction algorithms. Test results will include a data quality score and confidence interval that reflects the precision limitations of the underlying sensor.

For clinical-grade testing where accuracy matters most, devices with native RR interval support (Polar H10, Garmin HRM-Pro) are strongly recommended.

Permissions

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Connect to heart rate monitor</string>

<key>NSCameraUsageDescription</key>
<string>Video recording for test validation</string>

<key>NSMicrophoneUsageDescription</key>
<string>Audio recording for test verification</string>

<key>NSMotionUsageDescription</key>
<string>Motion data for body position validation</string>

Next Steps

Continue to SDK Initialization to configure the SDK.