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.
Public Member Functions | Private Attributes | List of all members
SimpleAGC< AvgSize > Class Template Reference

#include <agc.h>

+ Collaboration diagram for SimpleAGC< AvgSize >:

Public Member Functions

 SimpleAGC (Real initial, Real cutoff=0, Real clip=0)
 
void resize (Real initial, Real cutoff=0, Real clip=0)
 
void resizeNew (uint32_t newSize, Real initial, Real cutoff=0, Real clip=0)
 
void fill (double value)
 
Real getValue ()
 
void feed (Real value)
 

Private Attributes

Real m_cutoff
 
Real m_clip
 
MovingAverage< double > m_moving_average
 

Detailed Description

template<uint32_t AvgSize>
class SimpleAGC< AvgSize >

Definition at line 78 of file agc.h.

Constructor & Destructor Documentation

◆ SimpleAGC()

template<uint32_t AvgSize>
SimpleAGC< AvgSize >::SimpleAGC ( Real  initial,
Real  cutoff = 0,
Real  clip = 0 
)
inline

Definition at line 81 of file agc.h.

81  :
82  m_cutoff(cutoff),
83  m_clip(clip),
84  m_moving_average(AvgSize, initial)
85  {
86  }
Real m_cutoff
Definition: agc.h:124
MovingAverage< double > m_moving_average
Definition: agc.h:126
Real m_clip
Definition: agc.h:125

Member Function Documentation

◆ feed()

template<uint32_t AvgSize>
void SimpleAGC< AvgSize >::feed ( Real  value)
inline

Definition at line 116 of file agc.h.

Referenced by AMDemod::processOneSample(), and FreeDVDemod::processOneSample().

117  {
118  if (value > m_cutoff) {
119  m_moving_average.feed(value);
120  }
121  }
void feed(Type value)
Definition: movingaverage.h:24
Real m_cutoff
Definition: agc.h:124
MovingAverage< double > m_moving_average
Definition: agc.h:126
+ Here is the caller graph for this function:

◆ fill()

template<uint32_t AvgSize>
void SimpleAGC< AvgSize >::fill ( double  value)
inline

Definition at line 102 of file agc.h.

103  {
104  m_moving_average.fill(value);
105  }
void fill(Type value)
Definition: movingaverage.h:37
MovingAverage< double > m_moving_average
Definition: agc.h:126

◆ getValue()

template<uint32_t AvgSize>
Real SimpleAGC< AvgSize >::getValue ( )
inline

Definition at line 107 of file agc.h.

Referenced by AMDemod::processOneSample(), and FreeDVDemod::processOneSample().

108  {
109  if ((Real) m_moving_average.average() > m_clip) {
110  return (Real) m_moving_average.average();
111  } else {
112  return m_clip;
113  }
114  }
Type average() const
Definition: movingaverage.h:43
MovingAverage< double > m_moving_average
Definition: agc.h:126
float Real
Definition: dsptypes.h:42
Real m_clip
Definition: agc.h:125
+ Here is the caller graph for this function:

◆ resize()

template<uint32_t AvgSize>
void SimpleAGC< AvgSize >::resize ( Real  initial,
Real  cutoff = 0,
Real  clip = 0 
)
inline

Definition at line 88 of file agc.h.

89  {
90  m_cutoff = cutoff;
91  m_clip = clip;
92  m_moving_average.resize(AvgSize, initial);
93  }
Real m_cutoff
Definition: agc.h:124
MovingAverage< double > m_moving_average
Definition: agc.h:126
void resize(int historySize, Type initial)
Definition: movingaverage.h:16
Real m_clip
Definition: agc.h:125

◆ resizeNew()

template<uint32_t AvgSize>
void SimpleAGC< AvgSize >::resizeNew ( uint32_t  newSize,
Real  initial,
Real  cutoff = 0,
Real  clip = 0 
)
inline

Definition at line 95 of file agc.h.

Referenced by AMDemod::applyAudioSampleRate(), FreeDVDemod::applyFreeDVMode(), AMDemod::applySettings(), and FreeDVDemod::FreeDVDemod().

96  {
97  m_cutoff = cutoff;
98  m_clip = clip;
99  m_moving_average.resize(newSize, initial);
100  }
Real m_cutoff
Definition: agc.h:124
MovingAverage< double > m_moving_average
Definition: agc.h:126
void resize(int historySize, Type initial)
Definition: movingaverage.h:16
Real m_clip
Definition: agc.h:125
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_clip

template<uint32_t AvgSize>
Real SimpleAGC< AvgSize >::m_clip
private

Definition at line 125 of file agc.h.

◆ m_cutoff

template<uint32_t AvgSize>
Real SimpleAGC< AvgSize >::m_cutoff
private

Definition at line 124 of file agc.h.

◆ m_moving_average

template<uint32_t AvgSize>
MovingAverage<double> SimpleAGC< AvgSize >::m_moving_average
private

Definition at line 126 of file agc.h.


The documentation for this class was generated from the following file: