在做了一些研究之后,我决定在这里寻求建议,因为我不确定如何继续。
问题:
我有一组 RR (IBI) 数据
例子:[679, 686, 650...]
如何将其转换为心率?
我的研究:
- http://www.meddean.luc.edu/lumen/meded/medicine/skills/ekg/les1prnt.htm
- github 上的各种库,但 JS 上没有,或者我可以移植到 JS -
我的方法当然是有缺陷的:
for (const ibiInMilliseconds of eventJSONObject.DeviceLog["R-R"].Data) {
ibiBuffer.push(ibiInMilliseconds);
const ibiBufferTotal = ibiBuffer.reduce((a, b) => a + b, 0);
// If adding the ibi to the start of the activity is greater or equal to 2.5 second then empty the buffer there
if ((lastDate.getTime() + ibiBufferTotal) >= lastDate.getTime() + 2500) {
const average = ibiBuffer.reduce((total, ibi) => {
return total + ibi;
}) / ibiBuffer.length;
const avg = 1000 * 60 / average;
// I save this avg to a 1s list but it's very error prone
ibiBuffer = [];
lastDate = new Date(lastDate.getTime() + ibiBufferTotal);
}
}
我将不胜感激任何类型的帮助或指示在哪里寻找。