XCORE SDK
XCORE Software Development Kit
Functions
ADEC API Functions

Functions

void adec_init (adec_state_t *state, adec_config_t *config)
 Initialise ADEC data structures. More...
 
void adec_process_frame (adec_state_t *state, adec_output_t *adec_output, const adec_input_t *adec_in)
 Perform ADEC processing on an input frame of data. More...
 
void adec_estimate_delay (de_output_t *de_output, const bfp_complex_s32_t *H_hat, unsigned num_phases)
 Estimate microphone delay. More...
 

Detailed Description

Function Documentation

◆ adec_estimate_delay()

void adec_estimate_delay ( de_output_t de_output,
const bfp_complex_s32_t H_hat,
unsigned  num_phases 
)

Estimate microphone delay.

This function measures the microphone signal delay wrt the reference signal. It does so by looking for the phase with the peak energy among all AEC filter phases and uses the peak energy phase index as the estimate of the microphone delay. Along with the measured delay, it also outputs information about the peak phase energy that can then be used to guage the AEC filter convergence and the reliability of the measured delay.

Parameters
[out]de_stateDelay estimator output structure
[in]H_hatbfp_complex_s32_t array storing the AEC filter spectrum
[in]Numberof phases in the AEC filter

◆ adec_init()

void adec_init ( adec_state_t state,
adec_config_t config 
)

Initialise ADEC data structures.

This function initialises ADEC state for a given configuration. It must be called at startup to initialise the ADEC data structures before processing any frames, and can be called at any time after that to reset the ADEC instance, returning the internal ADEC state to its defaults.

Parameters
[out]statePointer to ADEC state structure
[in]configPointer to ADEC configuration structure.
Example with ADEC configured for delay estimation only at startup
adec_state_t adec_state;
adec_config_t adec_conf;
adec_conf.bypass = 1; // Bypass automatic DE correction
adec_conf.force_de_cycle_trigger = 1; // Force a delay correction cycle, so that delay correction happens once after initialisation
adec_init(&adec_state, &adec_conf);
// Application needs to ensure that adec_state->adec_config.force_de_cycle_trigger is set to 0 after ADEC has requested a transition to delay estimation mode once in order to ensure that delay is corrected only at startup.
void adec_init(adec_state_t *state, adec_config_t *config)
Initialise ADEC data structures.
ADEC configuration structure.
Definition: adec_state.h:38
int32_t force_de_cycle_trigger
Definition: adec_state.h:45
int32_t bypass
Definition: adec_state.h:41
ADEC state structure.
Definition: adec_state.h:124
Example with ADEC configured for automatic delay estimation and correction
adec_state_t adec_state;
adec_conf.bypass = 0;
adec_conf.force_de_cycle_trigger = 0;
adec_init(&adec_state, &adec_conf);

◆ adec_process_frame()

void adec_process_frame ( adec_state_t state,
adec_output_t adec_output,
const adec_input_t adec_in 
)

Perform ADEC processing on an input frame of data.

This function takes information about the latest AEC processed frame and the latest measured delay estimate as input, and decides if a delay correction between input microphone and reference signals is required. If a correction is needed, it outputs a new requested input delay, optionally accompanied with a request for AEC restart in a different configuration. It updates the internal ADEC state structure to reflect the current state of the ADEC process.

Parameters
[in,out]stateADEC internal state structure
[out]adec_outputADEC output structure
[in]adec_inADEC input structure