Skip to main content
. 2018 Jan 28;18(2):379. doi: 10.3390/s18020379
Algorithm 3: Abnormal ECG morphology detection
Input:
Vecg: Vector of ECG data points with amplitude, Sr: ECG data sampling rate,
Hr: Heart rate, RFV: Set of referenced feature values, k: User defined constant to group k-cycles.
Output: Detection of abnormal morphologies
Notations:
θXwv: Measured amplitude of X wave,
ψXwv: Measured duration of X wave,
cXwv: Counter for X wave abnormal morphologies, where X{P,QRS,T},
cRRinv: Counter for RR interval abnormal morphologies,
ψRRinv: Measured duration of RR interval.
1 Initialize k;
2 Initialize cPwv=cQRSwv=cTwv=cRRinv=0;
3 Estimate Cardiac cycle Length: CL=SrHr;
4 Calculate # of cardiac cycles: CCs=|Vecg|CL;
5 for i=1 to CCsk+1 do
6  j=i;
7while j≤(i+k) do
8  if (θPwv>ΩPwv)(θPwv<ωPwv)(ψPwv>ΔPwv)(ψPwv<δPwv) then
9   cPwv=cPwv+1; // P wave abnormal morphology detection
10  end
11  ;
12  if (θQRSwv>ΩQRSwv)(θQRSwv<ωQRSwv)(ψQRSwv>ΔQRSwv)(ψQRSwv<δPwv) then
13   cQRSwv=cQRSwv+1; // QRS wave abnormal morphology detection;
14  end
15  if (θTwv>ΩTwv)(θTwv<ωTwv)(ψTwv>ΔTwv)(ψTwv<δTwv) then
16   cTwv=cTwv+1; // T wave abnormal morphology detection;
17  end
18  if (ψRRinv>ΔRRinv)(ψRRinv<δRRinv) then
19   cRRinv=cRRinv+1; // RRinv interval abnormal morphology detection;
20   end
21end
22 endfor