XCORE SDK
XCORE Software Development Kit
Functions
AGC API functions

Functions

void agc_init (agc_state_t *agc, agc_config_t *config)
 Initialise the AGC. More...
 
void agc_process_frame (agc_state_t *agc, int32_t output[AGC_FRAME_ADVANCE], const int32_t input[AGC_FRAME_ADVANCE], agc_meta_data_t *meta_data)
 Perform AGC processing on a frame of input data. More...
 

Detailed Description

Function Documentation

◆ agc_init()

void agc_init ( agc_state_t agc,
agc_config_t config 
)

Initialise the AGC.

This function initialises the AGC state with the provided configuration. It must be called at startup to initialise the AGC before processing any frames, and can be called at any time after that to reset the AGC instance, returning the internal AGC state to its defaults.

Parameters
[out]agcAGC state structure
[in]configInitial configuration values
Example with an unmodified profile
void agc_init(agc_state_t *agc, agc_config_t *config)
Initialise the AGC.
#define AGC_PROFILE_ASR
AGC profile tuned for Automatic Speech Recognition (ASR).
Definition: agc_profiles.h:27
AGC state structure.
Definition: agc_api.h:103
Example with modification to the profile
agc_init(&agc, &conf);
#define AGC_PROFILE_FIXED_GAIN
AGC profile tuned to apply a fixed gain.
Definition: agc_profiles.h:59
float_s32_t float_to_float_s32(const float x)
Convert an IEEE754 float to a float_s32_t.
Definition: xs3_scalar_float_s32.c:44
AGC configuration structure.
Definition: agc_api.h:38
float_s32_t gain
Definition: agc_api.h:49

◆ agc_process_frame()

void agc_process_frame ( agc_state_t agc,
int32_t  output[AGC_FRAME_ADVANCE],
const int32_t  input[AGC_FRAME_ADVANCE],
agc_meta_data_t meta_data 
)

Perform AGC processing on a frame of input data.

This function updates the AGC's internal state based on the input frame and meta-data, and returns an output containing the result of the AGC algorithm applied to the input.

The input and output pointers can be equal to perform the processing in-place.

Parameters
[in,out]agcAGC state structure
[out]outputArray to return the resulting frame of data
[in]inputArray of frame data on which to perform the AGC
[in]meta_dataMeta-data structure with VAD/AEC data
Example
int32_t input[AGC_FRAME_ADVANCE];
int32_t output[AGC_FRAME_ADVANCE];
agc_meta_data md;
md.vad_flag = AGC_META_DATA_NO_VAD;
md.aec_ref_power = AGC_META_DATA_NO_AEC;
md.aec_corr_factor = AGC_META_DATA_NO_AEC;
agc_process_frame(&agc, output, input, &md);
#define AGC_FRAME_ADVANCE
Length of the frame of data on which the AGC will operate.
Definition: agc_api.h:26
#define AGC_META_DATA_NO_VAD
Definition: agc_api.h:185
#define AGC_META_DATA_NO_AEC
Definition: agc_api.h:201
void agc_process_frame(agc_state_t *agc, int32_t output[AGC_FRAME_ADVANCE], const int32_t input[AGC_FRAME_ADVANCE], agc_meta_data_t *meta_data)
Perform AGC processing on a frame of input data.