sdr::AGC< Scalar > Class Template Reference
Filter and signal processing nodes.

An automatic gain control node. More...

`#include <utils.hh>`

Inheritance diagram for sdr::AGC< Scalar >:

## Public Member Functions

| AGC (double tau=0.1, double target=0)
| Constructor. More...
bool | enabled () const
| Returns true, if the AGC is enabled. More...
void | enable (bool enabled)
| Enable/disable the AGC node. More...
float | gain () const
| Returns the current gain factor. More...
void | setGain (float gain)
| Resets the current gain factor. More...
double | tau () const
| Returns the time-constant of the AGC. More...
void | setTau (double tau)
| Sets the time-constant of the AGC. More...
virtual void | config (const Config &src_cfg)
| Configures the AGC node. More...
virtual void | process (const Buffer< Scalar > &buffer, bool allow_overwrite)
| Performs the amplification and adjusts the gain. More...
Public Member Functions inherited from sdr::Sink< Scalar >
| Sink ()
| Constructor. More...
virtual | ~Sink ()
| Drestructor. More...
virtual void | handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
| Re-implemented from `SinkBase`. More...
Public Member Functions inherited from sdr::SinkBase
| SinkBase ()
| Constructor. More...
virtual | ~SinkBase ()
| Destructor. More...
Public Member Functions inherited from sdr::Source
| Source ()
| Constructor. More...
virtual | ~Source ()
| Destructor. More...
virtual void | send (const RawBuffer &buffer, bool allow_overwrite=false)
| Sends the given buffer to all connected sinks. More...
void | connect (SinkBase *sink, bool direct=false)
| Connect this source to a sink. More...
void | disconnect (SinkBase *sink)
| Disconnect a sink again. More...
virtual void | setConfig (const Config &config)
| Stores the configuration and propergates it if the configuration has been changed. More...
virtual double | sampleRate () const
| Returns the configured sample rate or `0` otherwise. More...
virtual Config::Type | type () const
| Returns the configured source type or `Config::Type_UNDEFINED` otherwise. More...
template<class T >
void | addEOS (T *instance, void(T::*function)())
| Adds a callback to the end-of-stream signal of the source. More...

## Protected Attributes

bool | _enabled
| If true, the automatic gain adjustment is enabled. More...
float | _tau
| The time-constant of the AGC. More...
float | _lambda
| One over the time-constant. More...
float | _sd
| The averaged std. More...
float | _target
| The target level of the output signal. More...
float | _gain
| The current gain factor. More...
double | _sample_rate
| The current sample-rate. More...
Buffer< Scalar > | _buffer
| The output buffer. More...
Protected Attributes inherited from sdr::Source
Config | _config
| Holds the source configuration, this can be updated by calling `setConfig`. More...
std::map< SinkBase *, bool > | _sinks
| The connected sinks. More...
std::list< DelegateInterface * > | _eos
| The connected EOS singal handlers. More...

## Additional Inherited Members

Protected Member Functions inherited from sdr::Source
void | signalEOS ()
| Signals the EOS. More...
void | propagateConfig (const Config &config)
| Propagates the given configuration to all connected sinks. More...

## Detailed Description

### template<class Scalar>
class sdr::AGC< Scalar >

An automatic gain control node.

## Constructor & Destructor Documentation

template<class Scalar >

sdr::AGC< Scalar >::AGC | ( | double | tau = `0.1`,
|  | double | target = `0`
| ) |  |

inline

Constructor.

## Member Function Documentation

template<class Scalar >

virtual void sdr::AGC< Scalar >::config | ( | const Config & | src_cfg | ) |

inlinevirtual

Configures the AGC node.

Implements sdr::SinkBase.

template<class Scalar >

void sdr::AGC< Scalar >::enable | ( | bool | enabled | ) |

inline

Enable/disable the AGC node.

template<class Scalar >

bool sdr::AGC< Scalar >::enabled | ( |  | ) | const

inline

Returns true, if the AGC is enabled.

template<class Scalar >

float sdr::AGC< Scalar >::gain | ( |  | ) | const

inline

Returns the current gain factor.

template<class Scalar >

virtual void sdr::AGC< Scalar >::process | ( | const Buffer< Scalar > & | buffer,
|  | bool | allow_overwrite
| ) |  |

inlinevirtual

Performs the amplification and adjusts the gain.

Implements sdr::Sink< Scalar >.

template<class Scalar >

void sdr::AGC< Scalar >::setGain | ( | float | gain | ) |

inline

Resets the current gain factor.

template<class Scalar >

void sdr::AGC< Scalar >::setTau | ( | double | tau | ) |

inline

Sets the time-constant of the AGC.

template<class Scalar >

double sdr::AGC< Scalar >::tau | ( |  | ) | const

inline

Returns the time-constant of the AGC.

## Member Data Documentation

template<class Scalar >

Buffer<Scalar> sdr::AGC< Scalar >::_buffer

protected

The output buffer.

template<class Scalar >

bool sdr::AGC< Scalar >::_enabled

protected

If true, the automatic gain adjustment is enabled.

template<class Scalar >

float sdr::AGC< Scalar >::_gain

protected

The current gain factor.

template<class Scalar >

float sdr::AGC< Scalar >::_lambda

protected

One over the time-constant.

template<class Scalar >

double sdr::AGC< Scalar >::_sample_rate

protected

The current sample-rate.

template<class Scalar >

float sdr::AGC< Scalar >::_sd

protected

The averaged std.

dev. of the input signal.

template<class Scalar >

float sdr::AGC< Scalar >::_target

protected

The target level of the output signal.

template<class Scalar >

float sdr::AGC< Scalar >::_tau

protected

The time-constant of the AGC.

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

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/utils.hh