From 432ab7d834b8c02b124e1c2d7dd02ae5f36bc351 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 26 Jul 2017 15:55:25 +0200 Subject: [PATCH] SSB demod: fixed step up/down factor calculation (float) --- sdrbase/dsp/agc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdrbase/dsp/agc.cpp b/sdrbase/dsp/agc.cpp index 05803cf94..eecf2b341 100644 --- a/sdrbase/dsp/agc.cpp +++ b/sdrbase/dsp/agc.cpp @@ -107,7 +107,7 @@ double MagSquaredAGC::feedAndGetValue(const Complex& ci) m_stepUpCounter++; } - return m_u0 * StepFunctions::smootherstep(m_stepUpCounter/m_stepLength); + return m_u0 * StepFunctions::smootherstep( ((float) m_stepUpCounter) / ((float) m_stepLength) ); } else { @@ -117,7 +117,7 @@ double MagSquaredAGC::feedAndGetValue(const Complex& ci) m_stepDownCounter--; } - return m_u0 * StepFunctions::smootherstep(m_stepDownCounter/m_stepLength); + return m_u0 * StepFunctions::smootherstep( ((float) m_stepDownCounter) / ((float) m_stepLength) ); } //return (m_count < m_moving_average.historySize()) ? m_u0 : 0.0; @@ -190,7 +190,7 @@ double MagAGC::feedAndGetValue(const Complex& ci) m_stepUpCounter++; } - return m_u0 * StepFunctions::smootherstep(m_stepUpCounter/m_stepLength); + return m_u0 * StepFunctions::smootherstep( ((float) m_stepUpCounter) / ((float) m_stepLength) ); } else { @@ -200,7 +200,7 @@ double MagAGC::feedAndGetValue(const Complex& ci) m_stepDownCounter--; } - return m_u0 * StepFunctions::smootherstep(m_stepDownCounter/m_stepLength); + return m_u0 * StepFunctions::smootherstep( ((float) m_stepDownCounter) / ((float) m_stepLength) ); } //return (m_count < m_moving_average.historySize()) ? m_u0 : 0.0;