Automatic gain control (agc) for level correction and signal detection
Public Functions
agc_rrrf | agc_rrrf_create( |
agc_rrrf | agc_rrrf_copy( |
int | agc_rrrf_destroy( |
int | agc_rrrf_print( |
int | agc_rrrf_reset( |
int | agc_rrrf_execute( |
int | agc_rrrf_execute_block( |
int | agc_rrrf_lock( |
int | agc_rrrf_unlock( |
int | agc_rrrf_is_locked( |
int | agc_rrrf_set_bandwidth( |
float | agc_rrrf_get_bandwidth( |
float | agc_rrrf_get_signal_level( |
int | agc_rrrf_set_signal_level( |
float | agc_rrrf_get_rssi( |
int | agc_rrrf_set_rssi( |
float | agc_rrrf_get_gain( |
int | agc_rrrf_set_gain( |
float | agc_rrrf_get_scale( |
int | agc_rrrf_set_scale( |
int | agc_rrrf_init( |
int | agc_rrrf_squelch_enable( |
int | agc_rrrf_squelch_disable( |
int | agc_rrrf_squelch_is_enabled( |
int | agc_rrrf_squelch_set_threshold( |
float | agc_rrrf_squelch_get_threshold( |
int | agc_rrrf_squelch_set_timeout( |
unsigned int | agc_rrrf_squelch_get_timeout( |
int | agc_rrrf_squelch_get_status( |
Interfaces
agc_rrrf agc_rrrf_create(
Create automatic gain control object.
agc_rrrf agc_rrrf_copy(
Copy object including all internal objects and state
int agc_rrrf_destroy(
Destroy object, freeing all internally-allocated memory.
int agc_rrrf_print(
Print object properties to stdout, including received signal strength indication (RSSI), loop bandwidth, lock status, and squelch status.
int agc_rrrf_reset(
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_rrrf_execute(
Execute automatic gain control on an single input sample
- _q : automatic gain control object
- _x : input sample
- _y : output sample
int agc_rrrf_execute_block(
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_rrrf_lock(
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_rrrf_unlock(
Unlock agc object, and allow amplitude correction to resume.
int agc_rrrf_is_locked(
Get lock state of agc object
int agc_rrrf_set_bandwidth(
Set loop filter bandwidth: attack/release time.
- _q : automatic gain control object
- _bt : bandwidth-time constant, 0 < _bt
float agc_rrrf_get_bandwidth(
Get the agc object's loop filter bandwidth.
float agc_rrrf_get_signal_level(
Get the input signal's estimated energy level, relative to unity. The result is a linear value.
int agc_rrrf_set_signal_level(
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_rrrf_get_rssi(
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_rrrf_set_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_rrrf_get_gain(
Get the gain value currently being applied to the input signal (linear).
int agc_rrrf_set_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_rrrf_get_scale(
Get the output scaling applied to each sample (linear).
int agc_rrrf_set_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_rrrf_init(
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_rrrf_squelch_enable(
Enable squelch mode.
int agc_rrrf_squelch_disable(
Disable squelch mode.
int agc_rrrf_squelch_is_enabled(
Return flag indicating if squelch is enabled or not.
int agc_rrrf_squelch_set_threshold(
Set threshold for enabling/disabling squelch.
- _q : automatic gain control object
- _thresh : threshold for enabling squelch [dB]
float agc_rrrf_squelch_get_threshold(
Get squelch threshold (value in dB)
int agc_rrrf_squelch_set_timeout(
Set timeout before enabling squelch.
- _q : automatic gain control object
- _timeout : timeout before enabling squelch [samples]
unsigned int agc_rrrf_squelch_get_timeout(
Get squelch timeout (number of samples)
int agc_rrrf_squelch_get_status(
Get squelch status (e.g. LIQUID_AGC_SQUELCH_TIMEOUT)