Project

General

Profile

DesignAEC » History » Version 17

Adrian Georgescu, 11/16/2009 06:23 PM

1 2 Adrian Georgescu
= Echo cancellation =
2 1 Adrian Georgescu
3
[[TOC(Design*, depth=1)]]
4
5
SIP SIMPLE client is a Python software library that allows for easy development of Internet communications end-points based on SIP and related protocols for voice, rich presence, session based instant messaging (IM), file transfers and desktop sharing. Other media types can be easily added by using an extensible high-level API. SIP SIMPLE client uses [http://www.pjsip.org/pjmedia/docs/html/index.htm PJSIP media library] for audio processing (sound card abstraction, audio codec and acoustic echo cancellation).
6
7
For more information see http://sipsimpleclient.com
8
9 16 Adrian Georgescu
The project is maintained by AG Projects that can provide help to the developer to integrate its AEC implementation.
10
11 1 Adrian Georgescu
== Background ==
12
13 17 Adrian Georgescu
The present implementation of the echo canceller from PJSIP media library is not performing to the desired level of quality. Practically, the speakerphone function of SIP SIMPLE client is not reliable and not performing satisfactory. The result is that the software phone cannot be used without a head-set.
14 1 Adrian Georgescu
15
[[Image(http://www.pjsip.org/images/media-flow.jpg)]]
16
17
== Project goal ==
18
19 14 Adrian Georgescu
Replace the existing AEC from Pjmedia library (what is displayed as echo.h in the above diagram whihc employes the AEC of the speex project) with an alternative to be developed solution that provides a high quality speakerphone user experience. The acoustic echo cancelation should perform comparable with any other proven VoIP commercial solution like Skype or iChat making the need of a headset un-necessary.
20 1 Adrian Georgescu
21
The developed software will be released under an open source licence and distributed with SIP SIMPLE client library.
22
23 11 Adrian Georgescu
The deliverable is C written program that can be applied to the pjsip  cvs trunk 1.0 with the '''patch''' command.
24
25 1 Adrian Georgescu
== Resources ==
26
27 7 Adrian Georgescu
General
28 1 Adrian Georgescu
29 7 Adrian Georgescu
 * Digital Signal Processing http://www.dsptutor.freeuk.com/
30
 * Graduation thesis about AEC  http://innovexpo.itee.uq.edu.au/2003/exhibits/s365914/
31 9 Adrian Georgescu
 * DSP concepts: http://www.bores.com/courses/intro/basics/index.htm
32 7 Adrian Georgescu
33
PJSIP media library
34
35 1 Adrian Georgescu
 * PJSIP media library http://pjsip.org, used by this project, AEC is implemented based on the Speex library, the code in pjsip/pjmedia/src/pjmedia/echo_speex.c 
36
 * Media flow - http://trac.pjsip.org/repos/wiki/media-flow
37 12 Adrian Georgescu
 * PJSIP AEC API http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__Echo__Cancel.htm
38 1 Adrian Georgescu
39
=== Speex AEC ===
40
41 17 Adrian Georgescu
This is the standard used AEC algorithm in PJSIP that needs to be replaced by a better solution. 
42 15 Adrian Georgescu
43 1 Adrian Georgescu
 * Speex project http://speex.org, the echo canceller implements AEC based on the MDF algorithm, see speex/libspeex/mdf.c. A test client is available in speex/speexclient, this has been used for developing pjmedia equivalent
44 6 Adrian Georgescu
 * http://speex.org/docs/api/speex-api-reference/group__SpeexEchoState.html
45 1 Adrian Georgescu
46
=== Andree Adrian AEC ===
47
48 17 Adrian Georgescu
Research for other implementations revealed a well documented algorithm together with source code as C++ implementation. 
49
50 1 Adrian Georgescu
 * Draft AEC http://www.andreadrian.de/echo_cancel/draft-aec-03.txt
51 17 Adrian Georgescu
52
The white-paper gave enough insight and trust into its author understanding and capability of implementation for considering its blueprint as an alternative. Unfortunately, the author's claims about its high quality could not be tested, due to the fact that his C++ code dates back from 2004 and the application that used it could not be compiled on todays newer systems.
53
54 1 Adrian Georgescu
 * Kphone AEC implemented using above AEC http://www.andreadrian.de/echo_cancel/ (not tested)
55 17 Adrian Georgescu
 * http://www.andreadrian.de/intercom/ implements AEC based on NLMS algorithm (not tested yet)
56 1 Adrian Georgescu
57 17 Adrian Georgescu
Finally, this AEC has been implemented by a student in plain C and integrated to the SIP SIMPLE project. It does not work properly, audio artifacts being present and further debugging requires DSP knowledge which the developer did not have.
58 1 Adrian Georgescu
59 17 Adrian Georgescu
The actual implementation can be used as working example for how a third party AEC algorithm can be integrated with the SIP SIMPLE project. See attached file for more information.
60 1 Adrian Georgescu
61
== Next steps ==
62 16 Adrian Georgescu
63 17 Adrian Georgescu
At this stage the problem has not been solved due to the lack of knowledge of the developers in this specialized DSP area.
64
65 16 Adrian Georgescu
There are two choices for going further:
66
67 17 Adrian Georgescu
 1. Implement an AEC from scratch and integrated with PJSIP based on its API
68
 2. Debug and fix  Andree Adrian AEC, an analysis of the code  can reveal if the concept is valid but poorly implemented