International Journal of Scientific & Engineering Research, Volume 4, Issue 12, December-2013 1624

ISSN 2229-5518

ECG Signal Processing Using Digital Signal Processing Techniques

S.Thulasi Prasad (Phd)., Dr. S. Varadarajan, Phd., Associate Professor., Professor.,

CVSCE, SVUCE., Tirupati. Tirupati.

Email: stpr asad123@yahoo.co.in var ad asouri@gmai l.com

Abstract: This work describes the implementation of wavelet-based de noising algorithm on electrocardiogram (ECG) signal and detection of important parameter such as heart rate, amplitude, timings of the ECG, etc. The algorithm is implemented in DSP based starter kit (DSK) with a two- electrode ECG preamplifier. The signal from

the ECG preamplifier is acquired through
processing. In this design, high-speed floating point digital signal processor TMS320C6711 and TLC320AD535 dualchannel voice/data codec based DSP starter kit (DSK) was employed for processing the ECG.
Electrocardiogram (ECG) signal frequency range varies between 0 Hz-300 Hz and most
of the information available in the signal lies

IJSER

the Codec input of the DSP starter kit. The
acquired data is subjected to signal processing techniques such as removal of power line frequencies and high frequency component removal using wavelet-denoising technique. ECG component analysis such as QRS peak detection, heart rate calculation, etc is performed using nonlinear filter technique called first order derivative and moving average filter. The performance of the algorithm is studied in the DSP environment as well as MATLAB environment for comparison. The results of this study reveal the potentiality of the DSP system for routine clinical use.

Index Terms: ECG, DSP, Denoising, Wavelet, Heart rate, Power line interference

1. Introduction

In recent years, there has been increasing interest in the design and implementation of DSP systems for real time ECG signal
in the range 0.5-150 Hz “Ref. [1-4]”.
Therefore, the removal of higher frequencies is necessary to eliminate the unwanted signals, which reduces only less than 1% of the useful information. ECG signal processing comprises of two steps viz. (i) preliminary processing and (ii) primary processing. In preliminary processing, artifacts like higher peaks due to electrode motion and power line interference are removed through the application of suitable software filters in the DSK system.
In primary processing, techniques like denoising, baseline wandering and detection of P, QRS, and T waveforms are performed through the implementation of suitable algorithms in the DSK system. For analyzing the ECG signal in DSK system, the ECG signal is sampled at the frequency of 1 kHz and the sampled data is stored in DSP buffer for processing. This sampled
ECG data are subjected to various signal

IJSER © 2013 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 4, Issue 12, December-2013 1625

ISSN 2229-5518

processing algorithms to obtain a noise free and clear ECG waveform for analysis.

2. Hardware Details

Fig. 1, depicts the complete setup for DSP based ECG system, which comprises of a set of electrodes, ECG pre-amplifier board, TMS320C6711 DSP Starter Kit (DSK) with
3.5mm audio jack, and Pentium IV Desktop PC. The DSP based ECG system has been built around the TMS320C6711 DSK.
environment (IDE), called Code Composer Studio (CCS). The CCS is a high-level language, which has built-in FFT, Wavelet, and other functions for signal processing applications. Also, we can develop our own functions in C for dedicated and novel applications. The TMS320C6711 DSK has a built in CODEC, which has 16-bit register to acquire the ECG signal directly. The acquired ECG data can be viewed in the display before processing. Here 2048 samples can be viewed at a time but the data can be updated in a circular for real time display of ECG. The DSK can process upto
5000 samples at a time, but the display can store and view only 2048 samples at a time due to its limitation in video buffer memory.

Hence a circular memory technique is

IJSER

Fig.1 Block Diagram of the DSP Starter Kit
based ECG Analysis Experimental Setup
A two-electrode ECG preamplifier “Ref. [5]” is constructed using op-amps MCP607/OPA2336. A set of standard stick- on disposable electrodes are placed in the two arms of the subject (patient) picks-up the ECG signal from the body and the signal is amplified to 1 V level by the ECG preamplifier circuit. The output of the amplifier is directly connected with the Codec input of the DSK system. The Codec sampled the ECG signal at the sampled of 1 kHz. The data is stored in DSK buffer memory for processing.

3. Description Of the DSK Environment

For Algorithm Development

For the development of algorithms in the DSK system, the Texas Instrument DSK is provided with an integrated development
employed in this design to view the
processed data in a sequential manner.
Fig. 2 is the display of the 2048 raw samples of a typical ECG signal acquired using the preamplifier hardware and the DSK system. Here the X-axis represents the sample number and the Y-axis represents the amplitude of the signal. This view shows 7
QRS peaks and other components of the ECG waveforms such as P and T, which are buried in artifacts and noises.
Original signal

Fig. 2 Plot of the actual ECG signal without any processing

IJSER © 2013 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 4, Issue 12, December-2013 1626

ISSN 2229-5518

4. Implementation Of Wavelet Transform

For Denoising

Denoising is the primary processing to remove all the high frequency as well as power supply interference from the ECG signal. Several researches have been attempting wavelets for denoising of biomedical signals “Ref. [6, 7, 8]”. To estimate the performance of wavelet in denoising, biomedical researchers have made several attempts employing various wavelet basis functions like Coiflets, Haar, etc in the “Ref. [9, 10]” The outcome of this study revealed that the performance of the Daubechies (DB4) wavelet basis function in denoising is extremely well and has the basis function graphically shown in Fig 3.
Also, the Daubechies wavelet was chosen
in the signal. Almost all other unwanted informations are removed.

Fig. 4 Denoising of ECG signal using
Daubechies wavelet

5. Analyses Of ECG Waveforms Using Filtered Derivative Operator And Moving Average Filter

Most of the diseases and complaints are
reflected in the waveform intervals, morphology of the waveforms, and their

IJSER

for this work on the basis of the resemblance
and similar frequency response characteristics of the DB4 basis function with the ECG waveform. The denoised ECG signal using the Daubechies DB4 wavelet is shown in the Fig. 4, which clearly indicates that the Daubechies DB4 Wavelet denoising is an efficient method to completely remove all high frequency as well as power-line interferences.

Fig. 3 Daubechies Wavelet
Daubechies DB4 wavelet has the exact response characteristics like the ECG signal except the baseline wandering, which has very low frequency of the order of 0.05 Hz

amplitude values. Most important diagnostic information can be obtained by the detection of QRS complex, calculation of various intervals and heart rate measurement. Hence, analysis of ECG waveform is performed mainly on the detection of QRS waveform “Ref. [11, 12]” and the localization of other waveforms (S, T, P) with respective to the QRS complex. In this work, the detection of QRS complex is performed using weighted and squared first- derivative operator (Filtered- Derivative) and Moving Average (MA) filter proposed by Murthy et al “Ref. [13]”. A Filtered- Derivative Operator can be represented as,
where x(n) is the digitized ECG sample, N is the width of a window within which first order differences are computed, squared, and weighted by the factor (N-i+1). The weighting factor provides a smoothing

IJSER © 2013 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 4, Issue 12, December-2013 1627

ISSN 2229-5518

effect. Further smoothing was performed by the moving average filter defined by the following equation.

This algorithm provides a single peak for each QRS complex and suppresses the other components in the ECG such as P, T, etc.
Fig. 5 shows the QRS peak detection after applying the Filtered Derivative Operator and Moving Average Filter. Here the QRS detection is achieved by applying a threshold and finding out the number of peaks that cross the threshold value, forty percentage of the maximum amplitude of the
signal is chosen as threshold value for the
Using the above relationship, the heart rate calculated for normal case as 73 beats per minute (bpm) for the R-R interval of 825 m sec, which is well agreed with the commercial machine readings. The same methodology was employed for other important interval calculation by fixing different threshold for identifying the other components of the ECG such as P, T, etc. Important intervals and durations of the waveforms are found after identifying and locating the P, QRS and T waves.

6. Calculation Efficiency

Fig. 6 shows the timing diagram of the processor in terms of the execution cycle. The total processing time becomes

IJSER

detection of QRS peaks.
In this process, the position of each QRS has been identified and from the QRS values, the R-R interval is measured by calculating the number of samples between adjacent R peaks multiplied with the sampling time.

Fig. 5 Application of first-Derivative and
Moving Average
From the Fig 5, the time duration calculated between the adjacent R peaks as 825 m sec. From the R-R interval, the heart rate is calculated using the formula
Heart Rate = (1/RR interval in sec.) * 60
Tt = Tproc + N× Tist ............ (3)

Fig. 6 Processor efficiency Analysis Where N is the number of interruptions that occur in Tt, given by,

N = Tt / T = Tt × Tsam ............ (4) Therefore,
Tt (1- fsam × Tist) = Tproc ......... (5)

7. Conclusion

In this work, the power of the memory on chip DSP was realized by implementing the various signal processing algorithms for ECG signal processing and analysis. Novel signal processing techniques such as Daubechies Wavelet and Filtered-Derivative operator are tested for ECG denoising and
QRS peak detection respectively. De-

IJSER © 2013 http://www.ijser.org

International Journal of Scientific & Engineering Research, Volume 4, Issue 12, December-2013 1628

ISSN 2229-5518

noising comparison between Coif3 and db4 was also made and achieved the promising result with db4 wavelet.
The wavelet approach is more convenient than the conventional filtering techniques, which highlights the details of the ECG signal with optimal time-frequency resolution. The result of this study reveals that the DSP system paves way to implement highly complex mathematical techniques such as Wavelet Transform and averaging techniques for real time signal processing and analysis of the ECG signal through structured algorithms for routine clinical use.

References

Proceedings of the IEEE Volume 84, Issue
4, Apr 1996 Page(s): 626 – 638
[7]. Bahoura M., Hassani M., Hubin M, “DSP implementation of wavelet transform for real time ECG wave forms detection and heart rate analysis”, Computer Methods and Programs in Biomedicine, No. 52, 35 – 44,
1997.
[8]. Behzad Mozaffary, Mohammad A. Tinati, ECG Baseline Wander Elimination using Wavelet Packets, Transactions on Engineering, Computing and Technology V3 Dec 2004 ISSN 1305-5313
[9]. Fatimah Ibrahim, Noor Azuan Abu Osman, Juliana Usman and Nahrizul Adib Kadri, Performance Evaluation of Coifman Wavelet for ECG Signal Denoising, IFMBE
Proceedings, vol 15, pp 419-422, 2007

IJSER

[1]. Rangaraj M. Rangayyan. Bio-Medical
Signal Analysis, Wiley-Interscience (IEEE
press), 2002.
[2]. Hamilton PS, Tompkins WJ, “Quantitative investigation of QRS detection rules using the MITBIH arrhythmia database”, IEEE Transactions on Biomedical Engineering 1996, BME-33:
1157-1187
[3]. Joseph D. Bronzing, The Biomedical Engineering Handbook, Published by CRC Press, 2000
[4]. Ivaylo I Christov, Real time electrocardiogram QRS detection using combined adaptive threshold, BioMedical Engineering Online 2004, 3:28
[5]. D. Dobrev, Technical Note: Two- electrode low supply voltage electrocardiogram signal amplifier, Med. Biol. Eng. Comput., 2004, 42, 272-276.
[6]. Unser, M.; Aldroubi, A. A review of
wavelets in biomedical applications,
[10]. D.Nedumaran, S.Stalin and D.
Balasubramaniam, Application of novel signal processing techniques for Electrocardiogram signal, Proceedings of the National Conference on Bio- Instrumentation (BINCON-2005), Royal Institute of Technology and Science, 19th &
20th March 2005, pp.31-34.
[11]. Aldroubi, M.A. Unser, Wavelets in Medicine and Biology, CRC Press, Boca Raton FL, USA, 1996, 616 pages.
[12]. Ivaylo I Christov, Real time electrocardiogram QRS detection using combined adaptive threshold, Biomedical Engineering On Line 2004, 3:28
[13]. Murthy ISN and Rangaraj MR, New Concepts for PVC detection, IEEE Transactions on Biomedical Engineering,
26(7): 409-416, 1979.

IJSER © 2013 http://www.ijser.org