|
spandsp 3.0.0
|
#include <inttypes.h>#include <stdio.h>#include <stdbool.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "spandsp/telephony.h"#include "spandsp/alloc.h"#include "spandsp/logging.h"#include "spandsp/math_fixed.h"#include "spandsp/agc_float.h"#include "spandsp/private/logging.h"#include "spandsp/private/agc_float.h"Macros | |
| #define | DC_BLOCK_COEFF 0.9921875 |
| #define | power_threshold_dbm0(len, thresh) |
Functions | |
| agcf_descriptor_t * | agcf_make_descriptor (agcf_descriptor_t *s, float signal_target_power, float signal_on_power_threshold, float signal_off_power_threshold, int signal_on_persistence_check, int signal_off_persistence_check) |
| Create an AGC descriptor. | |
| int | agcf_free_descriptor (agcf_descriptor_t *s) |
| bool | agcf_from_int16_rx (agcf_state_t *s, float out[], const int16_t in[], int len) |
| Process a block of received samples. | |
| bool | agcf_rx (agcf_state_t *s, float out[], const float in[], int len) |
| Process a block of received samples. | |
| float | agcf_get_scaling (agcf_state_t *s) |
| void | agcf_set_scaling (agcf_state_t *s, float scaling) |
| float | agcf_current_power_dbm0 (agcf_state_t *s) |
| void | agcf_set_adaption (agcf_state_t *s, bool adapt) |
| logging_state_t * | agcf_get_logging_state (agcf_state_t *s) |
| Get the logging context associated with an AGC context. | |
| agcf_state_t * | agcf_init (agcf_state_t *s, const agcf_descriptor_t *desc) |
| Initialise an AGC context. | |
| int | agcf_release (agcf_state_t *s) |
| Release an AGC receive context. | |
| int | agcf_free (agcf_state_t *s) |
| Free the resources of an ADSI receive context. | |
| #define power_threshold_dbm0 | ( | len, | |
| thresh ) |
| int agcf_free | ( | agcf_state_t * | s | ) |
Free the resources of an ADSI receive context.
| s | The ADSI receive context. |
| bool agcf_from_int16_rx | ( | agcf_state_t * | s, |
| float | out[], | ||
| const int16_t | in[], | ||
| int | len ) |
Process a block of received samples.
Process a block of received samples.
| out | The output buffer for the scaled samples. |
| in | The input buffer for the samples. |
| len | The length of the in and out buffers. |
| logging_state_t * agcf_get_logging_state | ( | agcf_state_t * | s | ) |
Get the logging context associated with an AGC context.
Get the logging context associated with an AGC context.
| s | The AGC context. |
| float agcf_get_scaling | ( | agcf_state_t * | s | ) |
Get the current scaling.
| agcf_state_t * agcf_init | ( | agcf_state_t * | s, |
| const agcf_descriptor_t * | desc ) |
Initialise an AGC context.
| s | The AGC context. |
| desc |
| agcf_descriptor_t * agcf_make_descriptor | ( | agcf_descriptor_t * | s, |
| float | signal_target_power, | ||
| float | signal_on_power_threshold, | ||
| float | signal_off_power_threshold, | ||
| int | signal_on_persistence_check, | ||
| int | signal_off_persistence_check ) |
Create an AGC descriptor.
| s | The AGC context. |
| signal_target_power | The power to normalize to, in dBm0. |
| signal_on_power_threshold | The minimum power to declare signal on, in dBm0. |
| signal_off_power_threshold | The maximum power to declare signal off, in dBm0. |
| signal_on_persistence_check | Persistence check count for signal on. |
| signal_off_persistence_check | Persistence check count for signal off. |
| int agcf_release | ( | agcf_state_t * | s | ) |
Release an AGC receive context.
| s | The ADSI receive context. |
| bool agcf_rx | ( | agcf_state_t * | s, |
| float | out[], | ||
| const float | in[], | ||
| int | len ) |
Process a block of received samples.
Process a block of received samples.
| out | The output buffer for the scaled samples. |
| in | The input buffer for the samples. |
| len | The length of the in and out buffers. |
| void agcf_set_adaption | ( | agcf_state_t * | s, |
| bool | adapt ) |
Enable or disable AGC adpation.
| void agcf_set_scaling | ( | agcf_state_t * | s, |
| float | scaling ) |
Set the scaling, instead of adapting it. This allows a known good scaling factor to be resused within a session.