0% found this document useful (0 votes)
11 views37 pages

Project New-1

suitable

Uploaded by

tarikhus052704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views37 pages

Project New-1

suitable

Uploaded by

tarikhus052704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Hawassa University Institute of Technology

FACULTY OF ELECTRICAL AND COMPUTER


ENGINEERING
(Communication stream)
Semester project

Project Title: Adaptive acoustic echo cancellation

Submitted by: Id Number

1. SMRET DEMISSIE Tech/0944/11


2. SEBLE ASEFA Tech/0906 /11
3. LIDIYA MELAKU Tech/0611/11

Advisor:

Mr. Yonathan T

June 13, 2022

Hawassa,Ethiopia
Abstract
Acoustic echo cancellation is usually needed in hand-free telephone system or video conference
application in order to have good voice signal quality when two or more peoples communicate
from different places. The presence of large acoustic coupling between speakers and microphone
would produce a loud acoustic echo making the conversation difficult. The problem often arises
during the conversation due to the creation of acoustic echo. This problem will cause the bad
quality of voice signal and thus talkers could not hear clearly the content of the conversation
even though we lost the important information this acoustic echo is actually the noise which is
created by the reflection of sound waves by the wall of the room and other things exist in the
room. The main objective of this project is the cancellation of this acoustic echo and to provide
an echo free environment for speakers during conversation. AEC will be simulated and results
will be evaluated by using MATLAB.

i
Contents

Acknowledgment
Abstract...................................................................................................................................................i
List of figures..........................................................................................................................................i
List of tables............................................................................................................................................i
List of abbreviation.................................................................................................................................i
Chapter one............................................................................................................................................1
1 Introduction and Background........................................................................................................1
1.1.1 Echo...............................................................................................................................................1
1.1.2 Acoustic Echo Cancellation...........................................................................................................3
1.1.3 Adaptive filter..............................................................................................................................3
1.2 statementof the problem.................................................................................................................4
1.3 Objective........................................................................................................................................4
1.3.1 General objective...................................................................................................................4
1.3.2 Specific objective...................................................................................................................4
1.4 Scope of the study..........................................................................................................................4
1.5 Expected Result.............................................................................................................................5
Chapter two............................................................................................................................................6
2 Literature review............................................................................................................................6
Chapter three..........................................................................................................................................9
3 Methodology .................................................................................................................................9
3.1 Material used ...............................................................................................................................10
Chapter four.........................................................................................................................................11
4 Theory of acoustic echo cancellation ............................................................................................9
4.1 System overview....................................................................................................................9
4.1.1 Adaptive filter......................................................................................................................11
4.1.2 Double-talk detector(DTD)..................................................................................................13
4.1.3 Non linear processor ( NLP)................................................................................................13
4.2 Adaptive filter algorithm......................................................................................................13
4.2.1 Wiener filter...........................................................................................................................5
4.2.2 Steepest Decent method........................................................................................................5
4.2.3 Least mean square..................................................................................................................5
4.3 Douoble-talk detector(DLD)..................................................................................................5
4.3.1 Normalized cross-corelation(NCC) algorithm.......................................................................5

ii
4.4 Simulation..............................................................................................................................5
4.4.1 General setup of simulation...................................................................................................5
4.4.2 Flow chart of the AEC algorithm..........................................................................................5
4.5 Measure room impulse response(RIR)..................................................................................5
4.5.1 Why we must measure room impulse response.....................................................................5
4.5.2 Method of meeauring RIR ....................................................................................................5
4.6 Explanation of matlab code...................................................................................................5
1.3.1 Adaptive filter algorithm........................................................................................................5
Chapter Five...........................................................................................................................................6
5 Result and discussioon...................................................................................................................6
5.1 Result.............................................................................................................................................6
5.2 Discussion......................................................................................................................................6
Chapter six.............................................................................................................................................6
6 Conclusion and Recommendations .......................................................................................5
6.1 Conclusion ............................................................................................................................5
6.2 Recommendation ..................................................................................................................5
Appendix..............................................................................................................................................11
Reference.............................................................................................................................................12

iii
List of Abbreviations

AEC Acoustic Echo Cancellation


FIR Finite Impulse Response
LMS Least Mean Square
MSE Mean Square Error
NLMS Normalized Least Mean Square
NLP Non Linear Processor
PSTN Public Switched Telephone Network
RIR Room Impulse Response
RLS Recursive Least Square
SNR Signal to Noise Ratio

iv
Chapter one

1. Introduction

1.1. Background of the study


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.

1.1.1. Echo
In principle, “Echo is the phenomenon in which delayed and distorted version of an original
sound or electrical signal is reflected back to the source”.
There are two types of echoes that exist in a typical communication network. They are

 Electrical (Hybrid) Echo

 Acoustic Echo

•Hybrid Echo:- caused by the impedance mismatch at the hybrids transformer which the
subscriber two-wire lines are connected to telephone exchange four-wire lines in the
telecommunication systems.

•Acoustic Echo:- when a fraction of sound signal from the speaker of the telephone is picked up
by the microphone and gets transmitted back, an acoustic echo occurs. Acoustics coupling
between the loudspeaker and the microphone. In teleconference system the speech signal from
far-end generated from loud speaker after directing and reflecting from the wall, floor and other
objects inside the room is receipt by microphone of near end, as the result this makes the echo
that is sent 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

1
networks. Two main characteristics of echo are reverberation and latency. Reverberation is the
persistence of sound after stopping the original sound. This sound will slowly decay because of
the absorption by the materials constructing the environment. Latency or delay is the different
time of the signal between the transmitter and receiver.

In the case of teleconference system, the sound is generated from loud speaker and received by
microphone, the delay can compute base on the distance between them the length of the direct
sound.

Delay = distance/speed of sound

In teleconference system (figure 1.1), the speech signal from far-end generated from loud
speaker after directing and reflecting from the wall, floor and other objects inside the room is
receipt by microphone of near-end, as the result, this makes the echo that is sent 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.

Far-end room Near-end room

Figure 1.1: A teleconference system with echo paths of room

2
1.1.2 Acoustic Echo Cancellation (AEC)

The need for acoustic echo cancellation has been increasing in acoustic signal processing
motivated mainly by the increasing demand for hands free communication.

AEC is used to cancel acoustic feedback between a speaker and a microphone in loud-speaking
audio systems, teleconferencing devices, hands free mobile devices, and voice-controlled
systems. To handle with the acoustic echo problem above in teleconference systems, one can use
voice switches and directional microphones but these methods have placed physical restriction
on the speaker.

The common and more perfective method is implementing the Acoustic Echo Cancellation
(AEC) to remove the echo. AEC enhances greatly the quality of the audio signal of the hands-
free communication system. Due to their assistance, the conferences will work more smoothly
and naturally, keep the participants more comfortable.

1.1.3 Adaptive Filters

Adaptive filter is the most important component of acoustic echo cancellation. It performs the
work of estimating the echo path of the room for getting a replica of echo signal. It requires an
adaptive update to adapt the environmental change. Another important thing is the adaptive
algorithm is the heart of an AEC, which decides the tracking and convergence behavior of the
AEC. The tracking behavior indicates how fast the adaptive filter can follow enclosure
dislocations, whereas the convergence behavior of the adaptive filter measures how fast the filter
converges for best estimation of the room acoustic path.

In the Figure (1.2), by using adaptive filter for AEC follows three basic steps above
1. Estimate the characteristics of echo path h (n) of the room: ̂(n)
2. Create a replica of the echo signal: ̂(n)
3. Echo is then subtracted from microphone signal (includes near-end and echo
signals) to obtain the desired signal: clear signal = d (n) - ̂(n)

In the modern digital communication system such as: Public Switched Telephone
Network (PSTN), Voice over IP (VoIP), Voice over Packet (VOP) and cell phone
networks; the application of AEC is very important and necessary because it brings the better

3
quality of service and obtains the main purpose of the communication service
providers.

Figure 1.2: Implement Acoustic Echo Canceller using adaptive filter

1.2 .Statement of the problem


There are many reasons and facts which motivate us to seek the solutions and suggestions for
the problems and situations caused by echo sound. As a result, it initiated us to develop this
project.
And these are some problems, the double talk, acoustic coupling and active conversation.
 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,

4
As a solution for these problems scientists tried to solve using different algorithms specially
LMS algorithm. Now we will solve these problems by adding some more efficient algorithms
that is called NLMS and RLS.
1.3. Objectives of the project
1.3.1. General objective
 The general objective of this project is to deal with adaptive echo canceller and cancelation
techniques, to provide echo free signal to the far-end listener by using MATLAB program.
1.3.2 Specific objective
Specifically the main goal of this project is to deal about the related ideas with adaptive echo
cancelation techniques, such as:
 Mathematical modeling of the system
To Design and implementation of FIR filter using MATLAB.
To Implement MSE, LMS and different types of algorithm in MATLAB.

1.4. Scope of the project


The scope of this semester project is to provide information on adaptive acoustic
echo cancellation techniques, applications and implementations to provide a better
understanding of adaptive acoustic echo cancellation and how it can be used to
improve acoustic spaces such as an echoic environment. This project will make an
echo free conversation in teleconference system and in a telephone system using
adaptive filter algorithms. It implements the concept of different algorithms using
MATLAB that are the main back bone of the system instructing the components
involved. After the system has been implemented pure signals or the original signals
are transmitted without any echo. Here to notice is that the system is constructed for
acoustic echo cancellation by implementing on MATLAB software.

1.5 Expected result


This project will increase the capacity achieved through silence suppression by preventing echo
from traveling across a network or system, and accomplishing free communication in
communication system.

5
Chapter two

2. 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. Throughout the development of our project we were able to review some
project, journals, articles and books which are related to the title of our project. We believe that
all the reviewed materials have been a good asset for the design and development of the project
we have chosen in this section some of the related project we have reviewed are discussed.
[1] A paper prepared by “ 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 MATLAB 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 software to implement them. We forced to use MAT LAB
because of the absence of DSP kit in the institute.
The weakness we found on this paper is convergence is not considered. Therefore, when the
echo is eliminated in their works the convergence was very slow. And also demands using of
training sequence as reference, as thus decreasing the communication band width (BW).
[2] Vaibhav Narula et al. paper presents a novel approach for Active Noise Cancellation through
the technique of Adaptive filtering. In majority applications, algorithm used for practically
implementing this concept is LMS (Least Mean Square) Algorithm. The work
done here includes testing of LMS algorithm and its variants for Low and mid range frequency

6
audio environments. The experimental results demonstrated in this paper are quite beneficial
in identification of specific LMS variant corresponding to particular category of signals in terms
of application [2].
The weakness we found on this paper is noisy approximation. Therefore, when the noise is
approximated appropriate output does not exist. And also there is low SNR (signal to noise ratio).

[3] Rachana Nagal et al. This paper works echo cancellation using LMS and Normalized LMS
algorithm in frequency domain. Their corresponding results have also been shown after their
implementation in both the time as well as frequency domain. Later their results have been
compared on the basis of the SNR and the output graphs obtained. In the LMS algorithm,
problem arises in deciding the value of the step size so, Normalized LMS algorithm have been
implemented. NLMS gives a standard equation for the step size using two constants Į and c. The
results obtained in time domain have less SNR value and more noise in the output signal as
compared to the one in the frequency domain. So, implementation of both LMS and NLMS in
frequency domain raise the SNR around 8-9 times. This will provide good quality of
reconstructed signal as compared to time domain in both the cases.

The weakness we found on this paper is the weight error ∆w(n) = w(o) -w(n) never goes
permanently to zero. That is, in steady state (n → ∞), the filter coefficient vector w(∞) fluctuates
randomly around the optimum w(o). Consequently, the mean-square error J1 (w(∞)) in steady
state is larger than due to miss adjustment of μ. And also it Have less SNR value and more noise
in the output signal in time domain.

[4]John Hakon Husoy et al. In this paper development of a normalized circulantly preconditioned
LMS adaptive filter. Thus, just as the NLMS algorithm improves on the LMS
algorithm incorporating a signal dependent adaption parameter, the NCPLMS
does the same for the PLMS algorithm. This considerably simplifies the sometimes tricky
tradeoffs involved in selecting an appropriate adaption parameter, μ, that is encountered in non

normalized algorithms. In particular a solution to the problem of selecting an optimum circulant


preconditioned for the NCPLMS algorithms. Through experiments we have demonstrated that,
through the use of NCPLMS, we can successfully shift the superior convergence behavior
observed for NLMS with white input signals to input signals having user-determined
autocorrelation properties given by some set of autocorrelation matrices. This may be useful in

7
applications where some a priori knowledge of input autocorrelation properties is available. They
supported this through some simulations in which the NCPLMS algorithms was
successfully applied in a line echo cancellation setting [3].
The weakness we found on this paper are signal to noise ratio is not well developed and slow
rate of convergence.

8
Chapter three

3 Methodology and material used in this project


The methods that we are going to use to do our project are described below. The first thing is
that we will prepare a proper time schedule that specifies the things we will do. Then we will
gather different information that are needed for our project from sources such as, books and
internet.

We then assemble each information to a meaningful and in supportive way to the project. From
these we list some of them.

Literature
Review

Collecting and
organizing data
ollecting and

Understanding
and analyzing
data

Mathematical
Modeling

Adaptive
Simul Result and
algorithm
ation discussion

This project will begin after the title is approved, then we start to collect data and
organize the data on the selected title from different literatures. After collecting and organizing
data, we will start to understand and analyses the working principle of the system. The next step

9
we will do is designing the simulation model of the adaptive aquatic echo cancellation.
Designing the adaptive filter structure will take the next step of the mathematical modeling of the
system. Completing the design of each relevant subsystem we will create a simulation acoustic
echo cancellation. After we simulate the system we will show the result of the simulation and
discuss the result.
 For the success of this project we will use a software program known as
MATLAB.

10
CHAPTER FOUR

4. THEORY OF ACOUSTIC ECHO CANCELLATION

4.1 System overview

Acoustic echo cancellation is required in different fields of communication for removing the
echo of the coupling between the loudspeaker and the microphone. In case of not doing this, then
this coupling results in an undesired acoustic echo which degrades the quality of sound.

Figure 3.1: Block diagram of AEC

We describe a block diagram of an AEC system as in Figure (3.1). This system consists of
following three components:
1. Adaptive filter.
2. Doubletalk detector.
3. Nonlinear processor.
4.1.1 Adaptive Filter

Adaptive filter is the most important component of acoustic echo canceller and it plays a key
role in acoustic echo cancellation. It performs the work of estimating the echo path of the room
for getting a replica of echo signal. It requires an adaptive update to adapt to the environmental
change. Another important thing is the convergence rate of the adaptive filter which measures
that how fast the filter converges for best estimation of the room acoustic path.

11
a. Structure of Adaptive Filter
This is structure to develop the lattice structure, let us consider in order to FIR filter. The
lattice structure is most widely used in digital speech processing and in adaptive filtering.

Tapped weights line

Figure 3.2 adaptive filter block diagram

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.
b. 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 quasi-stationary
statistics. Although these applications are quite different, they have input, output, error, and

12
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.

Figure 3.3 block diagram of adaptive identification

4.1.2 Double-talk detector (DTD)

It is rather difficult to predict when the adaptation of the filter should stop or slow down and it is
also important to know that the near-end speech signal exists or not in the presence of far-end
signal. In the situation when both ends talk (near-end and far end), this is known as double-talk.
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. So to
overcome this problem, one uses Double-talk Detector.
4.1.3 Nonlinear Processor (NLP)

The nonlinear processor (NLP) is required for completely or partly cancels the residual signal in
the absence of near-end speech signal. By removing the residual signal will cancel any occurring
acoustic echo. The NLP will gradually cancel the signal and insert a form of comfort noise to

13
give the impression to far-end. The NLP as well as the adaptive filter need an accurate estimation
from the DTD to operate efficiently.
4.2 Adaptive filter algorithms

Adaptive filtering is the process which is required for echo canceling in different applications.
Adaptive filter is such type of filter whose characteristics can be changed for achieving optimal
desired output. An adaptive filter can change its parameters to minimize the error signal by using
adaptive algorithms. The error is the difference between the desired signal and the output signal
of the filter. The figure below shows the basic model of adaptive filter used in AEC.

Figure 3.4: The basic model of AEC

The notions are used for in the figure above and during this project in turn are:

Far-end signal: x(n)


Near-end signal: v(n)
The true echo path (room impulse response): h
Echo signal: y(n)
Microphone signal: d(n) = v(n) + y(n)
Estimated echo path: ĥ
Estimate echo signal: ŷ(n)
Error signal: e( n)= v(n) + y( n) - ŷ(n)
The echo path h of the room normally variable depends on the room structure and the moving
object inside. The estimated echo ŷ(n) is calculated from the reference input signal x(n)

14
and the adaptive filter ĥ. The near-end signal v(n) and background noise are added into echo
signal y (n) to create the desired signal d (n),

d(n) = v(n) + y(n)


The signal x (n) and y(n) are correlated. We get the error signal as,
error (n) =d (n) + ŷ (n) = v (n) + y (n) - ŷ (n)
The adaptive filter works to minimize the echo y(n)-ŷ(n) to be zero to obtain only
near-end signal v (n) in the perfect case.

4.2.1 Wiener Filter

Figure 3.5: General Wiener filter problem.

Wiener filters play a central role in a wide range of applications such as linear prediction, echo
cancellation, signal restoration, channel equalization and system identification. The FIR Wiener
Filter is the signal processing to produces the minimum mean-square estimate, d (n$) of d (n).
Two signals x (n) and d(n) are assumed to be wide-sense stationary with known autocorrelations
rx(k), rd(k) and cross-correlation rdx(k) .W (n) is the unit sample response of the wiener filter:

p−1
W (z) =∑ w ( n ) z n (3.3)
n−1

The output signal dˆ(n) of the wiener filter is the convolution of w(n) and x(n) 9,
p−1
d^ (n)=∑ w ( l ) x ( n−1 ) (3.4)
n=0

The requirement of the filter is to find filter coefficients w(k) that minimizing the mean square
error,

ξ=E{|e(n)|2 }=E{|d(n) –|2 }

ξ=E{|e(n)|2 }=E{|d(n) –d^ (n)|2 }

15
Now taking the derivative to both sides with respect to with respect to w(k),

∂ξ ∂ξ ∂ e∗(n)
= {E(e(n)e*(n))}={e(n) }
∂ w∗(k) ∂ w∗(k)∁ ∂ w∗(k)
(3.6)

For k = 0,1,..., p -1,

This derivative must be equal to zero to minimize ξ for a set of filter coefficients,

∂ e∗(n)
{e(n) }=0
∂ w∗(k)
(3.7)

Where,
p−1
the error signal e (n) =d ( n )− d^ (n)=d ( n ) −∑ w ( l ) x( n−l) (3.8)
n−1

It follows that

∂ e∗( n )
=x*(n-k)
∂ w∗(k)

Now the above Equation (3.7) becomes,

E{e(n)x*(n-k)}=0; k = 0,1, 2,..., p-1

This equation is known as orthogonally principle or the projection theorem.

By substituting e(n) in Equation (3.8) into Equation (3.9) , we have


p−1
E{d(n)x*(n-k)}-∑ w (l ) E {x ( n−1 ) x∗( n−k ) }=0
l =0

Already assumed that x(n) and d(n) are jointly wide-sense stationary, then

E{x(n-1)x*(n-1)= rk(k-1)

E{d(n) x*(n-k)}=rdx (k)

So the above equation becomes,

16
p−1

∑ w (l ) rx (k−1)= rdx(k); k = 0,1, 2,..., p-1


n =0

This equation is known as Wiener-Hopf equation and we can write this equation in generalized
form as,
Rxw=rdx

Where:
Rx is p×p Hermitian Toeplitz matrix of auto correlation
w is vector of filter coefficients
rdx is vector of cross-correlation between d(n) and x(n)
By taking the Equation (3.5), we try to find the minimum mean square error,
p−1
ξ =E{|e(n)| }={e(n)[d(n)- ∑ w (l ) x (n−1) ]*}
2

l =0

p−1
=E {e(n)d*(n)}-∑ w∗( l ) E {e ( n ) x∗( n−1 ) }
l =0

By following the Equation (3.9), the second term of above Equation (3.15) is equal to

Zero. So we attain,

𝝽min=E {e(n)d*(n)}

Also, we have,
p−1
e (n)=d(n)-∑ w (l ) x (n−1)
n =0

So Equation (3.16) becomes,

𝝽min = E {e (n)d*(n)}=E{[d(n)-∑ w (l ) x (n−1)]d*(n)}


p−1

n =0

Finally, by taking the expected values, we have

𝝽min = rd(0)-∑ w (l ) r dx (l)


p−1

n =0

In vector form, we have from Equation (3.14) and Equation (3.18)

17
𝝽min=rd(0)-r dx w
H
or

𝝽min=rd(0) - r dx R X rdx
H −1

4.2.2Steepest Decent Method

The method of steepest descent is an iterative procedure that has been used to find extreme of
nonlinear functions since before the time of Newton

In the steepest decent or gradient algorithm, the mean square error surface (respect to an FIR
filter coefficients) is a quadratic bowl-shaped curve as shown in Figure (3.6) below

Figure 3.6: illustration of gradient search of the mean square error surface for the minimum error
point

This figure explains the mean square error curve for a single coefficient filter and the steepest
decent search for the coefficient of minimum mean square error. This steepest decent search is to

18
find a value by taking successive downward step in the direction of negative gradient of the error
surface. By taking start with different initial values and the coefficients of the filter are updated
while moving in the downward direction towards the negative gradient and until a point comes
where the gradient shows zero value. This steepest decent adaptation method can be written as,

W(n+1)=w(n)-µ∇ £(n)

Where μ is the step-size parameter and ξ(n) is the mean square error at time n.

Now we assume that we have,

d^ (n)=W T x(n)

R x=E{x(n) x T d(n)} (3.24)

rd x =E{x(n)d(n)} (3.25)

The gradient of the mean square error function is,

∆£(n) = ∇ E{|e(n)|2}=E{ |e(n)|2}=E{e(n)∇ e¿ (n } (3.26)

And we know that,


¿
∇ e (n) =- x ¿ (n)

Thus it yields,

∇ Ԑ (n) =-E{ e(n) x ¿(n)} (3.27)

In the case of stationary processes, if x(n) and d(n) are jointly WSS (wide-sense

Stationary ) then,
¿ ¿
E{e(n) x (n) }= E{ d(n) x t (n)) } - E{w Tn x(n) x (n) }

= rd x - R x w(n) (3.28)

Therefore,

∇ Ԑ (n) =- rd x + R X w(n) (3.29)

By considering the above two Equations (3.22) and (3.29), we have

W(n+1)=w(n)+µ[r d x - R X w(n)] (3.30)

19
Now we can define a filter coefficients error vector as,
~
w (n) =W(n)+w o

Where,

 w o is the optimal least square error filter coefficient vector.

By Wiener filter, w o is given by,


−1
wo = R X rd x (3.32)

After few mathematical arrangements in last three equations, (2.30) becomes,

~
w (n+1)= [I-µ R x ]w(n)

The step-size parameter μ controls the stability and rate of convergence of the adaptive filter.
The filter shows instability if the value of μ is too large and low convergence rate if μ too small.
The stability of the filter depends on the selection of step-size adaptive parameter μ and the
autocorrelation matrix. The correlation matrix can be expressed in term of the matrices of
eigenvectors and eigen values as,

R x=Q˄QT

Where,

 Q is orthonormal matrix of the eigenvectors of Rx.


 Λ is a diagonal matrix having diagonal elements corresponding to the eigen values of
Rx.

By putting the value of Rx in Equation (3.34) into Equation (3.33) we obtain,

~
w (n+1) =[I- Q^QT ]w(n) (3.35)

Multiplying QT to both sides of Equation (3.35) and the using relations QT Q = QQT = I
yields,

W(n+1)=[I- Q ˄QT ] w(n) (3.36)

20
Let v(n) =QT w(n),

So the Equation (3.36) becomes,

V(n+1)= [I-µ˄ ]v(n) (3.37)

Here, Ι and Λ are diagonal matrices. So the above equation can be written in term of
individual elements of the error vector v(n) as,

V k = [I-µ⋋k ] V k (n) (3.38)

Where is the eigen values of the autocorrelation of the filter input x(n)

Figure 3.7: Feedback model of the variation of coefficient error with time

By considering the Equation (3.38), we make a condition for stability for the process

of adaptation and the coefficient error vector decay is,

-1< 1-µ⋋k <1 (3.39)

Let’s denote ⋋max the maximum eigenvalue of the autocorrelation matrix, the limits

Of μ for stable adaptation is,

2
0<µ<
⋋max

21
4.2.3 Least Mean Square (LMS) Algorithm
In 1959, Widow and Hoff [3] derived an algorithm whose name was Least Mean Square
(LMS) algorithm and till now it is one of the best adaptive filtering algorithms. This
algorithm is used widely for different application such as channel equalization and
echo cancellation. This algorithm adjusts the coefficients of w(n) of a filter in order to
reduce the mean square error between the desired signal and output of the filter. This
algorithm is basically the type of adaptive filter known as stochastic gradient-based
algorithms. Why it’s called stochastic gradient algorithm? Because in order to
converge on the optimal Wiener solution, this algorithm use the gradient vector of the
filter tap weights. This algorithm is also used due to its computational simplicity

The equation below is LMS algorithm for updating the tap weights of the adaptive
filter for each iteration.
W(n+1)=w(n)+µe(n)X*(n)
Where,
X (n): input vector of time delayed input values.
w(n) : weight vector at time n .
µ is a step-size parameter and it controls the immediate change of the updating factor.
It shows a great impact on the performance of the LMS algorithm in order to change
its value. If the value of µ is so small then the adaptive filter takes long time to
converge on the optimal solution and in case of large value the adaptive filter will be
diverge and become unstable.
Derivation of the LMS algorithm:
The derivation of LMS algorithm is the development of the steepest decent method
and also takes help from the theory of Wiener solution (optimal filter tap weights).
This algorithm is basically using the formulas which updates the filter coefficients by
using the tap weight vectors w and also update the gradient of the cost function
accordingly to the filter tap weight coefficient vector ∇ξ (n). From Equation (4.22) in
the steepest decent algorithm,

22
W (n+1) =w (n)-µ∇ξ (n)
W (n+1) =w(n) +µE{e(n)X*(n)}
In practice, the value of the expectation E{e(n)X*(n)} is normally unknown, therefore
we need to introduces the approximation or estimated as the sample mean,
l−1
1
Ê{e(n)x*(n)}=
l ∑ e ( l−1 ) x ¿ (l−1)
l=0

With this estimate we obtain the updating weight vector as,


p−1
W (n+1)=w(n)+ ∑ e (l−1 ) x (l−1)
¿

l =0

If we using one point sample mean (L=1) then,

Ê{e(n)X*(n)}=e(n)X*(n)
And finally, the weight vector update equation become the simple form,
W (n+1)=w(n)-µe(n)X*(n)

4.3 Double-talk detector (DTD)


In Acoustic Echo Cancellation, the most difficult problem is to handle with the situation of
Double-talk presence. Double-talk occurs when far-end and near-end talk at the same time, as a
result, the far-end speech signal is corrupted by near-end signal.
To solve this problem, one introduces the Double-talk Detector. The task of DTD is freezes the
adaptation step during filtering algorithm in case of near-end speech present to avoid the
divergence of adaptive algorithm. Without DTD, when the near end talking would make the
system estimation process fail and produce extremely erroneous results. Now we see the Figure
(3.6), when near-end speech is not present (v (n) =0) then the adaptive algorithm will quickly
converse to an estimate echo path. This is the best case of canceling echo. But when near-end
speech present (v (n) =0) then this signal could influence to the adaptation of the filter and cause
the divergence. The process of adaptive algorithm will be incorrect and the echo cannot be
removed.

23
By implementing the DTD and Updating filter blocks in the figure above, the DTD
will estimate the statistic decision may depend on far-end speech, near-end speech and
error signal. After that, it will compare to the threshold to make the DTD decision to
control the Updating filter (freeze the adaptation or not). The “Updating filter” block
here has the meaning as a switch (on or off) which permits to update weight vector or
not. There are several methods of DTD, one can use the basic algorithm as Geigel, one
bases on the cross correlation calculations (Benesty and Normalized Cross-Correlation
algorithms) and another method is Variance Impulse Response.

4.3.1 Normalized cross-correlation (NCC) algorithm


One of method here we will discuss for doubletalk detection is the Normalized Cross Correlation
algorithm [8]. The NCC algorithm computes the decision statistic depending on the relations of
microphone signal and error signal. It can be approached by considering the values of variance of
near-end signal and cross-correlation between error signal and microphone signal.
The cross-correlation red between the error signal e(n) and microphone signal d(n) which is
given as,
red=E{e(n)d(n)

24
=E[(y(n)+v(n)-hT x(n))(y(n)+v(n))T]
=E[(hT x(n)-hT x(n)+v(n))(hT x(n)+v(n))T]
=E[(hT x(n)-ĥ T x(n)) x (n)T h+v(n) v (n)T ]
=(hT -ĥ T )Rxh+σ 2v

Now one introduces the normalized decision statistic as,


r ed
ξ Ncc =1−
= 2 (3.78)
σ
d
By substituting the values of red and from above relations into Equation (2.78), we have,
( h T −hT ) R x h+ σ 2 v
=ξ Ncc =1−
h T R x h+σ 2 v
T
h Rx h
= T 2 (3.79)
h R x h+ σ v
Look at the Equation (3.79), when the adaptive filter works well to converge to an
estimate echo path that approximately equal to the true echo path h . Therefore,
easily to obtain bellow conclusion,
If near-end speech is present ( v(n) = 0 ), then ξ MEcc ≈ 1

If near-end speech is not present ( v(n) ≠ 0 ), then ξ MEcc <1


Thus, finally we get the double-talk decisions as,
decision= ξ Ncc (t)<T Double Talk

ξ Ncc (t)>T No Double talk


Where, T is a threshold with the chosen value approximately is 1.

The values of and are not available in practice, so we define the new estimated
decision statistic as,
~r
ed
ξ =1−
= Ncc ~ 2 (3.79)
σ
d
Where,
~r ed is the estimate of r ed

25
2 2
~
σ is the estimate of σ
d d
We can found these estimates by using the exponential recursive weighting algorithm.
r ed = λ r ed (n+1)+(1- λ)e(n) d T (n) (3.81)
2 2
σ = λ σ (n+1)+ (1-λ)d T (n) (3.82)
d d
Where,
e(n) is the captured cancellation error sample at time n
d(n) is the captured microphone signal sample at time n
λ is the exponential weighting factor (λ <1 and λ ≈1)

26
3.4 SIMULATION

In the previous chapters above provided us the detail theory about the Acoustic Echo
Cancellation including Algorithms of Adaptive filter, Double-talk Detection and other issues.
This chapter will perform these ideas to simulate the topic’s problems by using the software
environment (MATLAB).
3.4 SIMULATION
In the previous chapters above provided us the detail theory about the Acoustic Echo
Cancellation including Algorithms of Adaptive filter, Double-talk Detection and other issues.
This chapter will perform these ideas to simulate the topic’s problems by using the software
environment (MATLAB).
3.4.1 GENERAL SETUP OF SIMULATION
Setup of the Simulation
1. MATLAB
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:
Adaptive echo cancellation
Easy to record audio signals of the far-end and near-end speeches. These data are
indispensable of the simulation.

27
Matrix calculation is very important since data was processed as the matrix formats.
Easy to monitor the results by plotting desired graphs. Especially, we need to hear the resultant
sounds – By MATLAB, it is simple to achieve.
The structure of the commands is suitable to compute with Signal Processing
2. Requirements during the simulation
This simulation tries to perform the tasks of the acoustic echo canceller and doubletalk detector
at the near-end conference room. We assume that both far-end and near-end rooms are the same
characteristics (size, acoustic features). In the case of the perfectively performance of the far-end
echo canceller, we only try to do the task of near-end room.
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 40,000
samples ,as follow

28
Chapter four

4.1 Work plan


NO ACTIVITY MARCH APIRL MAY

Week 3

Week 4

Week 1

Week 2

Week 3

Week 4

Week 1

Week 2

Week 3

Week 4
1 Title selection
2 Literature Review
3 Data collection
4 Proposal
preparation
5 Mathematical
analysis
6 Simulating
&analysis
7 Documentation
8 Presentation
Table 4.1.Table of work plan

29
30
REFERENCES

[1]. Rachana Nagal, Pradeep Kumar and Poonam Bansal, “An Approach to Implement LMS
and NLMS Adaptive Noise Cancellation Algorithm in Frequency domain”, pp. 871-876,
September,2014.
[2]. Vaibhav Narula, Mukul Sagar, Pranab Joshi, “Assessment of Variants of LMS Algorithms
for Noise Cancellation in Low and Medium Frequency Signals”, pp. 432-437, December, 2011.

[3]. Thamar M. Jamal, “Performance Enhancement of Adaptive Acoustic Echo Canceller Using
a New Time Varying Step Size LMS Algorithm (NTVSSLMS)”, January, 2013.

[4]. John Hakon Husoy and Mohammad Shams Esfand Abadi, “A Family of Flexible NLMStype
Adaptive Filter Algorithms”, pp.1-5, December, 2007.

31
32

You might also like