From 3c01571043affb5b5386d3bc77f4d2708b27860a Mon Sep 17 00:00:00 2001 From: Kyle Keen Date: Sun, 30 Nov 2014 23:06:31 -0500 Subject: [PATCH] rtl_power: fix peak hold --- src/rtl_power.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rtl_power.c b/src/rtl_power.c index dc777e1..e79ea6b 100644 --- a/src/rtl_power.c +++ b/src/rtl_power.c @@ -971,7 +971,9 @@ void csv_dbm(struct tuning_state *ts) } dbm = (double)ts->avg[i]; dbm /= (double)ts->rate; - dbm /= (double)ts->samples; + if (!ts->peak_hold) { + dbm /= (double)ts->samples; + } if (ts->linear) { fprintf(file, "%.5g%s", dbm, sep); } else {