Echo Cancellation with negative echo tail
- On May 7, 2017
- Acoustic Echo Cancellation, echo tail
Background
Echo path/tail is one of the most fundamental parameters when performing echo cancellation. In previous posts, we elaborated on the importance of echo tail and we also provided a Do It Yourself (DIY) method to calculate the echo tail. In most usage scenarios, the value of the echo tail will be a positive one and will range between few milli-seconds up to few hundred milli-seconds. This post discusses the scenario in which you find out this value is a negative one.
What does a negative value mean?
From mathematical point of view the answer is very simple. A negative value means that the audio segment that contains an echo, is seen before the source of the echo is seen. For example the echo of the letter “A” is seen before the letter “A” itself is seen. From physical point of view, such a behavior indicate on a problem in the observation mechanism since surely the letter “A” was played to the speakers before the echo of “A” was captured by the microphone. In other words, you first need to play the audio before you can hear its echo. Negative echo tail means there is a contradiction between the measured/observed value to the real occurrences in the field. You have measured a negative value but you know that in reality the value should be positive. Your measured value is an illusion and not the real value. Like the below optical illusion – your eyes observe movements but you know that in reality the picture is steady as a rock.
What can cause a negative value?
By now we understand that a negative value indicates that there is something wrong in the way we observe the system. But what? The answer depends on the nature of your application.
Unmanaged audio devices
Some applications do not directly control the audio that is being played to the speakers or the audio that is being captured from the microphone. These applications are usually notified, using some trigger, on the audio streams but they do not have real-time control over the audio buffers and its timing. For these application, a negative echo tail usually means that they have some bias in timing for receiving and processing the audio data. The source of this bias depends on the system and environment but it should be identified and corrected. Alternatively, some compensation mechanism should be added.
Uncorrelated audio streams
Many application have different threads for handling the rendered audio and the captured audio. In these cases, a negative echo tail usually means that buffer handling is not balanced. For example, the captured audio buffer is processed until its empty while the rendered audio buffer contains significant amount of data that was not processed yet. As a result, a negative echo tail will be observed during processing. The common solution in this case is to make sure that buffer processing is balanced between the two threads.
Conclusion
When a negative echo tail is detected in your system, this is sign that something is wrong in the audio processing of your system. You should find the source of the problem and fix it in order for echo cancellation to work. Alternatively a compensation mechanism can be provided. In our next post on this topic, we will discuss the acceptable range for a positive echo tail in multiple usage scenarios.