AGC (Automatic Gain Control)

Supported ICs

Overview

Automatic gain control is one of the AFE’s functions, to adjust the amplitude of the output audio.

Algorithm Description

The AGC in AIVoice consists of two submodules: Fixed gain and Adaptive AGC:

  • Fixed Gain

    • Speech recognition: When the output signal amplitude obviously affects the KWS or ASR effect, the AGC module can be enabled to apply the appropriate gain.

    • Voice communication: Except for special requirements, thefixed gain needs to be enabled.

  • Adaptive AGC

    • Speech recognition: Not supported.

    • Voice communication: Except for special requirements, theadaptive AGC needs to be enabled.

Configurations

The complete AFE configuration file is located at ${aivoice_lib_dir}/include/aivoice_afe_config.h. The AGC-related configurations include:

afe_mode_e afe_mode;                    // AFE mode, for ASR or voice communication.
bool enable_agc;                        // AGC(Automation Gain Control) module switch

// AGC module parameter
int agc_fixed_gain;                     // AGC fixed gain(dB) applied on AFE output, the value should be in [0, 18].
bool enable_adaptive_agc;               // adaptive AGC switch. Only supports voice communication mode.

When adjusting the AGC_fixed_gain parameter, ensure that the processed signal is not clipped under maximum speech volume conditions.