1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-05 22:57:47 -04:00

SSB demod: exchange up and down step counter values when the threshold state changes to avoid restarting from 0 or step length when state changes rapidly

This commit is contained in:
f4exb 2017-07-26 17:50:17 +02:00
parent e17a815125
commit 7acc42436a

View File

@ -102,7 +102,7 @@ double MagSquaredAGC::feedAndGetValue(const Complex& ci)
if (m_count < m_moving_average.historySize()) if (m_count < m_moving_average.historySize())
{ {
m_stepDownCounter = m_stepLength; m_stepDownCounter = m_stepUpCounter;
if (m_stepUpCounter < m_stepLength) if (m_stepUpCounter < m_stepLength)
{ {
@ -116,7 +116,7 @@ double MagSquaredAGC::feedAndGetValue(const Complex& ci)
} }
else else
{ {
m_stepUpCounter = 0; m_stepUpCounter = m_stepDownCounter;
if (m_stepDownCounter > 0) if (m_stepDownCounter > 0)
{ {
@ -192,7 +192,7 @@ double MagAGC::feedAndGetValue(const Complex& ci)
if (m_count < m_moving_average.historySize()) if (m_count < m_moving_average.historySize())
{ {
m_stepDownCounter = m_stepLength; m_stepDownCounter = m_stepUpCounter;
if (m_stepUpCounter < m_stepLength) if (m_stepUpCounter < m_stepLength)
{ {
@ -206,7 +206,7 @@ double MagAGC::feedAndGetValue(const Complex& ci)
} }
else else
{ {
m_stepUpCounter = 0; m_stepUpCounter = m_stepDownCounter;
if (m_stepDownCounter > 0) if (m_stepDownCounter > 0)
{ {