polarofficial / polar-ble-sdk

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

Timestamp for PPI measurements. #484

Closed hamletAppsfactory closed 3 weeks ago

hamletAppsfactory commented 2 months ago

Platform your question concerns:

Device:

Why the Timestamp for PPI (PolarPpiData) measurements are deprecated and always 0? Is it possible to get them somehow?

orestesgaolin commented 2 months ago

In our case we just assume that the last PPI sample comes from current instant, and samples before that are x ms before that e.g. if we get a batch of [300,500,900] ms then they are at [t-(300+500+900), t-(500+900), t-900] where t is now

hamletAppsfactory commented 2 months ago

Thanks for the reply, let's assume this is not an offline recording and there is no startTime provided by the device(or SDK). What is now in this case: 1) the time of receiving the first measurement 2) the time of sending the command to the device to start the streaming? In my case with OH1 there is a difference between those two points around 3-5 seconds.

orestesgaolin commented 2 months ago

I'd assume it's more likely that time of receiving the measurement is closer to reality.

I suspect the algorithm that determines the PPI values requires several cycles to establish a baseline. When switching to PPI mode you can notice that HR stream stops for a while and starts over.

jimmyzumthurm commented 3 weeks ago

@orestesgaolin is correct. I think it's even 25 seconds to receive the first sample after the start command, which contains 5 second windows of PPI samples. The algorithm inside Verity Sense doesn't calculate any timestamp for the samples and this is why it's not provided for PPI data for Verity Sense.

Some other devices such as Polar 360 do have timestamps attached to PPI data as they have more recent algorithm that provide it.