You can do that using a custom interval field and some Javascript:
{
let hr = streams.heartrate
let peak = hr[interval.end_index - 1]
let after30s = hr[interval.end_index + 29]
//console.log("peak", peak)
//console.log("after30s", after30s)
let recovery = peak - after30s
recovery
}
I have published this one so you can search for it. It is under “Antoinette” because I tested it on my wife’s data. She has been doing 4x4 VO2 max on the trainer recently.
It assumes that the last point of the interval will be the highest HR and that the data has 1 second per tick.
