xmos / fwk_voice

Voice Framework
Other
11 stars 19 forks source link

Some open issues related to ADEC testing #159

Closed shuchitak closed 2 years ago

shuchitak commented 2 years ago

While testing sw_avona adec module using the ADEC tests ported from lib_audio_pipelines (https://github.com/xmos/lib_audio_pipelines/tree/develop/tests/test_delay_estimator_controller), I found some issues that I've described here.

I have 3 failing tests on sw_avona ADEC. rapid_changes - False negatives small_mic_increase - False positives delay_at_start - False positives.

While debugging these failures, I realised that 3610 lib_aec calculates inverse_X_energy normDenom in a slightly different way than the python model. 3610 lib_aec: https://github.com/xmos/lib_aec/blob/develop/lib_aec/src/aec_calc_inv_energy_params.xc#L59 python model: https://github.com/xmos/py_aec/blob/develop/py_aec/aec.py#L581

So there's an extra factor of 2 that is multiplied to X_energy to do norm_denom = **2**X_energy + sigma_xxgamma. When I add this multiplication by 2 factor in sw_avona lib_aec, the ADEC tests pass. If I remove this factor of 2 from 3610, lib_aec code, I see the 3 ADEC tests failures in lib_audio_pipelines as well.

I'm not sure how this discrepancy wrt python model got implemented in the first place. I don't recall adding an extra multiplication while implementing 3610 lib_aec and I maybe the python itself had the factor of 2 at some point?

When I run lib_audio_pipelines full keyword tests with and without this factor of 2 multiplication the results don't show any significant difference so both implementations seem okay.

While debugging these failing ADEC tests, here's what I found:

Conclusion: