agc_crcf

Automatic gain control (agc) for level correction and signal detection

Variants: agc_crcf, agc_rrrf

Public Functions

agc_crcf agc_crcf_create()
agc_crcf agc_crcf_copy(agc_crcf _q)
int agc_crcf_destroy(agc_crcf _q)
int agc_crcf_print(agc_crcf _q)
int agc_crcf_reset(agc_crcf _q)
int agc_crcf_execute(agc_crcf _q, float complex _x, float complex * _y)
int agc_crcf_execute_block(agc_crcf _q, float complex * _x, unsigned int _n, float complex * _y)
int agc_crcf_lock(agc_crcf _q)
int agc_crcf_unlock(agc_crcf _q)
int agc_crcf_is_locked(agc_crcf _q)
int agc_crcf_set_bandwidth(agc_crcf _q, float _bt)
float agc_crcf_get_bandwidth(agc_crcf _q)
float agc_crcf_get_signal_level(agc_crcf _q)
int agc_crcf_set_signal_level(agc_crcf _q, float _x2)
float agc_crcf_get_rssi(agc_crcf _q)
int agc_crcf_set_rssi(agc_crcf _q, float _rssi)
float agc_crcf_get_gain(agc_crcf _q)
int agc_crcf_set_gain(agc_crcf _q, float _gain)
float agc_crcf_get_scale(agc_crcf _q)
int agc_crcf_set_scale(agc_crcf _q, float _scale)
int agc_crcf_init(agc_crcf _q, float complex * _x, unsigned int _n)
int agc_crcf_squelch_enable(agc_crcf _q)
int agc_crcf_squelch_disable(agc_crcf _q)
int agc_crcf_squelch_is_enabled(agc_crcf _q)
int agc_crcf_squelch_set_threshold(agc_crcf _q, float _thresh)
float agc_crcf_squelch_get_threshold(agc_crcf _q)
int agc_crcf_squelch_set_timeout(agc_crcf _q, unsigned int _timeout)
unsigned int agc_crcf_squelch_get_timeout(agc_crcf _q)
int agc_crcf_squelch_get_status(agc_crcf _q)

Interfaces

agc_crcf agc_crcf_create()

Create automatic gain control object.

agc_crcf agc_crcf_copy(agc_crcf _q)

Copy object including all internal objects and state

int agc_crcf_destroy(agc_crcf _q)

Destroy object, freeing all internally-allocated memory.

int agc_crcf_print(agc_crcf _q)

Print object properties to stdout, including received signal strength indication (RSSI), loop bandwidth, lock status, and squelch status.

int agc_crcf_reset(agc_crcf _q)

Reset internal state of agc object, including gain estimate, input signal level estimate, lock status, and squelch mode If the squelch mode is disabled, it stays disabled, but all enabled modes (e.g. LIQUID_AGC_SQUELCH_TIMEOUT) resets to just LIQUID_AGC_SQUELCH_ENABLED.

int agc_crcf_execute(agc_crcf _q, float complex _x, float complex * _y)

Execute automatic gain control on an single input sample

  • _q : automatic gain control object
  • _x : input sample
  • _y : output sample

int agc_crcf_execute_block(agc_crcf _q, float complex * _x, unsigned int _n, float complex * _y)

Execute automatic gain control on block of samples pointed to by _x and store the result in the array of the same length _y.

  • _q : automatic gain control object
  • _x : input data array, shape: (_n, 1)
  • _n : number of input, output samples
  • _y : output data array, shape: (_n, 1)

int agc_crcf_lock(agc_crcf _q)

Lock agc object. When locked, the agc object still makes an estimate of the signal level, but the gain setting is fixed and does not change. This is useful for providing coarse input signal level correction and quickly detecting a packet burst but not distorting signals with amplitude variation due to modulation.

int agc_crcf_unlock(agc_crcf _q)

Unlock agc object, and allow amplitude correction to resume.

int agc_crcf_is_locked(agc_crcf _q)

Get lock state of agc object

int agc_crcf_set_bandwidth(agc_crcf _q, float _bt)

Set loop filter bandwidth: attack/release time.

  • _q : automatic gain control object
  • _bt : bandwidth-time constant, 0 < _bt

float agc_crcf_get_bandwidth(agc_crcf _q)

Get the agc object's loop filter bandwidth.

float agc_crcf_get_signal_level(agc_crcf _q)

Get the input signal's estimated energy level, relative to unity. The result is a linear value.

int agc_crcf_set_signal_level(agc_crcf _q, float _x2)

Set the agc object's estimate of the input signal by specifying an explicit linear value. This is useful for initializing the agc object with a preliminary estimate of the signal level to help gain convergence.

  • _q : automatic gain control object
  • _x2 : signal level of input, 0 < _x2

float agc_crcf_get_rssi(agc_crcf _q)

Get the agc object's estimated received signal strength indication (RSSI) on the input signal. This is similar to getting the signal level (above), but returns the result in dB rather than on a linear scale.

int agc_crcf_set_rssi(agc_crcf _q, float _rssi)

Set the agc object's estimated received signal strength indication (RSSI) on the input signal by specifying an explicit value in dB.

  • _q : automatic gain control object
  • _rssi : signal level of input [dB]

float agc_crcf_get_gain(agc_crcf _q)

Get the gain value currently being applied to the input signal (linear).

int agc_crcf_set_gain(agc_crcf _q, float _gain)

Set the agc object's internal gain by specifying an explicit linear value.

  • _q : automatic gain control object
  • _gain : gain to apply to input signal, 0 < _gain

float agc_crcf_get_scale(agc_crcf _q)

Get the ouput scaling applied to each sample (linear).

int agc_crcf_set_scale(agc_crcf _q, float _scale)

Set the agc object's output scaling (linear). Note that this does affect the response of the AGC.

  • _q : automatic gain control object
  • _scale :

int agc_crcf_init(agc_crcf _q, float complex * _x, unsigned int _n)

Estimate signal level and initialize internal gain on an input array.

  • _q : automatic gain control object
  • _x : input data array, shape: (_n, 1)
  • _n : number of input, output samples

int agc_crcf_squelch_enable(agc_crcf _q)

Enable squelch mode.

int agc_crcf_squelch_disable(agc_crcf _q)

Disable squelch mode.

int agc_crcf_squelch_is_enabled(agc_crcf _q)

Return flag indicating if squelch is enabled or not.

int agc_crcf_squelch_set_threshold(agc_crcf _q, float _thresh)

Set threshold for enabling/disabling squelch.

  • _q : automatic gain control object
  • _thresh : threshold for enabling squelch [dB]

float agc_crcf_squelch_get_threshold(agc_crcf _q)

Get squelch threshold (value in dB)

int agc_crcf_squelch_set_timeout(agc_crcf _q, unsigned int _timeout)

Set timeout before enabling squelch.

  • _q : automatic gain control object
  • _timeout : timeout before enabling squelch [samples]

unsigned int agc_crcf_squelch_get_timeout(agc_crcf _q)

Get squelch timeout (number of samples)

int agc_crcf_squelch_get_status(agc_crcf _q)

Get squelch status (e.g. LIQUID_AGC_SQUELCH_TIMEOUT)