polarofficial / polar-ble-sdk

Repository includes SDK and code examples. More info https://polar.com/en/developers
Other
449 stars 147 forks source link

H10: RR Interval in ms and 1/1024 format. #343

Closed Retsam-crypto closed 1 year ago

Retsam-crypto commented 1 year ago

Device:

What the 1/1024 format means for RRI, please (found it on first page of SDK documentation)?

Silent assumption is that sensor sampling rate is 1000 Hz, RR peaks are discovered from ECG internally, then ECG is down sampled to 130 Hz. But that assumption may be incorrect and sampling rate internally is 1024 Hz. (hence the 1/1024 'format' mentioned in SDK documentation).

Please shed some light on that process.

JOikarinen commented 1 year ago

Hi @Retsam-crypto,

The format of 1/1024 to represent RR time has been a source of confusion. RRI is the time between the two consecutive R waves in the electrocardiogram (ECG) signal.

The format 1/1024 to represent the RRI time is quite strange. Heart Rate BLE service provides the RR data for HR BLE client in 1/1024 format. I suspect that reason for HR service using the 1/1024 format is the limited resources in some heart rate sensor devices at the time specification was made (approximately 10 years ago).

Why the Polar BLE SDK API exposes the 1/1024 format? Well, it is provided in API to let raw data pass through from heart sensor without any manipulation by the Polar BLE SDK.

However, due to the confusion, the Polar BLE SDK API will be updated in the next release (5.0.0) to only use the "milliseconds" format for RR time. The PolarHrData will have only one property, rrs, instead of rrs and rrsMs. The Android and iOS changes can be viewed in the provided links.

Change in Android: here

Change in iOS: here

JOikarinen commented 1 year ago

It was not a good decision to rename rrs to rrsMs and remove rrsMs, done in Android: here iOS: here

Better idea implemented, let's remove rrs (i.e. format 1/1024) and let's leave only the property rrsMs, done in Android: here iOS: here