The International Journal of Engineering and Science (The IJES)
File 2
1. CHAPTER -1
INTRODUCTION
1.1 OVERVIEW:-
It may be worth trying to understand the meaning of the terms ‘Adaptive’ and
‘filters’ in a very general sense. The adjective ‘Adaptive’ can be understood by
considering the system which is trying to adjust itself so as to respond to some
phenomenon that is taking place in its surrounding. In other words the system tries to
adjust its parameters with the aim of meeting some well-defined goal or target which
depends upon the state of the system as well as its surrounding. This is what
‘Adaptation’ means. Moreover, there is a need to have a set of steps or certain procedure
by which this process of ‘Adaptation’ is carried out. And finally, the ‘system’ that carries
out and undergoes the process of ‘Adaptation’ is called by the more technical, yet
general enough, name ‘filter’.
The subject of adaptive filters constitutes an important part of statistical signal
processing. Whenever there is a requirement to process signals that result from operation
in an environment of unknown statistics or one that is inherently non-stationary, the use
of an adaptive filter offers a highly attractive solution to the problem as it provides a
significant improvement in performance over the use of a fixed filter designed by
conventional methods. Furthermore, the use of adaptive filter provides new signal
processing capabilities that would not be possible otherwise. We thus find that adaptive
filters have been successfully applied in such diverse fields as communications, control,
radar, sonar & biomedical engineering, among others.
The term estimator or filter is commonly used to refer to a system that is designed
to extract information about a prescribed quantity of interest from noisy data. Clearly,
depending upon the time required to meet the final target of the adaptation process,
which we call convergence time, and the complexity/resources that are available to carry
out the adaptation, we can have a variety of adaptation algorithms and filter structures.
From this point of view, we may go through the adaptive algorithms like LMS, NLMS,
VSLMS, VSNLMS, RLS..
1
2. 1.2 OBJECTIVE OF THE PROJECT
Nowadays there are so many cases where the noise is unknown and variable. This kind
of noises cannot be suppressed by using fixed filters like notch, etc. To suppress this kind
of noise Adaptive Filter is used. Adaptive means tendency to adapt different situations.
The use of an adaptive filter offers a highly attractive solution to the problem as it
provides a significant improvement in performance over the use of a fixed filter designed
by conventional methods. This seminar is based on various techniques and algorithms for
noise cancellation like LMS, NLMS, RLS,etc..
1.3 PROJECT SCOPE
This project is focused to design and build a adaptive filter that would filter
the unwanted noise by using various algorithms like LMS, NLMS, RLS,etc .This type
of filters can be used in many practical applications such as in ear phones.
1.4 ANALYZING THE PROJECT:-
The use of adaptive filter provides new signal processing capabilities that would
not be possible otherwise. We thus find that adaptive filters have been successfully
applied in such diverse fields as communications, control, radar, sonar & biomedical
engineering, among others[1]. The term estimator or filter is commonly used to refer to a
system that is designed to extract information about a prescribed quantity of interest from
noisy data. Clearly, depending upon the time required to meet the final target of the
adaptation process, which we call convergence time, and the complexity/resources that
are available to carry out the adaptation, we can have a variety of adaptation algorithms
and filter structures. From this point of view, we may go through the adaptive algorithms
like LMS, NLMS, VSLMS, VSNLMS, RLS
1.5) IMPROVEMENT TO THE PREVIOUS PROJECT :-
Digital signal processing (DSP) has been a major player in the current technical
advancements such as noise filtering, system identification, and voice prediction.
Standard DSP techniques, however, are not enough to solve these problems quickly and
obtain acceptable results. Adaptive filtering techniques must be implemented to promote
accurate solutions and a timely convergence to that solution.
1.6) THESIS ORGANIZATION
2
3. This thesis consists of six chapters. This chapter discuss about overview of
project, objective research, project scope, problem statement and thesis organization.
Chapter 2 contains a detailed description of adaptive filtering and the
blocks involved in their design.
Chapter 3 includes the project methodology. It will explain how the project is
organized and the flow of process in completing this project. Also in this topic
discusses the methodology of the system, circuit design, software design and the
mechanical design.
Chapter 4 contained detailed description about hardware development.
It will explain more detail about the electronic component that had been used and the
method used to develop hardware.
Chapter 5 includes the software methodology. This will discuss more about the
software that had been use to design a programming for the whole project and the
software that had been used to design a Printed Circuit Board (PCB).
Chapter 6 will discuss more about the result and discussion. This chapter will
show the result of this project step by step.
3
4. CHAPTER 2
ADAPTIVE FILTERING
2.1) INTRODUCTION:
A filter is designed and used to extract or enhance the desired information
contained in a signal. An adaptive filter is a filter with an associated adaptive
algorithm for updating filter coefficients so that the filter can be operated in an
unknown and changing environment. The adaptive algorithm determines filter
characteristics by adjusting filter coefficients (or tap weights) according to the signal
conditions and performance criteria (or quality assessment). A typical performance
criterion is based on an error signal, which is the difference between the filter output
signal and a given reference (or desired) signal. An adaptive filter is a digital filter
with coefficients that are determined and updated by an adaptive algorithm.
Therefore, the adaptive algorithm behaves like a human operator that has the ability to
adapt in a changing environment. For example, a human operator can avoid a
collision by examining the visual information (input signal) based on his/her past
experience (desired or reference signal) and by using visual guidance (performance
feedback signal) to direct the vehicle to a safe position (output signal).
2.2)Adaptive Filtering System Configurations :
There are four major types of adaptive filtering configurations; adaptive system
identification, adaptive noise cancellation, adaptive linear prediction, and adaptive
inverse system. All of the above systems are similar in the implementation of the
algorithm, but different in system configuration. All 4 systems have the same general
parts; an input x(n), a desired result d(n), an output y(n), an adaptive transfer function
w(n), and an error signal e(n) which is the difference between the desired output u(n)
and the actual output y(n). In addition to these parts, the system identification and the
inverse system configurations have an unknown linear system u(n) that can receive
an input and give a linear output to the given input.
2.2.1)Adaptive System Identification Configuration
The adaptive system identification is primarily responsible for determining a discrete
estimation of the transfer function for an unknown digital or analog system. The same
input x(n) is applied to both the adaptive filter and the unknown system from which the
4
5. outputs are compared (see figure 1). The output of the adaptive filter y(n) is subtracted
from the output of the unknown system resulting in a desired signal d(n). The resulting
difference is an error signal e(n) used to manipulate the filter coefficients of the
adaptive system trending towards an error signal of zero.
Both of the noise signals for this configuration need to be uncorrelated to the signal
s(n). In addition, the noise sources must be correlated to each other in some way,
preferably equal, to get the best results. Do to the nature of the error signal, the error
signal will never become zero. The error signal should converge to the signal s(n), but
not converge to the exact signal. In other words, the difference between the signal s(n)
and the error signal e(n) will always be greater than zero. The only option is to
minimize the difference between those two signals.
2.2.2)Adaptive Linear Prediction Configuration
Adaptive linear prediction is the third type of adaptive configuration (see figure 3).
This configuration essentially performs two operations. The first operation, if the
output is taken from the error signal e(n), is linear prediction. The adaptive filter
coefficients are being trained to predict, from the statistics of the input signal x(n),
what the next input signal will be. The second operation, if the output is taken from
y(n), is a noise filter similar to the adaptive noise cancellation outlined in the previous
section.
As in the previous section, neither the linear prediction output nor the noise
cancellation output will converge to an error of zero. This is true for the linear
prediction output because if the error signal did converge to zero, this would mean
5
6. that the input signal x(n) is entirely deterministic, in which case we would not need
to transmit any information at all.
In the case of the noise filtering output, as outlined in the previous section, y(n) will
converge to the noiseless version of the input signal.
2.2.3)Adaptive Inverse System Configuration
The final filter configuration is the adaptive inverse system configuration as
shown in figure 4. The goal of the adaptive filter here is to model the inverse of the
unknown system u(n). This is particularly useful in adaptive equalization where the goal
of the filter is to eliminate any spectral changes that are caused by a prior system or
transmission line. The way this filter works is as follows. The input x(n) is sent through
the unknown filter u(n) and then through the adaptive filter resulting in an output y(n).
The input is also sent through a delay to attain d(n). As the error signal is converging to
zero, the adaptive filter coefficients w(n) are converging to the inverse of the unknown
system u(n).
6
7. For this configuration, as for the system identification configuration, the error can
theoretically go to zero. This will only be true, however, if the unknown system
consists only of a finite number of poles or the adaptive filter is an IIR filter. If neither
of these conditions are true, the system will converge only to a constant due to the
limited number of zeroes available in an FIR system.
2.3)APPLICATIONS OF ADAPTIVE FILTERING:-
Adaptive filtering finds practical applications in many diverse fields such as
communications, radar, sonar, control, navigation, seismology, biomedical
engineering and even in financial engineering [1–7]. In Section 1.6, we will introduce
some typical applications using adaptive filtering.
2.4CONCLUSION:
This chapter also briefly introduces subband adaptive filters that are more
computationally efficient for applications that need a longer filter length, and are
more effective if the input signal is highly correlated. For example, high-order
adaptive filters are required to cancel the acoustic echo in hands-free telephones [2].
The high-order filter together with a highly correlated input signal degrades the
performances of most time-domain adaptive filters. Adaptive algorithms that are
effective in dealing with ill-conditioning problems are available; however, such
algorithms are usually computationally demanding, thereby limiting their use in many
real-world applications.
7
8. CHAPTER-3
ADAPTIVE ALGORITHMS
3.)INTRODUCTION:
An adaptive algorithm is a set of recursive equations used to adjust the weight
vector w(n) automatically to minimize the error signal e(n) such that the weight vector
converges iteratively to the optimum solution wo that corresponds to the bottom of the
performance surface, i.e. the minimum MSE Jmin. The least-mean-square (LMS)
algorithm is the most widely used among various adaptive algorithms because of its
simplicity and robustness
3.2 LMS algorithm:
The least mean square (LMS) algorithm is the simplest and is the most universally
applicable adaptive algorithm to be used. This algorithm is used for the descending on
the performance surface, and is known as the least mean square algorithm. The weights
are updated using this algorithm. This algorithm uses a special estimate of the gradient
that is valid for the adaptive linear combiner. This algorithm is important because of its
simplicity and ease of computation, and it doesn’t require off-line gradient estimations or
repetitions of data. If the adaptive system is an adaptive linear combiner, and if the input
vector x(n) and the desired response d(n) are available at each iteration, the LMS
algorithm is generally the best choice for many different applications of adaptive signal
processing [Kuo96].
3.3 Filtered- X LMS algorithm:
The use of adaptive filter is complicated by the fact that electrical reference signal must
be obtained from the acoustic pressure using a microphone. Also, an electrical error
signal must be obtained from the residual acoustic noise using as error microphone.
Finally, the canceling sound must be produced from the electrical output signal using a
loud speaker. Therefore, a number of other transfer functions must be included. The
summing junction represents acoustic superposition in the space from the canceling
loudspeaker to the error microphone, where the primary noise is combined with the
output of the adaptive filter. Therefore it is necessary to compensate for the secondary
path transfer function S(z) from y(n) to e(n),which includes the D/A converter,
reconstruction filter, power amplifier error microphone etc. [Kuo96].
3.4Transform Domain Adaptive Algorithm:
The main shortage of the filtered –X LMS algorithm, which is widely used in a variety of
active noise control (ANC) systems, is that its convergence behavior highly depends on
8
9. the power spectrum of the filtered reference signal. The more correlated reference signal
is the slower convergence speed the adaptive filter can achieve. Transform domain
adaptive filter (TDAF) into ANC to solve this problem. To strongly correlate broadband
signal, TDAF can achieve much faster convergence speed than LMS with relative low
computational cost [Son02]. These three algorithms are elaborated in Appendix A.
3.5)Practical applications
Noise canceling headphones are particularly useful for workers, operating or working
near heavy machinery and engines. The noise is selectively eliminated thus enabling the
reception of the desired sounds, such as speech and warning signals.
Cabin noise in small aircraft is a combination of noise from a variety of sources,
the major ones being the engine, wind, and propeller. So plane pilots routinely wear
noise attenuating headsets to get rid of the unwanted noise. Such headsets usually
employ passive noise attenuation in the form of an annular cushion carried on the rim of
each earcup. But NCH is proved to be worthy in attenuating noise to a further level
which makes the pilot as well as passengers to hear warnings and instructions
effectively. In hospitals to diagnose the hearing defects in human ear and speech
discrimination,
noiseless room is required which is highly expensive. Most of the hospitals cannot afford
to procure such rooms. The noise canceling headphone along with audiometry
apparatus can be useful in this application.
The proposed NCH for audiometry is as shown in Fig.6. A test tone is given to
headphone as input. A microphone is placed inside the headphone which senses noise
along with tone. The test tone is subtracted from the microphone output using spectral
subtraction before it is given as input to LMS block. The output of the LMS block is an
anti noise signal which is added to test tone at the summing block. Finally the speaker
gives an output which is a combination of anti noise signal and tone so that anti noise
signal cancels the noise and listener only gets test tone. The attenuation required for
audiometry application is high compared to other applications of NCHs. So the better
passive attenuation as well active attenuation is required.
In military applications, the soldiers usually work noisy environments. NCH are handy in
9
10. hearing commands through mobile sets devoid of any noise. As a commercial
application NCHs along with personalized music system (Walkman,
etc.) can provide better listening conditions for music. Sony, NCT, Aiwa, and Bose
Corporation are producing these headphones, mainly used for audio listening.
Information of these is given in Appendix B.
CHAPTER-4
MATHEMATICAL EQUATIONS TO VARIOUS ALGORITHMS
LMS Algorithm
The LMS algorithm is used to create a filter w. The input is defined as the vector x, the
output is the scalar y, and the desired output is the scalar d. The output is calculated
according to
y(n) = x(n)T w(n) (1)
where the subscript n defines the time indexing. The scalar error e(n) is defined as
e(n) = d(n) – y(n) and the filter is updated according to w(n+1) = w(n) + 2 m e(n) x(n)
(3) where m is an update coefficient that determines the speed of the adaptation. We also
define R = E[xxT] (where E[·] denotes expectation) as the autocorrelation matrix. The
largest valid value of m is 1/lmax, where lmax is the largest eigenvalue of R. Larger
values of m will cause instability and the weights will not converge. The error signal will
decrease as the weights converge, and follow a set of exponential curves, each with time
constant tn = 1/ (4mln) where ln is the nth eigenvalue of R.
The LMS algorithm is one of a class of gradient descent algorithms. Another
variant, known as the a-LMS algorithm is given by
w(n+1)= w(n) + a e(n)x(n)/|x(n)|2
10
11. Figure.7 System identification block diagram,
Note that 2m has been replaced by a, and the input signal x(n) is scaled by its
magnitude. These changes remove the need for eigenvalue estimation to choose m.
Values in the range 0 < a < 2 converge, and the time constants are unchanged since the
ratio of eigenvalues in R are still the same. This algorithm is particularly useful in the
face of nonstationary x signals. In this case, the assumption that scaling x(n) leaves the
eigenvalue ratio unchanged is false. However, it still relieves us of the estimation of
values for m and thus it is useful for nonstationary x. The main drawback of the LMS
algorithm is the speed of convergence becomes very slow if there is a big spread among
the eigenvalues of R and changes in the feedback path. The existence of the secondary
path affects the performance of ANC filter and the convergence of the LMS algorithm .
Filtered –X LMS algorithm
Figure.8 Block diagram of ANC system using the FXLMS algorithm, from [Kuo96].
The compensation can be carried by placing an inverse filter in series with the
loudspeaker or placing as identical filter in the reference signal path to the weight update
of LMS algorithm. The placement of the secondary path transfer function following the
digital filter W(z) controlled by the LMS algorithm is shown in figure 8.The residual
error is expressed as
e( n) =d(n)-y’(n)
=d(n)-s(n) * y(n)
=d(n – s(n) * [w T(n) x(n)]
11
12. where s(n) is the impulse response of the secondary path S(z) at time n,* denotes linear
convolution,
w(n)= [w0(n) w1(n) . . . w L-1(n)]T
is the coefficient vector of W(z) at times n,
x(n) = [x(n) x(n-1) … x(n-L+1)]T
is the signal vector at time n and L is the order of the filter W(z)
The objective of the adaptive filter is to minimize the instantaneous squared error,
xˆ(n) =e2(n) .The most widely used method to achieve this is the stochastic gradient or
LMS algorithm, which updates the coefficient in the negative gradient direction with step
size m
w(n+1)=w(n)-2µξˆ(n)
where xˆ(n) is an instantaneous estimate of the MSE gradient at time n, and can be
expressed as W(n) = w(n) + m x’(n) e(n)
The implementation of the filtered-x LMS algorithm is more complicated than that of
the normal LMS algorithm because of the need to generate the filtered reference signal.
Also the stability of the algorithm depends on the accuracy of the estimated
filter Sˆ(z)modeling the true secondary path [Kuo96].
Transform Domain Adaptive Algorithm
Figure.9 Feedforward ANC headset, from [Son02].
The main difference between Filtered X DCT- LMS and Filtered X- LMS algorithms is
that two orthogonal transform parts of Sliding DCT (SDCT) are interposed. The
reference signal x(n) is acquired through reference microphone as the error signal e(n)
through the error microphone. The primary path P(z) describes the acoustic response
from reference microphone to error microphone while the secondary path S(z) consists
of transfer functions from adaptive filter output to error microphone .W(z) is the adaptive
12
13. filter to minimize the residual error signal e(n).To compensate the secondary path effect,
Sˆ(z) ,the estimate of S(z),is introduced to filter x(n) .
Figure.10 Block diagram of Filtered X DCT-LMS algorithm, as described in [Son02].
The Filtered X DCT-LMS algorithm can provide not only fast, but also uniform
convergence speed throughout whole broadband [Son02].
CHAPTER-5
APPLICATIONS OF ADAPTIVE FILTERING
Adaptive filters are used in many applications because of their ability to operate
in unknown and changing environments. Adaptive filtering applications can be classified
in four categories: adaptive system identification, adaptive inverse modeling, adaptive
prediction and adaptive array processing.
In this section, we introduce several applications of adaptive filtering. These
applications are implemented in MATLAB code for computer simulation. MATLAB
examples include acoustic echo cancellation, adaptive interference cancellation, adaptive
line enhancer, active noise control, adaptive channel equalizer, acoustic feedback
reduction for hearing aids and adaptive array processing. These applications provide a
useful platform to evaluate the performance of different adaptive algorithms. Several
plots include an ensemble or time-averaged square error, and the norm of weight error,
echo return loss, spectrogram of error signal and magnitude-squared coherence, etc., are
used to evaluate the performance of these algorithms.
1.6.1 Adaptive system identification
A structure of adaptive system identification (or modeling) is shown in Figure 1.5, where
13
14. the adaptive filter is placed in parallel with an unknown system (or plant) to be
identified.
The adaptive filter provides a linear model that is the best approximation of the unknown
system. The excitation signal u(n) serves as the input to both the unknown system and
the adaptive filter, while η(n) represents the disturbance (or plant noise) occurring within
the unknown system. The objective of the adaptive filter is to model the unknown system
such that the adaptive filter output y(n) closely matches the unknown system output d(n).
This can be achieved by minimizing the error signal e(n), which is the difference
between the physical response d(n) and the model response y(n). If the excitation signal
u(n) is rich in frequency content, such as a white noise, and the plant noise η(n) is
small and uncorrelated with u(n), the adaptive filter identifies the unknown system from
the input–output viewpoint.
Figure 1.5 Block diagram of adaptive system identification
The adaptive system identification has been widely applied in echo cancellation,active
noise control, digital control, geophysics and communications. In fact, many problems
can be formulated from the adaptive system identification point of view. A typical
example is the acoustic echo cancellation (AEC), which finds many applications in
hands-free telephones, audio (or video) conferencing systems, hearing aids, voice-control
systems and much more. This book uses the adaptive identification of unknown systems
with a long impulse response in later chapters to illustrate the performance of subband
adaptive filters.
1.6.1.1 Acoustic echo cancellation
14
15. The acoustic echo in hands-free telephones arises when the microphone picks up the
sound radiated by the loudspeaker and its reflections in a room. Figure 1.6 shows a
general AEC configuration for hands-free telephony systems. Speech originating from
the far-end talker is amplified and reproduced by a loudspeaker. The output of the
loudspeaker will be picked up by the microphone via the acoustic echo path in the room.
This signal is transmitted back to the far-end user where it is perceived as acoustic echo.
The far-end user is annoyed by listening to his/her own speech delayed by the round-trip
traveling time of the system. The acoustic echo can be canceled electronically using an
adaptive filter, as illustrated in Figure 1.6.
Figure 1.6 Block diagram of an acoustic echo canceller
The adaptive filter models the acoustic echo path between the loudspeaker and
microphone. The estimated transfer function is used to filter the far-end speech signal
u(n) to generate an echo replica y(n), which is then used to cancel the acoustic echo
components in the microphone signal d(n), resulting in the echo-free signal e(n).
The following three factors make the AEC a very difficult task:
(i) The acoustic echo path usually has long impulse response. The characteristics of
the acoustic path depend on the physical conditions of the room. For a typical office, the
duration of the impulse response (i.e. the reverberation time) is about 300 ms. At 8 kHz
sampling frequency, an adaptive FIR filter of 2400 taps is required to model the acoustic
echo path. As discussed in Section 1.4, a long adaptive FIR filter incurs a heavy
computational load and results in slower convergence because of small step sizes, as
indicated .
15
16. (ii) The characteristics of the acoustic echo path are time varying and may change
rapidly due to the movement of people, doors opening or closing, temperature changes in
the room, etc. Therefore, an adaptive algorithm has to converge quickly to track any
changes by continuously updating the adaptive filter.
(iii) The excitation speech signal is highly correlated and nonstationary. For a short
speech segment, the spectral density may differ by more than 40 dB at different
frequencies. This also results in slow convergence, as shown in Equation .
1.6.1.2 Active noise control
A single-channel active noise control (ANC) for suppressing acoustic noise in an air duct
is shown in Figure 1.7 [4]. The input signal u(n) is acquired by a reference microphone
placed near the noise source. The primary noise travels to the error microphone via
Figure 1.7 An example of single-channel active noise control viewed as an adaptive
system identification problem
an unknown plant. At the same time, the canceling loudspeaker generates a secondary
canceling noise that propagates to the error microphone via the secondary path. This
secondary noise has the same amplitude with opposite phase to cancel the primary noise
based on the principle of acoustic superposition. The residual noise picked up by the
error microphone is used as the error signal e(n) to update the adaptive filter. The ANC
system operates in the electrical domain, while the unknown plant and secondary path
are located in the electroacoustic domain. ANC is a challenging application since there
are many considerations such as secondary path modeling and compensation, fast
changing environment and noise characteristics, interactions between acoustic and
16