ref: 4cb7d826e03ac02689c8c5240e7af5931b10a257
parent: 462bbd369301684138b7c63ef4d702de86d3e127
author: Rob Sykes <robs@users.sourceforge.net>
date: Sat Apr 23 09:00:30 EDT 2011
fix nonsense values for peak and trough RMS with very short files
--- a/src/stats.c
+++ b/src/stats.c
@@ -170,6 +170,8 @@
priv_t * q = (priv_t *)(effp - effp->flow + i)->priv;
min = min(min, q->min);
max = max(max, q->max);
+ if (q->num_samples < q->tc_samples)
+ q->min_sigma_x2 = q->max_sigma_x2 = q->sigma_x2 / q->num_samples;
min_sigma_x2 = min(min_sigma_x2, q->min_sigma_x2);
max_sigma_x2 = max(max_sigma_x2, q->max_sigma_x2);
sigma_x += q->sigma_x;