Raj Kumar Thenua et. al.

/ International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378

SIMULATION AND PERFORMANCE
ANALYASIS OF ADAPTIVE FILTER IN
NOISE CANCELLATION
RAJ KUMAR THENUA
Department of Electronics & Instrumentation, Anand Engineering College,
Agra, Uttar Pradesh-282007,India
S.K. AGARWAL
Department of Electronics & Communication, Sobhasaria Engineering College,
Sikar, Rajasthan-332021, India

Abstract
Noise problems in the environment have gained attention due to the tremendous growth of technology that has
led to noisy engines, heavy machinery, high speed wind buffeting and other noise sources. The problem of
controlling the noise level has become the focus of a tremendous amount of research over the years. In last few
years various adaptive algorithms are developed for noise cancellation. In this paper we present an
implementation of LMS (Least Mean Square), NLMS (Normalized Least Mean Square) and RLS (Recursive
Least Square) algorithms on MATLAB platform with the intention to compare their performance in noise
cancellation. We simulate the adaptive filter in MATLAB with a noisy tone signal and white noise signal and
analyze the performance of algorithms in terms of MSE (Mean Squared Error), percentage noise removal,
computational complexity and stability. The obtained results shows that RLS has the best performance but at the
cost of large computational complexity and memory requirement.
Keywords: Adaptive filter; convergence speed; LMS; Mean Squared Error; NLMS; RLS.
1. Introduction
In the process of transmission of information from the source to receiver side, noise from the surroundings
automatically gets added to the signal. This acoustic noise [1] picked up by microphone is undesirable, as it
reduces the perceived quality or intelligibility of the audio signal. The problem of effective removal or reduction
of noise is an active area of research [2]. The usage of adaptive filters is one of the most popular proposed
solutions to reduce the signal corruption caused by predictable and unpredictable noise.
An adaptive filter [3] has the property of self-modifying its frequency response to change the behavior in
time, allowing the filter to adapt the response to the input signal characteristics change. Due to this capability
the overall performance and the construction flexibility, the adaptive filters have been employed in many
different applications, some of the most important are: telephonic echo cancellation [1], radar signal processing,
navigation systems, communications channel equalization and biometrics signals processing.
The purpose of an adaptive filter in noise cancellation is to remove the noise from a signal adaptively to
improve the signal to noise ratio. Figure 1 shows the diagram of a typical Adaptive Noise Cancellation (ANC)
system [4]. The discrete adaptive filter processed the reference signal x(n) to produce the output signal y(n) by a
convolution with filter’s weights w(n).The filter output y(n) is subtracted from d(n) to obtain an estimation error
e(n). The primary sensor receives noise x
1
(n) which has correlation with noise x(n) in an unknown way. The
objective here is to minimize the error signal e(n). This error signal is used to incrementally adjust the filter’s
weights for the next time instant.
The basic adaptive algorithms which widely used for performing weight updation of an adaptive filter are:
the LMS (Least Mean Square), NLMS (Normalized Least Mean Square) and the RLS (Recursive Least Square)
algorithm [5]. Among all adaptive algorithms LMS has probably become the most popular for its robustness,
good tracking capabilities and simplicity in stationary environment. RLS is best for non-stationary environment
with high convergence speed but at the cost of higher complexity. Therefore a tradeoff is required in
convergence speed and computational complexity, NLMS provides the right solution.
ISSN: 0975-5462 4373
Raj Kumar Thenua et. al. / International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378

2. Adaptive algorithms
2.1 LMS algorithm
The LMS is one of the simplest algorithm used in the adaptive structures due to the fact that it uses the error
signal to calculate the filter coefficients. The output y(n) of FIR filter structure can be obtain from Eq. (1)[6].
¿
÷
=
÷ =
1
0
) 1 ( ) ( ) ( ) (
N
m
m n x m w n y

Where n is no. of iteration
The error signal is calculated by Eq. (2)
) 2 ( ) ( ) ( ) ( n y n d n e ÷ =
The filter weights are updated from the error signal e(n) and input signal x(n) as in Eq. (3).
) 3 ( ) ( ) ( ) ( ) 1 ( n x n e n w n w µ + = +
Where: w(n) is the current weight value vector, w(n+1) is the next weight value vector, x(n) is the input
signal vector, e(n) is the filter error vector and µ is the convergence factor which determine the filter
convergence speed and overall behavior.















Fig.1 Adaptive Noise Cancellation
2.2 NLMS algorithm
In the standard LMS algorithm, when the convergence factor μ is large, the algorithm experiences a gradient
noise amplification problem. In order to solve this difficulty, we can use the NLMS (Normalized Least Mean
Square) algorithm. The correction applied to the weight vector w(n) at iteration n+1 is “normalized” with
respect to the squared Euclidian norm of the input vector x(n) at iteration n.
We may view the NLMS algorithm as a time-varying step-size algorithm, calculating the convergence factor μ
as in Eq. (4)[7].
( ) 4
) (
) (
2
n x c
n
+
=
o
µ

Where: α is the NLMS adaption constant, which optimize the convergence rate of the algorithm and should
satisfy the condition 0< α<2, and c is the constant term for normalization and is always less than 1.
The Filter weights are updated by the Eq. (5).
) 5 ( ) ( ) (
) (
) ( ) 1 (
2
n x n e
n x c
n w n w
+
+ = +
o

2.3 RLS algorithm
Adaptive Noise Canceller
Output
e(n)
d(n)
y(n)
+
_
E
Adaptive
Filter
s(n)
x(n)
x1(n)
Primary Sensor
Reference Sensor
Signal
Source
Noise
Source
ISSN: 0975-5462 4374
Raj Kumar Thenua et. al. / International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378

The RLS algorithms are known for their excellent performance when working in time varying environments
but at the cost of an increased computational complexity and some stability problems. In this algorithm the filter
tap weight vector is updated using Eq. (6) [8].


Eq. (7) and (8) are intermediate gain vector used to compute tap weights.

) 8 ( ) ( ) 1 ( ) (
1
n x n w n u ÷ =
÷
ì

Where: λ is a small positive constant very close to, but smaller than 1.
The filter output is calculated using the filter tap weights of previous iteration and the current input vector as
in Eq. (9).


In the RLS Algorithm the estimate of previous samples of output signal, error signal and filter weight is
required that leads to higher memory requirements.
3. Simulation Results
In the simulation the reference input signal x(n) is a white Gaussian noise of power two-dB generated using
randn function in MATLAB, the desired signal d(n) ,obtained by adding a delayed version of x(n) into clean
signal s(n), d(n) = s(n) + x
1
(n) as shown in Fig.2.

Fig.2:(a) Clean tone(sinusoid) signal s(n);(b)Noise signal x(n);(c) Delayed noise signal x1(n);(d) desired signal d(n)
The simulation of the LMS algorithm is carried out with the following specifications:
Filter order N=19, step size µ= 0.001 and iterations= 8000
The LMS filtered output is shown in Fig.3 (a), the mean squared error generated as per adaption of filter
parameters is shown in Fig.3 (b). The step size µ control the performance of the algorithm, if µ is too large the
convergence speed is fast but filtering is not proper, if µ is too small the filter gives slow response, hence the
selection of proper value of step-size for specific application is prominent to get good results. The effect of step-
size on mean squared error is illustrated in Fig.7.

( ) ( ) ( ) ( ) ( ) ) 7 ( / n u n x n u n k
T
+ = ì
( ) ( ) ( ) ) 9 ( 1
1
n x n w n y
T
n
÷ =
÷
( ) ( ) ( ) ) 10 (
1 1
n y n d n e
n n ÷ ÷
÷ =
( ) ( ) ( ) ( ) ) 6 ( 1
1
n e n k n w n w
n
T
÷
+ ÷ =
ISSN: 0975-5462 4375
Raj Kumar Thenua et. al. / International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378


Fig.3: MATLAB simulation for LMS algorithm; N=19, step size=0.001

Fig.4: MATLAB simulation for NLMS algorithm; N=19, step size=0.001

Fig.5: MATLAB simulation for RLS algorithm; N=19, lembda=1

Fig.4 and Fig.5 shows the output results for NLMS and RLS algorithms respectively. If we investigate the
filtered output of all algorithms, LMS adopt the approximate correct output in 2800 samples, NLMS adopt in
2300 samples and RLS adopt in 300 samples. This shows that RLS has fast learning rate.
The filter order also affect the performance of a noise cancellation system.Fig.6 illustrate how the MSE
change as we change filter order, when filter order is less (<15) LMS has good MSE as compared to NLMS and
RLS but as the filter order increased (>15) the performance of RLS becomes good and LMS has poor
performance it proves that the selection of right filter order is necessary to achieve the best performance. In our
work the appropriate filter order is 19 therefore all simulations are carried out at N=19.
In table1 performance analysis of all three algorithms is presented in term of MSE, percentage noise reduction,
computational complexity and stability [9]. It is clear from the table1, the computational complexity and
stability problems increases in an algorithm as we try to reduce the mean squared error. NLMS is the favorable
choice for most of the industries due less computational complexity and fair amount of noise reduction.

ISSN: 0975-5462 4376
Raj Kumar Thenua et. al. / International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378


Fig.6 MSE versus filter order (N)

Fig.7 MSE versus Step-size (µ) for LMS algorithm

Table1. Performance comparison of various adaptive algorithms
S.N Algorithm Mean
Squared
Error
(MSE)
% Noise
Reduction
Complexity
(No. of multiplications
per iteration)
Stability
1. LMS 2.5×10
-2
91.62% 2N+1 Highly Stable
2. NLMS 2.1×10
-2
93.85% 5N+1 Stable
3. RLS 1.7×10
-2
98.78% 4N
2
less Stable
4. Conclusions
In this work, different Adaptive algorithms were analyzed and compared. These results shows that the LMS
algorithm has slow convergence but simple to implement and gives good results if step size is chosen correctly
and is suitable for stationary environment. For a lower filter order (<15) the LMS proved to have the lowest
MSE then the NLMS and RLS, but as we increase the filter order (>15) the results showed the opposite, so we
need to take this in consideration when selecting the algorithm for a specific application.
ISSN: 0975-5462 4377
Raj Kumar Thenua et. al. / International Journal of Engineering Science and Technology
Vol. 2(9), 2010, 4373-4378

When input signal is non-stationary in nature, the RLS algorithm proved to have the highest convergence
speed, less MSE, and highest percentage of noise reduction but at the cost of large computational complexity
and memory requirement.
The NLMS algorithm changes the step-size according to the energy of input signals hence it is suitable for
both stationary as well as non-stationary environment and its performance lies between LMS and RLS. Hence it
provides a trade-off in convergence speed and computational complexity. The implementation of algorithms
was successfully achieved, with results that have a really good response.
References
[1] J. Benesty, et. al. , “Adaptive Filtering Algorithms for Stereophonic Acoustic Echo Cancellation”, International
Conference on Acoustics, Speech, and Signal Processing, 1995, vol.5, Page(s): 3099 – 3102.
[2] Bernard Widrow, et. al. “Adaptive Noise Cancelling: Principles and Applications”, Proceedings of the IEEE, 1975,
Vol.63 , No. 12 , Page(s): 1692 – 1716.
[3] Simon Haykin, “Adaptive Filter Theory”, Prentice Hall, 4
th
edition.
[4] Ying He, et. al. “The Applications and Simulation of Adaptive Filter in Noise Canceling”, 2008 International
Conference on Computer Science and Software Engineering, 2008, Vol.4, Page(s): 1 – 4.
[5] Paulo S.R. Diniz, “Adaptive Filtering: Algorithms and Practical Implemetations” ,ISBN 978-0-387-31274-3, Kluwer
Academic Publisher © 2008 Springer Science+Business Media, LLC, pp.77-195.
[6] Slock, D.T.M., “On the convergence behavior of the LMS and the normalized LMS algorithms”, IEEE Transactions on
Signal Processing, 1993,Vol. 41, Issue 9, pp. 2811-2825.
[7] Abhishek Tandon, M. Omair Ahmad, “An efficient, low-complexity, normalized LMS algorithm for echo cancellation”
The 2nd Annual IEEE Northeast Workshop on Circuits and Systems, 2004. NEWCAS 2004, Page(s): 161 – 164.
[8] Sanaullah Khan, M.Arif and T.Majeed, “Comparison of LMS, RLS and Notch Based Adaptive Algorithms for Noise
Cancellation of a typical Industrial Workroom”, 8th International Multitopic Conference, 2004, Page(s): 169 – 173.
[9] Yuu-Seng Lau, Zahir M. Hussian and Richard Harris, “Performance of Adaptive Filtering Algorithms: A Comparative
Study”, Australian Telecommunications, Networks and Applications Conference (ATNAC), Melbourne, 2003.

ISSN: 0975-5462 4378

(3). The output y(n) of FIR filter structure can be obtain from Eq. Signal Source s(n) Primary Sensor x1(n) d(n) +  e(n) _ Output Noise Source Reference Sensor x(n) Adaptive Filter y(n) Adaptive Noise Canceller Fig. and c is the constant term for normalization and is always less than 1. Adaptive algorithms 2.3 RLS algorithm ISSN: 0975-5462 4374 . we can use the NLMS (Normalized Least Mean Square) algorithm. (2) e( n )  d ( n )  y ( n ) ( 2) The filter weights are updated from the error signal e(n) and input signal x(n) as in Eq.1 LMS algorithm The LMS is one of the simplest algorithm used in the adaptive structures due to the fact that it uses the error signal to calculate the filter coefficients.2 NLMS algorithm In the standard LMS algorithm. / International Journal of Engineering Science and Technology Vol. In order to solve this difficulty. e(n) is the filter error vector and µ is the convergence factor which determine the filter convergence speed and overall behavior. y ( n)   w(m) x (n  m) m 0 N 1 (1) Where n is no. (4)[7]. 2(9).Raj Kumar Thenua et. 4373-4378 2. We may view the NLMS algorithm as a time-varying step-size algorithm. w( n  1)  w(n)  e(n) x(n) (3) Where: w(n) is the current weight value vector. when the convergence factor μ is large.  w( n  1)  w( n)  c  x(n) 2 e( n ) x ( n ) (5) 2. w(n+1) is the next weight value vector. The correction applied to the weight vector w(n) at iteration n+1 is “normalized” with respect to the squared Euclidian norm of the input vector x(n) at iteration n. of iteration The error signal is calculated by Eq. the algorithm experiences a gradient noise amplification problem. 2010.1 Adaptive Noise Cancellation 2. x(n) is the input signal vector. (5). calculating the convergence factor μ as in Eq.  4  ( n)  2 c  x(n) Where: α is the NLMS adaption constant. (1)[6]. al. The Filter weights are updated by the Eq. which optimize the convergence rate of the algorithm and should satisfy the condition 0< α<2.

3 (b). wn   w T n  1  k n en 1 n  ( 6) Eq. (6) [8]. Simulation Results In the simulation the reference input signal x(n) is a white Gaussian noise of power two-dB generated using randn function in MATLAB. d(n) = s(n) + x1(n) as shown in Fig. The effect of stepsize on mean squared error is illustrated in Fig. Fig.(c) Delayed noise signal x1(n). if µ is too large the convergence speed is fast but filtering is not proper. if µ is too small the filter gives slow response.3 (a). (7) and (8) are intermediate gain vector used to compute tap weights. step size µ= 0. but smaller than 1. y n1 n   w T n  1xn  (9) en1 n   d n   yn1 n  (10) In the RLS Algorithm the estimate of previous samples of output signal.(b)Noise signal x(n). 4373-4378 The RLS algorithms are known for their excellent performance when working in time varying environments but at the cost of an increased computational complexity and some stability problems.7. The filter output is calculated using the filter tap weights of previous iteration and the current input vector as in Eq. 2010.2:(a) Clean tone(sinusoid) signal s(n). al. the desired signal d(n) . 3. ISSN: 0975-5462 4375 . (9). In this algorithm the filter tap weight vector is updated using Eq. 2(9). error signal and filter weight is required that leads to higher memory requirements.obtained by adding a delayed version of x(n) into clean signal s(n). k n   u n  /   xT n u n  u (n)  w (n  1) x ( n) 1   (7 ) (8) Where: λ is a small positive constant very close to. the mean squared error generated as per adaption of filter parameters is shown in Fig.(d) desired signal d(n) The simulation of the LMS algorithm is carried out with the following specifications: Filter order N=19. hence the selection of proper value of step-size for specific application is prominent to get good results.Raj Kumar Thenua et. The step size µ control the performance of the algorithm.001 and iterations= 8000 The LMS filtered output is shown in Fig. / International Journal of Engineering Science and Technology Vol.2.

Raj Kumar Thenua et.5: MATLAB simulation for RLS algorithm.5 shows the output results for NLMS and RLS algorithms respectively.Fig. In our work the appropriate filter order is 19 therefore all simulations are carried out at N=19.001 Fig. 4373-4378 Fig. This shows that RLS has fast learning rate. al. computational complexity and stability [9]. In table1 performance analysis of all three algorithms is presented in term of MSE. NLMS adopt in 2300 samples and RLS adopt in 300 samples. N=19. percentage noise reduction. N=19. It is clear from the table1. 2(9). when filter order is less (<15) LMS has good MSE as compared to NLMS and RLS but as the filter order increased (>15) the performance of RLS becomes good and LMS has poor performance it proves that the selection of right filter order is necessary to achieve the best performance. The filter order also affect the performance of a noise cancellation system. lembda=1 Fig. If we investigate the filtered output of all algorithms. LMS adopt the approximate correct output in 2800 samples. NLMS is the favorable choice for most of the industries due less computational complexity and fair amount of noise reduction.3: MATLAB simulation for LMS algorithm.001 Fig.6 illustrate how the MSE change as we change filter order. step size=0.4: MATLAB simulation for NLMS algorithm.4 and Fig. 2010. step size=0. N=19. ISSN: 0975-5462 4376 . the computational complexity and stability problems increases in an algorithm as we try to reduce the mean squared error. / International Journal of Engineering Science and Technology Vol.

N Algorithm Mean Squared Error (MSE) % Noise Reduction Complexity (No. LMS NLMS RLS 2. For a lower filter order (<15) the LMS proved to have the lowest MSE then the NLMS and RLS.5×10-2 2. Performance comparison of various adaptive algorithms S.62% 93. 2010. so we need to take this in consideration when selecting the algorithm for a specific application. different Adaptive algorithms were analyzed and compared. 2(9). al. but as we increase the filter order (>15) the results showed the opposite. 2.7 MSE versus Step-size (µ) for LMS algorithm Table1. ISSN: 0975-5462 4377 .1×10 -2 91. These results shows that the LMS algorithm has slow convergence but simple to implement and gives good results if step size is chosen correctly and is suitable for stationary environment. 3.Raj Kumar Thenua et.78% 2N+1 5N+1 4N2 Highly Stable Stable less Stable 1.7×10-2 4.6 MSE versus filter order (N) Fig.85% 98. of multiplications per iteration) Stability 1. Conclusions In this work. 4373-4378 Fig. / International Journal of Engineering Science and Technology Vol.

2008. NEWCAS 2004. “Adaptive Filtering: Algorithms and Practical Implemetations” . 1993. The NLMS algorithm changes the step-size according to the energy of input signals hence it is suitable for both stationary as well as non-stationary environment and its performance lies between LMS and RLS. [9] Yuu-Seng Lau. al. 4373-4378 When input signal is non-stationary in nature. “The Applications and Simulation of Adaptive Filter in Noise Canceling”. [2] Bernard Widrow. Diniz. Proceedings of the IEEE. Zahir M. and highest percentage of noise reduction but at the cost of large computational complexity and memory requirement. with results that have a really good response. 1975. M. Vol.63 . [3] Simon Haykin. normalized LMS algorithm for echo cancellation” The 2nd Annual IEEE Northeast Workshop on Circuits and Systems. “Adaptive Filter Theory”. et. LLC. Omair Ahmad. Australian Telecommunications. Prentice Hall. et. 2004. References [1] J.Raj Kumar Thenua et. less MSE.4. “An efficient.M. and Signal Processing. 41. vol. 4th edition. “Comparison of LMS. pp. No. Vol. International Conference on Acoustics. IEEE Transactions on Signal Processing. Page(s): 1 – 4. the RLS algorithm proved to have the highest convergence speed. The implementation of algorithms was successfully achieved.77-195. low-complexity. “Adaptive Noise Cancelling: Principles and Applications”. pp. [6] Slock. 8th International Multitopic Conference. 12 . [4] Ying He. Hussian and Richard Harris.5. 2003. Hence it provides a trade-off in convergence speed and computational complexity.R. “Performance of Adaptive Filtering Algorithms: A Comparative Study”. al. Page(s): 169 – 173. Page(s): 3099 – 3102. et.. / International Journal of Engineering Science and Technology Vol.Vol. Page(s): 161 – 164. 2010. 2004. 2(9). . [7] Abhishek Tandon. RLS and Notch Based Adaptive Algorithms for Noise Cancellation of a typical Industrial Workroom”. “Adaptive Filtering Algorithms for Stereophonic Acoustic Echo Cancellation”. Speech. “On the convergence behavior of the LMS and the normalized LMS algorithms”. 2811-2825. Benesty. Kluwer Academic Publisher © 2008 Springer Science+Business Media. Melbourne. al. 2008 International Conference on Computer Science and Software Engineering. ISSN: 0975-5462 4378 . M. al. [5] Paulo S. [8] Sanaullah Khan. Page(s): 1692 – 1716. D. Issue 9. Networks and Applications Conference (ATNAC).T.Arif and T. 1995.ISBN 978-0-387-31274-3.Majeed.

Sign up to vote on this title
UsefulNot useful