From c85c9cc40d05c89b3fa6de997590ab488c13cb2e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 7 Mar 2018 15:28:21 +0100 Subject: Introduce slow peak statistic, averaging over 5 minutes --- src/ManagementServer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ManagementServer.h') diff --git a/src/ManagementServer.h b/src/ManagementServer.h index 274dece..17b8bda 100644 --- a/src/ManagementServer.h +++ b/src/ManagementServer.h @@ -117,11 +117,14 @@ class InputStat uint32_t m_num_overruns; // Peak audio levels (linear 16-bit PCM) for the two channels. - // Keep a FIFO of values from the last few seconds + // Keep a FIFO of values from the last minutes, apply + // a short window to also see short-term fluctuations. std::deque m_peaks_left; std::deque m_peaks_right; std::chrono::time_point m_time_last_peak_notify; + size_t m_short_window_length = 0; + /************* STATE ***************/ /* Variables used for determining the input state */ int m_glitch_counter; // saturating counter -- cgit v1.2.3