Automatic Delay Estimation & Correction (ADEC)

The ADEC module automatically corrects for possible delay offsets between the reference and the loudspeakers.

Echo cancellation is an adaptive filtering process which compares the reference audio to that received from the microphones. It models the reverberant time of a room, i.e. the time it takes for acoustic reflections to decay to insignificance. This is shown in the figure below (the red “Acoustic echo path delay”).

The time window modelled by the AEC is finite (filter tail length), and to maximise its performance it is important to ensure that the reference audio is presented to the AEC time aligned to the audio being reproduced by the loudspeakers. The diagram below highlights how the reference audio path delay and the audio reproduction path may be significantly different, therefore requiring additional delay to be inserted into one of the two paths, correcting this delay difference.


Fig. 13 ADEC use case diagram

The functional blocks in the ADEC are shown below:


Fig. 14 ADEC block diagram

Delay corrections may be applied to either microphone or reference path, to cope with reference or loudspeaker being ahead of the other, accomplished by switching the delay into either the microphone channel or the reference channel.

Automatic delay estimation is triggered at power-up, or if the host system configuration changes. The process will not begin until the reference signal is present and has sufficient energy.

The delay estimation process re-purposes the AEC to detect larger delays. During estimation, the AEC does not perform cancellation. Once the delay is detected, and delay correction made the AEC restarts and converges based on the delayed signals.

Possible causes that may trigger an estimation cycle (where automatic mode is enabled):

  • Host changing applications causing a delay change between speakers and reference

  • Large volume changes between the reference and the loudspeaker play-back

  • User equipment changes, such as switching from TV audio output to playing the audio through a sound bar.

The characteristics and specification of the ADEC function is shown below:

Table 14 ADEC characteristics




Maximum delay correction

± 150ms

The maximum delay that can be added to either the microphone channel or the reference channel.

Estimation time

With good reference SNR: 2-5 seconds

During this time AEC is disabled. Note that estimation will not start unless reference is available and loudspeakers are playing back.

The configuration commands are shown below:

Table 15 Automatic Delay Estimator parameters








[0 .. 2399]

Change the number of samples of input delay at the sample rate 16kHz. The delay is applied to either the reference or the microphone input according to the delay direction. This provides a maximum delay of +/- 150mS.




0 - Delay the reference input (default)
1 - Delay the microphone input

Select the direction of input delay. i.e. it is applied to either the microphone input path or the reference signal path.




[0 .. 7200]

Get an estimate of the number of samples of delay on the reference input at a sample rate of 16kHz. This value is valid only when a delay estimation is in progress and is offset by the maximum length of the delay buffer (2400 samples). Add 2400 samples to this value to get the absolute delay estimate.



[0, 1]
0 - ADEC disabled
1 - ADEC enabled

Enable automatic delay control.



0 - Normal AEC mode
1 - delay estimation in progress

Get the status of delay estimation.



Trigger a delay estimation cycle. The default behavior in firmware is to trigger a delay estimation cycle when the far end reference is detected for the first time after device reset. This is done irrespective of whether automatic delay control is enabled or disabled. To disable this initial delay estimation, set SET_MANUAL_ADEC_CYCLE_TRIGGER=0 in the data partition. For all other times, if delay estimation is disabled, the SET_MANUAL_ADEC_CYCLE_TRIGGER can be used to force a delay estimation cycle.



Get current AEC filter coefficients peak to average ratio. If this value is above 4, the AEC has a “good” peak to average ratio.


[A] When the ADEC is enabled, this value will be overwritten, therefore the SET commands should not be used. GET commands remain valid.