You are on page 1of 5

Adaptive filtering algorithms for acoustic noise

cancellation – LMS and RLS


S. Abinaya S. Sanjana
IIITDM Kancheepuram IIITDM Kancheepuram
esd15i003@iiitdm.ac.in esd15i020@iiitdm.ac.in

Abstract— For the cancellation of noise signal adaptive are not corrupted by signal impurities such as active
filtering technique is used. In many applications of noise noise, echo and reverberation. In most of the cases, the
cancellation, the changes in signal is quite fast. This requires desired signal is an exact replica of input signal and it is
adaptive algorithm, which converge rapidly. From this found with the process of auto regressive analysis
point of view LMS and RLS algorithms suit these situations 3(ARA). Adaptation involves automatic adjustment of
best. LMS algorithm is one of the most used algorithms in
the parameters of the filter (weights of coefficients) in
many signal processing applications. Unfortunately, LMS
algorithm has high computation complexity and stability accordance with the estimation error. The combination
problems. Here, we have presented RLS, which is a of filtering and adaptation forms a closed loop feedback
deterministic algorithm that works well for high frequency system where the feedback signal is non-additive in
noise signals. nature.
The LMS algorithm is classified as adaptive filtering in
Keywords—Active Noise Cancellation (ANC); Tap- which is a self-designing and time-varying system that
length; LMS; Adaptive filters; RLS; continuously adjust its tap weight in the algorithm [1].
LMS algorithm has been used to suppress the effect of
I. INTRODUCTION acoustic noise in speech signals. 𝑤(𝑛) is the weight
Noise cancellation in acoustic signals is done by vector of the filter at the time instant n. e(n) is the
using optimum filtering techniques, i.e., adaptive filters. difference between the desired and output signal.
The coefficients of adaptive filter are varied with time
using different algorithms. FIR adaptive filters are widely 𝑤(𝑛 + 1) = 𝑤(𝑛) + 𝜇𝑒(𝑛)𝑥(𝑛)
used and are described in terms of tapped-delay-line and 𝑤 = 𝑅 𝑃
lattice models. In FIR adaptive filters, the tap-length is the 𝐿𝑒𝑡 Ɛ(𝑛) = 𝑤(𝑛) − 𝑤
total number of filter coefficients or weights of the filter. Ɛ(𝑛) = 𝐸[Ɛ(𝑛)]
Tap-length plays a major role in achieving the steady state
of the system. This is because, the MSE rises if the
After solving, we get Ɛ(𝑛 + 1) = Ɛ(𝑛)[𝐼 − 𝜇𝑅] where
number of weights is very less, but having a large number
R is the input autocorrelation matrix.
of coefficients might introduce more complexity.

II. PROPOSED ALGORITHM


A. Least Mean square algorithm
There are many techniques that can be used in noise
cancellation. Two such algorithms are Least Mean
Square Algorithm (LMS) and Filtered-x Least Mean
Square Algorithm (FXLMS). Any LMS adaptive process
runs through 2 sub processes – Filtering and Adaptation.
Filtering involves computing the output of a linear
Fig. 1. LMS Algorithm
traversal filter in response to the input signal where all
the samples are independent of each other. Also involves
generating the estimation error comparing the output On the other hand, the FXLMS algorithm will need a
with the desired response. Desired signal is generated in filtered reference signal as input as requires a filtered
the due course from past input and output signals which version of the reference signal as input in which the filter
is having the same impulse response as the cancellation selective. That is, the convergence is achieved soon but
path. FXLMS has been used on cancelling the periodic steady state value might not be as required. Hence it is
noise generated by laptop fan after identification [4]. necessary to find a proper trade-off value of ⋋.
There was another development in 2013. To improve
convergence rate and noise reduction ratio in ANC, the The value of wopt(n) that minimize J(w,n) is taken as the
variable tap length and step size FXLMS were filter weights.
introduced [5]. Yang et al. (2014) reduced 8dB noise
level in the cabin of high-speed elevator by
1
implementing modified FXLMS algorithm [6]. 𝒘 (𝑛) = 𝒖(𝑘)𝒖 (𝑘)
However, the FXLMS algorithm has higher complexity 𝑛+1
compared to LMS algorithm due to the consideration of 1
the secondary path parameter. × 𝒖(𝑘)𝑑(𝑘)
𝑛+1

Where,

1 𝟏
𝒖(𝑘)𝒖 (𝑘) → 𝑸 = 𝑷
𝑛+1

1
𝒖(𝑘)𝑑(𝑘) → 𝑟
𝑛+1

Algorithm :
With the given input vector X(n) and the desired output
signal d(n),
1) Update the input to the filter.
2) Compute the filter output using the previous set of
filter coefficients w(n-1).
𝑦(𝑛) = 𝑿 (𝑛)𝒘(𝑛 − 1)

3) Compute the error e(n)


𝑒(𝑛) = 𝑑(𝑛) − 𝑦(𝑛)

B. Recursive least square algorithm 4) Compute the Kalman Gain vector k(n)
𝑷(𝑛 − 1) 𝑿(𝑛)
RLS algorithm recursively finds the coefficients to 𝒌(𝑛) =
minimize the following weighted linear least squares cost ⋋ +𝑿 𝑷(𝑛 − 1)𝑿(𝑛)
function relating to the input signal. Note: To achieve fast estimation when a change occurs in
the input signal, the gain matrix of the RLS algorithm
k(n) must be increased for a short time.
𝐽(𝑤, 𝑛) = ⋋ 𝑒 (𝑘) 5) Update P according to the following equation
𝑷(𝑛) =⋋ [𝑷(𝑛 − 1) − 𝒌(𝑛)𝑿 (𝑛)𝑷(𝑛 − 1)]
6) Update the filter coefficients for the next iteration
⋋ is known as the forgetting factor. It is chosen depending 𝑷(𝑛 − 1) 𝑿(𝑛)ệ(𝑛)
𝒘(𝑛) = 𝒘(𝑛 − 1) +
on the desired speed and frequency selectivity in ⋋ +𝑿 𝑷(𝑛 − 1)𝑿(𝑛)
estimation. A small value of the forgetting factor may
result in the estimation to happen fast but it will be less Convergence of RLS is much faster than LMS though
computational complexity of RLS substantially increases.
III. SIMULATION only slightly different from the original noise-free
speech signal. The amplitude and the noise of the signal
are reduced after filtering.
A. Least Mean square algorithm

Audio file of Waveform Audio File Format (.wav) was B. Recursive Least Square Algorithm
used as input for the simulation model which was done
in MATLAB software environment. Input is a speech Audio file of Waveform Audio File Format (.wav) was
signal of sampling frequency 8 kHz. An acoustic noise used as input for the simulation model which was done in
with a frequency of 50 Hz is added to the input signal. MATLAB software environment. Input is a speech signal
The algorithm is initiated by setting column weight of sampling frequency 8 kHz. An acoustic noise with a
vector w(n) and filtered output e(k) as a zero column frequency of 500 Hz was added to the signal. The
vector. The initial value of μ is taken as 0.005 randomly algorithm is initiated by setting the initial input
with the following LMS algorithm condition [2]: covariance estimate as 0.1 and P matrix as an identity
2 matrix of order M. In our case, M was taken as 32. The
0< 𝜇< performance of RLS algorithm is tested by comparing the
𝑡𝑟(𝑅) plots of the convergence of the adaptive filter response to
Taking total number of iterations to infinity, it is not
the response of the FIR filter using Timescope.
practically realisable. Hence a more stringent condition
for step size variation is used for LMS algorithm to
restrict the values of μ beyond a particular limit which
causes severe degradation in steady state performance.
Input is multiplied with the weight vector to generate a
weighted signal y(n). This is subtracted from the desired
signal to obtain error signal e(n). After each iteration, the
weigh vector updates according to equation (*). The
filtering process goes on until it reaches the length of
primary input signal. The output of this process and the
original error-free speech signal are compared in both
time and frequency domain. The implementation of the
LMS adaptive filter is tested this way.

The simulation using the LMS adaptive filter algorithm


attenuates the noise gradually and finally cancels the
noise in the corrupted speech signal. The images (***)
show the clean speech signal after the filtering done. It is
4. Cordourier-Maruri HA and Orduna-Bustamante F
2009 Active Control of Periodic Fan Noise in Laptos:
Spectral Width Requiremnts in Delayed Buffer
Implementation Journal of Applied Research and
Technology 7(2) pp 124-35
5. Chang DC and Chu FT 2013 Active noise cancellation
with a new variable tap length and step size FXLMS
algorithm IEEE International Conference on
Multimedia and Expo
6. Yang IH, Jeong JE, Jeong UC, Kim JS and Oh JE 2014
Improvement of noise reduction performance for a
high-speed elevator using modified active noise
control Applied Acoustics 79 pp 58-68

IV. CONCLUSION
The LMS and RLS adaptive filtering techniques are
implemented.
The simulation model establishes the fact that LMS
adaptive algorithm is capable of updating the weights
and essentially cancelling the noise. Lower frequency
noise (upto 5kHz) can be removed using this algorithm.
From the implementation of this project and the
synthesis report it can also be concluded that the
computation time and the area required for LMS
algorithm is less. On the basis of simulation, a
comparison is presented which shows that the RLS
algorithm has better performance in terms of noise
cancellation at higher frequencies.

REFERENCES

1. Hamidia M and Amrouche A 2016 Improved


variable step-size NLMS adaptive filtering algorithm
for acoustic echo cancellation Digital Signal
Processing 49 pp 44-55
2. Apolin JA, Diniz PSR, Laakso TI and Campos MLR
1998 Step-size optimization of the BNDRLMS
algorithm 9 th European Signal Processing
Conference
3. E. Horita, K. Sumiya, H. Urakami and S. Mitsuishi
A leaky RLS algorithm: it’s optimality and
implementation IEEE Transactions on Signal
Processing ( Volume: 52 , Issue: 10 , Oct. 2004 )

You might also like