HARDT - The Ham Radio DSP Toolkit
Public Member Functions | List of all members
HAgc< T > Class Template Reference

#include <hagc.h>

Inheritance diagram for HAgc< T >:
Inheritance graph
[legend]
Collaboration diagram for HAgc< T >:
Collaboration graph
[legend]

Public Member Functions

 HAgc (HWriter< T > *writer, T level, int average, size_t blocksize, int increment=4, bool allowUnity=false, HProbe< T > *probe=NULL)
 
 HAgc (HWriterConsumer< T > *consumer, T level, int average, size_t blocksize, int increment=1, bool allowUnity=false, HProbe< T > *probe=NULL)
 
 HAgc (HReader< T > *reader, T level, int average, size_t blocksize, int increment=1, bool allowUnity=false, HProbe< T > *probe=NULL)
 
 ~HAgc ()
 
virtual void Filter (T *src, T *dest, size_t blocksize)
 
void SetLevel (T level)
 
void SetAverage (int average)
 
void SetEnabled (bool enabled)
 
void SetGain (float gain)
 
- Public Member Functions inherited from HGain< T >
 HGain (HWriter< T > *writer, float gain, size_t blocksize, HProbe< T > *probe=NULL)
 
 HGain (HWriterConsumer< T > *consumer, float gain, size_t blocksize, HProbe< T > *probe=NULL)
 
 HGain (HReader< T > *reader, float gain, size_t blocksize, HProbe< T > *probe=NULL)
 
 ~HGain ()
 
void SetGain (float gain)
 
float GetGain ()
 
- Public Member Functions inherited from HFilter< T >
 ~HFilter ()
 
int Write (T *src, size_t blocksize)
 
int Read (T *dest, size_t blocksize)
 
bool Start ()
 
bool Stop ()
 
bool Command (HCommand *command)
 
void Enable ()
 
void Disable ()
 
bool GetEnabled ()
 
- Public Member Functions inherited from HObject
 HObject ()
 
- Public Member Functions inherited from HWriter< T >
virtual ~HWriter ()=default
 
HWriter< T > * Writer ()
 
- Public Member Functions inherited from HReader< T >
virtual ~HReader ()=default
 
HReader< T > * Reader ()
 
- Public Member Functions inherited from HWriterConsumer< T >
HWriterConsumer< T > * Consumer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from HFilter< T >
static std::vector< float > ReadCoeffsFromFile (std::string filename)
 
static std::vector< float > ReadCoeffsFromFile (char *filename)
 
- Protected Member Functions inherited from HFilter< T >
 HFilter (HWriter< T > *writer, size_t blocksize, HProbe< T > *probe=NULL)
 
 HFilter (HWriterConsumer< T > *consumer, size_t blocksize, HProbe< T > *probe=NULL)
 
 HFilter (HReader< T > *reader, size_t blocksize, HProbe< T > *probe=NULL)
 
void SetWriter (HWriter< T > *writer)
 
- Protected Attributes inherited from HFilter< T >
int _blocksize
 

Detailed Description

template<class T>
class HAgc< T >

A filter providing automatic gain (or attenuation)

Constructor & Destructor Documentation

◆ HAgc() [1/3]

template<class T >
HAgc< T >::HAgc ( HWriter< T > *  writer,
level,
int  average,
size_t  blocksize,
int  increment = 4,
bool  allowUnity = false,
HProbe< T > *  probe = NULL 
)

Construct a new HAgc object that writes to a writer

Parameters
writerDownstream writer
levelDesired output level
averageNumber of blocks to average over when comparing to desired output level
blocksizeBlocksize
incrementWhen a larger or smaller gain is needed, gain is increased/decreased by this fraction of the full needed increment
allowUnityAllow use of unity gain (1), do not reduce gain further
probeProbe

◆ HAgc() [2/3]

template<class T >
HAgc< T >::HAgc ( HWriterConsumer< T > *  consumer,
level,
int  average,
size_t  blocksize,
int  increment = 1,
bool  allowUnity = false,
HProbe< T > *  probe = NULL 
)

Construct a new HAgc object that registers with an upstream writer

Parameters
consumerUpstream consumer
levelDesired output level
averageNumber of blocks to average over when comparing to desired output level
blocksizeBlocksize
incrementWhen a larger or smaller gain is needed, gain is increased/decreased by this fraction of the full needed increment
allowUnityAllow use of unity gain (1), do not reduce gain further
probeProbe

◆ HAgc() [3/3]

template<class T >
HAgc< T >::HAgc ( HReader< T > *  reader,
level,
int  average,
size_t  blocksize,
int  increment = 1,
bool  allowUnity = false,
HProbe< T > *  probe = NULL 
)

Construct a new HAgc object that reads from a reader

Parameters
readerUpstream reader
levelDesired output level
averageNumber of blocks to average over when comparing to desired output level
blocksizeBlocksize
incrementWhen a larger or smaller gain is needed, gain is increased/decreased by this fraction of the full needed increment
allowUnityAllow use of unity gain (1), do not reduce gain further
probeProbe

◆ ~HAgc()

template<class T >
HAgc< T >::~HAgc

Default destructor

Member Function Documentation

◆ Filter()

template<class T >
void HAgc< T >::Filter ( T *  src,
T *  dest,
size_t  blocksize 
)
virtual

Run a block of samples through the gain filter

Reimplemented from HGain< T >.

◆ SetAverage()

template<class T >
void HAgc< T >::SetAverage ( int  average)
inline

Set average (how many blocks is averaged before evaluating the gain again)

◆ SetEnabled()

template<class T >
void HAgc< T >::SetEnabled ( bool  enabled)
inline

Enable or disable the automatic gain control

◆ SetGain()

template<class T >
void HAgc< T >::SetGain ( float  gain)
inline

Set the gain level. This will disable the automatic gain control

◆ SetLevel()

template<class T >
void HAgc< T >::SetLevel ( level)
inline

Set bounds (lowest and highest value in the hysteresis interval)


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