Delivery of electroporation pulses in electroporation-based treatments could potentially induce heart-related effects. The objective of our work was to develop a software tool for electrocardiogram (ECG) analysis to facilitate detection of such effects in pre-selected ECG- or heart rate variability (HRV) parameters. Our software tool consists of five distinct modules for: (i) preprocessing; (ii) learning; (iii) detection and classification; (iv) selection and verification; and (v) ECG and HRV analysis. Its key features are: automated selection of ECG segments from ECG signal according to specific user-defined requirements (e.g., selection of relatively noise-free ECG segments); automated detection of prominent heartbeat features, such as Q, R and T wave peak; automated classification of individual heartbeat as normal or abnormal; displaying of heartbeat annotations; quick manual screening of analyzed ECG signal; and manual correction of annotation and classification errors. The performance of the detection and classification module was evaluated on 19 two-hour-long ECG records from Long-Term ST database. On average, the QRS detection algorithm had high sensitivity (99.78%), high positive predictivity (99.98%) and low detection error rate (0.35%). The classification algorithm correctly classified 99.45% of all normal QRS complexes. For normal heartbeats, the positive predictivity of 99.99% and classification error rate of 0.01% were achieved. The software tool provides for reliable and effective detection and classification of heartbeats and for calculation of ECG and HRV parameters. It will be used to clarify the issues concerning patient safety during the electroporation-based treatments used in clinical practice. Preventing the electroporation pulses from interfering with the heart is becoming increasingly important because new applications of electroporation-based treatments are being developed which are using endoscopic, percutaneous or surgical means to access internal tumors or tissues and in which the target tissue can be located in immediate vicinity to the heart. 
Matlab-based tool for ECG and HRV analysis