From 8e34dca1c242e9f495ed6d8ad1e70b73a427cc1e Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 29 Oct 2020 03:11:48 -0700 Subject: [PATCH] comments --- firmware/sampling.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/sampling.cpp b/firmware/sampling.cpp index 86f97ce..21ee5ce 100644 --- a/firmware/sampling.cpp +++ b/firmware/sampling.cpp @@ -30,14 +30,13 @@ static void SamplingThread(void*) float r_1 = result.NernstVoltage; - // Compute results - // r2_opposite_phase estimates where the previous sample would be had we not been toggling // AKA the absolute value of the difference between r2_opposite_phase and r2 is the amplitude // of the AC component on the nernst voltage. We have to pull this trick so as to use the past 3 // samples to cancel out any slope in the DC (aka actual nernst cell output) from the AC measurement float r2_opposite_phase = (r_1 + r_3) / 2; + // Compute AC (difference) and DC (average) components nernstAc = f_abs(r2_opposite_phase - r_2); nernstDc = (r2_opposite_phase + r_2) / 2;