summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2016-01-26 22:01:28 +0100
committerChris Schlaeger <chris@linux.com>2016-01-26 22:01:28 +0100
commitf46daf2b2d7a642ace7e08bd1a455ce7bd9d38a7 (patch)
tree36d6ae1df1176a8915dc969d0b26e1db655e47b2 /lib
parentad10d7bc12eb171ebbb4b8acb8f06288df6bd877 (diff)
downloadpostrunner-f46daf2b2d7a642ace7e08bd1a455ce7bd9d38a7.zip
Fix HRV time alignment.
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/ChartView.rb4
-rw-r--r--lib/postrunner/HRV_Analyzer.rb10
2 files changed, 2 insertions, 12 deletions
diff --git a/lib/postrunner/ChartView.rb b/lib/postrunner/ChartView.rb
index 3e7729b..df52554 100644
--- a/lib/postrunner/ChartView.rb
+++ b/lib/postrunner/ChartView.rb
@@ -58,8 +58,8 @@ module PostRunner
},
{
:id => 'hrv',
- :label => 'R-R Intervals/Heart Rate Variability',
- :short_label => 'R-R Interval',
+ :label => 'Heart Rate Variability',
+ :short_label => 'HRV',
:unit => 'ms',
:graph => :line_graph,
:colors => '#900000',
diff --git a/lib/postrunner/HRV_Analyzer.rb b/lib/postrunner/HRV_Analyzer.rb
index 116561b..664f7c9 100644
--- a/lib/postrunner/HRV_Analyzer.rb
+++ b/lib/postrunner/HRV_Analyzer.rb
@@ -170,16 +170,6 @@ module PostRunner
predictor.insert(dt)
end
end
-
- # The accumulated R-R intervals tend to be slightly larger than the
- # total timer time measured by the device. It's unclear why this is the
- # case, but I assume it's an accumulated measuring error. We calculate a
- # correction factor and time-warp all timestamps so the total time
- # aligns with the other data of the FIT file. We also correct the R-R
- # intervals times accordingly.
- time_warp_factor = @fit_file.total_timer_time / @timestamps.last
- @timestamps.map! { |t| t * time_warp_factor }
- @rr_intervals.map! { |t| t ? t * time_warp_factor : nil }
end
end