Professional Documents
Culture Documents
T TECHNOLOGY
ENGINEERING
ADVISOR: Mr Melese.D
ACKNOWLEDGEMENT................................................................................................. IV
ABSTRACT........................................................................................................................V
CHAPTER ONE: INTODUCTIION ABOUT ECHO..............................................1
1.1 Background of project....................................................................................................1
1.1.1Adaptive filter....................................................................................................1
1.2 Problem statement...................................................................................................……2
1.3 Objective.........................................................................................................................2
1.3.1 General objective.............................................................................................2
1.3.2 Specific objective.............................................................................................2
1.4 Limitation and challenge of the project..........................................................................3
1.5 Methodology and tools....................................................................................................3
1.6 Expected result................................................................................................................ 4
CHAPTER TWO: LITERATURE REVIEW AND THEORY.....................5
2.1 Literature Review............................................................................................................5
2.2 Theory..............................................................................................................................5
2.2.1 Speech signal..........................................................................................................6
2.2.2 Structure of Adaptive Filter....................................................................................7
2.2.3 Application of adaptive filter..................................................................................8
CHAPTER THREE: METHODOLOGY..............................................................9
3.1 Echo cancellation adaptive method..................................................................................9
3.2 LMS Adaptive Algorithm...............................................................................................10
3. 2.1 Derivation of LMS algorithm..................................................................................11
3.2.2 Implementation of LMS algorithm...........................................................................12
3.3 Simulation........................................................................................................................12
3.3.1 Why MATLAB need for this project......................................................................12
3.3.2 Requirements during simulation.............................................................................13
3.3.3 Flow chart of adaptive echo cancellation algorithm...............................................14
CHAPTER FOUR: RESULTS AND DISCUSSION..........................................16
4.1 RESULTS.........................................................................................................................16
4.2 DISCUSSION...................................................................................................................22
CHAPTER FIVE: CONCLUSSION AND RECOMENDATION.................23
5.1 Conclussion.......................................................................................................................23
5.2 Recomendation..................................................................................................................23
REFERENCE.........................................................................................................................24
APPENDIX: MATLAB CODE OF LMS.............................................................................25
LIST OF FIGURES
Figure 2.1 Microphone speech signal..............................................................................6
Figure 2.2 Adaptive filter block diagram........................................................................7
Figure 2.3 Block diagram of adaptive Identification.......................................................8
Figure 3.1 Adaptive acoustic echo cancellation...............................................................9
Figure 3.2 Flow chart of adaptive echo cancellation algorithm.......................................15
Figure 4.1Magnitude response.........................................................................................16
Figure 4.2 Room impulse response...................................................................................17
Figure 4.3 Near-end speech signal....................................................................................17
Figure 4.4 Far- end speech signal.....................................................................................18
Figure 4.5 Microphone speech signal...............................................................................19
Figure 4.6 Magnitude response of echo return loss enhancement....................................20
Figure 4.7 Over all work of output filter at mu= 0.025......................................................21
Figure 4.8 Over all work of output filter at mu= 0.04........................................................22
Abbreviations
DDU:-Dire Dawa university
AEC:-Acoustic Echo Cancellation
NLMS:-Normalized Least Mean Square
PC:-Personal Computer
MSE:-Mean Square Error
MMS:-Minimum Mine Square
LMS:-Least Mean square
NTVSSLMS:-New Time Varying Step Size LMS
DSP:-Digital Signal Processing
RLS:-Recursive Least Square
FIR:-Finite Impulse Response
TDL:-Tapped Delay Line
ACKNOWLEDGEMENTS
First of all, we would like to say thanks to God, who helped us in every aspect of our
life and in success in our education at university. Next we would like to express our deepest
and foremost thank to our advisor Melese.D and all staffs in our institute for being a constant
source of helps and inspiration throughout our proposal work. Their Timely advice and
guidelines have assisted us to get our work done through a lot of difficulty, situations and
obstacles. Our other committee members, the institute and department have been very
Considered and cooperated with us for the completion of this project and thank for their
prompt Feedback and being approachable and available whenever we needed any assistance.
We would also like to thank the ddu institute of technology for the help and valuable
suggestions. At this juncture and we would like to thanks our parents, brethren and friends for
their adequate support and encouragement. This project would have not been completed
without their support, so may God pay back their countless efforts, time, energy, and spirit
they give us for our success.
ABSTRACT
In hands-free telephony and in teleconference systems, the main aim is to provide
good free voice quality when two or more people communicate from different places. The
problem often arises during the conversation is the creation of acoustic echo and this problem
will cause the bad quality of voice signal and the talkers could not hear the contents of the
conversation clearly, despite the fact that they lost the important information. This acoustic
echo is actually the noise which is created by the reflection of sound waves by the wall, floor
of the room and the other things existing in the room. The main objective for our project is
the cancellation of this acoustic echo sound and provides an echo free environment for
speakers during conversation. For this purpose, scientists design different adaptive filter
algorithms. Our project is also to study and simulate the acoustics echo cancellation by using
different adaptive algorithms.
In case of double-talk, the error signal will contain both echo estimation error and
near-end speech signal. When we use this signal for updating the filter coefficient
then it diverges. As the result, the adaptive filter will work incorrectly and finally the
bad sound signal was issued.
In an active conversation, both talkers often speak at the same time or interrupt each
other. Those situations are called “doubletalk”. Doubletalk presents a special
Processing challenge to echo.
Acoustic coupling is due to the reflection of the loudspeaker’s sound waves from the
wall, door, ceiling, windows and other objects back to the microphone. The result of
the reflections is the creation of a multipath echo and multiple harmonics of echoes,
which are transmitted back to the far-end and are heard by the talker as an echo,
1.3 OBJECTIVES
The general objective of this project is to deal with adaptive echo canceller and
cancelation techniques, to write a MAT LAB program that can eliminate echoes from echoed
signal and finally to provide echo free signal to the far-end listener.
Specifically the main goal of this project is to deals about related ideas with adaptive
echo cancelation techniques, such as:
RESULT &
DISCUSTION
PROPOSAL
APPROVED
COLLECTION END
&ORGANIZING DATA
UNDERSTAND
&ANALIZING DATA
MATHIMATICAL
MODELING
LMS Adaptive
Algorithm
NO SIMULATI YES
ON
Tools:-
For the success of this project we will use a soft were program known as
MAT LAB
1.6 Expected result
This project increases the capacity achieved through silence suppression by preventing echo
from traveling across a network or system, and accomplishing free communication in
communication system, ddu administration hall as for instance.
CHAPTER TWO
2. LITERATURE REVIEW AND THEORY
2.1 LITERATURE REVIEW
As we discussed in the above point of view in this 21th century, acoustic echoes are
indication of backwardness especially in communication system of developed countries.
Therefore several scientists, engineers, engineering students and others experts have seek the
solution for echoes. And we also find latest paper works from different fabulous people. For
example a paper prepared by “Dr.Thamer M.Jamel’’(instructor in university of technology and
department of electrical engineering) in Baghdad, Iraq. In the year 2013 with the title of
Performance of Adaptive Acoustic Echo Canceller Using a New Time Varying Step Size LMS
Algorithm (NTVSSLMS).In his paper he describe the way how echoes can eliminate by using
adaptive FIR filter and LMS algorithms. Similarly this group saw a paper work of “Sanjay
Nagendra” and “Vinay Kumar.S.B” from Dept. of Electronics &Communication in “Sri
Bhagawan Mahaveer Jain College of Engineering” (India) in the year 2011.with the title of
Echo Cancellation in Audio Signal using LMS Algorithm. By their paper they describe
varies algorithms which are used in echo cancellation like MSE and RLS; basically they
describe MAT LAB implementation of LMS algorithm for cancel acoustic echo. As we know
we are the first group with this title in this institute. So we try to LMS algorithms and MAT
LAB soft where to implement them. We forced to use MAT LAB because of the absence of
DSP kit in the institute.
2.1 THEORY
The invention relates generally to reducing unwanted audio or acoustic feedback in a
communication system, and particularly to an adaptive acoustic echo cancellation device for
suppressing acoustic feedback between the loudspeaker and microphone of a telephone unit in a
teleconferencing system. The telephone unit of a typical audio conferencing system includes a
loudspeaker for broadcasting an incoming telephone signal into an entire room. Similarly, the
telephone’s microphone is typically designed to pick up the voice of any person within the room
and transmit the voice to a remote telephone at the far end of the communication system. Unlike
conventional hand held telephone sets, conference telephone units are prone to acoustic
feedback between the loudspeaker unit and microphone. For example, a voice signal which is
broadcast into the room by the loudspeaker unit may be picked up by the microphone and
transmitted back over the telephone lines. As a result, persons at the far end of the
communication system hear an echo of their voice. The echo lags the person’s voice by the
round trip delay time for the voice signal. Typically, the echo is more noticeable as the lag
between the person’s voice and the echo increases. Accordingly, it is particularly annoying in
video conferencing systems which transmit both video and audio information over the same
telephone lines.
A speech signal consists of three classes of sounds such as: voiced, fricative and plosive
sounds. Voiced sounds are caused by excitation of the vocal tract with quasi-periodic pulses of
air flow. Fricative sounds are formed by constricting the vocal tract and passing air through it,
causing turbulence results in a noise-like sound. Plosive sounds are created by closing up the
vocal tract, building up air behind it then suddenly releasing, this is heard in the sound made by
the letter p [2]. Fig (1), shows a time representation of a speech signal. That is, its mean values
vary with time and cannot be predicted using the above mathematical models for random
processes. However, a speech signal can be considered as a linear composite of the above three
classes of sound, each of these sounds are stationary and remain fairly constant over intervals of
the order of 40m.
∑ Y(n)
D WN-1 e(n)
Here we represents the coefficients of the adaptive filter tap weight vector, x (n) is the input
vector samples, the tapped delay line D, is needed to make full use of the filter. The input signal
enters from the left and passes through N-1 delays. The output of the tapped delay line (TDL) is
an N-dimensional vector, made up of the input signal at the current time, the previous input
signal, etc. the y (n) is the adaptive filter output, d (n) is the desired echoed signal and e (n) is
the estimation error signal at time n. The aim of an adaptive filter is to calculate the difference
between the desired signal and the adaptive filter output, e (n). This error signal is fed back into
the adaptive filter and its coefficients are changed algorithmically in order to minimize a
function of this difference, known as the mean square error function. In the case of acoustic
echo cancellation, the optimal output of the adaptive filter is equal in value to the unwanted
echoed signal. When the adaptive filter output is equal to desired signal the error signal goes to
zero. In this situation the echoed signal would be completely cancelled and the far user would
not hear any of their original speech returned to them, where the noise no (n) signal is assumed
zero.
2.2.3 Application of adaptive filters
The adaptive filters are widely used in areas such as control systems, communications,
signal processing, acoustics, and others to deal with random Signals with stationary or
quasistationary statistics. Although these applications are quite different, they have input,
output, error, and reference signals. The Applications of the adaptive filters can be classified
into four fundamental Classes based on the architecture of the implementation: adaptive
identification, Adaptive inverse, adaptive prediction, and active noise cancellation. But our
Project concerned on adaptive identification, because of the adaptive Identification is an
approach to model an unknown system. As seen in Figure, the unknown system is in parallel
with an adaptive filter, and both are receiving the input signal. The output of the unknown
system provides the reference signal for the adaptive digital filter. Applications for adaptive
Identification include room acoustic identification, channel estimation, echo Cancellation and so
on.
INTRODUCTION
Most echo cancellers use variants of the LMS adaptation algorithm [1] [2][3]. The
attractions of the LMS are its relatively low memory and computational requirements and its
ease of implementation and monitoring. In practice, LMS adaptation has produced effective line
echo cancellation system back to the far-end. The acoustic echo problem will disturb the
conversation of the people and reduce the quality of system. This is a common problem of the
communication networks.
From far-
end talker Loudspeaker
x(n)
Reflection
Direct coupling
Adaptive
filter
To far-end
talker y^(n) (Echo path)
d(n) d(n) h(n)
∑
e(n) ∑ near-end talker
mic Microphone
Here x (n) is the input vector of time delayed input values, x (n) = [x (n) x (n-1) x (n-2) ...
X (n-N+1)]T. The vector w (n) = [w0 (n) w1 (n) w2 (n) ... wN-1(n)] T represents the
Coefficients of the adaptive FIR filter tap weight vector at time n. The parameter μ is
Known as the step size parameter and is a small positive constant. This step size
Parameter controls the influence of the updating factor. Selection of a suitable value for μ
is imperative to the performance of the LMS algorithm, if the value is too small the time
The adaptive filter takes to converge on the optimal solution will be too long; if μ is too
Large the adaptive filter becomes unstable and its output diverges.
( )
=
( )
=2e (n)
( ( ) ( ))
= 2e (n)
( ) ( )
=-2e (n)
=2e (n) x (n)……………..equation 4
Substituting this into the steepest descent algorithm of equation 2 we arrive at the recursion for
the LMS adaptive algorithm.
W (n +1) = w (n) + 2μe (n) x (n) ………………………….equation
3.3 SIMULATION
The previous chapters provide a detailed sketch of an Acoustic Echo Cancellation (AEC).
In this chapter the flowchart for the software simulation and the results of Simulation of the
AEC algorithm, which was performed in MATLAB are discussed
3.3.1 Why MATLAB Need for this Project
MATLAB is a numerical computing environment that especially effective to calculate and
simulate the technical problems. This programming language is very powerful allows matrix
manipulation, plotting of functions and data, implementation of algorithms, creation of user
interfaces, and interfacing with other programming languages (C, C++, Fortran and Java). One
of the most beneficial features is graphical visualization which helps us have confidence in
results by monitoring and analyzing resultant plots. In addition, MATLAB implement Simulink,
the software package models, simulates and analyzes dynamic systems. It enables us to pose a
question about a system, model the system, and see what happens. For our simulation purpose,
MATLAB actually is necessary and effective software to attain the convincible results because
of some reasons as following. The MATLAB software environment suited the needs of this
project for the following reasons
The input signals (far-end and near-end talker signals) were voices. These voices were
stored as wav files and the wav files were easily imported into the code.
The intermediate signals (echo signals) and output signals (error signal and signals
obtained after echo cancellation) were obtained as wav files. Thus the audio of the voice
signals could be literally be heard, which aided immensely judgments with respect to the
results obtained.
The signal processing toolbox has in-built functions for almost all signal processing
applications. The toolbox helped the efficiency of the code since these functions could
be called wherever necessary instead of writing separate sub-routines.
Since MATLAB supports graphics, the results of a simulation could be presented in a
graphical format with ease.
3.3.2 Requirements during the simulation
The speech signals (including far-end and near-end signals) were recorded by
MATLAB software at the sampling rate of 8 kHz. The speech signal is the audio signal
contains the frequencies between 300Hz-3400Hz. Because of the sampling theorem
(Nyquist–Shannon sampling theorem), the analog signal will reconstruct perfectly from
the sequence of samples if the sampling rate exceeds 2B (B is highest frequency of the
analog signal). Thus by using sampling rate fs of 8000Hz, we will satisfy to the
Sampling theorem (fs=8000Hz>2B=3400x2=6800Hz).
For our simulation, the duration of the signals is 20 seconds (160.000 samples) which
can express 4 cases (5 seconds for each case, respective to 40.000 samples) of the
Communication between far-end and near-end in the teleconference system. These
Signals are plotted as the figures below. 4 cases in teleconference are:
Freeze adaptive
filter
STOP
2 .This section is a graphical representation of the results obtained by simulating the algorithm
in MATLAB. The plot of the near-end speech signal.
4.2 DISCUSSION
From the experiment works and the resultant graphs, we can discuss the echo
cancellation algorithm in order to have a deeper understanding and the conclusion of the project.
As the results we have been discussed about LMS as, it could converge approximately to the
estimated impulse response of the true room impulse response h, thus the estimated echo yˆ(n )
signal look like similar to the true echo signal y( n) . And we have found that, error signals
almost obtain our desired results.
CHAPTER FIVE
5.CONCLUTION AND RECOMDATION
5 .1 CONCLUSION
With the world shrinking into a global village because of superior Communications,
telephones, both conventional and hands-free sets, occupy a prominent position in
solving people’s communication needs. One of the major Problems in a modern
communication system is echo.
The Echo cancellation Algorithm presented in this paper successfully attempted to find a
software Solution for the problem of echoes in the acoustic environment. The proposed
Algorithm was completely a software approach without utilizing any DSP Hardware
components. The algorithm was capable of running in any PC with MATLAB software
installed. The audio of the output speech signals were highly Satisfactory and validated
the goals of this project.
5.2 RECOMMENDATION
This project can be more successful than this, if we get complete components for
DSP kit, so we recommended that DDU should have to provide the opportunity to
make sure that all components are available in university especially DSP Kit for the
generations.
We also recommend that it is preferable to use NLMS and RLS algorism to handle
far-end speech signal for next generations and those who are voluntary to do this
project in the future.
And we further recommended that NLMS and RLS algorism by using DSP-kit is
suitable for our new administration hall.
REFFERENCE
www.researchgate.net
[1] Sadaoki Furui and M. Mohan Sondhi, “Advances in Speech Signal Processing”,
Marcel Dekker, Inc., 1992
[2] Digital Signal Processing, Fourth Edition
[3] Simon Haskin, “Adaptive filter theory,” 4th Edition
[4] Eberhard Hansler, Gerhard Schmidt, “Acoustic Echo and Noise Control-A Practical
Approach
[5]Farhang-Boroujeny, B. 1999, Adaptive Filters, Theory and Applications. John Wiley and
Sons, New York.
[6]Haykin, Simon. 1991, Adaptive Filter Theory. 2nd Edition. Prentice-Hall Inc., New
Jersey.
[7] Lester S.H Ngia, “System Modelling using Basis Functions and Application to Echo
Cancellation”, Ph. D. Dissertation, Chalmers University of Technology
[8] Paulo S.R. Diniz, “Adaptive Filtering Algorithms and Practical Implementation”,
Kluwer Academic Publishers, 1997
[9] J. Benesty, T. Gansler, D.R. Morgan, M.M. Sondhi and S.L. Gay, “Advances in
Network and Acoustic Echo Cancellation”, Springer-Verlag, 2001
[10] Mu Tian, P.K. Gupta, Marcus Harte and Danny Yip, “Improved Echo Canceller and
Implementation”, Dialogic Corporation
[11] Andrze Borys, “Nonlinear Aspects of Telecommunications”, CRC Press, 2001
Appendix: MATLAB code of LMS algorithm
%% Acoustic Echo Cancellation (AEC)
% This example shows how to apply adaptive filters to acoustic echo
% cancellation (AEC).
%
% Author(s): Scott C. Douglas
% Copyright 1999-2014 The MathWorks, Inc.
%% Introduction
% Acoustic echo cancellation is important for audio teleconferencing when
% simultaneous communication (or full-duplex transmission) of speech is
% necessary. In acoustic echo cancellation, a measured microphone signal
% |d(n)| contains two signals:
%
% * the near-end speech signal |v(n)|
% * the far-end echoed speech signal |dhat(n)|
%
% The goal is to remove the far-end echoed speech signal from the
% microphone signal so that only the near-end speech signal is transmitted.
% This example has some sound clips, so you might want to adjust your
% computer's volume now.
fs = 8000;
M = fs/2 + 1;
frameSize = 8192;
%%
H = step(IIR, ...
(log(0.99*rand(1,M)+0.01).*sign(randn(1,M)).*exp(-0.002*(1:M)))');
H = H/norm(H)*4; % Room Impulse Response
firRoom = dsp.FIRFilter('Numerator', H');
fig = figure;
plot(0:1/fs:0.5, H);
xlabel('Time [sec]');
ylabel('Amplitude');
title('Room Impulse Response');
fig.Color = [1 1 1];
%% The Near-End Speech Signal
%
% The teleconferencing system's user is typically located near the system's
% microphone. Here is what a male speech sounds like at the microphone.
load nearspeech
AP = dsp.AudioPlayer('SampleRate', fs);
nearSpeechSrc = dsp.SignalSource('Signal',v,'SamplesPerFrame',frameSize);
nearSpeechScope = dsp.TimeScope('SampleRate', fs, ...
'TimeSpan', 35, ...
'YLimits', [-1.5 1.5], ...
'BufferLength', length(v), ...
'Title', 'Near-End Speech Signal', ...
'ShowGrid', true);
load farspeech
farSpeechSrc = dsp.SignalSource('Signal',x,'SamplesPerFrame',frameSize);
farSpeechSink = dsp.SignalSink;
farSpeechScope = dsp.TimeScope('SampleRate', fs, ...
'TimeSpan', 35, ...
'YLimits', [-0.5 0.5], ...
'BufferLength', length(x), ...
'Title', 'Far-End Speech Signal', ...
'ShowGrid', true);
reset(nearSpeechSrc);
farSpeechEchoSrc = dsp.SignalSource('Signal', farSpeechSink.Buffer, ...
'SamplesPerFrame', frameSize);
micSink = dsp.SignalSink;
micScope = dsp.TimeScope('SampleRate', fs,...
'TimeSpan', 35, ...
'YLimits', [-1 1], ...
'BufferLength', length(x), ...
'Title', 'Microphone Signal', ...
'ShowGrid', true);
AECScope1.ActiveDisplay = 2;
AECScope1.ShowGrid = true;
AECScope1.YLimits = [-1.5 1.5];
AECScope1.Title = 'Microphone Signal';
AECScope1.ActiveDisplay = 3;
AECScope1.ShowGrid = true;
AECScope1.YLimits = [-1.5 1.5];
AECScope1.Title = 'Output of Acoustic Echo Canceller mu=0.025';
AECScope1.ActiveDisplay = 4;
AECScope1.ShowGrid = true;
AECScope1.YLimits = [0 50];
AECScope1.YLabel = 'ERLE [dB]';
AECScope1.Title = 'Echo Return Loss Enhancement mu=0.025';
AECScope2 = clone(AECScope1);
AECScope2.ActiveDisplay = 3;
AECScope2.Title = 'Output of Acoustic Echo Canceller mu=0.04';
AECScope2.ActiveDisplay = 4;
AECScope2.Title = 'Echo Return Loss Enhancement mu=0.04';
reset(nearSpeechSrc);
reset(farSpeechSrc);
reset(farSpeechEchoSrc);
reset(micSrc);
reset(firERLE1);
reset(firERLE2);
displayEndOfDemoMessage(mfilename)