Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Heart Rate Monitor → Thread

   

Timing of HR events and transmissions

Rank

Total Posts: 16

Joined 2014-04-09

PM

Dear ANT+ experts and novices,
I would like to share some observations with you that I have made regarding the timing of heart-rate events and transmissions.

As context, this adventure started here https://www.thisisant.com/forum/viewthread/4299/ and an indication of the script I was using is provided here https://www.thisisant.com/forum/viewthread/4358/
It is important to know that the log-file I create (written out from SimulANT+) contains the following columns:
(1) Event time [1/1024 s]
(2) Event count (8-bit seq. num.)
(3) Heart-rate [bpm]
(4) Local computer system time [HH:mm:ss.000]

So the first issue is that most "events" resulted in 3 transmissions, each with their own local computer clock timestamp. (When I say computer, think PC or laptop.) Although sometimes only 2 or even just 1.
This was evident because for each event the Event time and Event count were identical, as were the reported Heart rate values.

It might be anticipated that the data would be broadcast perhaps at 1 Hz (once per second), and, indeed, this is what the manufacturer has told me. However, according to my system clock timestamps, the transmission interval took several values that were all multiples (approximately) of 250 ms, as if by 4Hz sampling. See attachment 1.

Actually, I don't care that much about the transmission times, partly due to the known unreliability of PC time clocks anyway, along with the greater importance of the timing of the event than its broadcast, and the complication of having up to three data transmissions for a single event. Thus, I focussed on Event time.

They key thing I noticed was that the interval between Event times was almost exactly varying in inverse relation to the HR. See attachment 2.

This seemed to indicate that each event was the detection of a pulse! How great, so I could then obtain a millisecond-precise estimate of intervals between pulses!

But further investigation showed that the relationship was 'too perfect'. The intervals between physiological pulses should be allowed to have any millisecond value from about 300 ms up to to 1500 ms.
For example, an interval of 1481 ms (corresponding, if extrapolated, to 40.51 bpm) should be possible to observe. But in the data series such intervals were never observed.
Only intervals which converted almost perfectly to integer values of HR were reported in the data set! It is hard to imagine how this can happen.
In the meanwhile, I have also been informed by the company that the HR reported is a "blended" value, which I presume means is not literally 'instantaneous', but is a filtered value computed from the last few events.

Below is an abridged and amended version of what I have sent the company. However, they have ultimately been unable to fully explain this to me.

~~~~~~~~~

...we never seemed to obtain intervals such as 803 ms or 747 ms, for which the HR would be most accurately estimated as non-integer (74.72 bpm and 80.32 bpm).
Rather, we only ever seemed to obtain intervals such as 800 ms or 750 ms, for which the HR would be most accurately estimated as integer (75.00 bpm and 80.00 bpm), to one or two decimal places [according to the precision of the timestamp].

In my mind this seems to break the direct connection between the timing of the physical pulse and the signal transmission from the device.
In that case it would have to follow a pattern more like the following:

Time = 0 ms: Beat detected.
Time ~ 1 ms: The device computes that there was an interval of X ms from the previously detected beat. It might also consider a moving window of (say) the ten previous beats, check for noise, etc.; it then estimates the current HR as Y bpm. By rounding the HR to Y* bpm, the device determines that it should report this value associated with a fictitious event occurring Z ms after the previous fictitious event.
Time = 300 ms: Time of latest fictitious event.
Time = 500 ms: The device reports the current HR as (approx.) Y* bpm, with Event time=300ms.

Time = 803 ms: Beat detected.
Time ~ 804 ms: The device computes that there was an interval of 803 ms from the previously detected beat (803 – 0). It might also consider a moving window of (say) the ten previous beats, check for noise, etc.; it then estimates the current HR as (say) 74.80 bpm. By rounding the HR to 75 bpm, the device determines that it should report this value associated with a fictitious event occurring 800 ms after the previous fictitious event.
Time = 1100 ms: Time of latest fictitious event (300 + 800).
Time = 1250 ms: The device reports the current HR as (approx.) 75 bpm, with Event time=1100ms.

Time = 1550 ms: Beat detected.
Time ~ 1551 ms: The device computes that there was an interval of 747 ms from the previously detected beat (1550 – 803). It might also consider a moving window of (say) the ten previous beats, check for noise, etc.; it then estimates the current HR as (say) 80.41 bpm. By rounding the HR to 80 bpm, the device determines that it should report this value associated with a fictitious event occurring 750 ms after the previous fictitious event.
Time = 1850 ms: Time of latest fictitious event (1100 + 750).
Time = 2000 ms: The device reports the current HR as (approx.) 80 bpm, with Event time=1850ms.

If this is what happens, it might still provide useful information.
I guess this would mean that the transmission intervals still have some relationship to the interval between physiological pulses of blood, albeit complicated.

~~~~~~~~~

Can anybody shed light on whether the above makes sense, and how & why it would be implemented like that?

I only got this data from one model of device (wrist monitor). I did not get such data from a chest-strap.      

Image Attachments

Analysis_pastedImage1.pngAnalysis_pastedImage2.png

Click thumbnail to see full-size image

Rank

Total Posts: 16

Joined 2014-04-09

PM

Note: it occurs to me that 4Hz sampling is a good compromise, because it is unlikely that two consecutive heartbeats would occur faster than this, at least in an adult.

—DIV      
RankRankRankRank

Total Posts: 120

Joined 2013-05-07

PM

Hi DIV,

Have you read the ANT+ Heart Rate Monitor Device Profile (available on the downloads page)?

SimulANT+ is just a simulation tool. Therefore, if you are simulating an ANT+ Heart Rate Monitor, its event timestamps will be "too perfect" because they are simulated and not real values.

The ANT+ Heart Rate Device Profile specified a 4 Hz transmission rate of data. This will likely explain the behavior you are seeing.      
Rank

Total Posts: 16

Joined 2014-04-09

PM

Hello, BK.

It is a fair point to question whether I am using a HeartRateSensor simulation. The very first thing I tried with SimulANT+ was to use/adapt the model script "hr_SensorSweep.py". However, I eventually realised that the displayed data bore no relationship to the real, physical, actual HR monitor device that I was wearing on my wrist!

So, to remove all doubt, after I realised this initial misstep, thereafter I have only ever used a modification of the model script "hr_DisplayCSV.py" which is for a HeartRateDisplay. The logic of this is that: (i) our physical HR monitor does not have its own built-in display, and (ii) we wanted to log that data on a roughly second-by-second basis (aka as fast as it can be sent/received).

Regarding your specific question on reading the 'Device Profile' document.... [RTFM? grin ]
...frankly I can't exactly remember. Having a look now, it looks kinda familiar, so maybe I looked at it early on, but I don't think I referred to it when I devised 'my' method of estimating RR interval. As it turns out, 'my' calculation seems identical to that described in §7 of the 'Device Profile' document.

The other good news is that although I never had gotten completely on top of the details regarding different "pages", apparently it doesn't matter here, because "The Heart Beat Event Time and Heart Beat Count values that are transmitted in all data pages". The main two things that could go wrong are:
* handling rollover, which I do routinely anyway, and
* ensuring intervals are computed only for consecutive events, which is obvious from the fact that when (say) one event is dropped, the interval is pretty much doubled in size compared to all the others around that moment (besides examining Event Count).

As I mentioned, the data looks correct if you only examine a few seconds' worth, because you wouldn't bother about all the intervals corresponding to (rounded) reciprocals of integer HR [bpm] values.
However, when I do a statistical analysis over a period of tens of minutes it becomes incontrovertible. You could see this in the charts above. But I may add one more chart to illustrate even more clearly.

By the way, as (I think) I mentioned, this only happened for one model of physical HR monitor device (worn on the wrist); it was not observed for another model of physical HR monitor device (worn on the chest).

—DIV      
Rank

Total Posts: 16

Joined 2014-04-09

PM

Hi, again, BK & co.

Attached are two graphs. One for the wrist-watch style device, and the other for the chest strap.

These are frequency histograms.
Total peak height shows number of occasions on which reciprocal of interval yields a HR estimate with a decimal within the range indicated on the horizontal axis.
For example, if interval was 403 ms, then HR estimate would be 148.88 bpm, and this one (hypothetical) data point would cause one additional count to be tallied to the 0.85–0.9 bin.
The blue peak height is the more relevant, because this is the data only allowing estimates from consecutive events.

You will notice that for one device the estimates are clustered around the bins corresponding almost to integers (but not so perfect as if I simulated it programmatically, without adding noise!) — except for some pink bars particularly around the 0.5-second bin, corresponding to situations where exactly one beat was dropped from the record.
Whereas for the other device, despite substantial fluctuation, there is no evident preference towards any particular bin or group of bins, as it should be expected for unmanipulated data!

—DIV      

Image Attachments

Analysis_pastedImage3b.pngAnalysis_pastedImage3a.png

Click thumbnail to see full-size image