# Pacing_spike_removal_v2 Overview Pacing_spike_removal_v2 is a MATLAB-based software for automated detection and removal of pacing artifacts from 12-lead ECG signals. Pacing artifacts, generated by cardiac implantable electronic devices, can distort ECG morphology and interfere with downstream analysis. This software provides a semi-automated workflow combining signal processing and user-guided refinement to accurately identify and remove both ventricular and atrial pacing artifacts while preserving underlying ECG morphology. The algorithm follows a three-step approach: 1. Automatic detection and removal of pacing artifacts using high-frequency enhancement and peak detection. 2. Refinement step detects low-amplitude atrial artifacts using width-based criteria, when present. 3. Manual review and correction via an interactive graphical user interface. Table of Contents The repository includes the following files: 1. ECGApp_final.m Main MATLAB application with graphical user interface (GUI) for pacing artifact detection and removal. 2. kors.m Implements the Kors transformation to convert 12-lead ECG signals into orthogonal XYZ leads for visualization and processing. 3. Test_file1.mat, Test_file2.mat Example 12-lead ECG recordings for testing the application. - Sampling rate: 500 Hz - Amplitude resolution: 1 µV 4. user_manual.pdf Detailed instructions and screenshots describing how to use the software. Requirements - MATLAB (tested on MATLAB R2024a or later) - No additional toolboxes are strictly required beyond standard MATLAB signal processing functions Instructions Step 1: Download Files Download the following files: - ECGApp_final.m - kors.m - Test_file1.mat/ Test_file2.mat Step 2: Launch the Application 1. Open MATLAB 2. Navigate to the folder containing the files 3. Open and run ‘ECGApp_final.m’