Installation
Minimum Requirements
- iOS
- Android
- iOS 14.0 or later
- Xcode 15.0 or later
- Swift 5.9 or later
- Android API 24+ (Android 7.0 Nougat)
- Kotlin 1.9+
- Gradle 8.0+
Installation
- iOS
- Android
Swift Package Manager
Add the Autonomic Health SDK to your project using Swift Package Manager:
- In Xcode, select File > Add Package Dependencies
- Enter the repository URL:
URL Endpoint coming soon - Select the version you want to use
- Choose the products you need:
AHSDKCore(Required) - Core SDK and API clientAHSDKPolar(Optional) - Polar device supportAHSDKGarmin(Optional) - Garmin device supportAHSDKBLEHeartRate(Optional) - Generic Bluetooth heart rate monitorsAHSDKWatchKit(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"),
]
)
]
Gradle
Add the SDK to your app's build.gradle.kts:
dependencies {
// Core SDK (required)
implementation("ai.autonomichealth:ah-sdk-core:1.0.0")
// Device adapters (optional)
implementation("ai.autonomichealth:ah-sdk-polar:1.0.0")
implementation("ai.autonomichealth:ah-sdk-garmin:1.0.0")
implementation("ai.autonomichealth:ah-sdk-ble-hr:1.0.0")
}
Add the Maven repository:
repositories {
maven {
url = uri("url coming soon")
}
}
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 Adapter | iOS Module | Android Module |
|---|---|---|
| Polar | AHSDKPolar | ah-sdk-polar |
| Garmin | AHSDKGarmin | ah-sdk-garmin |
| Generic BLE | AHSDKBLEHeartRate | ah-sdk-ble-hr |
| Apple Watch | AHSDKWatchKit | N/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.
| Device | RR Intervals | Accelerometer | Gyroscope | PPG | Data Quality |
|---|---|---|---|---|---|
| Polar H10 | ✅ Native | ✅ | ✅ | ❌ | Excellent |
| Polar Verity Sense | ✅ Native | ✅ | ✅ | ✅ | Excellent |
| Polar OH1 | ✅ Native | ✅ | ✅ | ✅ | Excellent |
| Garmin HRM-Pro | ✅ Native | ✅ | ❌ | ❌ | Very Good |
| Garmin HRM-Dual | ✅ Native | ❌ | ❌ | ❌ | Very Good |
| Generic BLE HR | ❌ BPM only | Varies | Varies | Varies | Fair |
| Apple Watch S4+ | ❌ BPM only | ✅ | ✅ | ✅ | Fair |
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.
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:
-
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.
-
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.
-
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
- iOS
- Android
<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>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
Next Steps
Continue to SDK Initialization to configure the SDK.