QT Interval Measurement: The PhysioNet/Computing in Cardiology Challenge 2006 1.0.0
(1,954 bytes)
function [Q_on_out] = preciseQ(in_ECG,points)
ekg = slidingavg(in_ECG,5);
for i = 1:length(ekg)-15,
gradient2(i) = ekg(end-i-2)-ekg(end-i);
gradient4(i) = ekg(end-i-4)-ekg(end-i);
gradient8(i) = ekg(end-i-8)-ekg(end-i);
gradient12(i) = ekg(end-i-12)-ekg(end-i);
end
smallG = find(abs(gradient12)<120);
gradient12(smallG) = 0;
clear('smallG');
smallG = find(abs(gradient8)<100);
gradient8(smallG) = 0;
clear('smallG');
smallG = find(abs(gradient4)<75);
gradient4(smallG) = 0;
clear('smallG');
smallG = find(abs(gradient2)<40);
gradient2(smallG) = 0;
clear('smallG');
Q_on_possible = zeros(1,length(points));
for i=1:length(points),
for point_fuzzy = points(i)-2:points(i)+2
if (i > round(length(points)/2)-1) && (i < round(length(points)/2)+1)
if (abs(sum(gradient12(point_fuzzy-1:point_fuzzy+1))))<220
if (abs(sum(gradient8(point_fuzzy-1:point_fuzzy+1))))<175
Q_on_possible(i) = 0.5;
if (abs(sum(gradient4(point_fuzzy-1:point_fuzzy+1))))<115
Q_on_possible(i) = 1;
if (abs(sum(gradient2(point_fuzzy-1:point_fuzzy+1))))<60
Q_on_possible(i) = 2;
end
end
end
end
else
if (abs(sum(gradient12(point_fuzzy-1:point_fuzzy+1))))<220
if (abs(sum(gradient8(point_fuzzy-1:point_fuzzy+1))))<175
Q_on_possible(i) = 0.25;
if (abs(sum(gradient4(point_fuzzy-1:point_fuzzy+1))))<115
Q_on_possible(i) = 0.5;
if (abs(sum(gradient2(point_fuzzy-1:point_fuzzy+1))))<60
Q_on_possible(i) = 1;
end
end
end
end
end
end
end
Q_on_out = Q_on_possible;