This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problems with Hand Set Echo cancellation in AEC3254.

Other Parts Discussed in Thread: TLV320AIC3254EVM-K

Hi,
we are following "AIC3254 Acoustic Echo Cancellation" document that can be found under "C:\Program Files\Texas Instruments Inc\PurePath Studio Portable Audio\ApplicationNotes".
In our case, we are trying to test Hands Set echo cancellation as it is stated in page 17 of this document, chapter 5.1.

It turns out that when we disable all AEC paramters (as seen in Table 3) and try to determine the DAC digital PGA gain so that it provides sufficient loudness at the speaker output, no matter what DAC digital PGA gain we use that the sound will always be choppy and distorted.

Here is an image which shows AEC parameters are disabled in AIC3254_AEC_32_1 process flow:






To test this feature, the following points have been regarded:
- We are using TLV320AIC3254EVM-K board.
- We are using a PC under Windows XP.
- We play the following file to test the proper value of DAC digital PGA gain using VLC: http://www.nch.com.au/acm/8k16bitpcm.wav
- When AEC_32 algorithm has been loaded in the codec we open AIC3254 CS software and tune DAC digital PGA gain as stated in page 18 of  "AIC3254 Acoustic Echo Cancellation" application note.

  • Moreover, in page 18, chapter 5.1 4 c) of the same application note (AIC3254 Acoustic Echo Cancellation),  it says "Determine the ADC analog PGA gain that provides sufficient signal level at the I2S output. It is suggested to start with an ADC PGA gain of about 30dB".

    I am using "Sound recorder" in Windows XP with my microphone conectected to J5 and I can't record anything despite of changing ADC PGA gain using AIC3254 CS.

    Do you know what could be wrong? Remember I am using TLV320AIC3254EVM-K board connected using USB to my Windows PC.

    Thank you.

  • Javier:

    Sorry you are having issues with this process flow.  Can you provide detailed information regarding the process flow you are using, the version of PPS and also provide a sample of the output signal when it is choppy and distorted?  Here are some questions that may help direct us to the source of the problem.  Does the process flow appear to operate correctly when AEC is enabled? What do you hear when you use the default property settings (i.e. before disabling AEC)?   Is the EVM firmware configured for 8kHz?

    Thanks,

    Brent

  • Thank you for your answer. Here is all the information you requested:

    - Process flow used: AIC3254_AEC_32_1
    - Version of PPS: version 3.20 build 1 revision 8286
    - Sample of the output signal when it is choppy and distorted. Measured at HPL (TP11) with default AGC parameters:

    - With default AEC parameters the sound is still choppy and distorted:

    - The firmware of EVM seems to be configured at 44.1KHz instead of 8KHz as it has been measured at WCLK (TP21), just after loading AIC3254_AEC_32_1 process flow:

    Maybe this is the problem. I thought this process flow modified sample frequency of the codec. How can I modify EVM firmware to operate at 8KHz without breaking AGC algorithm loaded by PPS?

     

    Thank you.

  • Javier:

    The process flow sample rate etablishes the appropriate coefficients, but does not automatically update the EVM sample rate to match.  Update PPS - Portable audio to the latest version at: http://pps.ext.ti.com. The latest version should automatically detect that the EVM sample rate (44.1kHz) does not match the process flow sample rate (8kHz) and guide you through updating the EVM to 8kHz. It is a simple process. Reply if you have any further questions on changing the EVM sample rate or require additional support for running the AEC process flow after you have updated PPS. I will be glad to help you.

    Best Regards,

    Brent

  • Hi, thank you for your guidelines.

    I am now able to listen and record audio properly. However, in the tuning process described in the application note "AIC3254 Acoustic Echo Cancellation", on page19, part d, it says "Measure the I2S input and output signal levels. These will be used to set some tuning parameter later".

    I wonder if by I2S input signal it means TP20 (DIN to the codec) and by I2S output signal it means TP21 (DOUT from the codec). Those are digital signals, aren't they? I just want to confirm.

     

    Also, is this algorithm capable of canceling echo when level of this echo is greater than the local signal itself?

     

    Thank you.

     

     

  • Hello Javier:

    Good questions!  In part (d) the digital input and output levels should be measured.  Since it is a digital measurement it is measured relative to the maximum signal level and is in decibels (dB). The digital input can be measured at DIN (TP20) while the digital output can be measured at DOUT (TP19).   

    The condition you describe is double talk.  When there are signals at both the uplink and downlink the the nonlinear processor (NLP) applies attenuation to both signals based on the NLP_Gs_DT and NLP_Gr_DT settings respectively. The NLP_Gr_DT setting should be set to prevent this scenario from occuring.

    Please reply if you  have additional questions.  I will be in a couple of days next week during the holidays.

    Best Regards,

    Brent

  • Javier:

    After writing the previous post I realized I did not make it clear that while TP19 and TP20 are test points for the digital input and output pins they cannot be connected to an analog scope or logic analyzer to determine the signal level. I think you understand that, but I meant to add that comment to my post but forgot to include it.  I want to make sure you do not use your time to measure a digital signal with analog equipment.  It may be easiest if you can measure the levels at the digital source or sink device. Otherwise, connect an AP or other digital test equipment with a digital input to take the measurement. You will need to also connect the word clock and bit clock to take the measurement s.  I apologize if this was already understood. 

     

    Best Regards,

    Brent

  • Thank you for your answers, now it is quite clear.

    First of all, I would like to clarify that, besides the title of this post, I am currently trying audio settings for hands free operation (HF). In fact, our situation is that of a strong speaker-microphone coupling.

    Thanks to the information given in this post I have managed to adjust the AEC algorithm to achieve the goal which I consider is the best this algorithm can do: almost perfect echo cancellation in far end only and high attenuation in double-talk.


    However, after several tries, I have only achieved two scenarios:

    1. Half-duplex.
    2. Partial-duplex with very poor stability, i.e. when someone at the near end shouts or makes a loud sound the algorithm sends distorted and disgusting sounds to the far end. The same effect can be achieved unplugging and plugging the audio jack at the near end. The audio codec needs to be programmed again to recover from this state.

    I am not sure if we are pushing the algorithm to its limit or what can be the problem. Any suggestion is welcome.

  • As we were waiting for a response, we have been trying a new HF configuration with good speaker-microphone separation.

    After the tunning process described in chapter 5.2 the following parameters are being used for AEC:

    1. Faster Step Size (mu_step):            477568
    2. Slower Step Size (mu_step_slow):       0
    3. CC threshold (CC Threshold):    0
    4. Coupling Loss (CL):                0.25
    5. NLP Rx Attenuation in DT (NLP_Gr_DT):    0.70794582366943359375
    6. NLP Tx Attenuation in DT (NLP_Gs_DT):    0.70794582366943359375
    7. NLP Tx Attenuation in FE (NLP_Gs_FE):    0.29999999523162841796875
    8. NLP Rx/Tx Attenuation in IDLE (NLP_G_IDLE):    0.70794677734375
    9. CNG filter B0 (CNG_b0):            0.259735107421875
    10. CNG filter A1 (CNG_a1):            1.6629831790924072265625
    11. CNG filter A2 (CNG_a2):            -0.809999942779541015625

    NOTE: all values are in decimal format.

    With these parameters, we have a decent full-duplex AEC during far-end only and during double-talk. However, the following phenomena make the algorithm stop canceling echo and begin to amplify it instead:

    1. Sneeze, or make a loud sudden sound in front of the microphone of the far end.
    2. Double-talk during several seconds.
    3. Unplug and plug the microphone at the near end.
    4. Power off and power on the microphone at the far end.

    The only way to make the codec to cancel echo again is to re-program it.

    Is this behavior a limitation of the AEC algorithm or can it be solved tuning some parameter?

    Thank you.

     

  • Javier:

    I am glad to see you are making good progress!

    In the hands-free mode with very strong mic/speaker coupling you should be able to configure the NLP algorithm to either terminal type 2c or 3. It is probably not possible to achieve the other types if the coupling is very strong.  NLP_Gr_DT and NLP_Gs_DT should be reduced, otherwise you will hear an echo during double-talk.  Also, reducing the mu-step will help to eliminate divergence and it is also recommended that you optimize the coupling loss parameter as noted in the tuning section of the applications note.  Note that if the filters diverge re-setting is required to re-establish operation. Coupling loss affects decision making in the NLP algorithm i.e. between far-end only and double talk.  If NLP has mis-classified the mode during double talk due to a mis-setting of the coupling loss parameter, it will adapt the filter during double talk and may cause divergence even if mu-step is lowered.  Focus on the coupling loss parameter initially and make sure it is correct before setting up the NLP parameters. 

    Best Regards,

    Brent