10 #include "aec_state.h"
75 uint8_t *main_mem_pool,
76 uint8_t *shadow_mem_pool,
77 unsigned num_y_channels,
78 unsigned num_x_channels,
79 unsigned num_main_filter_phases,
80 unsigned num_shadow_filter_phases);
140 unsigned start_offset,
211 unsigned recalc_bin);
429 unsigned num_x_channels,
431 unsigned start_offset,
433 int32_t bypass_enabled);
455 const uint32_t *mapping,
457 uint32_t desired_index,
458 uint32_t min_headroom);
469 const uint32_t *mapping,
471 uint32_t desired_index,
472 uint32_t min_headroom);
#define AEC_FRAME_ADVANCE
AEC frame size This is the number of samples of new data that the AEC works on every frame....
Definition: aec_defines.h:53
void aec_calc_output(aec_state_t *state, int32_t(*output)[AEC_FRAME_ADVANCE], unsigned ch)
Calculate AEC filter output signal.
void aec_calc_normalisation_spectrum(aec_state_t *state, unsigned ch, unsigned is_shadow)
Calculate normalisation specturm.
void aec_update_X_fifo_1d(aec_state_t *state)
Update the X FIFO alternate BFP structure.
void aec_calc_T(aec_state_t *state, unsigned y_ch, unsigned x_ch)
Calculate the parameter T
void aec_inverse_fft(bfp_s32_t *output, bfp_complex_s32_t *input)
Calculate inverse Discrete Fourier Transform (DFT) of an input spectrum.
void aec_frame_init(aec_state_t *main_state, aec_state_t *shadow_state, const int32_t(*y_data)[AEC_FRAME_ADVANCE], const int32_t(*x_data)[AEC_FRAME_ADVANCE])
Initialise AEC data structures for processing a new frame.
void aec_reset_state(aec_state_t *main_state, aec_state_t *shadow_state)
Reset parts of aec state structure.
void aec_calc_time_domain_ema_energy(float_s32_t *ema_energy, const bfp_s32_t *input, unsigned start_offset, unsigned length, const aec_config_params_t *conf)
Calculate exponential moving average (EMA) energy of a time domain (TD) vector.
void aec_init(aec_state_t *main_state, aec_state_t *shadow_state, aec_shared_state_t *shared_state, uint8_t *main_mem_pool, uint8_t *shadow_mem_pool, unsigned num_y_channels, unsigned num_x_channels, unsigned num_main_filter_phases, unsigned num_shadow_filter_phases)
Initialise AEC data structures.
void aec_filter_adapt(aec_state_t *state, unsigned y_ch)
Update filter.
void aec_calc_Error_and_Y_hat(aec_state_t *state, unsigned ch)
Calculate error spectrum and estimated mic signal spectrum.
void aec_update_X_fifo_and_calc_sigmaXX(aec_state_t *state, unsigned ch)
Update X FIFO with the current X frame.
void aec_calc_X_fifo_energy(aec_state_t *state, unsigned ch, unsigned recalc_bin)
Calculate total energy of the X FIFO.
void aec_compare_filters_and_calc_mu(aec_state_t *main_state, aec_state_t *shadow_state)
Compare and update filters. Calculate the adaption step size mu.
uint32_t aec_detect_input_activity(const int32_t(*input_data)[AEC_FRAME_ADVANCE], float_s32_t active_threshold, int32_t num_channels)
Detect activity on input channels.
float_s32_t aec_calc_corr_factor(aec_state_t *state, unsigned ch)
Calculate a correlation metric between the microphone input and estimated microphone signal.
void aec_calc_freq_domain_energy(float_s32_t *fd_energy, const bfp_complex_s32_t *input)
Calculate energy in the spectrum.
void aec_calc_coherence(aec_state_t *state, unsigned ch)
Calculate coherence.
float_s32_t aec_calc_max_input_energy(const int32_t(*input_data)[AEC_FRAME_ADVANCE], int num_channels)
Calculate the energy of the input signal.
void aec_forward_fft(bfp_complex_s32_t *output, bfp_s32_t *input)
Calculate Discrete Fourier Transform (DFT) spectrum of an input time domain vector.
void aec_l2_calc_Error_and_Y_hat(bfp_complex_s32_t *Error, bfp_complex_s32_t *Y_hat, const bfp_complex_s32_t *Y, const bfp_complex_s32_t *X_fifo, const bfp_complex_s32_t *H_hat, unsigned num_x_channels, unsigned num_phases, unsigned start_offset, unsigned length, int32_t bypass_enabled)
Calculate Error and Y_hat for a channel over a range of bins.
void aec_l2_adapt_plus_fft_gc(bfp_complex_s32_t *H_hat_ph, const bfp_complex_s32_t *X_fifo_ph, const bfp_complex_s32_t *T_ph)
Adapt one phase of the adaptive filter.
void aec_l2_bfp_s32_unify_exponent(bfp_s32_t *chunks, int32_t *final_exp, uint32_t *final_hr, const uint32_t *mapping, uint32_t array_len, uint32_t desired_index, uint32_t min_headroom)
Unify bfp_s32_t chunks into a single exponent and headroom.
void aec_l2_bfp_complex_s32_unify_exponent(bfp_complex_s32_t *chunks, int32_t *final_exp, uint32_t *final_hr, const uint32_t *mapping, uint32_t array_len, uint32_t desired_index, uint32_t min_headroom)
Unify bfp_complex_s32_t chunks into a single exponent and headroom.
AEC control parameters.
Definition: aec_state.h:128
AEC shared state structure.
Definition: aec_state.h:168
[aec_shared_state_t]
Definition: aec_state.h:259
[bfp_s16_t]
Definition: xs3_math_types.h:340
A block floating-point vector of 32-bit elements.
Definition: xs3_math_types.h:276
A floating-point scalar with a 32-bit mantissa.
Definition: xs3_math_types.h:167