Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

heart rate time series

ANSWERED

Hi, this is what I obtain by running

https://api.fitbit.com/1/user/-/activities/heart/date/2015-07-16/1d/1sec.json

 

dataset: [{“time":"00:00:00","value":70},{"time":"00:00:05","value":69},{"time":"00:00:10","value":68}, ,{"time":"00:00:25","value":68} …. ]

 

Can you help me to intertpret this result? It means that the heartrate from 00:00:00 to 00:00:05 was 70 bpm, from 00:00:05 to 00:00:10 was 69 bpm and so on?

 

Thanks al lot!

 

Floriano

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@dancoal is correct. When using the second-level granularity, the measurement is the heart rate at the exact point in time specified.

 

Minute and hour-level granularity for the heart rate time series values are averages of the measurements in the interval.

View best answer in original post

Best Answer
0 Votes
12 REPLIES 12

Hello, my interpretation of this is that the time values are discrete. This means your heart was 70 at time 0, 69 and 5, with no information on the time between. 

 

 

Best Answer

@dancoal is correct. When using the second-level granularity, the measurement is the heart rate at the exact point in time specified.

 

Minute and hour-level granularity for the heart rate time series values are averages of the measurements in the interval.

Best Answer
0 Votes
Strictly speaking, there is no such thing as a point-in-time heart rate measurement... Does Fitbit calculate each measurement from samples taken over the preceding five second interval, or is it some kind of moving average?
Eric Jain
Got data? Get answers at zenobase.com.
Best Answer
0 Votes
Ejain, Dancoal, thank you for your answers.

The documentation says that heart rate is second-level, so i would expect
to know the "true" heartrate every single second.

I would appreciate a comment from anybody of the fitbit staff.

Thank you!
Best Answer
0 Votes
There is no such thing as a "true heart rate every single second". You need at least two heart beats to calculate a "beats per minute" number, and doing so would be quite inaccurate even if Fitbit's heart rate sensor was more accurate than it is. If you want higher-resolution data, you need an ECG device that reports RR intervals (e.g. a chest strap like the Polar H7).
Eric Jain
Got data? Get answers at zenobase.com.
Best Answer
0 Votes
Just wondering what second level HR means then.

Cheers.
Best Answer
0 Votes

The field, 00:00:00, would be hours:minutes:seconds.  And the times in your example are 5 second intervals.  At 60 BPM, that means they would see 5 peaks in the pulse.  So I expect this is an average of the inverse of the five intervals between beats - with one peak used from the preceeding 5 seconds.

 

BPM = 60 *( [1/(T1-T0) ]+ [1/(T2-T1)] + [1/(T3-T2)] + [1/(T4-T3)]+ [1/(T5-T4])/5

 

If the pulse were 120 BPM, then the average would be built from 10 peaks.

 

(120 peaks per minute/60 Seconds per Minute)  = 2 peaks per second

2 peaks per  second*5 seconds = 10 peaks.

 

Build a table of synthetic heart beat timings and you can convince yourself that you would need to keep a running sum of the inverse of the intervals.  When the cumulative time (sum of intervals) exceeds a multiple of 5 seconds: divide the sum by the number of intervals and multiply by 60.  Set the first time to the last time, set the sum to zero, set the count to zero.  Wait for the timer.

 

Of course, Fitbit would serve the data community better if they just reported the stream of peak times in milliseconds or finer resolution.  Then we could calculate our own, including heart rate variability.

 

They truncate the time to the nearest second and the pulse to nearest beat.  The raw data is hopefully more accurate.

 

I built an Excel spreadsheet with synthetic heart beat data to show you, but there is no way to attach it to this message.

Best Answer

@JeremiahFitbit

 

1) Coud you please post the formula you use to calculate second-level HR? It would like to calculate an approximation of RR intervals from HR, and the formula will help e a lot

 

2) Are you going to provide an API for RR intervals in the future?

 

Thanks again!

 

 

Best Answer
0 Votes

@caplina: I don't have anything to share at this time regarding those, but your request is appreciated and noted.

Best Answer
0 Votes

For someone new to the API area, can you explain what he just asked?  What is second level HR data?

 

I presume he asked for documentation related to the API workings and data interpretation.  What is Fitbit's policy on sharing information?

 

Is there any documentation on the API?  Is there a wiki somewhere that explains it?  Are there code samples to use?  Any help for a newbie?  Any FAQ's?  Something?

Best Answer
0 Votes

@RichardCollins wrote:

For someone new to the API area, can you explain what he just asked?  What is second level HR data?


The documentation for the second-level heart rate data is at https://wiki.fitbit.com/display/API/API-Get-Intraday-Time-Series

 

Second-level heart rate data is the heart rate as displayed on a Fitbit device at a particular second in time.

 


RichardCollins wrote:

I presume he asked for documentation related to the API workings and data interpretation, and you told him to take a hike.  Is that what happened?


That is not what happened. Please be considerate in your tone on the forum.

 

Regarding caplina's request, Fitbit generally does not share proprietary algorithms and it does not comment on unannounced features.

 


RichardCollins wrote:

Is there any documentation on the API?  Is there a wiki somewhere that explains it?  Are there code samples to use?  Any help for a newbie?  Any FAQ's?  Something?


See https://dev.fitbit.com/

Best Answer
0 Votes

Thank you for the pointers.  That answered my questions.  I edited my post.  I did not intend to hurt your feelings.

Best Answer
0 Votes