In numerous applications of signal processing, communications and biomedical we are faced with the necessity to remove noise and distortion from the signals. Adaptive filtering is one of the most important areas in digital signal processing to remove background noise and distortion. 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 ECG signal and analyze the performance of algorithms in terms of MSE (Mean Squared Error), SNR Improvement, 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.
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Performance analysis of adaptive noise canceller for an ecg signal
1. “Performance analysis of Adaptive
Noise Canceller for an ECG signal”
Raj Kumar Thenua
Anand Engineering College, Agra, U.P., India
E-mail:rkthenua@gmail.com
Web: www.rkthenua.in
2. Outline
Need of Noise Cancellation
Adaptive Filters
Approaches to Adaptive Filtering
MATLAB Simulation
Performance Comparison
Conclusions
References
2
3. Need of Noise Cancellation
In the process of transmission of information, noise
gets added to the signal from the surroundings
automatically .
It reduces the perceived quality or intelligibility of the
signal.
The effective removal or reduction of noise is an active
area of research .
In a general sense, noise cancellation has applications
in various fields such as channel equalization, radar
signal processing, pattern analysis, data forecasting,
biomedical signal processing etc.
In this work a MATLAB simulation is carried out for de-
noising a biomedical ECG signal in a noisy
environment.
3
4. Adaptive Filters
In order to design a filter, a priori knowledge of the
desired response is required.
When such knowledge is not available, due to the
changing nature of the filter’s requirements.
It is impossible to design a standard digital filter.
In such situations, adaptive filters are desirable.
Adaptive filters continuously change their impulse
response in order to satisfy the given condition.
Adaptive filters are capable of learning from the
statistics of current conditions.
Change their coefficients in order to achieve a certain
goal.
4
5. Real Life Examples of Adaptive Filtering:
Example-1:
A good example to illustrate the principles of adaptive noise
cancelling is the noise removal from the pilot’s microphone in
the airplane. Due to the high environmental noise produced by
the airplane engines, the pilot’s voice in the microphone is
distorted with a high amount of noise, and can be very difficult
to understand. In order to overcome the problem, an adaptive
filter can be used.
5
6. Example-2:
To measure the ECG of a pregnant lady and her baby
which is to be born, measurement of mother’s ECG is
simple but it is very difficult for the baby, here the
concept of adaptive filtering is used. The mother’s heart
sound acts as a noise signal and we have to cancel that
noise using various adaptive algorithms.
6
8. Approaches to adaptive filtering
Adaptive Filtering
Stochastic Gradient Approach Least Square Estimation
( Least Mean Square Algorithms) ( Recursive Least Square algorithm)
LMS
NLMS RLS
TVLMS FTRLS
VSSNLMS
8
9. LMS Algorithm
• Filter weights are updated by the following formula
for each iteration:
Here x(n) is the input vector of time delayed input values,
w(n) represents the coefficients of the adaptive FIR filter
tap weight vector at time n.
• μ is known as the step size,
• If μ is too small ;converge on the optimal solution will be too
long;
• if μ is too large; the adaptive filter becomes unstable and its
output diverges.
9
10. NLMS Algorithm
• The step size is normalized by the input signal power.
• The NLMS is always the favorable choice of algorithm
for fast convergence speed and for non-stationary
input.
• α: NLMS adaption constant, which optimize the
convergence rate of algorithm.
• 0<α<2 (practically <1)
• c : constant term for normalization
10
11. RLS Algorithm
RLS algorithms are known for excellent performance
when working in time varying environments.
cost of an increased computational complexity and
some stability problems.
Filter tap weight vector is updated using equation
wn w T n 1 k n en 1 n
intermediate gain vector
k n un / xT n u n
The filter output is calculated using the filter tap weights from
the previous iteration and the current input vector.
yn 1 n w T n 1 x n en 1 n d n yn 1 n
11
12. MATLAB Simulation
The adaptive noise canceller is implemented in
MATLAB for three algorithms; LMS, NLMS and RLS
[7].
In the simulation the reference input signal x(n) is
a white Gaussian noise of power 1-dB generated
using randn function in MATLAB, and source
signal s(n) is a clean amplified ECG signal
recorded with 12-lead configuration [6].
The desired signal d(n) ,obtained by adding a
delayed version of x(n) into clean signal s(n),
d(n) = s(n) + x1(n).
12
13. Results
Fig. 2 (a) Clean ECG signal s(n);(b) Noise signal x(n);(c) desired signal d(n)
13
15. Results Contd...
Fig.5. MATLAB simulation for RLS algorithm; N=19
If we investigate the filtered output of all algorithms, LMS
adopt the approximate correct output in 750 samples,
NLMS adopt in 600 samples and RLS adopt in 250
samples. This shows that RLS has fast learning rate.
15
17. Results Analysis
Table. 2
Performance Comparison of adaptive
algorithms
S.N. Algorithm SNR Pre SNR Post SNR
dB dB Improved
dB
1. LMS 0.89 7.04 6.15
2. NLMS 0.89 9.26 8.37
3. RLS 0.89 10.87 9.98
17
18. Conclusions
The main objective of this paper was to implement an
adaptive noise canceller for de-noising an ECG signal and
test the performance of the system for various adaptive
algorithms. When input signal is non-stationary in
nature, the RLS algorithm proved to have the highest
convergence speed, less MSE, and higher SNR
Improvement 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.
18
20. REFERENCES
[5] 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.
[6] Ch. Renumadhavi, Dr. S.Madhava Kumar, Dr. A. G. Ananth,
Nirupama Srinivasan, “A New Approach for Evaluating SNR of
ECG Signals and Its Implementation”, Proceedings of the 6th
WSEAS International Conference on Simulation, Modelling and
Optimization, Lisbon, Portugal, September 22-24, 2006.
[7] 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.
[8] Cristina Gabriela SĂRĂCIN, Marin SĂRĂCIN, Mihai DASCĂLU,
Ana-Maria LEPAR, “Echo Cancellation Using The LMS
Algorithm”, U.P.B. Sci. Bull., Series C, Vol. 71, No. 4, 2009.
20