SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <agc.h>
Public Member Functions | |
MagAGC (int historySize, double R, double threshold) | |
virtual | ~MagAGC () |
void | setSquared (bool squared) |
void | resize (int historySize, int stepLength, Real R) |
void | setOrder (double R) |
virtual void | feed (Complex &ci) |
double | feedAndGetValue (const Complex &ci) |
double | getMagSq () const |
void | setThreshold (double threshold) |
void | setThresholdEnable (bool enable) |
void | setGate (int gate) |
void | setStepDownDelay (int stepDownDelay) |
void | setClamping (bool clamping) |
void | setClampMax (double clampMax) |
int | getStepDownDelay () const |
float | getStepValue () const |
void | setHardLimiting (bool hardLimiting) |
Public Member Functions inherited from AGC | |
AGC (int historySize, double R) | |
virtual | ~AGC () |
void | resize (int historySize, double R) |
void | setOrder (double R) |
Real | getValue () |
Real | getAverage () |
Private Member Functions | |
double | hardLimiter (double multiplier, double magsq) |
Private Attributes | |
bool | m_squared |
use squared magnitude (power) to compute AGC value More... | |
double | m_magsq |
current squared magnitude (power) More... | |
double | m_threshold |
squelch on magsq average More... | |
bool | m_thresholdEnable |
enable squelch on power threshold More... | |
int | m_gate |
power threshold gate in number of samples More... | |
int | m_stepLength |
transition step length in number of samples More... | |
double | m_stepDelta |
transition step unit by sample More... | |
int | m_stepUpCounter |
step up transition samples counter More... | |
int | m_stepDownCounter |
step down transition samples counter More... | |
int | m_gateCounter |
threshold gate samples counter More... | |
int | m_stepDownDelay |
delay in samples before cutoff (release) More... | |
bool | m_clamping |
clamping active More... | |
double | m_R2 |
square of ordered magnitude More... | |
double | m_clampMax |
maximum to clamp to as power value More... | |
bool | m_hardLimiting |
hard limit multiplier so that resulting sample magnitude does not exceed 1.0 More... | |
Additional Inherited Members | |
Protected Attributes inherited from AGC | |
double | m_u0 |
AGC factor. More... | |
double | m_R |
ordered magnitude More... | |
MovingAverage< double > | m_moving_average |
Averaging engine. The stack length conditions the smoothness of AGC. More... | |
int | m_historySize |
Averaging length (attack) More... | |
int | m_count |
Samples counter. More... | |
MagAGC::MagAGC | ( | int | historySize, |
double | R, | ||
double | threshold | ||
) |
Definition at line 43 of file agc.cpp.
|
virtual |
Implements AGC.
Definition at line 94 of file agc.cpp.
References feedAndGetValue().
double MagAGC::feedAndGetValue | ( | const Complex & | ci | ) |
Definition at line 108 of file agc.cpp.
References MovingAverage< Type >::average(), MovingAverage< Type >::feed(), hardLimiter(), m_clamping, m_clampMax, AGC::m_count, m_gate, m_gateCounter, m_magsq, AGC::m_moving_average, AGC::m_R, m_squared, m_stepDelta, m_stepDownCounter, m_stepDownDelay, m_stepLength, m_stepUpCounter, m_threshold, m_thresholdEnable, AGC::m_u0, StepFunctions::smootherstep(), and sqrt().
Referenced by feed(), UDPSink::feed(), AMDemod::processOneSample(), and SSBDemod::processOneSample().
|
inline |
Definition at line 46 of file agc.h.
Referenced by UDPSink::feed().
|
inline |
Definition at line 53 of file agc.h.
Referenced by SSBDemod::processOneSample().
float MagAGC::getStepValue | ( | ) | const |
Definition at line 199 of file agc.cpp.
References AGC::m_count, m_stepDelta, m_stepDownCounter, m_stepUpCounter, and StepFunctions::smootherstep().
Referenced by SSBDemod::processOneSample().
|
private |
Definition at line 99 of file agc.cpp.
References m_hardLimiting, and sqrt().
Referenced by feedAndGetValue().
void MagAGC::resize | ( | int | historySize, |
int | stepLength, | ||
Real | R | ||
) |
Definition at line 65 of file agc.cpp.
References MovingAverage< Type >::fill(), AGC::m_moving_average, m_R2, m_stepDelta, m_stepDownCounter, m_stepLength, m_stepUpCounter, and AGC::resize().
Referenced by AMDemod::AMDemod(), AMDemod::applyAudioSampleRate(), SSBDemod::applyAudioSampleRate(), UDPSink::applySettings(), and SSBDemod::applySettings().
|
inline |
Definition at line 51 of file agc.h.
Referenced by SSBDemod::applySettings(), SSBDemod::SSBDemod(), and UDPSink::UDPSink().
|
inline |
Definition at line 52 of file agc.h.
Referenced by SSBDemod::SSBDemod(), and UDPSink::UDPSink().
|
inline |
Definition at line 49 of file agc.h.
Referenced by SSBDemod::applyAudioSampleRate(), UDPSink::applySettings(), and SSBDemod::applySettings().
|
inline |
void MagAGC::setOrder | ( | double | R | ) |
Definition at line 76 of file agc.cpp.
References MovingAverage< Type >::fill(), AGC::m_moving_average, m_R2, and AGC::setOrder().
|
inline |
Definition at line 41 of file agc.h.
References AGC::feed(), AGC::resize(), and AGC::setOrder().
|
inline |
Definition at line 50 of file agc.h.
Referenced by SSBDemod::applyAudioSampleRate(), UDPSink::applySettings(), and SSBDemod::applySettings().
|
inline |
Definition at line 47 of file agc.h.
Referenced by UDPSink::applySettings(), and SSBDemod::applySettings().
void MagAGC::setThresholdEnable | ( | bool | enable | ) |
Definition at line 83 of file agc.cpp.
References m_stepDownCounter, m_stepUpCounter, and m_thresholdEnable.
Referenced by AMDemod::AMDemod(), and SSBDemod::applySettings().
|
private |
|
private |
maximum to clamp to as power value
Definition at line 71 of file agc.h.
Referenced by feedAndGetValue().
|
private |
power threshold gate in number of samples
Definition at line 62 of file agc.h.
Referenced by feedAndGetValue().
|
private |
threshold gate samples counter
Definition at line 67 of file agc.h.
Referenced by feedAndGetValue().
|
private |
hard limit multiplier so that resulting sample magnitude does not exceed 1.0
Definition at line 72 of file agc.h.
Referenced by hardLimiter().
|
private |
current squared magnitude (power)
Definition at line 59 of file agc.h.
Referenced by feedAndGetValue().
|
private |
square of ordered magnitude
Definition at line 70 of file agc.h.
Referenced by resize(), and setOrder().
|
private |
use squared magnitude (power) to compute AGC value
Definition at line 58 of file agc.h.
Referenced by feedAndGetValue().
|
private |
transition step unit by sample
Definition at line 64 of file agc.h.
Referenced by feedAndGetValue(), getStepValue(), and resize().
|
private |
step down transition samples counter
Definition at line 66 of file agc.h.
Referenced by feedAndGetValue(), getStepValue(), resize(), and setThresholdEnable().
|
private |
delay in samples before cutoff (release)
Definition at line 68 of file agc.h.
Referenced by feedAndGetValue().
|
private |
transition step length in number of samples
Definition at line 63 of file agc.h.
Referenced by feedAndGetValue(), and resize().
|
private |
step up transition samples counter
Definition at line 65 of file agc.h.
Referenced by feedAndGetValue(), getStepValue(), resize(), and setThresholdEnable().
|
private |
|
private |
enable squelch on power threshold
Definition at line 61 of file agc.h.
Referenced by feedAndGetValue(), and setThresholdEnable().