DOI: 10.7910/dvn/qtg0ep
title: TELE ECG Database: 250 telehealth ECG records (collected using dry metal electrodes) with annotated QRS and artifact masks, and MATLAB code for the UNSW artifact detection and UNSW QRS detection algorithms

description: -------------------------------------------------------------------------------------------------------------&lt;br&gt;
CITATION&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
Please cite this data and code as:&lt;br&gt;
&lt;br&gt;
H. Khamis, R. Weiss, Y. Xie, C-W. Chang, N. H. Lovell, S. J. Redmond, "QRS detection algorithm for telehealth electrocardiogram recordings," IEEE Transaction in Biomedical Engineering, vol. 63(7), p. 1377-1388, 2016. &lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
DATABASE DESCRIPTION&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
The following description of the TELE database is from Khamis et al (2016):&lt;br&gt;
&lt;br&gt;
"In Redmond et al (2012), 300 ECG single lead-I signals recorded in a telehealth environment are described. The data was recorded using the TeleMedCare Health Monitor (TeleMedCare Pty. Ltd. Sydney, Australia). This ECG is sampled at a rate of 500 Hz using dry metal Ag/AgCl plate electrodes which the patient holds with each hand; a reference electrode plate is also positioned under the pad of the right hand. Of the 300 recordings, 250 were selected randomly from 120 patients, and the remaining 50 were manually selected from 168 patients to obtain a larger representation of poor quality data. &lt;br&gt;
&lt;br&gt;
Three independent scorers annotated the data by identifying sections of artifact and QRS complexes. All scorers then annotated the signals as a group, to reconcile the individual annotations. Sections of the ECG signal which were less than 5 s in duration were considered to be part of the neighboring artifact sections and were subsequently masked. QRS annotations in the masked regions were discarded prior to the artifact mask and QRS locations being saved.&lt;br&gt;
&lt;br&gt;
Of the 300 telehealth ECG records in Redmond et al. (2012), 50 records (including 29 of the 250 randomly selected records and 21 of the 50 manually selected records) were discarded as all annotated RR intervals within these records overlap with the annotated artifact mask and therefore, no heart rate can be calculated, which is required for measuring algorithm performance. The remaining 250 records will be referred to as the TELE database."&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
For all 250 recordings in the TELE database, the mains frequency was 50 Hz, the sampling frequency was 500 Hz and the top and bottom rail voltages were 5.556912223578890 and -5.554198887532222 mV respectively.&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
DATA FILE DESCRIPTION&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
Each record in the TELE database is stored as a X_Y.dat file where X indicates the index of the record in the TELE database (containing a total of 250 records) and Y indicates the index of the record in the original dataset containing 300 records (see Redmond et al. 2012).&lt;br&gt;
&lt;br&gt;
The .dat file is a comma separated values file. Each line contains:&lt;br&gt;
- the ECG sample value (mV)&lt;br&gt;
- a boolean indicating the locations of the annotated qrs complexes&lt;br&gt;
- a boolean indicating the visually determined mask&lt;br&gt;
- a boolean indicating the software determined mask (see Khamis et al. 2016)&lt;br&gt; 
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
CONVERTING DATA TO MATLAB STRUCTURE&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
A matlab function (readFromCSV_TELE.m) has been provided to read the .dat files into a matlab structure:&lt;br&gt;
&lt;br&gt;
%%&lt;br&gt;
% [DB,fm,fs,rail_mv] = readFromCSV_TELE(DATA_PATH) &lt;br&gt;
%&lt;br&gt;
% Extracts the data for each of the 250 telehealth ECG records of the TELE database [1] &lt;br&gt;
% and returns a structure containing all data, annotations and masks. &lt;br&gt;
%&lt;br&gt;
% IN: DATA_PATH - String. The path containing the .hdr and .dat files&lt;br&gt;
%&lt;br&gt;
% OUT: DB - 1xM Structure. Contains the extracted data from the M (250) data files. &lt;br&gt;
% The structure has fields: &lt;br&gt;
% * data_orig_ind - 1x1 double. The index of the data file in the original dataset of 300 records (see [1]) - for tracking purposes. &lt;br&gt;
% * ecg_mv - 1xN double. The ecg samples (mV). N is the number of samples for the data file. &lt;br&gt;
% * qrs_annotations - 1xN double. The qrs complexes - value of 1 where a qrs is located and 0 otherwise. &lt;br&gt;
% * visual_mask - 1xN double. The visually determined artifact mask - value of 1 where the data is masked and 0 otherwise. &lt;br&gt;
% * software_mask - 1xN double. The software artifact mask - value of 1 where the data is masked and 0 otherwise. &lt;br&gt;
% fm - 1x1 double. The mains frequency (Hz) &lt;br&gt;
% fs - 1x1 double. The sampling frequency (Hz) &lt;br&gt;
% rail_mv - 1x2 double. The bottom and top rail voltages (mV) &lt;br&gt;
%&lt;br&gt;
% If you use this code or data, please cite as follows: &lt;br&gt;
%&lt;br&gt;
% [1] H. Khamis, R. Weiss, Y. Xie, C-W. Chang, N. H. Lovell, S. J. Redmond, &lt;br&gt;
% "QRS detection algorithm for telehealth electrocardiogram recordings," &lt;br&gt;
% IEEE Transaction in Biomedical Engineering, vol. 63(7), p. 1377-1388, &lt;br&gt;
% 2016. &lt;br&gt;
%&lt;br&gt;
% Last Modified: 05/09/2016&lt;br&gt;
%&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
CALCULATING ARTIFACT MASKS – UNSW Artifact Detection Algorithm&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
A matlab function (UNSW_ArtifactMask.m) has been provided to compute the Rail Contact, High Frequency, Low Power, Baseline Shift and Final artifact masks described in Khamis et al 2016:&lt;br&gt;
&lt;br&gt;
%%&lt;br&gt;
% [rcmask,hfmask,lpmask,bsmask,finalmask] = UNSW_ArtifactMask(rawecg,railV,fm,fs) &lt;br&gt;
%&lt;br&gt;
% Determines the ECG artifact mask as described in [1] &lt;br&gt;
%&lt;br&gt;
% IN: rawecg - 1xN double. The ECG samples (mV). N is the number of samples. &lt;br&gt;
% railV - 1x2 double. Bottom and top rail voltages (mV). &lt;br&gt;
% fm - 1x1 double. The mains frequency (Hz) &lt;br&gt;
% fs - 1x1 double. The sampling frequency (Hz) &lt;br&gt;
%&lt;br&gt;
% OUT: rcmask - 1xM1 double. M1 is the number of masked samples. Indices in rawecg of the rail contact mask - See RC Mask in [1]. &lt;br&gt;
% hfmask - 1xM2 double. M2 is the number of masked samples. Indices in rawecg of the high frequency mask - See HF Mask in [1]. &lt;br&gt;
% lpmask - 1xM3 double. M3 is the number of masked samples. Indices in rawecg of the low power mask - See LP Mask in [1]. &lt;br&gt;
% bsmask - 1xM4 double. M4 is the number of masked samples. Indices in rawecg of the baseline shift mask - See BS Mask in [1]. &lt;br&gt;
% finalmask - 1xM5 double. M5 is the number of masked samples. Indices in rawecg of the final mask - See Final Mask in [1]. &lt;br&gt;
%&lt;br&gt;
%&lt;br&gt;
% This function uses the files sortfilt1.m, medianfilter.mexw64 and&lt;br&gt;
% minmaxfilter.mexw64 - Ensure that these files are on the MATLAB path. &lt;br&gt;
%&lt;br&gt;
% If the .mexw64 files are incompatible with you version of MATLAB, please&lt;br&gt;
% rebuild the mex files from the corresponding .cpp and .h files provided. &lt;br&gt;
%&lt;br&gt;
% If you use this code or data, please cite as follows: &lt;br&gt;
%&lt;br&gt;
% [1] H. Khamis, R. Weiss, Y. Xie, C-W. Chang, N. H. Lovell, S. J. Redmond, &lt;br&gt;
% "QRS detection algorithm for telehealth electrocardiogram recordings," &lt;br&gt;
% IEEE Transaction in Biomedical Engineering, vol. 63(7), p. 1377-1388, &lt;br&gt;
% 2016. &lt;br&gt;
%&lt;br&gt;
% Last Modified: 05/09/2016&lt;br&gt;
%&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
DETECTING QRS LOCATIONS – UNSW QRS Detection Algorithm&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
A matlab function (UNSW_QRSDetector.m) has been provided which is an implementation of the QRS detector algorithm described in Khamis et al 2016:&lt;br&gt;
&lt;br&gt;
%%&lt;br&gt;
% [qrs,RRlist,nRR,mRR,nSections] = UNSW_QRSDetector(rawecg,fs,mask,isplot) &lt;br&gt;
%&lt;br&gt;
% Determines the QRS locations in the raw ECG based on the UNSW QRS detection algorithm &lt;br&gt;
%&lt;br&gt;
% IN: rawecg - 1xN double. The ECG samples (mV). N is the number of samples. &lt;br&gt;
% fs - 1x1 double. The sampling frequency (Hz)- A vector of ECG amplitude.&lt;br&gt;
% mask - 1xM double. Indices of the artifact mask. &lt;br&gt;
% isplot - 1x1 boolean. True for ploting intermediate signals. False for no plotting. &lt;br&gt;
%&lt;br&gt;
% OUT: qrs - 1xQ double. Indices of the qrs locations. &lt;br&gt;
% RRlist - 1xR double. Indices of the RR-intervals in samples (not interupted by masking). &lt;br&gt;
% nRR - 1x1 double. The number of RR-intervals (not interupted by masking). &lt;br&gt;
% meanRR - 1x1 double. The mean RR interval in samples (not interupted by masking). &lt;br&gt;
% nSections - 1x1 double. The number of unmasked sections of ECG. &lt;br&gt;
%&lt;br&gt;
%&lt;br&gt;
% This function uses the files sortfilt1.m, medianfilter.mexw64 and&lt;br&gt;
% minmaxfilter.mexw64 - Ensure that these files are on the MATLAB path. &lt;br&gt;
%&lt;br&gt;
% If the .mexw64 files are incompatible with you version of MATLAB, please&lt;br&gt;
% rebuild the mex files from the corresponding .cpp and .h files provided. &lt;br&gt;
%&lt;br&gt;
% If you use this code or data, please cite as follows: &lt;br&gt;
%&lt;br&gt;
% [1] H. Khamis, R. Weiss, Y. Xie, C-W. Chang, N. H. Lovell, S. J. Redmond, &lt;br&gt;
% "QRS detection algorithm for telehealth electrocardiogram recordings," &lt;br&gt;
% IEEE Transaction in Biomedical Engineering, vol. 63(7), p. 1377-1388, &lt;br&gt;
% 2016. &lt;br&gt;
%&lt;br&gt;
% Last Modified: 05/09/2016&lt;br&gt;
%&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
REFERENCES&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
&lt;br&gt;
H. Khamis, R. Weiss, Y. Xie, C-W. Chang, N. H. Lovell, S. J. Redmond, "QRS detection algorithm for telehealth electrocardiogram recordings," IEEE Transaction in Biomedical Engineering, vol. 63(7), p. 1377-1388, 2016.&lt;br&gt;
&lt;br&gt;
S. J. Redmond, Y. Xie, D. Chang, J. Basilakis, and N. H. Lovell, "Electrocardiogram signal quality measures for unsupervised telehealth environments," Physiological Measurement, vol. 33, p. 1517, 2012.&lt;br&gt;