REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in...

12
REAL TIME ARRHYTHMIA ANALYSIS Srinidhi H 1 , Dr Rathnakara S 2 , Janardan M 3 , 1,2 Department of Electronics and Instrumentation JSS Science and Technology University Mysuru. 3 Chief Technical Officer BIDMAS Pvt. Ltd Bangalore. 1 [email protected] 2 rathnakara [email protected] 3 [email protected] July 30, 2018 Abstract According to latest medical survey cardiac issues are increasing continuously. It becomes extremely important to detect the possible cardiac related issues at the early stages. In medical terms irregular, abnormal and asyn- chronous heart rhythm are called as arrhythmia. Real time Arrhythmia can be made possible by analyzing the shape of the Electrocardiography (ECG) signals and also involves computational complexity because of various dependent fac- tors. It becomes important to extract clean and unaltered ECG signal to analyze the arrhythmia. This analysis is at real time is most challenging part which involves develop- ment of some accurate and complex algorithm. This analy- sis in real time requires accurate combination of few existing algorithm and customized algorithm which makes path to a new algorithm proposal. This paper demonstrates the Real 1 International Journal of Pure and Applied Mathematics Volume 120 No. 6 2018, 11657-11668 ISSN: 1314-3395 (on-line version) url: http://www.acadpubl.eu/hub/ Special Issue http://www.acadpubl.eu/hub/ 11657

Transcript of REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in...

Page 1: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

REAL TIME ARRHYTHMIAANALYSIS

Srinidhi H1, Dr Rathnakara S2,Janardan M3,

1,2Department of Electronics and InstrumentationJSS Science and Technology University

Mysuru.3Chief Technical Officer

BIDMAS Pvt. Ltd [email protected]

2rathnakara [email protected]@gmail.com

July 30, 2018

Abstract

According to latest medical survey cardiac issues areincreasing continuously. It becomes extremely importantto detect the possible cardiac related issues at the earlystages. In medical terms irregular, abnormal and asyn-chronous heart rhythm are called as arrhythmia. Real timeArrhythmia can be made possible by analyzing the shapeof the Electrocardiography (ECG) signals and also involvescomputational complexity because of various dependent fac-tors. It becomes important to extract clean and unalteredECG signal to analyze the arrhythmia. This analysis is atreal time is most challenging part which involves develop-ment of some accurate and complex algorithm. This analy-sis in real time requires accurate combination of few existingalgorithm and customized algorithm which makes path to anew algorithm proposal. This paper demonstrates the Real

1

International Journal of Pure and Applied MathematicsVolume 120 No. 6 2018, 11657-11668ISSN: 1314-3395 (on-line version)url: http://www.acadpubl.eu/hub/Special Issue http://www.acadpubl.eu/hub/

11657

Page 2: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

time multiplexed and moving window baseline wandering re-moval and arrhythmia analysis algorithm. This algorithminvolves usage of traditional Pan Tompkins algorithm to ob-tain the positions of QRS complex, algorithm is expandedto remove the motion artifacts such as baseline wandering.Baseline wandering of the signal is nullified by implement-ing moving array memory technique along with estimationof midpoint of moving ECG signals. Baseline wandering re-moved signals are analyzed for irregularity in real time usingtime multiplexed signal processing technique. If the signalis not a Normal sinus rhythm (NSR) then the different kindsof arrhythmia are estimated. Obtained signal is NSR thenthere will be no signal processing. If the signal is found tobe non NSR, signal is taken for the further processing todetect the kind of arrhythmia. Different of arrhythmia de-tected based on its morphology, energy, power of the signal,also the signal is analysed in frequency domain and checkedfor periodicity and randomness.

Key Words:Arrhythmia, Electrocardiography, baselinewandering, Pan Tompkins algorithm, Normal sinus rhythm,QRS complex, power spectral density.

1 Introduction

Arrhythmia is elaborated as asynchronous rhythm or not normalsinus rhythm. In general arrhythmia is irregular or abnormal heart-beat. It doesnt mean that heart is beating too faster or too slower.It means its out of control. Arrhythmia can be medical emergencyor it may also be harmless. The patient or subject may feel likeheart is beating too fast, too slow, added a beat, skipped a beat,fluttering or may notice anything or some of the arrhythmia aresilent. An arrhythmia can be identified by subject or patient under-going several tests like mainly Electrocardiography (ECG), Holtermonitoring or Event records, Exercise stress testing, Electrophysi-ology testing(EPS), Implantable loop records (ILR).Comparativelythe ECG is simple and easy way to detect few Arrhythmias. Theoverall algorithm is to clean the ECG and also differentiates thelife threatening Ventricular arrhythmias such as Ventricular fibril-lation and Ventricular tachycardia. In the previous work, an algo-rithm for automatic external defibrillator that detects normal sinus

2

International Journal of Pure and Applied Mathematics Special Issue

11658

Page 3: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

rhythm, Ventricular fibrillation and ventricular tachycardia withminimum hands on interval is developed. The final sub algorithmcalculates heart rate and distinguishes Rapid Ventricular Tachy-cardia from slow Ventricular Tachycardia [1]. Later developed anew cloud computing based architecture for real-time personalizedcardiac arrhythmia detection and diagnosis in order to reduce en-ergy consumption on patients mobile devices and enable real-timedata processing [2]. Later new personalized features are based onthe correlation coefficient between a patient-specific regular QRScomplex template and his/her real-time ECG data. The new fea-tures aveCC and medianCC are verified to be effective in enhancingthe performance of existing features under both the record-basedand database-based data divisions [3]. We were evaluated the per-formance of the arrhythmia discrimination algorithm with iPhonespulsatile time series data. 2 min pulsatile time series is collectedfrom each subject.Accurate real-time arrhythmia discrimination us-ing smartphones has been elusive to date [4]. A model where anenergy-efficient electrocardiogram (ECG) processor for arrhythmiadetection with a weak strong hybrid classifier that includes a weaklinear classifier (WLC) and a strong support vector machine (SVM)classifier [5].The performance of a novel three-dimensional (3D) car-diac activation imaging technique to noninvasively localize and im-age origins of focal ventricular arrhythmias in patients undergoingradio frequency ablation [6]. Cardiovascular Diseases (CVDs) causea very large number of casualties around the world every year andcardiac arrhythmias contribute to significant proportion of CVDrelated deaths. The data contained five types of arrhythmia in-cluding tachycardia, bradycardia, asystole, ventricular tachycardiaand ventricular fibrillation. An overall true positive rate of 93%has been achieved with true negative rate of 53.78% [7]. A genericplatform for autonomous medical monitoring and diagnostics. Theyvalidated the platform in the context of arrhythmia detection withpublicly available database [9]. An algorithm for the detection ofMI, AR using minimal features from a single lead is challenging.The performance from lead v4 was the best among other leads interms of the cross-validation accuracy, sensitivity, specificity, pre-cision, and f1 score. [10]. In this paper complex and efficient al-gorithm is designed to check the obtained lead II ECG is normalsinus rhythm or not by removing motion artifacts and other noises.

3

International Journal of Pure and Applied Mathematics Special Issue

11659

Page 4: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

The irregularity of the wave can be analysed by time multiplexedsignal processing technique. And further few arrhythmias are pre-dicted by analyzing the shape and periodicity of the ECG signals.This algorithm is tried to implement on TM4C1294CPDT TIVAC floating point digital signal microcontroller with real time ECGdata.

2 METHODOLOGY

The ECG data is processed using Real time multiplexed and movingwindow baseline wandering removal and arrhythmia analysis algo-rithm. The data is sampled from AFE, The sampled data is storedin moving buffer and the same data is sent for signal processing.The data is sampled from AFE, The sampled data is stored in mov-ing buffer and the same data is sent for signal processing. The algo-rithm includes different level of signal processing, L1 processing andL2 processing. In L1 processing signals are passed through notchfilter which removes 50/60Hz noise and filtered signal is passedthrough moving average filter which provides the smoothing effect.These signals are stored to moving buffer and same data is passedthrough L2 processing. L2 processing is sample wise real-time pro-cessing. Under L2 processing series of filters are applied, adaptivethreshold is applied and peaks and peak positions are detected.These peaks and peak positions correspond to the QRS complexesof the signal which is stored in the moving buffer. So, basicallyL2 processing provides the peak positions of the signal which ispresent in the moving buffer, the L1 processed signal is stored inthe moving buffer until the third peak is obtained. Now using thepeak positions and amplitudes baseline shift is determined. Theinterpolation is applied and baseline shift is removed by subtract-ing interpolated data and corresponding raw datapresentin movingbuffer. Now baseline shift removed sample is shifted to a bufferfor arrhythmia analysis. The data in the moving buffer are shiftedleft and newly obtained data from AFE is written to the tail ofmoving buffer. Here peaks are detected and their correspondingpositions are detected, and knots are detected, baseline wanderingis removed, signal is shifted left and new data is taken in and pro-cess repeats continuously, thus giving justice to the term moving

4

International Journal of Pure and Applied Mathematics Special Issue

11660

Page 5: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

buffer.

Figure 1: Real time Arrhythmia analysis

A. Baseline wandering removalThe raw ECG signal consists of motion artifacts, one importantfactor among is baseline wandering which is to be removed. Theproposed algorithm targets at the removing baseline drift at realtime. The signal received from ADC are fed to second order highpass filter, the high pass filter is implemented using transposed di-rect form 2. The output of the high pass filter is the considerableattenuation of P and T waves. Now output of the high pass filter isfed to squaring. The squared signal is given to FIR integral filter.If output of the integral filter crosses the threshold set by adaptivethresholding in positive direction then peak prediction begins, ifsignal crosses adaptive threshold value in negative direction thenpresence of peak is confirmed and counter is started and a variablenamed peak is incremented. If peak is equal to one then,insameway peak 2 is detected when peak ==2, thenK1 counter = 0in same way peak 2 is detected when peak ==2, thenk1 = (K1 counter/2)ref k = BW counter - k1K1 counter = 0in same way peak 3 is detected when peak ==3, thenk2 = (K1 counter/2)init peak = 1

5

International Journal of Pure and Applied Mathematics Special Issue

11661

Page 6: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

K1 counter = 0Kt p 1 = ref kKt p 1 b = Kt p 1Kt p =Kt p 1 +(k1 + k2)peak = 1slope = (a[Kt p]−a[Kt p 1])

(Kt p−Kt p 1)

Now Knot positions are calculated and slope is calculated is calcu-lated and interpolation is carried between the two knot positions.Interpolated signals are subtracted from raw ECG present in mov-ing buffer. This yields the baseline removed clean ECG, this signalis passed through moving average filter to smoothen the ECG.

Figure 2:Real time multiplexed and moving window baselinewandering removal and arrhythmia analysis

B. Arrhythmia analysisBaseline wandering removed and cleaned ECG signals are taken forarrhythmia analysis. Arrhythmia analysis is a complex time con-suming technique. In entire procedure of ECG analysis its beenobserved that we have time corresponding to duration between two

6

International Journal of Pure and Applied Mathematics Special Issue

11662

Page 7: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

knot position to analyze the signal. Here while one memory is get-ting filled with cleaned ECG samples, another memory is used foranalyzing arrhythmia of previous samples. Hence time multiplexedprocessing is applied to complete the arrhythmia analysis. If thereare n samples between two knots, then we have approximately Tduration to analyze the arrhythmia of samples present in buffer,whereT = (n-1)*(1/ sampling rate) *3/4Basically, we have th of the time duration between 2 samples whichcan be utilized for arrhythmia analysis. In proposed real time multiReal time multiplexed and moving window baseline wandering re-moval and arrhythmia analysis algorithm, time slots are provided toobtain different arrhythmia analysis parameters for the ECG signalof same buffer.

Figure 3: Timing diagram for task performance

From above figure which represents timing diagram which evidentthat time slot C1 is used to analyse the parameter1 of ECG signalpresent in buffer B1, that time slot C2 is used to analyse the param-eter2 of ECG signal present in buffer B1 and the process repeats.Hence the available time is effectively used to analyse the signalby time multiplexing and mapping different parameters analysis ofsame buffer data to different time slots. While B1 analysis is car-ried on buffer B2 is filled with new samples. As soon as B1 analysisis completed control shifts to B2 buffer and analyses the signal insame way, in this condition buffer B1 will be filled with new sam-ples. Hence, using this methodology analysis can be carried at realtime by switching between 2 buffers alternatively.

7

International Journal of Pure and Applied Mathematics Special Issue

11663

Page 8: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

Table 1: Slots and Parameter analysed with scheduling

Different parameters analyzed in different slots are tabulated in thebelow table, if there is irregularity observed at any slot arrhythmiaflag is raised and further slots will be free of analysis. Where theParameters are arranged in task list depend upon the sequentialmanner, the fast Fourier transform (FFT) and Mean absolute value(MAV). If the frequency of the signal is more than 100Hz then it isidentified as ventricular fibrillation or ventricular tachycardia. Alsothe MAV is greater than 0.3 then it is clarified as ventricular fib-rillation or ventricular tachycardia. The auto correlation functionis applied to check whether the obtained is periodic or not. If sig-nal is periodic then it is identified as Ventricular tachycardia elseidentified as Ventricular fibrillation.

3 RESULTS

Real time multiplexed and moving window baseline wandering re-moval and arrhythmia analysis algorithm is applied and found thealgorithm can be used affectively to remove Baseline wandering ofthe ECG signal and also used to determine the different types of ar-rhythmias available in lead II. The figure 4 represents the removalof real time base line wandered signal and removed signal. Thealgorithm removes the Real time baseline wandering with 98.2%efficiency.

8

International Journal of Pure and Applied Mathematics Special Issue

11664

Page 9: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

Figure 4: Real time Baseline wandered signal and removed signal

The figure 5 represents each window or buffer with each completeone ECG data from knot to knot is sent for checking whether theobtained signal is NSR or not. The algorithm differentiates thesignals by checking their peak amplitudes and duration of the signalrespectively. The algorithm differentiates the NSR and non NSRwith efficiency of 96% .This part of algorithm takes major part insignal processing to analyse the arrhythmia if the obtained signalis not NSR

Figure 5: Each window with one complete ECG signal

Figure 6: Real time ventricular Tachycardia

Figure 7: Real time Ventricular Fibrillation

The above figures 6 and 7 represent the Real time ventricular Tachy-cardia and Ventricular fibrillation. These Real time life threaten-ing arrhythmias are analysed initially by checking their MAV and

9

International Journal of Pure and Applied Mathematics Special Issue

11665

Page 10: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

autocorrelation. This part of algorithm differentiates the ventricu-lar tachycardia and ventricular braycardia with 96% efficiently.Theoverall using Real time multiplexed and moving window baselinewandering removal and arrhythmia analysis algorithm identifiessome life threatening arrhythmia in real time.

4 Conclusion

Cardiac disorders are a serious issues which is observed to be grow-ing at drastic rate, measures is to be taken to detect the possible lifethreatening arrhythmias in the initial stage which requires analysisof ECG signals, so an algorithm is proposed to detect the arrhyth-mia in the affective way at real time. Overall algorithm includescleaning up the ECG for noise, removing the motion artifacts andthen analyzing the signals. Algorithm is developed to work on Realtime rather than storing and analyzing at the later stages. Furtherthe algorithm is enhanced to increase the efficiency and reduce thecomplexity and time of processing.

References

[1] Sabitha Ramakrishnan, V.Akshaya, Real Time Implementa-tion of Arrhythmia

[2] Classification Algorithm using Statistical Methods, 978-1-5090-3001-9/17, 2017 IEEE.

[3] Xuhui Chen, Kenneth Loparo, Real-time Personalized CardiacArrhythmia Detection and Diagnosis: A Cloud Computing Ar-chitecture, 978-1-5090-4179-4/17, Vol 202-204, 2017 IEEE.

[4] Ping cheng and xiaodai dong, Life-Threatening Ventricu-lar Arrhythmia Detection With Personalized Features, AC-CESS.2017.2723258, vol 5, PP 14195-14203,IEEE 2017.

[5] Jo Woon Chong, Nada Esa, David D. McManus, and Ki H.Chon, Arrhythmia Discrimination Using a Smart Phone, IEEEJournal Of Biomedical And Health Informatics, Vol. 19, No.3, May 2015.

10

International Journal of Pure and Applied Mathematics Special Issue

11666

Page 11: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

[6] Zhijian Chen, Jiahui Luo, Kaiwen Lin, Jiaquan Wu, TaotaoZhu, Xiaoyan Xiang, and Jianyi Meng, An Energy-EfficientECG Processor with Weak-Strong Hybrid Classifier for Ar-rhythmia Detection, Journal of Latex Class Files, Vol. 14, No.8,IEEE, August 2015.

[7] Long Yu, Qi Jin, Zhaoye Zhou, Liqun Wu, Bin He, Three-Dimensional Noninvasive Imaging of Ventricular Arrhythmiasin Patients with Premature Ventricular Contractions, 0018-9294 (c) 2017 IEEE.

[8] Neeraj Paradkar and Shubhajit Roy Chowdhury, Cardiac Ar-rhythmia Detection using Photoplethysmography, 978-1-5090-2809-2/17, PP 113-116, 2017 IEEE.

[9] Radhagayathri K. Udhayakumar, Chandan Karmakar, Mem-ber, Marimuthu Palaniswami, Secondary Measures of Regu-larity from an Entropy Profile in detecting Arrhythmia, 978-1-5090-2809-2/17, PP 3485-3488,2017 IEEE.

[10] Lemkaddem, M. Proena, R. Delgado-Gonzalo, Ph. Renevey, I.Oei, G. Montano, J.A. Martinez-Heras, A. Donati, M. Bertschiand M. Lemay,An Autonomous Medical Monitoring System:Validation on Arrhythmia Detection , 978-1-5090-2809-2/17,PP 4553-4556,2017 IEEE.

[11] Saleha Khatun, and Bashir I. Morshed, Detection of Myocar-dial Infarction and Arrhythmia from Single-Lead ECG Datausing Bagging Trees Classifier, 978-1-5090-4767/3/17, PP 541-524, 2017 IEEE.

11

International Journal of Pure and Applied Mathematics Special Issue

11667

Page 12: REAL TIME ARRHYTHMIA ANALYSIS · 2018. 9. 29. · age origins of focal ventricular arrhythmias in patients undergoing radio frequency ablation [6]. Cardiovascular Diseases (CVDs)

11668