Skip to content

Conversation

@Allan-xmos
Copy link
Collaborator

No description provided.

@Allan-xmos Allan-xmos force-pushed the feature/aec_erle branch 3 times, most recently from 42aa624 to 149d4dc Compare November 3, 2025 12:49
fix calc coherence

avoid calling bfp_use_exponent in unify_exponent if length is 0

fix compare filters test

only check unity prints for unity test report

correct deinterleaveing typo in wav file,
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces ERLE (Echo Return Loss Enhancement) based adaptation control and reference activity detection to the AEC algorithm, along with refactoring of AGC meta-data initialization and various fixes.

Key changes:

  • Adds ERLE calculation and moving average tracking to control filter adaptation alongside coherence
  • Introduces ref_active_flag to track reference signal activity across the system
  • Refactors AGC meta-data initialization to use a new agc_meta_data_init() helper function
  • Updates configuration parameters including coherence thresholds and timer behavior
  • Fixes logic bugs in L2 unification and test parsing

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
modules/lib_aec/api/aec_state.h Adds ERLE fields to coherence_mu_params_t, ref_active_flag and overall_Yhat to shared state, removes x_energy_thresh
modules/lib_aec/src/aec_priv_impl.c Implements aec_priv_calc_erle(), updates calc_coherence_mu logic with ERLE and ref_active_flag, changes coherence threshold values
modules/lib_aec/src/aec_priv.h Adds function declarations for new ERLE calculation and updated signatures
modules/lib_aec/src/aec_impl.c Integrates ERLE calculation into filter comparison workflow
modules/lib_aec/src/aec_l2_impl.c Simplifies conditional logic in bfp_s32_unify_exponent
modules/lib_agc/api/agc_api.h Adds agc_meta_data_init() declaration, AGC_META_DATA_NO_REF define, updates documentation
modules/lib_agc/src/agc_impl.c Implements agc_meta_data_init() function
examples/bare-metal//src/.c Updates to use agc_meta_data_init() and set ref_active_flag
test/lib_agc/test_process_frame/src/*.c Replaces manual meta-data initialization with agc_meta_data_init()
test/lib_aec/aec_unit_tests/src/*.c Updates test reference models with ERLE calculation and ref_active_flag handling
test/lib_aec/aec_unit_tests/conftest.py Fixes test output parsing to handle lines prefixed with 'C:'
test/lib_aec/aec_unit_tests/CMakeLists.txt Adds XMATH_BFP_DEBUG_CHECK_LENGTHS flag
test/pipeline/py_pipeline/config/prev_arch.json Updates configuration with new parameters
Jenkinsfile Archives output wav files from bare-metal examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if(task == 0) {
aec_calc_freq_domain_energy(&main_state->overall_Error[ch], &main_state->Error[ch]);
// main_state->shared_state->overall_Yhat[ch] is updated
aec_calc_freq_domain_energy(&main_state->shared_state->overall_Yhat[ch], &main_state->Y_hat[ch]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this into 4 tasks or 2 tasks


/** Detect if there's activity on the reference channels*/
int32_t ref_active_flag;
ref_active_flag = aec_detect_input_activity(frame_x, f64_to_float_s32(pow(10, REF_ACTIVE_THRESHOLD_dB/20.0)), main_state.shared_state->num_x_channels);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this inside stage 1, init as -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant