Actions

Difference between revisions of "Line Echo Cancellation"

From Zenitel Wiki

(Introduction to Echo Cancellation)
(When LEC?)
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
{{A}}
 
= Introduction to Echo Cancellation=
 
= Introduction to Echo Cancellation=
 
In voice calls you will usually hear an echo of what your self are saying, due to overhearing at the far end terminal. In line-switched networks over short distances, the delay of the echo is very small, and you feel it as a natural and pleasant feedback.  
 
In voice calls you will usually hear an echo of what your self are saying, due to overhearing at the far end terminal. In line-switched networks over short distances, the delay of the echo is very small, and you feel it as a natural and pleasant feedback.  
Line 6: Line 7:
 
[http://en.wikipedia.org/wiki/Echo_cancellation Echo Cancellation] is a class of advanced signal processing techniques for reducing the echo from voice terminals. All usable Echo Cancelers use [http://en.wikipedia.org/wiki/Adaptive_filter Adaptive filters]. Echo Cancellation is needed for open duplex conversations over IP.
 
[http://en.wikipedia.org/wiki/Echo_cancellation Echo Cancellation] is a class of advanced signal processing techniques for reducing the echo from voice terminals. All usable Echo Cancelers use [http://en.wikipedia.org/wiki/Adaptive_filter Adaptive filters]. Echo Cancellation is needed for open duplex conversations over IP.
  
Echo Cancellation usually removes echo its own end of the conversation. Most networks require each end to take care of its own echo. It is best to locate the Echo Cancellation as close as possible to the terminals. Note that having good Echo Cancellation at your end, is something you need in order to be nice to your contacts. If your end has bad or none Echo Cancellation, it is not your self which suffers, directly. It is your contacts, which will find it very annoying to talk to you.
+
Echo Cancellation usually removes echo its own end of the conversation. Most networks require each end to take care of its own echo. It is best to locate the Echo Cancellation as close as possible to the terminals. Note that having good Echo Cancellation at your end, is something you need in order to be nice to your contacts. If your end has bad or none Echo Cancellation, it is not your self who suffers, directly. It is your contacts, which find it very annoying to talk to you.
  
 
== Line Echo Cancellation (LEC) ==
 
== Line Echo Cancellation (LEC) ==
Line Echo Cancellation (LEC)is a term used in telephony for Echo Cancellation on normal telephone lines. The LEC  sits in the exchange, and cancels echo due to 2-wire hybrids and acoustic overhearing in the handset. The LEC usually does not have to deal with long echo-tails.  
+
Line Echo Cancellation (LEC) is a term used in telephony for Echo Cancellation on normal telephone lines. The LEC  sits in the exchange, and cancels echo due to 2-wire hybrids and acoustic overhearing in the handset. The LEC usually does not have to deal with long echo-tails.
  
 
== Acoustic Echo Cancellation (AEC) ==
 
== Acoustic Echo Cancellation (AEC) ==
Acoustic Echo Cancellation handles acoustic echo from loudspeaking terminals. AEC has to handle the direct acoustic path from the speaker to the microphone, as well as multiple echoes from walls and ceiling in the room . AEC is usually implemented in the terminal itself, because the phone network traditionally does not take responsibility for loudspeaking terminals. AEC has to deal with long echo tails, which may change during the call, as people move around in the room. AEC is often combined with a howling suppressor, needed due to the positive feedback usually present in conversations between loudspeaking terminals.
+
Acoustic Echo Cancellation handles acoustic echo from loudspeaking terminals. AEC has to handle the direct acoustic path from the speaker to the microphone, as well as multiple echoes from walls and ceiling in the room. AEC is usually implemented in the terminal itself, because the phone network traditionally does not take responsibility for loudspeaking terminals. AEC has to deal with long echo tails, and the echo may change during the call, as people move around in the room. AEC is often combined with a howling suppressor, needed due to the positive feedback usually present in conversations between loudspeaking terminals.
  
 
AlphaCom IP stations has built-in AEC.  
 
AlphaCom IP stations has built-in AEC.  
Line 28: Line 29:
 
* Between two ASLT stations over AlphaNet, both have handset lifted. (Both exchanges must be be upgraded to 10.23!)
 
* Between two ASLT stations over AlphaNet, both have handset lifted. (Both exchanges must be be upgraded to 10.23!)
 
* Between two ASLT stations in different modules in a multimodule AlphaCom, where VoIP is used for module interconnection
 
* Between two ASLT stations in different modules in a multimodule AlphaCom, where VoIP is used for module interconnection
* Between a ASLT station with handset lifted, and a AlphaCom IP station.  
+
* Between a ASLT station with handset lifted, and a Zenitel IP station.  
 
* Between a ASLT station with handset lifted, and a SIP system.  
 
* Between a ASLT station with handset lifted, and a SIP system.  
  
Line 50: Line 51:
  
  
== Geek LEC ==
+
== DSP resources and call capacity ==
 +
By default, the echo cancellation time is set to 5 msec. In many cases, this is sufficient. The DSP has in that case enough capacity to service 10 simultaneous calls between IP on one side and an analogue intercom or telephone on the other side. Especially some telephones need a longer cancellation time, even up to 15 msec. The number of simultaneous calls then drops to 3.
 +
 
 +
Also in some MultiModule systems one might experience echo when calling between ATLB subscribers in different modules. If that is the case, one should try to increase the time to 10ms. If still echo, try 15ms.
 +
 
 +
LEC setting versus call capacity:
 +
* 5 msec up to 10 calls
 +
* 10 msec up to 6 calls
 +
* 15 msec up to 3 calls
 +
 
 +
The cancellation time can be set from the TST-console. Navigate to:
 +
ex_profile.timeouts.lec_time = 5 (0x0005)
 +
and change the LEC value as required.
 +
 
 +
Alternatively, create a startup event that sets the Line Echo Cancellation time. Create an event with the following properties:
 +
 
 +
[[File:Set Lec time.PNG]]
 +
 
 +
Action:
 +
$SNV Q5 W1 W6 W84
 +
 
 +
Time options:
 +
  Q5 = 5 msec
 +
  Q10 = 10 msec
 +
  Q15 = 15 msec
 +
 
 +
After having sent this to the exchange, a reset is required.
 +
 
 +
Note that when the DSP resources are exhausted the AlphaCom will simply set the call to voice switched duplex. The call can therefore still be established, but it will not be full duplex.
 +
 
 +
== LEC for geeks ==
  
 
The LEC algorithm in the DSP is taken from the core of [http://www.rowetel.com/ucasterisk/oslec Open Source Line Echo Canceller (OSLEC)].  
 
The LEC algorithm in the DSP is taken from the core of [http://www.rowetel.com/ucasterisk/oslec Open Source Line Echo Canceller (OSLEC)].  
Line 61: Line 92:
 
"Dual path": OSLEC uses two filters, one foreground filter, and one background filter.  
 
"Dual path": OSLEC uses two filters, one foreground filter, and one background filter.  
 
*The near end microphone signal is continuously run through the foreground filter, producing the cleaned signal to send to the far end.  
 
*The near end microphone signal is continuously run through the foreground filter, producing the cleaned signal to send to the far end.  
*The background filter is adapted most of the time, using NLMS on the microphone signals from near-end and far-end.  
+
*The background filter is adapted most of the time, using NLMS on the microphone signals from near-end and far-end.
 +
*The near end microphone signal is also run through the background filter, the result is only used in the next step:
 
*OSLEC analyzes the output of two filters. Using certain criteria OSLEC can decide that the background fiter is now performing better than the foreground filter. OSLEC will then copy the background filter coefficients to the foreground filter.
 
*OSLEC analyzes the output of two filters. Using certain criteria OSLEC can decide that the background fiter is now performing better than the foreground filter. OSLEC will then copy the background filter coefficients to the foreground filter.
 +
 +
OSLEC does '''not''' modify the far end microphone signal sent to local speaker!
 +
 +
Graph: Typical plot of the OSLEC filter after successful adaptation towards a ASLT station with handset lifted. (The filter is a estimate of echo / transfer function of the station as seen from LEC in DSP):
 +
 +
[[Image:LEC_ASLT.png]]
 +
 +
The graph confirms what we found during experiments: Insignificant echo after 5 ms. 4 ms window gives a fairly good result, and no noticeable improvement when increasing window length beyond 5 ms.
 +
 +
[[Category:AMC Software]]

Latest revision as of 09:46, 14 March 2022

AlphaCom icon 300px.png

Introduction to Echo Cancellation

In voice calls you will usually hear an echo of what your self are saying, due to overhearing at the far end terminal. In line-switched networks over short distances, the delay of the echo is very small, and you feel it as a natural and pleasant feedback.

With VoIP technologies, the transmission delay will always be significant, due to transmission in packets. Echo of your own voice with 50 to 100 ms delay can be very annoying. The longer the delay, the less returned echo power feels acceptable.

Echo Cancellation is a class of advanced signal processing techniques for reducing the echo from voice terminals. All usable Echo Cancelers use Adaptive filters. Echo Cancellation is needed for open duplex conversations over IP.

Echo Cancellation usually removes echo its own end of the conversation. Most networks require each end to take care of its own echo. It is best to locate the Echo Cancellation as close as possible to the terminals. Note that having good Echo Cancellation at your end, is something you need in order to be nice to your contacts. If your end has bad or none Echo Cancellation, it is not your self who suffers, directly. It is your contacts, which find it very annoying to talk to you.

Line Echo Cancellation (LEC)

Line Echo Cancellation (LEC) is a term used in telephony for Echo Cancellation on normal telephone lines. The LEC sits in the exchange, and cancels echo due to 2-wire hybrids and acoustic overhearing in the handset. The LEC usually does not have to deal with long echo-tails.

Acoustic Echo Cancellation (AEC)

Acoustic Echo Cancellation handles acoustic echo from loudspeaking terminals. AEC has to handle the direct acoustic path from the speaker to the microphone, as well as multiple echoes from walls and ceiling in the room. AEC is usually implemented in the terminal itself, because the phone network traditionally does not take responsibility for loudspeaking terminals. AEC has to deal with long echo tails, and the echo may change during the call, as people move around in the room. AEC is often combined with a howling suppressor, needed due to the positive feedback usually present in conversations between loudspeaking terminals.

AlphaCom IP stations has built-in AEC.

Traditional ASLT-based stations has no AEC, and the AlphaCom itself does not support AEC on VOIP calls. Loudspeaking VoIP conversations to a ASLT station has to go in switched duplex.

Line Echo Cancellation in AlphaCom

Line Echo Cancellation (LEC) is introduced in AMC X10.23 (2007-12-11) SW. The LEC can be applied on VoIP connections. The LEC function allow ASLT based stations to have open Duplex VoIP conversations when using the handset.

The AlphaCom LEC runs on 16 kHz samplingrate, which means that the full 7.5kHz bandwidth of G.722 is still avaliable!

When LEC?

The LEC does its magic in the following situations:

  • Between two ASLT stations over AlphaNet, both have handset lifted. (Both exchanges must be be upgraded to 10.23!)
  • Between two ASLT stations in different modules in a multimodule AlphaCom, where VoIP is used for module interconnection
  • Between a ASLT station with handset lifted, and a Zenitel IP station.
  • Between a ASLT station with handset lifted, and a SIP system.

Switched duplex is still used for any conversation involving at least one ASLT station in loudspeaking mode.

Handset conversation between ASLT stations, where no VoIP is involved, goes in open duplex without LEC, as always has been. This is because of the short transmission delay.

All statements above on "ASLT stations" also applies to telephones connected to ATLB/ATLB12.

To summarize: LEC is used instead of switched duplex when a ASLT station or a ATLB phone is in a VoIP call with the handset lifted, and the AlphaCom can assume that the other end also use Echo Cancellation.

LEC channel setup

The LEC function is implemented in the DSP SW of the AMC-IP card. LEC is implemented as a bank of LEC channels, which can be inserted into a VoIP connection, when needed.

AMCD SW version 10.23 / DSP_SW 01.06 has 10 LEC channels.

VoIP conversations in loudspeaking mode does not reserve a LEC resource. Only when handsets are lifted, will the AMCD SW try to allocate a LEC channel. If granted, the LEC is inserted, and the call goes open duplex. If all LEC channels are busy, the call will remain in switched duplex.

In the case of a MultiModule AlphaCom with VoIP interconnection, the LEC will be taken from the same module as the ASLT/ATLB station is connected. Ie LEC channels in slave modules can be used.


DSP resources and call capacity

By default, the echo cancellation time is set to 5 msec. In many cases, this is sufficient. The DSP has in that case enough capacity to service 10 simultaneous calls between IP on one side and an analogue intercom or telephone on the other side. Especially some telephones need a longer cancellation time, even up to 15 msec. The number of simultaneous calls then drops to 3.

Also in some MultiModule systems one might experience echo when calling between ATLB subscribers in different modules. If that is the case, one should try to increase the time to 10ms. If still echo, try 15ms.

LEC setting versus call capacity:

  • 5 msec up to 10 calls
  • 10 msec up to 6 calls
  • 15 msec up to 3 calls

The cancellation time can be set from the TST-console. Navigate to:

ex_profile.timeouts.lec_time = 5 (0x0005)

and change the LEC value as required.

Alternatively, create a startup event that sets the Line Echo Cancellation time. Create an event with the following properties:

Set Lec time.PNG

Action:

$SNV Q5 W1 W6 W84

Time options:

 Q5 = 5 msec
 Q10 = 10 msec
 Q15 = 15 msec

After having sent this to the exchange, a reset is required.

Note that when the DSP resources are exhausted the AlphaCom will simply set the call to voice switched duplex. The call can therefore still be established, but it will not be full duplex.

LEC for geeks

The LEC algorithm in the DSP is taken from the core of Open Source Line Echo Canceller (OSLEC).

We run the OSLEC algorithm unmodified at twice speed to get 7.5 kHz bandwidth.

The default window length of the LEC setup is 5 milliseconds (80 samples @16kHz). (This can be changed with the NVRAM variable .ex_profile.timeouts.lec_time. But do not change this value for other purposes than testing. Increasing the window length means the processing load increases on the DSP, and the DSP will not be able to handle 10 LEC channels.)

OSLEC is a timedomain algorithm, using Normalised least mean squares filter (NLMS) for adaptation of the filters. "Dual path": OSLEC uses two filters, one foreground filter, and one background filter.

  • The near end microphone signal is continuously run through the foreground filter, producing the cleaned signal to send to the far end.
  • The background filter is adapted most of the time, using NLMS on the microphone signals from near-end and far-end.
  • The near end microphone signal is also run through the background filter, the result is only used in the next step:
  • OSLEC analyzes the output of two filters. Using certain criteria OSLEC can decide that the background fiter is now performing better than the foreground filter. OSLEC will then copy the background filter coefficients to the foreground filter.

OSLEC does not modify the far end microphone signal sent to local speaker!

Graph: Typical plot of the OSLEC filter after successful adaptation towards a ASLT station with handset lifted. (The filter is a estimate of echo / transfer function of the station as seen from LEC in DSP):

LEC ASLT.png

The graph confirms what we found during experiments: Insignificant echo after 5 ms. 4 ms window gives a fairly good result, and no noticeable improvement when increasing window length beyond 5 ms.