A Comparative Analysis on Denoising and QRS Peak Detection Using BIOPAC and MATLAB Software

DOI : 10.17577/IJERTV2IS120466

Download Full-Text PDF Cite this Publication

Text Only Version

A Comparative Analysis on Denoising and QRS Peak Detection Using BIOPAC and MATLAB Software

Chandra Mukherjee1 Pratibha Bharti2 Susmita S Samanta3 1Dronacharya College of Engineering ECE Dept. under MDU University 2Dronacharya College of Engineering ECE Dept. under MDU University 3Dronacharya College of Engineering ECE Dept. under MDU University

Abstract

The present paper is a review of the work done in the field of ECG signal analysis. An accurate and reliable Denoising and ECG feature extraction algorithm is presented in this paper and developed algorithm is validated using BIOPAC software. ECG samples are de-noised using IIR FILTER and its First Derivative, Second Derivative and Hilbert transform are computed for detection of R-peak. For testing the efficiency of developed algorithm ECG samples are taken from different database and real time ECG signals acquired using BIOPAC system. First ECG signals are denoised using developed IIR filtering algorithm. Then accuracy of the developed filter is further tested by adding known noise component with clean ECG signal. Satisfactory value of Input and Output Signal to Noise Ratio (SNR),Correction- Coefficient and Mean Square Error (MSE) was obtained.Sample having maximum amplitudein the transformed domain is found out and those samples having amplitudes within a lead wise specified threshold of that maximum are marked.In the original signal, where these marked samples undergo slope reversals are spotted as R- peak. On the left and right side of the R-peak, slope reversals are identified as Q and S peak, respectively. QRS onset-offset points, T and P waves are also detected. Now the same Denoising and Detection algorithm is performed using BIOPAC software and both outputs are compared. ECG baseline modulation correction is done after detecting characteristics points. The algorithm offers a good level of Sensitivity, Positive Predictivity and accuracy of R peak detection. Measurement errors of extracted ECG features are calculated.

KEYWORDSIIR FILTER, First derivative, Hilbert transform, Variable threshold, Slope reversal, Baseline modulation correction.

  1. INTRODUCTION

    Heart is the central muscular organ of the cardiovascular system, located between two lungs. It consists of four chambers, two atria & two ventricles. The atrias are responsible for collecting both pure and impure blood and the ventricles are responsible for supplying blood throughout the whole body.ECG signals are reflective of electric activities of the heart and a graphic recording or display of time-variant voltages produced by the myocardium during the cardiac cycle.

    Fig1: waveform of ECG

    The main waves on the ECG are given the names P, Q, R, S, T, U. Normal ECG may not show a U wave. Each wave represents specific actions occurring within a certain region of the heart. The amplitude of these waves differs from each other because each size corresponds to the amount of voltage generated by the event.

    ECG signal is a very low frequency and low amplitude signal thats why it gets affected by different types of noise. Major noise components are

    classified into two types namely High Frequency Noise and Low Frequency Noise.Low Frequency noise is a result of changes of impedance between the electrode and a body of the patient caused by the movement of the patient including breathing and changes of contact between the body and the electrode. The low frequency noise is located in the frequency below 1Hz. The amplitude of low frequency noise becomes higher which calls for the use of more effective means of noise suppression. Baseline Wandering is an example of Low Frequency noise. ECG should ideally be at a constant level referred to as the isoelectric level. The variations in lung volume (diaphragm) due to respiration alter the path impedance between the ECG electrodes which results in a slowly varying potential difference for a constant current. Slow motion of the electrodes can also cause a non-steady baseline.A segment of an ECG signal with high frequency noise could be due to the instrumentation amplifiers, the recording system, pickup of ambient EM signals by the cables, and so on.EMG Noise,Power line Interference, Motion Artifacts and. Electrosurgical noise are examples of High Frequency noise. Any muscular activity in the body produces a bio-potential signal which is also known as the electromyography (EMG) signal. The peak amplitude of the EMG signal on the surface of the body is in the range from 0.1 to 1mV and the spectrum is concentrated on the frequency range from 5 to 500Hz. When the EMG and ECG signals have partly overlapping spectra, the muscular activity may cause interference in the ECG signal. This type of noise is known as EMG noise. Moreover, both the patient activity and ECG trace are monitored so that such a noisy episode in ECG trace can be recognized as EMG interference. The power lines and the lead wires of the ECG recorder are coupled through capacitive paths. Hence a 50/60Hz current flows in each of the lead wires depending on the amount of coupling. The currents take path from the corresponding lead wires through the body to the common ground. Assuming the distance between any two leads to be very small, the power line currents in both the leads would be the sameratio (CMRR), additional voltage deference (iZ) caused by the power line. This voltage signal is further amplified along with the ECG signal by the difference amplifier which is referred as power line interference. Motion Artifacts caused due to motion of electrodes. The

    electrode used for measuring the ECG signal which is basically electrical contact between the skin surface of body and the lead cable can be modeled as a network of equivalent resistors and capacitors representing electrical parameters of different layers of the skin and the skin electrode interface. When this type of signal is generated or produced & overlapped with the spectrum of the ECG signal in the frequency range 1-10Hz and hence it is very difficult to find out the original ECG signal. Electrosurgical noisegenerated by other medical equipment present in the patient care environment at frequencies between 100 kHz and 1 MHz, lasting for approximately 1 and 10 second.

  2. BIOPAC System

    BIOPAC system is the integration of AcqKnowledge software and MP System. Itis used to acquire and analyse physiological data.BIOPAC Systems, manufactures amplifiers and signal conditioning modules designed to measure an array of life science data including EMG, respiration, pulse, EEG, temperature, eye movement, skin conductance, evoked potentials, microelectrode recordings, electrical bio impedance, laser Doppler flow, CO2 and O2, and electro-gastrogram. It also offers a general-purpose amplifier that allows us to connect other devices, including bridge transducers like pressure, force, and strain gauges. In addition, it can be mix and match amplifiers designed to collect specific kinds of physiological signals (such as ECG, respiration, and EMG). These modules snap together, allowing us to create a customized data acquisition workstation.

    MP system

    MP System is a complete and flexible data acquisition system. This single integrated system can be used rather than using on-screen chart recorder, oscilloscope, and X/Y plotter separately. Allowing us to record, view, save, and print data.

    All facilities of computer based system are available in MP150.

    AcqKnowledge is extremely flexible and effective software, giving full control over the way in which the data is collected. AcqKnowledge software consists of both facility pre-recorded sample ata

    files and also live recording of data from patient. It is possible to analysis data at the time of acquisition and after that.

  3. THEORY OF IIR FILTER

    A filter is a frequency selective circuit, used in signal processing, mostly to remove unwanted frequencies from the input signal and allows the desired frequencies to pass through it to get the desired frequencies in the output signal. IIR filter is chosen because of some useful features of this filter. They are-in the signal processing sharp cutoff filters are required to implement this using FIR we need large no of coefficient(6 times larger than IIR)so it is preferable to use IIR. Analog filters can be transformed into its equivalent IIR digital filter having similar specifications. It is not possible in FIR filter.One more thing is that FIR filters are very tough to represent algebraically. In this application no of filter coefficient may be large.So remembering these things IIR filters are used. The band-reject filter performs exactly opposite to the band-pass; it rejects all the frequencies between its cut-off limit and allows all remaining frequencies to pass. So it has the stop band between two cut-off frequencies and

    .So it can be said that in the output the frequency

    component between and are not present. Thus this filter passes a band of frequencies. As the name suggests the filter rejects a particular band of frequencies from to . While passing the signals of other frequencies (with a constant gain A) starting from 0 to and onwards. This is also called a Notch filter.

    Fig 2: Band-reject filter

    Theory of Hilbert Transform

    In mathematicsand in signal processing, the Hilbert transform is a linear operator which takes a function, u(t), and produces a function, H(u)(t), with the same domain. It is a basic tool in Fourier analysis, and provides a concrete means for realizing the harmonic conjugate of a given function or Fourier series. Furthermore, in harmonic analysis, it is an example of a singular integral operator, and of a Fourier multiplier. The Hilbert transform is also important in the field of signal processing where it is used to derive the analytic representation of a signal u(t).

    The Hilbert transform of u can be thought of as the convolution of u(t) with the function h(t) = 1/(t). Because h(t) is not integrable the integrals defining the convolution do not converge. Instead, the Hilbert transform is defined using the Cauchy principal value (denoted here by p.v.) Explicitly, the Hilbert transform of a function (or signal) u(t) is given by

    Hence, the electrocardiogram and heartrate variability signal parameters are analysed and extractedusing a computer to assist doctors with their task of properdiagnosing. Performance of these computerized ECGmonitoring systems depends on several important factorsincluding the quality of the ECG signal, the learning andtesting dataset used. Denoising and QRS complex identification is the basis of almost all automatedECG analysis algorithms. ECG signal Analysis is not possible when it consist of noise. Due to presence of noise characteristic of ECG signal gets changed. To identify ECG componentslike P, QRS onset-offset, T-waves, ST segment, etc., it is very important to locate the QRScomplexes. Because other components are relative to the position of QRS complex. Numerous researchand algorithms have been developed for denoising, analysing and extracting ECG features. J. A. Van Alste and T. S. Schilder [9]proposed linear phase filtering algorithm for the removal of baseline wander. In order to reduce large number of computations involved in the digital filtering. Bruce B. Winter and John G. Webster [10] introduced a method to reduce the effect of non-ideal

    properties of biopotential amplifiers which can transform common mode voltage into interference. Nitish V. Thakor and Yi-Sheng Zhu [2] introduced several adaptive filter structures for noise cancellation and arrhythmia detection. The adaptive filter essentially minimizes the mean-squared error between a primary input, which is the noisy ECG, and a reference input, which is either noise that is correlated in some way with the noise in the primary input or a signal that is correlated only with ECG in the primary input. Soo Chang Pei and Chien-Cheng Tseng proposed a technique for suppressing the transient states of IIR notch filter. Several transform methods such as Hilberttransform, Wavelet transform, also HiddenMarkov Models Histogram based approach , crossdistance analysis ,Hermite function , Pattern recognition[20], Artificial Neural Network, Neuro-Fuzzyapproach Filtering Technique, First Derivative ,Curve Length Concept, Linear Prediction , GeneticAlgorithm and Rough-Set Theory have been usedto automatically detect and analyse ECG beats. Beside these,a method proposed in Jovic and Bogunovic , where chaostheory is successfully applied to ECG feature extraction.

  4. Methodology

    The proposed algorithm is divided into Eight parts. These are (1)Denoising using IIR Filter (2) First Derivative and Hilbert transformComputation, (3) Characteristic Points Identification, (4) Denoising and Detection using BIOPAC software (5)Baseline Modulation Correction,

    (6) Detection and Measurement Error estimation. A schematic of the proposed algorithm is shown in figure-

    1

    Amplitude (in mV))

    Amplitude (in mV))

    0.5

    0

    -0.5

    Reference signal

    0 1 2 3 4 5 6

    Sample (per millisecond)

    Reference signal with baseline wandering

    1

    4

    x 10

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1 2 3 4 5 6

    Sample (per millisecond)

    Denoised signal

    1

    4

    x 10

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1 2 3 4 5 6

    Fig3: Block Diagram of Developed Algorithm

    Sample (per millisecond)

    Fig 5 (a): Reference signal, 5 (b): Noisy signal, (c): Denoised output

    Comparison between reference signal and denoised output

    4

    x 10

    Results:

    Testing on PTB Database(S-0464)

    1

    0.8

    0.6

    0.4

    amplitude (mV)

    amplitude (mV)

    0.2

    0

    Denoising of Powerline Interference using

    IIRNOTCFilter

    -0.2

    -0.4

    0 200 400 600 800 1000 1200 1400 1600 1800 200

    sample (per milisecond)

    Fig

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    Reference signal

    6: Comparison between reference and denoised signal

    -0.5

    1000 2000 3000 4000 5000 6000 70

    Sample (per millisecond)

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    Reference signal with power line noise

    1000 2000 3000 4000 5000 6000 70

    Denoised signal

    1000 2000 3000 4000 5000 6000 70

    Denoised signal

    Sample (per millisecond)

    MIT-BIH database (100)

    In the following figure we have shown testing result

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    1000 2000 3000 4000 5000 6000 7

    Sample (per millisecond)

    Fig 4 (a): Reference signal, 4 (b): Noisy signal, 4 (c): Denoised output

    Denoising of base-line modulation using IIR Bandpass Filter

    of our developed denoising algorithm for removal of power-line interference and baseline wandering on MIT-BIH database respectively

    Denoising of Power-line noise

    1.2

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    Reference signal

    1

    -0.5

    1000 2000 3000 4000 5000 6000 7000 8000

    Sample (per millisecond)

    Reference signal with power line noise

    0.8

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    1000 2000 3000 4000 5000 6000 7000 8000

    0.6

    Denoised signal

    1

    Sample (per millisecond)

    Amplitude (in mV)

    Amplitude (in mV)

    amplitude (mV)

    amplitude (mV)

    0.5

    0

    -0.5

    1000 2000 3000 4000 5000 6000 7000 8000

    Sample (per millisecond)

    Fig 7 (a): Reference signal, 7(b): Noisy signal, 7 (c): Denoised output

    0.4

    0.2

    0

    -0.2

    0 200 400 600 800 1000 1200 1400 1600 1800 2000

    sample (per milisecond)

    Denoising of base-line modulation

    Fig 9: Comparison between reference and denoised

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    0

    0

    Reference signal

    signal

    0 1 2 3 4 5 6

    0 1 2 3 4 5 6

    -0.5

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    Sample (per millisecond) Reference signal with base-line wandering

    x 1 4 Real time database (acquired by BIOPAC system)

    -0.5

    -1

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1 2 3 4 5

    Sample (per millisecond) Denoised output

    0 1 2 3 4 5

    Sample (per millisecond)

    4

    x 10

    x 10

    Real time ECG data was acquired by BIOPAC system from the students of Applied Physics, CU. It was contaminated with different types of noises.

    Fig8 (a): Reference signal, 8(b): Noisy signal, 8 (c): Denoised output

    Comparison between reference signal and denoised output

    1.5

    Amplitude (in mV)

    Amplitude (in mV)

    1

    0.5

    0

    -0.5

    1.2

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.8

    0.6

    0.4

    0.2

    0

    -0.2

    Acquired signal

    0 500 1000 1500 2000 2500

    Sample (per millisecond)

    Denoised signal

    0 500 1000 1500 2000 2500

    Sample (per millisecond)

    Fig 10: Real-time data denoised by developed filter

    Analysis using BIOPAC Software

    denioed signal using developed filter

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

    Samples (per millisecond)

    R-peak, QRS region identified and base-line corrected ECG signal

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

    Samples (per millisecond)

    Fig 45: R-peak and QRS region identification and base-line corrected signal

    1

    Amplitude( in mV)

    Amplitude( in mV)

    0.5

    0

    -0.5

    Denoised ECG signal using developed filter

    0 1 2 3 4 5 6

    R-peak,QRS region identified and baseline corrected ECG signal

    1

    Sample(per millisecond)

    4

    x 10

    Fig11: Baseline Correction using BIOPAC software

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1 2 3 4 5 6

    Sample (per millisecond)

    4

    x 10

    Fig12: Powerline Noise Elimination using BIOPAC software

    Fig13: R-peak and QRS region identification and base-line corrected signal

    MIT-BIH data (100)

    In the following figure we have shown testing result of our developed detection algorithm on MIT-BIH database –

    QRS Detection:

    PTB database (p236/S-0464)

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    Denoised ECG Signal using Developed Filter

    0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

    Samples(per millisecond)

    R-peak,QRS region detected and baselinecorrected ECG signal

    In the following figure we have shown testing result of our developed detection algorithm on PTB database –

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

    Samples (per millisecond)

    Fig 14: R-peak and QRS region identification and base-line corrected signal

    1

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    Denoised ECG Signal using Developed Filter

    0 1 2 3 4 5 6

  5. Compution of Validation Parameters

    Samples(per millisecond)

    1

    R-peak,QRS region detected and baselinecorrected ECG signal

    4

    x 10

    Amplitude (in mV)

    Amplitude (in mV)

    0.5

    0

    -0.5

    0 1 2 3 4 5 6

    Samples (per millisecond)

    Fig15: R-peak and QRS region identification and base-line corrected signal

    6.5.2 R-peak detection of real-time data (acquired by BIOPAC system)

    In the following figure we have shown testing result of our developed detection algorithm on Real time data acquired by BIOPAC system from the students of Applied Physics, CU –

    Real time ECG signal(acquired by BIOPAC system)

    4

    x 10

    Table 1: Calculation of Denoising validation Parameters(PTB )

    Table 2: Calculation of Denoising validation Parameters(MIT)

    1.5

    Amplitude (in mV)

    Amplitude (in mV)

    1

    0.5

    0

    -0.5

    0 500 1000 1500

    Samples(per millisecond) 2000 2500

    1.5

    Amplitude (in mV)

    Amplitude (in mV)

    1

    0.5

    0

    -0.5

    R-peak,QRS region identified and baseline wandering corrected ECG signal

    0 500 1000 1500 2000 2500

    Samples (per millisecond)

    Fig 16: R-peak and QRS region identification and base-line correction of Real-time data

    Table 3: Calculation of Detection validation Parameters(MIT)

    Comparison of validation result between BIOPAC system and developed filter

    Table 4: Calculation of Denoising validation Parameters for BIOPAC Software

    References

    Table 5: Calculation of Denoising validation Parameters for MATLAB Software

  6. Discussion

The proposed denoising algorithm is based on conventional digital filtering. We have calculated several validation parameters and it is observed that satisfactory value of SNR ,MSE etc. We observed, accuracy of the detection algorithm is almost 100% but there were some false peak detection for certain leads of PTB database. We will try to minimize this false peak detection and enhance the accuracy by choosing the threshold value more specifically.From QRS region identified and baseline corrected ECG signal we were able to extract some features. But there were large scope of extraction of ECG signal characteristics for different analysis (HRV etc.) purpose. So after observing the result it can be concluded that our developed filter is more better than BIOPAC software.

Leave a Reply