flutter_hrv 0.0.1-dev.1
flutter_hrv: ^0.0.1-dev.1 copied to clipboard
Dart package to calculate HRV data
This is a Flutter package which can be used to calcualate HRV values of given RR signal. This is still alpha version
Features #
You can calculate using it the following time domain HRV indexes:
- MeanNN
- SDNN
- RMSSD
- SDSD
And cohenrence as a frequency domain coeficient as well as the power spectrum of the RR signal
Package provide also robust filtering which is helpful for calcualting missing peaks within the signal using moving median filter
Getting started #
This library is using following dart packages:
- scidart
- powerdart
Usage #
var List<RrsData> rrs = [RrsData(0, 0)]; // Here you aggregate your RR peaks from you device. (so far tested with polar H10)
var Map<String, double> hrvValues = {};
rrs = CalculateHrv.filterPeaks(rrs);
hrvValues.addAll(CalculateHrv.calcTimeDomain(rrsWindow));
psd = CalculateHrv.calcFrequencyDomain(rrsWindow);
hrvValues.addAll(psd.hrvFrequencyDomain);
// function to aggregate RrsData
void _addToList(rr){
rrs.add(RrsData((rrs.isEmpty ? 0 : rrs.last.x) + int.parse(rr.toString()), rr));
}
Additional information #
TODO:
- More time domain and frequency domain coeficients
- Parametrize filtering
- Test with more devices