# 0.3 The adaptive filter method

 Page 1 / 1
Background on a few adaptive filtering algorithms we tried in our echo cancellation project.

Adaptive filters are time-varying filters that use an update algorithm to create a finite impulse response (FIR) filter that outputs the best approximation of desired signal. Adaptive filters take in a desired signal and an input signal and update their parameters using feedback driven by the error signal. The adaptive filter finds the ideal filter coefficients for a filter that gives the least mean square of the error signal. The error signal is defined as the difference of the desired signal and the output signal.

$e\left(n\right)=d\left(n\right)-y\left(n\right)$

At every iteration (or block of samples) the gradient of the mean square error at that time is found, and is then used to adjust the filter coefficients at the time to converge towards the ideal filter coefficients.

We trained adaptive filters using signals recorded in a low-echo environment using three algorithms to filter out echoes in an echoic room and in the OEDK classroom. Our desired signal is a recording of our signal in a low-echo environment that would give us a signal with minimal echo. This gave us a baseline for the distortion of the signal caused by our equipment.

Having gathered a baseline signal, we recorded our input signals in the echoic room and the OEDK classroom. The basic idea of the adaptive filter method is to take in a desired signal and an input signal and mimic an ideal filter with ideal filter coefficients that would make the output signal virtually echo-free and therefore comparable to the desired signal. We explored three different adaptive filtering algorithms for our project.

## The least mean squares (lms) algorithm

The LMS algorithm is a class of adaptive filter used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean squares of the error signal (the difference between the desired and the actual signal). The algorithm begins by assuming small weights (zero in most cases), and at each step, by finding the gradient of the mean square error, $E\left[{e}^{2}\left(n\right)\right]$ , the weights are updated using this cost function. Each iteration uses three steps:

• Calculate the output of the filter.
$y\left(n\right)={w}^{T}\left(n\right)x\left(n\right)$
• Calculate the estimate of the error using the error signal.
$e\left(n\right)=d\left(n\right)-y\left(n\right)$
• Update the weights of the FIR coefficients.
$w\left(n+1\right)=w\left(n\right)+2\mu e\left(n\right)x\left(n\right)$
$y\left(n\right)$ is the output of the filter, $w\left(n\right)$ are the coefficients of the FIR filter, $x\left(n\right)$ is the input signal, $d\left(n\right)$ is the desired signal, and $\mu$ is the step size.

Computational complexity: $2N$ additions, $2N+1$ multiplications.

The MathWorks adaptfilt.lms documentation can be used in Matlab to create an LMS adaptive filter object.

## The normalized lms (nlms) algorithm

NLMS allows for a variable step size $\mu \left(n\right)$ for each iteration. The first two steps of the algorithm are identical to the first two steps of the regular LMS algorithm.

• Calculate the output of the filter.
$y\left(n\right)={w}^{T}\left(n\right)x\left(n\right)$
• Calculate the estimate of the error using the error signal.
$e\left(n\right)=d\left(n\right)-y\left(n\right)$
• Calculate the step size for the input.
$\mu \left(n\right)=\frac{1}{{x}^{T}\left(n\right)x\left(n\right)}$
• Update the weights of the FIR coefficients.
$w\left(n+1\right)=w\left(n\right)+\mu \left(n\right)e\left(n\right)x\left(n\right)$

Computational Complexity: $2N$ additions $3N+1$ multiplications.

The MathWorks adaptfilt.nlms documentation can be used in Matlab to create an NLMS adaptive filter object.

## The block lms (blms) algorithm

Rather than computing by discrete samples, the BLMS algorithm calculates in blocks of data, reducing computation cost and improving the convergence rate. The BLMS algorithm can be implemented in the frequency domain using the Discrete Fourier Transform or the FFT.

Computational complexity: $\frac{4N}{B}+\left(\frac{N}{B}+3\right)\mathrm{log}\left(2B\right)$ , where $B$ is the block length.

The MathWorks adaptfilt.blms documentation can be used in Matlab to create a BLMS adaptive filter object.

## Filtering in matlab

1. Choose a signal to be recorded. We chose a pseudo-dirac, an audiobook recording from The Hunger Games and a recording from Winston Churchill's A History of the English Peoples .
2. Record the signal being played in a room with desired acoustical properties. This is the desired signal, $d\left(n\right)$ . We chose a carpeted room in Hanszen College that had little discernible echo.
3. Record the signal being played in the echoed room. This is the input signal $x\left(n\right)$ . We recorded in the OEDK classroom and in an even more echoic classroom in Wiess College.
4. Import both responses into Matlab.
5. If you use Matlab's built-in adaptive filters. Create the adaptfilt object corresponding to the algorithm with desired parameters.
6. Use the maxstep() function to check that your filter is stable. If not, adjust your step size.
7. Use the filter() with your filter object, the input signal and the desire signal.
The desired signal, $d\left(n\right)$ , needs to be recorded in another room in order to neutralize the effects of the recording equipment and the amplifier. Using the original signal could lead to the filter trying to compensate for effects introduced by the equipment and the amplifier instead of the echoes caused by the room. Furthermore, the desired and input signals need to start at the same time. Cut out any silence beforehand so that the vectors line up, this way the adaptive filter sifts out the echoes at the appropriate times.
We used the Audacity software to record the sounds, trim the beginning of the sound files, and zero pad them to equal length. We exported these files as .wav files and then, on Matlab, used the wavread() function to import the sounds.
Links to MathWorks documentation for various adaptive filters can be found here .

anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Berger describes sociologists as concerned with
Got questions? Join the online conversation and get instant answers!