sensord: samsung pedometer sensor for fused location fix/update. 09/150409/2
authorMarcin Masternak <m.masternak@samsung.com>
Fri, 15 Sep 2017 10:31:31 +0000 (12:31 +0200)
committerKibak Yoon <kibak.yoon@samsung.com>
Mon, 18 Sep 2017 10:33:23 +0000 (10:33 +0000)
Change-Id: I297e0a9e6eb09afb0791fd7a64f608900dc62893
Signed-off-by: Marcin Masternak <m.masternak@samsung.com>
18 files changed:
src/sensor/pedometer/average_filter.cpp
src/sensor/pedometer/average_filter.h
src/sensor/pedometer/pedometer.cpp
src/sensor/pedometer/pedometer.h
src/sensor/pedometer/pedometer_info.h
src/sensor/pedometer/pedometer_sensor.cpp
src/sensor/pedometer/pedometer_speed_filter.cpp
src/sensor/pedometer/pedometer_speed_filter.h
src/sensor/pedometer/savitzky_golay_filter15.cpp
src/sensor/pedometer/savitzky_golay_filter15.h
src/sensor/pedometer/sensor_frequency_compensator.cpp
src/sensor/pedometer/sensor_frequency_compensator.h
src/sensor/pedometer/step_detection.cpp
src/sensor/pedometer/step_detection.h
src/sensor/pedometer/step_event.h
src/sensor/pedometer/timestamp.h [moved from src/sensor/pedometer/common.h with 90% similarity]
src/sensor/pedometer/zero_crossing_step_detection.cpp
src/sensor/pedometer/zero_crossing_step_detection.h

index 81ca075..b03f6ef 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "average_filter.h"
 
+#include <memory>
 #include <stdlib.h>
 
 static double mean(double *array, int size)
index e083ce0..ba89741 100644 (file)
 #ifndef __AVERAGE_FILTER_H__
 #define __AVERAGE_FILTER_H__
 
-#include <memory>
-#include "common.h"
+#include "timestamp.h"
 
 class average_filter {
 public:
+
        average_filter(int size);
+
        ~average_filter();
 
        /************************************************************************
index f076c16..2d2fe8a 100644 (file)
@@ -51,7 +51,7 @@ void pedometer::reset(void)
        m_acceleration_compensator.reset();
 }
 
-bool pedometer::get_pedometer(pedometer_info *info, timestamp_t timestamp, double acc[])
+bool pedometer::new_acceleration(pedometer_info *info, timestamp_t timestamp, double acc[])
 {
        bool result = false;
        m_acceleration_compensator.add(timestamp, acc);
@@ -60,7 +60,7 @@ bool pedometer::get_pedometer(pedometer_info *info, timestamp_t timestamp, doubl
        while (m_acceleration_compensator.has_next()) {
                double acceleration[3];
                m_acceleration_compensator.get_next(acceleration);
-               if (m_step_detection.get_step(timestamp,
+               if (m_step_detection.new_acceleration(timestamp,
                                sqrt(acceleration[0] * acceleration[0]
                                        + acceleration[1] * acceleration[1]
                                        + acceleration[2] * acceleration[2]),
@@ -68,7 +68,7 @@ bool pedometer::get_pedometer(pedometer_info *info, timestamp_t timestamp, doubl
                        if (event.m_timestamp != UNKNOWN_TIMESTAMP) {
                                m_step_count++;
                                m_total_length += event.m_step_length;
-                               m_pedometer_filter.get_step(timestamp, event.m_step_length);
+                               m_pedometer_filter.new_step(timestamp, event.m_step_length);
                                double speed = m_pedometer_filter.get_speed(timestamp);
                                info->timestamp = timestamp;
                                info->is_step_detected = true;
index f80c315..f990906 100644 (file)
 #ifndef __PEDOMETER_H__
 #define __PEDOMETER_H__
 
-#include "common.h"
 #include "step_detection.h"
 #include "pedometer_info.h"
 #include "pedometer_speed_filter.h"
 #include "sensor_frequency_compensator.h"
+#include "timestamp.h"
 
 /************************************************************************
  * stores pedometer engine state.
@@ -32,7 +32,7 @@ public:
        ~pedometer();
 
        /************************************************************************
-        * enables/disables savitzky filter.
+        * enables/disables Savitzky filter.
         */
        void set_savitzky_filter(bool enable);
 
@@ -47,20 +47,20 @@ public:
         * @param info
         *            result of pedometer algorithm. valid only it method returns true.
         * @param timestamp
-        *            timestamp of acceleration event in ns.
+        *            timestamp of acceleration event in [ns].
         * @param acc
-        *            global acceleration.
+        *            global acceleration vector in [m/s^2].
         *
         * @result
         *            true if new step event was detected.
         */
-       bool get_pedometer(pedometer_info *info, timestamp_t timestamp, double acc[]);
+       bool new_acceleration(pedometer_info *info, timestamp_t timestamp, double acc[]);
 
 private:
        /** detects step and estimates step length. */
        step_detection m_step_detection;
 
-       /** sum of lengths all steps from start. */
+       /** sum of lengths all steps from start in [m]. */
        double m_total_length;
 
        /** number of steps from start. */
@@ -73,6 +73,7 @@ private:
        bool m_some_speed;
 
        sensor_frequency_compensator m_acceleration_compensator;
+
 };
 
 #endif /* __PEDOMETER_H__ */
index ac521db..21f51e3 100644 (file)
 #ifndef __PEDOMETER_INFO_H__
 #define __PEDOMETER_INFO_H__
 
-#include "common.h"
+#include "timestamp.h"
 
 /************************************************************************
  * stores information about pedometer event detected.
  */
 class pedometer_info {
 public:
-       /** timestamp this event was detected in ns. */
+       /** timestamp this event was detected in [ns]. */
        timestamp_t timestamp;
 
        /** is step detected. */
@@ -33,13 +33,13 @@ public:
        /** step count from scanner start. */
        long long step_count;
 
-       /** step length in meters. */
+       /** step length in [m]. */
        double step_length;
 
-       /** total length of all steps detected from scanner start in meters. */
+       /** total length of all steps detected from scanner start in [m]. */
        double total_step_length;
 
-       /** current mean speed in m/s. */
+       /** current mean speed in [m/s]. */
        double step_speed;
 };
 
index e60ec43..5f46dff 100644 (file)
@@ -82,7 +82,7 @@ int pedometer_sensor::update(uint32_t id, sensor_data_t *data, int len)
        pedometer_info info;
        double acc[] = {data->values[0], data->values[1], data->values[2]};
 
-       if (!m_pedometer.get_pedometer(&info, US_TO_NS(data->timestamp), acc))
+       if (!m_pedometer.new_acceleration(&info, US_TO_NS(data->timestamp), acc))
                return OP_ERROR;
 
        m_step_count = info.step_count;
index d6ac774..372745e 100644 (file)
@@ -16,8 +16,8 @@
 
 #include "pedometer_speed_filter.h"
 
-/** default for maximum step duration in ns. currently 2s. */
-#define STEP_MAX_DURATION 2000000000L
+/** default for maximum step duration in [ns]. currently 2s. */
+static const long long STEP_MAX_DURATION = 2000000000L;
 
 pedometer_speed_filter::pedometer_speed_filter()
 : m_last_timestamp(UNKNOWN_TIMESTAMP)
@@ -43,12 +43,12 @@ void pedometer_speed_filter::clear_speed(void)
 }
 
 /************************************************************************
- * sets new maximum step duration in ns.
+ * sets new maximum step duration in [ns].
  * if there is no new speed during this time current speed is cleared.
  * 0 disables this feature.
  *
  * @param step_max_duration
- *            maximum step duration in ns.
+ *            maximum step duration in [ns].
  *            0 to disable step duration checking.
  */
 void pedometer_speed_filter::set_step_max_duration(long long step_max_duration)
@@ -60,11 +60,11 @@ void pedometer_speed_filter::set_step_max_duration(long long step_max_duration)
  * called when new step detection event occurs.
  *
  * @param timestamp
- *            timestamp of step detection event in ns.
+ *            timestamp of step detection event in [ns].
  * @param steplength
- *            length of detected step in m.
+ *            length of detected step in [m].
  */
-void pedometer_speed_filter::get_step(timestamp_t timestamp, double step_length)
+void pedometer_speed_filter::new_step(timestamp_t timestamp, double step_length)
 {
        if (m_last_timestamp == UNKNOWN_TIMESTAMP || timestamp == UNKNOWN_TIMESTAMP) {
                clear_speed();
@@ -86,9 +86,9 @@ void pedometer_speed_filter::get_step(timestamp_t timestamp, double step_length)
  * reports new speed.
  *
  * @param timestamp
- *            timestamp of speed event.
+ *            timestamp of speed event in [ns].
  * @param speed
- *            current speed in m/s.
+ *            current speed in [m/s].
  */
 void pedometer_speed_filter::new_speed(timestamp_t timestamp, double speed)
 {
@@ -106,7 +106,7 @@ void pedometer_speed_filter::new_speed(timestamp_t timestamp, double speed)
  *
  * @param timestamp
  *            timestamp for which speed should be calculated.
- * @return speed for given timestamp in m/s.
+ * @return speed for given timestamp in [m/s].
  */
 double pedometer_speed_filter::get_speed(timestamp_t timestamp)
 {
@@ -122,7 +122,7 @@ double pedometer_speed_filter::get_speed(timestamp_t timestamp)
  * changes current speed.
  *
  * @param speed
- *            current speed in m/s.
+ *            current speed in [m/s].
  */
 void pedometer_speed_filter::set_current_speed(double speed)
 {
@@ -130,7 +130,7 @@ void pedometer_speed_filter::set_current_speed(double speed)
 }
 
 /************************************************************************
- * @return estimated current speed in m/s.
+ * @return estimated current speed in [m/s].
  */
 double pedometer_speed_filter::get_current_speed(void)
 {
index 4c6fde1..d9e0b7f 100644 (file)
 #ifndef __PEDOMETER_SPEED_FILTER_H__
 #define __PEDOMETER_SPEED_FILTER_H__
 
-#include "common.h"
+#include "timestamp.h"
 
 /************************************************************************
  * stores pedometer speed filter state.
  */
 class pedometer_speed_filter {
 public:
+
        pedometer_speed_filter();
+
        ~pedometer_speed_filter();
 
        void clear_speed(void);
@@ -44,19 +46,19 @@ public:
         * called when new step detection event occurs.
         *
         * @param timestamp
-        *            timestamp of step detection event in ns.
+        *            timestamp of step detection event in [ns].
         * @param steplength
-        *            length of detected step in m.
+        *            length of detected step in [m].
         */
-       void get_step(timestamp_t timestamp, double step_length);
+       void new_step(timestamp_t timestamp, double step_length);
 
        /************************************************************************
         * reports new speed.
         *
         * @param timestamp
-        *            timestamp of speed event.
+        *            timestamp of speed event in [ns].
         * @param speed
-        *            current speed in m/s.
+        *            current speed in [m/s].
         */
        void new_speed(timestamp_t timestamp, double speed);
 
@@ -64,8 +66,8 @@ public:
         * returns current speed.
         *
         * @param timestamp
-        *            timestamp for which speed should be calculated.
-        * @return speed for given timestamp in m/s.
+        *            timestamp for which speed should be calculated in [ns].
+        * @return speed for given timestamp in [m/s].
         */
        double get_speed(timestamp_t timestamp);
 
@@ -73,12 +75,12 @@ public:
         * changes current speed.
         *
         * @param speed
-        *            current speed in m/s.
+        *            current speed in [m/s].
         */
        void set_current_speed(double speed);
 
        /************************************************************************
-        * @return estimated current speed in m/s.
+        * @return estimated current speed in [m/s].
         */
        double get_current_speed(void);
 
@@ -87,7 +89,7 @@ public:
        bool is_known_timestamp(void);
 
        /************************************************************************
-        * @return timestamp of last step detection event in ns.
+        * @return timestamp of last step detection event in [ns].
         */
        timestamp_t get_timestamp(void);
 
@@ -97,19 +99,19 @@ public:
        void reset(void);
 
 private:
-       /** timestamp of last step detection event in ns. */
+       /** timestamp of last step detection event in [ns]. */
        timestamp_t m_last_timestamp;
 
-       /** estimated current speed in m/s. */
+       /** estimated current speed in [m/s]. */
        double m_current_speed;
 
-       /** length of last step in m. */
+       /** length of last step in [m]. */
        double m_last_step_length;
 
-       /** duration of last step in s. */
+       /** duration of last step in [s]. */
        double m_last_step_duration;
 
-       /** maximum step duration in ns. 0 to disable step duration checking. */
+       /** maximum step duration in [ns]. 0 to disable step duration checking. */
        long long m_step_max_duration;
 };
 
index ced5d8f..549204b 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "savitzky_golay_filter15.h"
 
+#include <memory>
 #include <stdlib.h>
 
 /* length of filter. changing it requires changing coef_array! */
index a9a8899..77eef64 100644 (file)
 #ifndef __SAVITZKYGOLAYFILTER15_H__
 #define __SAVITZKYGOLAYFILTER15_H__
 
-#include <memory>
-#include "common.h"
+#include "timestamp.h"
 
 /************************************************************************
- * stores savitzky-golay filter state.
+ * stores Savitzky-Golay filter state.
  */
 class savitzky_golay_filter15 {
 public:
+
        savitzky_golay_filter15();
+
        ~savitzky_golay_filter15();
 
        /************************************************************************
@@ -38,7 +39,7 @@ public:
        double filter(double value);
 
        /************************************************************************
-        * resets savitzky-golay filter to initial state.
+        * resets Savitzky-Golay filter to initial state.
         */
        void reset(void);
 
index 9475bdc..855f2ca 100644 (file)
 /************************************************************************
  */
 sensor_frequency_compensator::sensor_frequency_compensator(double desired_rate)
-: m_desired_frequency(desired_rate)
-, m_t1(0)
+: m_desired_rate(desired_rate)
+, m_t1(UNKNOWN_TIMESTAMP)
 , m_v1{0.0, 0.0, 0.0}
-, m_t2(0)
+, m_t2(UNKNOWN_TIMESTAMP)
 , m_v2{0.0, 0.0, 0.0}
-, m_timestamp(0)
+, m_timestamp(UNKNOWN_TIMESTAMP)
 {
 }
 
@@ -64,7 +64,7 @@ bool sensor_frequency_compensator::has_next() {
        if (m_t1 == UNKNOWN_TIMESTAMP || m_t2 == UNKNOWN_TIMESTAMP) {
                return false;
        }
-       return m_timestamp + m_desired_frequency < m_t2;
+       return m_timestamp + m_desired_rate < m_t2;
 }
 
 /************************************************************************
@@ -74,10 +74,9 @@ void sensor_frequency_compensator::get_next(double *v) {
        if (t3 < m_t1) {
                t3 = m_t1;
        }
-       m_timestamp += m_desired_frequency;
-       double t = (t3 - m_t1) / ((double) (m_t2 - m_t1));
-       int i;
-       for (i = 0; i < 3; i++) {
+       m_timestamp += m_desired_rate;
+       double t = ((double) (t3 - m_t1)) / (m_t2 - m_t1);
+       for (int i = 0; i < 3; i++) {
                v[i] = (1.0 - t) * m_v1[i] + t * m_v2[i];
        }
 }
index 664fedb..d22f57c 100644 (file)
  *  limitations under the License.
  */
 
-#ifndef __SENSOR_FREQUENCY_COMPENSATOR_H_
-#define __SENSOR_FREQUENCY_COMPENSATOR_H_
+#ifndef __SENSOR_FREQUENCY_COMPENSATOR_H__
+#define __SENSOR_FREQUENCY_COMPENSATOR_H__
 
-#include "common.h"
+#include "timestamp.h"
 
 #include <memory>
 
@@ -26,7 +26,9 @@
  */
 class sensor_frequency_compensator {
 public:
+
        sensor_frequency_compensator(double desired_rate);
+
        ~sensor_frequency_compensator();
 
        /************************************************************************
@@ -52,7 +54,9 @@ public:
        void get_next(double *value);
 
 private:
-       long long m_desired_frequency;
+
+       /** desired sensor rate in [ns]. */
+       long long m_desired_rate;
 
        timestamp_t m_t1;
 
@@ -65,4 +69,4 @@ private:
        timestamp_t m_timestamp;
 };
 
-#endif /* __SENSOR_FREQUENCY_COMPENSATOR_H_ */
+#endif /* __SENSOR_FREQUENCY_COMPENSATOR_H__ */
index ad977f2..701add5 100644 (file)
@@ -17,7 +17,6 @@
 #include "step_detection.h"
 
 #include <math.h>
-#include <sensor_log.h>
 
 /* Size of average filter. */
 #define AV_FILTER_SIZE 7
@@ -41,7 +40,7 @@ step_detection::step_detection()
 , m_zero_crossing_down(false)
 , m_zc_filter()
 , m_peak_threshold(FAST_PEAK_THRESHOLD)
-, m_use_savitzky(false)
+, m_use_savitzky(true)
 , m_last_step_timestamp(UNKNOWN_TIMESTAMP)
 , m_zero_crossing_up_detected(false)
 , m_zero_crossing_down_detected(false)
@@ -147,7 +146,7 @@ bool step_detection::add_acc_sensor_values_average(
        }
 
        double peak_threshold;
-       if (m_zero_crossing_up.m_time_sum / 1E9 < 1.2) {
+       if (m_zero_crossing_up.get_time_sum() < 1.2) {
                peak_threshold = m_peak_threshold;
                m_is_slow_step_detected = false;
        } else {
@@ -165,7 +164,7 @@ bool step_detection::add_acc_sensor_values_average(
                }
        }
 
-       if (m_zero_crossing_up.m_time_sum / 1E9 < 0.3)
+       if (m_zero_crossing_up.get_time_sum() < 0.3)
                is_step_detected = false;
 
        if (is_step_detected) {
@@ -174,7 +173,7 @@ bool step_detection::add_acc_sensor_values_average(
 
                double time = (timestamp - m_last_step_timestamp) / 1E9;
                m_last_step_timestamp = timestamp;
-               m_zero_crossing_up.m_time_sum = 0;
+               m_zero_crossing_up.clr_time_sum();
                step->m_timestamp = timestamp;
                step->m_step_length = cal_step_length(time, sqrt4peak_valley_diff);
 
@@ -215,7 +214,7 @@ bool step_detection::add_acc_sensor_values_savitzky(
                }
        }
 
-       bool zup = m_zero_crossing_up.m_time_sum / 1E9 > 1.2;
+       bool zup = m_zero_crossing_up.get_time_sum() > 1.2;
        if (n_zero_down) {
                is_step_detected = false;
                amplitude = abs(m_maximum_acceleration - m_minimum_acceleration);
@@ -243,7 +242,7 @@ bool step_detection::add_acc_sensor_values_savitzky(
                }
        }
 
-       if (m_zero_crossing_up.m_time_sum / 1E9 < 0.3)
+       if (m_zero_crossing_up.get_time_sum() < 0.3)
                is_step_detected = false;
 
        if (is_step_detected) {
@@ -256,7 +255,7 @@ bool step_detection::add_acc_sensor_values_savitzky(
                if (time > 1.0 || amplitude < 3) {
                        is_step_detected = false;
                }
-               m_zero_crossing_up.m_time_sum = 0;
+               m_zero_crossing_up.clr_time_sum();
                if (is_step_detected) {
                        step->m_timestamp = timestamp;
                        step->m_step_length = cal_step_length(time, sqrt4peak_valley_diff);
@@ -269,7 +268,7 @@ bool step_detection::add_acc_sensor_values_savitzky(
 
 /************************************************************************
  */
-bool step_detection::get_step(timestamp_t timestamp, double acc, step_event* step)
+bool step_detection::new_acceleration(timestamp_t timestamp, double acc, step_event* step)
 {
        return m_use_savitzky
                        ? add_acc_sensor_values_savitzky(timestamp, acc, step)
index addd786..613751c 100644 (file)
 #include "zero_crossing_step_detection.h"
 #include "savitzky_golay_filter15.h"
 #include "step_event.h"
-#include "common.h"
+#include "timestamp.h"
 
 /************************************************************************
  * step detection engine state.
  */
 class step_detection {
 public:
+
        step_detection();
+
        ~step_detection();
 
        /************************************************************************
@@ -41,21 +43,7 @@ public:
 
        /************************************************************************
         */
-       bool is_slow_step(void);
-
-       /************************************************************************
-        */
-       bool add_acc_sensor_values_average(
-                       timestamp_t timestamp, double acc, step_event* step);
-
-       /************************************************************************
-        */
-       bool add_acc_sensor_values_savitzky(
-                       timestamp_t timestamp, double acc, step_event* step);
-
-       /************************************************************************
-        */
-       bool get_step(timestamp_t timestamp, double acc, step_event* step);
+       bool new_acceleration(timestamp_t timestamp, double acc, step_event* step);
 
        /************************************************************************
         * resets step_detection object to initial state.
@@ -77,6 +65,21 @@ private:
        double m_minimum_acceleration;
        double m_maximum_acceleration;
        bool m_is_slow_step_detected;
+
+       /************************************************************************
+        */
+       bool add_acc_sensor_values_average(
+                       timestamp_t timestamp, double acc, step_event* step);
+
+       /************************************************************************
+        */
+       bool add_acc_sensor_values_savitzky(
+                       timestamp_t timestamp, double acc, step_event* step);
+
+       /************************************************************************
+        */
+       bool is_slow_step(void);
+
 };
 
 #endif /* __STEP_DETECTION_H__ */
index 724f262..f571c45 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __STEP_EVENT_H__
 #define __STEP_EVENT_H__
 
-#include "common.h"
+#include "timestamp.h"
 
 class step_event {
 public:
@@ -26,7 +26,10 @@ public:
        , m_step_length(0)
        {}
 
+       /** step timestamp in [ns]. */
        timestamp_t m_timestamp;
+
+       /** estimated step length in [m]. */
        double m_step_length;
 };
 
similarity index 90%
rename from src/sensor/pedometer/common.h
rename to src/sensor/pedometer/timestamp.h
index b1a0fef..371c9a8 100644 (file)
@@ -17,9 +17,8 @@
 #ifndef __PEDOMETER_COMMON_H__
 #define __PEDOMETER_COMMON_H__
 
-#include <stdio.h>
-
 typedef long long timestamp_t;
-#define UNKNOWN_TIMESTAMP ((long long)0x8000000000000000)
+
+static const timestamp_t UNKNOWN_TIMESTAMP = (timestamp_t) 0x8000000000000000;
 
 #endif /* __PEDOMETER_COMMON_H__ */
index aff2b3c..f94647c 100644 (file)
@@ -25,11 +25,11 @@ static bool detect_zero_crossing(double last_accel, double new_accel, bool up)
 }
 
 zero_crossing_step_detection::zero_crossing_step_detection(bool up)
-: m_time_sum(0)
-, m_up(up)
+: m_up(up)
 , m_last_acceleration(0)
 , m_last_timestamp(UNKNOWN_TIMESTAMP)
 , m_last_zero_crossing_time(UNKNOWN_TIMESTAMP)
+, m_time_sum(0)
 {
 }
 
@@ -56,6 +56,14 @@ bool zero_crossing_step_detection::detect_step(timestamp_t timestamp, double acc
        return step_detected;
 }
 
+void zero_crossing_step_detection::clr_time_sum() {
+       m_time_sum = 0.0;
+}
+
+double zero_crossing_step_detection::get_time_sum() {
+       return m_time_sum / 1E9;
+}
+
 void zero_crossing_step_detection::reset(void)
 {
        m_last_acceleration = 0;
index 79ca518..76a155f 100644 (file)
 #ifndef __ZERO_CROSSING_STEP_DETECTION_H__
 #define __ZERO_CROSSING_STEP_DETECTION_H__
 
-#include "common.h"
+#include "timestamp.h"
 
 /************************************************************************
  * zero crossing detection engine state.
  */
 class zero_crossing_step_detection {
 public:
+
        zero_crossing_step_detection(bool up);
+
        ~zero_crossing_step_detection();
 
        /************************************************************************
@@ -35,7 +37,13 @@ public:
         */
        void reset(void);
 
-       timestamp_t m_time_sum;
+       /************************************************************************
+        */
+       void clr_time_sum();
+
+       /************************************************************************
+        */
+       double get_time_sum();
 
 private:
        /**
@@ -46,11 +54,13 @@ private:
        /** acceleration in previous detect step. */
        double m_last_acceleration;
 
-       /** timestamp of last acc event. unknown time if no one. */
+       /** timestamp of last acc event in [ns]. unknown time if no one. */
        timestamp_t m_last_timestamp;
 
-       /** timestamp of last detected zero crossing. unknown time if not yet detected. */
+       /** timestamp of last detected zero crossing in [ns]. unknown time if not yet detected. */
        timestamp_t m_last_zero_crossing_time;
+
+       timestamp_t m_time_sum;
 };
 
 #endif /* __ZERO_CROSSING_STEP_DETECTION_H__ */