mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-08-01 05:22:26 -04:00
SSB demod: set AGC threshold step up and down maximum time to 100ms
This commit is contained in:
parent
da6b60d48c
commit
a815507f77
@ -9,6 +9,7 @@
|
|||||||
#include "dsp/agc.h"
|
#include "dsp/agc.h"
|
||||||
#include "util/smootherstep.h"
|
#include "util/smootherstep.h"
|
||||||
|
|
||||||
|
#define StepLengthMax 4800 // 100ms
|
||||||
|
|
||||||
AGC::AGC(int historySize, Real R) :
|
AGC::AGC(int historySize, Real R) :
|
||||||
m_u0(1.0),
|
m_u0(1.0),
|
||||||
@ -49,9 +50,9 @@ MagSquaredAGC::MagSquaredAGC(int historySize, double R, double threshold) :
|
|||||||
m_magsq(0.0),
|
m_magsq(0.0),
|
||||||
m_threshold(threshold),
|
m_threshold(threshold),
|
||||||
m_gate(0),
|
m_gate(0),
|
||||||
m_stepLength(std::min(2400, historySize/2)),
|
m_stepLength(std::min(StepLengthMax, historySize/2)),
|
||||||
m_stepUpCounter(0),
|
m_stepUpCounter(0),
|
||||||
m_stepDownCounter(0),
|
m_stepDownCounter(m_stepLength),
|
||||||
m_gateCounter(0)
|
m_gateCounter(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ MagSquaredAGC::~MagSquaredAGC()
|
|||||||
|
|
||||||
void MagSquaredAGC::resize(int historySize, Real R)
|
void MagSquaredAGC::resize(int historySize, Real R)
|
||||||
{
|
{
|
||||||
m_stepLength = std::min(2400, historySize/2);
|
m_stepLength = std::min(StepLengthMax, historySize/2);
|
||||||
AGC::resize(historySize, R);
|
AGC::resize(historySize, R);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,9 +133,9 @@ MagAGC::MagAGC(int historySize, double R, double threshold) :
|
|||||||
m_magsq(0.0),
|
m_magsq(0.0),
|
||||||
m_threshold(threshold),
|
m_threshold(threshold),
|
||||||
m_gate(0),
|
m_gate(0),
|
||||||
m_stepLength(std::min(2400, historySize/2)),
|
m_stepLength(std::min(StepLengthMax, historySize/2)),
|
||||||
m_stepUpCounter(0),
|
m_stepUpCounter(0),
|
||||||
m_stepDownCounter(0),
|
m_stepDownCounter(m_stepLength),
|
||||||
m_gateCounter(0)
|
m_gateCounter(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ MagAGC::~MagAGC()
|
|||||||
|
|
||||||
void MagAGC::resize(int historySize, Real R)
|
void MagAGC::resize(int historySize, Real R)
|
||||||
{
|
{
|
||||||
m_stepLength = std::min(2400, historySize/2);
|
m_stepLength = std::min(StepLengthMax, historySize/2);
|
||||||
AGC::resize(historySize, R);
|
AGC::resize(historySize, R);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user