Biomedical Engineering Reference
In-Depth Information
(xii) if k1 \ n, skip step (xiii)
(xiii) stop
(xiv) i = r_th(k1 ? 1), go to step (i) for next search
Appendix 2
R-peak Detection by Squared Derivative ECG Array
i = data array index;
y = lead data array;
1. Spline smoothing operation on samples with a tolerance of .002, resulting array
y2
2. y1(i) = y2(i)* y2(i) %Squaring of array y2
% Lagrange's five-point interpolation for derivative
3. d1(i ? 2) = [y1(i)-(8*y1(i ? 1)) ? (8*y1(i ? 3))-(y1(i ? 4))]/(12*0.002);
4. d1 0 (i) = d1(i) * d1(i); %Squaring of array d1
% Lagrange's five-point interpolation for derivative
5. d2 = [d1 0 (i)-(8*d1 0 (i ? 1)) ? (8*d1 0 (i ? 3))-(d1 0 (i ? 4))]/(12*0.002);
6. d2 0 (i) = d2(i)*d2(i); %Squaring of array d2
7. find out maximum value in d2 0 array, say this is d2 max
8. find out the positions in array d2 0
with amplitudes greater than 0.05*d2 max say
this array is i3.
(i) i = 1; k1 = 1;
(ii) if d2 0 (i) \ 0.05* d2 max, go to step (v)
(iii) i = i ? 1; go to step (ii)
(iv) if end of data array d2 0 , go to step 9
(v) i3(k1) = i; k1 = k1 ? 1; i = i ? 1; go to step (ii)
9. for each i3 index (k), find out maximum y2 amplitude in the neighbor of 90-ms
window
(i) j = i3(k); k1 = 1
(ii) r = R-peak index array
(iii) y2 max = y2(j - 48);
(iv) if y2(j - 45) \ y2(j) skip step (v)
(v) y2 max = y2(j - 48); r1 = j - 45;
(vi) j = j ? 1;
(vii) if j \ i3(k) ? 48 go to step (iv)
Search WWH ::




Custom Search