Implementation of Noise Cancellation Using Adaptive Algorithms in GNU Radio

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2022 IEEE International Conference on Data Science and Information System (ICDSIS)

Implementation of Noise Cancellation using


Adaptive Algorithms in GNU Radio
1st Harshitha L 2nd Sindhu Kumari ND 3rd Rekha C
Department of ECE Department of ECE Department of ECE
2022 IEEE International Conference on Data Science and Information System (ICDSIS) | 978-1-6654-9801-2/22/$31.00 ©2022 IEEE | DOI: 10.1109/ICDSIS55133.2022.9915931

Siddaganga Institute of Technology Siddaganga Institute of Technology Siddaganga Institute of Technology


Tumakuru, India Tumakuru, India Tumakuru, India
[email protected] [email protected] [email protected]

4th Ramya S 5th B T Venkatesh Murthy


Department of ECE Department of ECE
Siddaganga Institute of Technology Siddaganga Institute of Technology
Tumakuru, India Tumakuru, India
[email protected] [email protected]

Abstract—The demand for wireless communication system useful data. As a result, processing of signals is frequently
design is on the rise recent days. When data is transferred tailored with a given application [8]. Filters that adaptto
through a wireless channel, the noise on the channel has a larger the situation, unlike traditional usage of constant filter
probability of affecting the information. The suggested project coefficients is not used in filter design procedures and do not
attempts to aid in the reduction of noise through the use of an require prior knowledge.
adaptive filter in order to ensure reliable communication. In this
way noise cancellation plays an important role in digital An adaptive filter is a filter with adjustable settings.
communication. GNU Radio is an open framework for building Finite impulse response (FIR), infinite impulse response
real-time signal processing applications on low-cost single-board (IIR), lattice, and transform domain filters are adaptive
computers. C++ and Python language is suitable for backend in filters that change the coefficients of their coefficients to
GNU radio. MATLAB and python simulation for different decrease an erroneous signal [9]. The transversal filter,
algorithms helps in analysing reduced noise and rate of which employs the least mean square (LMS) and
convergence. normalized least mean square (NLMS) algorithms, is the
most frequent form of adaptive filter. Any undesired
Keywords—Adaptive Noise cancellation (ANC), Adaptive signal, whether created by electrical, acoustic, vibration, or
filtering, GNU Radio, LMS Algorithm, NLMS algorithm, RLS any other medium, is defined as noise in this work.
algorithm.
Adaptive algorithms are used in this project to reduce or
I. INTRODUCTION reframe the original signal several types of noise to get the
desired signal [10]. An adaptive noise cancellation
In wireless communication systems, unwanted generated technique works by sending the corrupted signal via a
signals can corrupt the signals, which must be eliminated to noise-suppression filterwhile leaving the signal alone [11].
restore the original signal. Adaptive filters like LMS, NLMS, No prior knowledge of signal or noise characteristics is
and RLS have been used to do this [1]. Depending on the required because this is a flexible method [12]. Adaptive
frequency, noise may appear randomly or as a frequency- filtering is done using both FIR and IIR filters, but the FIR
dependent distribution. Noise encompasses all disturbances filter is significantly more practical and extensively
including those caused by the environment or by the parts of utilized filter compared to IIR filter [13-15].
sensors and circuits, in addition to thermal noise. A wide range
of internal and external sources can provide noisy data [2]. In II. ADAPTIVE ALGORITHMS
the measurement application, the signal of interest becomes
contaminated by noise occupying the same band of frequency A. LMS Algorithm
[3], consequently overlapping occurs among the desired The Least Mean Square (LMS) method is considered as a
narrow band signal and the broad band noise. The use of linear member of most basic and extensively used adaptive filtering
filters is insufficient if the signal statistics are not known over algorithms. To find a cost function optimal coefficient vector,
time, as this prevents the filter coefficients from being the LMS algorithm uses the stochastic gradient descent
determined in advance [4]. Utilizing filter algorithms that approach. If the step-size parameter is appropriately adjusted,
converge more quickly to the unknown environment is the tap-weight vector computed using the steepest descent
necessary due to the real-time changes in signal and noise technique will converge to the optimal wiener solution.
characteristics [5]. Exact measurements ofthe gradient vector are not achievable
since the optimum wiener solution requires prior knowledge
As the amount of engines, transformers, compressors, and of the autocorrelation matrix and cross correlation vector of
blowers are examples of industrial equipment that are rising the tap inputswith the expected response. As a result, while
in price worries about acoustic noise become more evident operating in an unknown environment, the gradient vector
[6]. To remove the undesirable noise signal, the classic must be computed using the data supplied. After
method to noise cancellation via acoustics involves estimating the vectorof gradient, recursively updating the tap
enclosures, barriers, and silencers are examples of passive weight vector is possible using the following relation (1) [16]
approaches [7]. Signal processing can be used to extract or
enhance information that is relevant from a cacophony of
conflicting input which is more accurate. Signal processing w(n + 1) = w(n) + µE{e(n)x(n)} (1)
is a method of gathering, enhancing, storing, and transmitting

978-1-6654-9801-2/22/$31.00 ©2022 IEEE

Authorized licensed use limited to: SRM Institute of Science and Technology. Downloaded on January 24,2024 at 08:51:31 UTC from IEEE Xplore. Restrictions apply.
After estimating the vector gradient, recursively g(n). Finally, combining the equations leads to the
updating the tap weight vector is possible using the exponentially weighted Recursive Least Squares RLS
following relation. Where u is the step size, w(n) is the algorithm [17].
weight value estimate vector at time n, x(n) is the vector of
the input signal, e(n) is the vector of the filter error, and
µ is the step-size, which controls the rate of filter
convergence. And the general behavior of the filter,
E{e(n)x(n)} is a commonly unknown expectation.
Step-size selection is the first stage in the LMS
adaptive filter implementation. This parameter must be
within a certain range. In order to converge the LMS
algorithm, the following conditions must satisfy equation
(2):

2
0µ  2
(2)
λ max

As indicated in Figure 2, when the filter is compared to


the expected response d(n), an error estimation e is obtained.
B. NLMS Algorithm
The step size is the design problem with the LMS
algorithm. The NLMS algorithmwas created in order to
tackle this problem. At iteration n, the weight vector wn is
corrected at sample n + 1 and then normalized in
reference to the input vector x(n).The NLMS algorithm
is a strategy for adjusting convergence speed. After Fig. 1. Flow chart for NLMS adaptive filter algorithm.
estimating the vector gradient, recursively updating the tap
weight vector is possible using the followingrelation (3).
wn = wn−1 + a(n) g (n) (6)
w(n + 1) = w(n) + µ(n)x(n)e(n) (3)
Where e(n) is the error signal, and µ(n) is the adaptive The rising window RLS method consider all prior
step size. The LMS technique converges in the auto- mistakes of equal weight in the total error at particular
correlation matrix mean square for wide-sense stationary situation of λ = 1 in equation (6). The beginning
processes (4). circumstance for the usage of LMS, NLMS, or RLS
adaptive filter is quite useful in this application. The major
purpose of this project is to look into the application of an
2 algorithm in the noise cancellation problem and to validate
0<µ < (4)
tx(rx) the results using the filtering that is adaptable. In noise
cancellation circumstances, the LMS algorithm has proved
to be effective. Both the vector w(n) and the matrix of
x ( n) inverse auto-correlation p(n) are essential since the RLS
wn+1 = wn + β e( n ) (5)
x ( n) 2 method requires recursive updating of both of these
variables.
The normalized LMSalgorithm NLMS is obtained by III. METHODOLOGY
replacing µ(n) in the LMS weight vector update equation
(5). The LMS method with a time-varying step size A. LMS algorithm implementation
parameter is known as the NormalizedLMS algorithm. Implementation of adaptive noise cancellation using
Flow chart of the NLMS adaptive filter algorithm is shown LMS filter requires an input signal where noise is added to
in Figure 1. this signal. Problems are caused by the additional noise
C. RLS Algorithm distortion of the initial signal. RLS, LMS, and NLMS
algorithms can be incorporated to remove the extra noise
Unlike the LMS algorithm, which seeks to reduce from the signal. This can be done by following a
mean square error, the RLS algorithm seeks to find filter MATLAB procedure. Each algorithm requires that certain
coefficients that iteratively reduce the least squares cost mathematical computations and procedures be followed.
function. Directly from the data x(n) and d(n), the least The processes that are outlined below in the form of a flow
squares error may be minimized, as opposed to the mean chart can be used to de-noise the signal. The
square error n. The weighted least squares error is implementation flow chart for the LMS adaptive filter
minimized using at sample n, the recursive least squares method is shownin Figure 2[17].
method creates a set of filter coefficients wn(k).
This is how the MATLAB is used to implement the
The inverse autocorrelation matrix P and the vector wn adaptive noise cancellation algorithm and obtain the
are updated iteratively as part of the RLS method. It is required outcomes. By changing parameters like the step
important to compute the product while evaluating the size µ and filterorder M = 20, the same method can be
inverse autocorrelation matrix p(n) and the gain vector carried out more than once.

Authorized licensed use limited to: SRM Institute of Science and Technology. Downloaded on January 24,2024 at 08:51:31 UTC from IEEE Xplore. Restrictions apply.
IV. RESULTS AND DISCUSSION
This project is implemented using various adaptive
algorithms like LMS, NLMS and RLS for comparing and
verifying the noise cancellation. These algorithms are
compared in various softwares like MATLAB, python
IDE and GNU Radio for same input. The performance of
the algorithms is compared using audio files. Noise
cancellation depends onthe Mean Square Error (MSE). By
comparing all the three algorithms, it is observed that RLS
has very fast convergence rate compared to NLMS and
RLS algorithms, but LMSis better in cancelling the noise
because the LMS adaptive filter doesn’t require the prior
coefficient.
A. GNU Radio Results
In this section, output of GNU radio is shown in
Figure 4. Initially, noise cancellation is done by providing
an audio signal along with noise as an input which is then
undergone through various forms of settings like beam
forming and coherent processing. Thereafter, whenever
Fig. 2. Flow chart of LMS adaptive filter algorithm. interference filter key is on, noise is removed and
recovered back the original signal.
B. NLMS algorithm implementation
The normalized version of the LMS algorithm is NLMS
algorithm. NLMS algorithm overcomes the issue present in
the LMS by means of computing maximum step size value.
Both the loop variable (i) and the weight parameter (w) are
initially set to zero. The filter output is computed in the
following step, and it is then utilized to calculate the error
estimate signal. In accordance with the determined step size
value (µ), the filter weights are changed until the loop
parameter matches the buffer size, this process is repeated.
C. RLS algorithm implementation
Non-recursive filters use the most recent and prior input
samples to determine its output.The fact that non-recursive
filters are quite stable in characteristic. Since FIR filters
are often non-recursive, they are also consistently stable.
The recursive filter is one whose output samples may
depend on earlier output samples as well as the present and
earlierinput samples. Fig. 4. Filtered outputs.

Figure 3 Block diagram of RLS adaptive filter algorithm, B. Comparison of Adaptive algorithms in Matlab.
x(n) is the input reference signal and w(n) is the variable In this section, simulation results of adaptive algorithms and
filter, these two undergoes summation and the error is
co is displayed. By looking into the comparison simulation
reduced by updating the algorithm. Here, regularization
results we compared.
parameter is indicated by ∆. This regularization parameter
value is measured with the help of SNR of the signals. The C. LMS Algorithm
resultant multiplication is summed up with the weight The Figure 5 represents the output of LMS algorithm
vector in order to restore the value of weights to its correct which represents different wave forms for various step
value. size. X-axis and Y-axis represents the average squared
error and number of iterations respectively. Noise can be
reduced by varying the step-size of the filter. The
simulation using the LMS adaptive filter algorithm
attenuates the noise from the noise corrupted speech
signal. The optimized result of the designed algorithm is
determined in the range of step size µ.

Fig. 3. Block diagram of RLS adaptive filter algorithm implementation.

Authorized licensed use limited to: SRM Institute of Science and Technology. Downloaded on January 24,2024 at 08:51:31 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Output of LMS algorithm.

Fig. 8. Output before applying RLS algorithm.


D. NLMS algorithm
Figure 6 illustrates the performance of noise in the speech
signal before applying the NLMS algorithm to the signal. In
this Waveform even after varying the step size there is no
change in the signal. Figure 7 describes simulated output after
applying the NLMS algorithm. This waveform clearly
explains the normalization of the LMS algorithm. Noise is
reduced by the implementation of NLMS adaptive filter
algorithm on varying the step-size in each iteration
significantly. This shows that NLMS adaptive filter attenuates
the noise from the desired signal.
Fig. 9. Output of RLS algorithm.

F. Comparison of adaptive algorithms


The simulation comparison results of the adaptive
algorithms before and after are shown in Figures 10 and 11.
LMS and NLMS almost give similar results. Even though
RLS has very fast convergence rate prediction of error free
signal becomes much complex compared to LMS. The
implementation of the LMS adaptive filter algorithm for the
noise corrupted speech signal clearly reduces noise
Fig. 6. Before applying NLMS algorithm. significantly. In this algorithm, step size µ=0.999 and order
of the filter M=20 is fixed. Each algorithm works on the
different methods for noise cancellation and reaches system
stability in different ways. In order to find the best adaptive
filtering algorithm for noise cancellation, it must satisfy three
main criteria such as rate of convergence, error performance
and signal to noise ratio (SNR).

Fig. 7. Output of NLMS algorithm.

E. RLS Algorithm
Figure 8 and 9 represents the output before and after
applying the RLS algorithm for speech signal respectively.
This algorithm is proved to be very effective in noise Fig. 10. Output before applying algorithms.
cancellation as it gives more attenuation than any other
algorithms and possess high convergence rate. This
performance comes at the cost of computational complexity
and large filter order is required for noise cancellation, this is
not feasible for implementation which is clearly observed in
the waveform. By using this algorithm, it is unable to predict
the noise free signal in each iterations due to its fast
convergence rate. Prediction of signal is much difficulty in
RLS algorithm.

Fig. 11. Output after applying algorithms.

Authorized licensed use limited to: SRM Institute of Science and Technology. Downloaded on January 24,2024 at 08:51:31 UTC from IEEE Xplore. Restrictions apply.
V. CONCLUSION Conference on Bio-engineering for Smart Technologies (BioSMART),
2019, pp. 1-4, doi: 10.1109/BIOSMART.2019.8734211.
On comparison of all three algorithms, it is observed that [15] W. Loedwassana, "A Variable Step Size Algorithm of LMS Algorithm
LMS is the best algorithm for noise cancellation because of its based on Squared Autocorrelation Criterion," 2019 7th International
slow convergence rate. Due to its less complexity and more Electrical Engineering Congress (iEECON), 2019, pp. 1-4, doi:
stability it is proved to be a better algorithm in cancelling the 10.1109/iEECON45304.2019.8938891.
noise other than NLMS and RLS. The filters designed are [16] W. Loedwassana, "A Variable Step Size Algorithm of LMS Algorithm
capable of providing adaptability, low output noise, and based on Squared Autocorrelation Criterion," 2019 7th International
Electrical Engineering Congress (iEECON), 2019, pp. 1-4, doi:
minimal signal distortion. To minimize noise in the required 10.1109/iEECON45304.2019.8938891.
signal, optimal filter designs are applied. The designed [17] W. Loedwassana, "A Variable Step Size Algorithm of LMS Algorithm
adaptive algorithms on noise-corrupted speech signals can based on Squared Autocorrelation Criterion," 2019 7th International
successfully eliminate the noise signal. Hence comparison of Electrical Engineering Congress (iEECON), 2019, pp. 1-4, doi:
different adaptive algorithms is validated by the simulation. 10.1109/iEECON45304.2019.8938891.

VI. SCOPE FOR FUTURE WORK


The implementation of other algorithms like NLMS, RLS,
Sign-LMS, Sigma-LMS and many more can be done in GNU
radio. This may become complex but by creating the new
blocks in GNU with the help of python code is appreciable.
Different kinds of noise like white noise, impulsive noise and
intermittent noise can be cancelled, as far as now a low
frequency noise can be cancelled.
REFERENCES
[1] Parvathy, A. K. and Gayathri Narayanan, “Comparative Study of
Adaptive Algorithms Using Matlab and Verilog”,International
Conference on Wireless Communications, Signal Processing and
Networking(WiSPNET), IEEE, pp. 1-6, March 2018.
[2] Adarsh J, P. Vishak and R. Gandhiraj, “Adaptive noise cancellation
using NLMS algorithm in GNU radio”, 4th International Conference
on Advanced Computing and Communication Systems (ICACCS),
IEEE, pp. 1-4, January 2017.
[3] Yadav, Gampa and Krishna, “Study of different adaptive filter
algorithms for noise cancellation in real-Time environment ”,
International Journal of Computer Applica- tions, vol. 96, no. 10, pp.
20-25, June 2017.
[4] Abdulmajeed Amar Alauldeen and Alhamzah Taher Mohammed,
“Noise Cancellation in Communication Systems using LMS and RLS
Algorithms”, International Journal of Simulation Systems, Science and
Technology, vol. 20, no. 1, pp. 41-48, February 2019.
[5] Soni Changlani and Dr. M. K. Gupta, “The applications And
Simulation of Adaptive Filter In Speech Enhancement ”, International
Journal of Computer Engineering And Architecture, vol. 1, no. 1, pp.
95-101, June 2017.
[6] Durba Satpathy and Prabodh Kumar Sahoo, “Design of Adaptive Noise
Canceller using LMS Algorithm”, International Jounal of Engineering
Research and Technology (IJERT), vol. 3, no. 25, pp. 1-4, 2018.
[7] B. Widow, “Adaptive noise canceling: principles and applications”,
Proceedings of the IEEE, vol. 63, pp.1692-1716, August 2016.
[8] K. R. Kumar, R. Anand and R. Gandhi raj, “Implementation of noise
cancellation using least mean square in GNU radio”, international
Conference on Computer Com- munication and Informatics (ICCCI),
IEEE, vol. 23, pp. 1-5, 2017.
[9] R. L. Das and M. Chakraborty, “Sparse adaptive filters-an overview
and some new results”, in Circuits and Systems (ISCAS), International
Symposium on. IEEE, vol. 32, pp. 2745-2748, 2017.
[10] R. Rashmi, S. Jagtap, “Adaptive Noise Cancellation Using NLMS
Algorithm”, In Soft Computing and Signal Processing. Advances in
Intelligent Systems and Computing, vol 898. Springer, 2019.
[11] B. Reshma and K. A. Kiran, “Active noise cancellation for in-ear
headphones imple- mented on FPGA”, International Conference on
Intelligent Computing and Control Systems (ICICCS), vol. 10, pp. 602-
606, 2017.
[12] D. Yang et al., “A Novel Adaptive Spectrum Noise Cancellation
Approach for En- hancing Heartbeat Rate Monitoring in a Wearable
Device”, IEEE Access, vol. 6, pp. 8364-8375, 2018.
[13] Goel, P, Chandra, M, “FPGA Implementation of Adaptive Filtering
Algorithms for Noise Cancellation”, International Conference on
Microelectronics, Computing and Communication Systems, vol 556,
Springer, 2019.
[14] M. S. Salman, F. El-Sayed and A. Youssef, "A sparse variable step-size
LMS algorithm for impulsive noise," 2019 3rd International

Authorized licensed use limited to: SRM Institute of Science and Technology. Downloaded on January 24,2024 at 08:51:31 UTC from IEEE Xplore. Restrictions apply.

You might also like