.
43
5) Dynamically threshold adjustment: after found the cardiac impulse location, use the
value at the cardiac impulse location for the dynamically adaptive adjustment of the threshold
value. Define the threshold value as 1/3 of the average of the nearest three cardiac impulses.
6) After found the cardiac impulse location, compute the RR-interval and accumulate it
with the previous RR-intervals, then count the number of accumulated RR-intervals.
7) Continue searching until the end of data, and calculate the global average value for
RR-intervals at the same time.
3.2 Find the beginning/end for each wave
The beginning/end of qrs-complex has been approached in above cardiac impulse locating
process, but it is mainly in order to assist to find the cardiac impulse location; in addition, the
location is searched based on the slope threshold value, which is imprecise. Here, according to
the found cardiac impulse location, the beginning/end of qrs-complex will be sought accurately.
Name the cardiac impulse location as the peak of R-wave.
1. Read data
1) Read one data of qrs-complex: take the peak of R-wave as reference, locate directly to the
original ecg file, read a piece of data containing the qrs-complex.
2) Preprocessing: superimpose the absolute value of slope for 12-lead signals.
3) Use the preprocessed data to carry on the searching of QRS-complex, P-wave and T-wave as
the followings.
4) Read the next data of qrs-complex, repeat step 2 and step 3 until the analyzing of all
qrs-complex are finished.
2. Find QRS-complex
1) Calculate the threshold value of S-wave: search the minimal value within 200ms after the
peak of R-wave, take the value that equals to minimal value plus 0.4, as the threshold value for
finding the end of S-wave.
2) Find the beginning of Q-wave: take 0.5 as the threshold vale, search forwardly starting from
R-wave, a point that less than the threshold value, within 0ms-200ms before the peak of R-wave,
which is the beginning of Q-wave.
3) Find the end of S-wave: search backwardly starting from R-wave, a point that less than the
threshold value of the end of S-wave, within 0ms-200ms after the peak of R-wave, which is the
end of S-wave.
3. Find P-wave
1) Peak of P-wave: search the max value within 30ms-100ms before the beginning of Q-wave,
temporarily mark the point as the peak of P-wave.
2) Find the end of P-wave: search the minimal value between the peak of P-wave and the
beginning of Q-wave, the minimal value plus 0.05 is the threshold value, use the threshold value
to find the end of P-wave.
3) Find the beginning of P-wave: search the minimal value within 150ms before the peak of
P-wave, the minimal value plus 0.06 is the threshold value, use the threshold value to find the
beginning of P-wave.
4) If the found P-wave is narrow, research the P-wave according to the following steps.