The present invention relates to a heartbeat detection method, heartbeat detection device, and program for detecting a heartbeat (R wave) from an electrocardiographic waveform.
An ECG (Electrocardiogram) waveform is obtained by recording continuous electrical activities of a heart. A general ECG waveform is mainly formed from components called P, Q, R, S, and T waves representing the electrical activity statuses of right and left atriums and ventricles, as shown in
As a method of detecting a heartbeat from an ECG waveform, a method of detecting the peak of an R wave having a relatively large amplitude from time-series data of the ECG waveform is easy. That is, with respect to the time-series data of the ECG waveform, a threshold is set in accordance with the amplitude of an R wave, an R wave is detected when a data value exceeds this threshold, and then an instantaneous heart rate is calculated from the period (patent literature 1).
To reduce undulation in a baseline of an ECG waveform caused by a body movement or the like, there are proposed a method (patent literature 2) that uses the time difference of the waveform as an index value instead of using the time-series data of the waveform, and a method (patent literature 3) that uses, as a new index, a value considering clearances before and after the peak from the time difference by paying attention to small individual differences of the peak widths between the Q, R, and S waves, thereby making it possible to detect an R wave more accurately.
In measurement of an ECG waveform by a wearable device that is attracting attention in monitoring of biological information at normal time or during exercise, electrical noise caused by floating of an electrode, a body movement, or myoelectricity may be added to an ECG waveform.
To cope with this, in a heartbeat detection method disclosed in patent literature 4, an abrupt variation in threshold is suppressed by setting, if large noise is superimposed on an ECG waveform, an upper limit for the above-described index value for R-wave detection, and not updating the threshold when the index value exceeds the upper limit, thereby detecting an R wave appropriately.
However, in the method disclosed in patent literature 4, if noise having an equal amplitude occurs between R waves, this noise is erroneously detected as an R wave, and a heart rate is thus erroneously detected as a value higher than an actual value.
Embodiments of the present invention have been made in consideration of the above problems, and has as its object to provide a heartbeat detection method, a heartbeat detection device, and a program which can accurately detect a heartbeat from an ECG waveform in which biological information other than a heartbeat represented by a body movement or myoelectricity is often mixed.
According to embodiments of the present invention, there is provided a heartbeat detection method comprising a first step of calculating a heartbeat time from a sampling data string of an electrocardiographic waveform of a living body, a second step of calculating, for each heartbeat time, a heart rate from the heartbeat time calculated in the first step, and a third step of calculating, based on the heart rate calculated in the second step, a length of a skip period every time the heartbeat time is calculated, wherein the first step includes a step in which if a time difference between a latest time calculated from the sampling data string and an immediately preceding heartbeat time is not longer than the length of the skip period calculated from the immediately preceding heartbeat time, the latest time calculated from the sampling data string is not adopted as a heartbeat time.
According to embodiments of the present invention, there is also provided a heartbeat detection device comprising a heartbeat time calculation unit configured to calculate a heartbeat time from a sampling data string of an electrocardiographic waveform of a living body, a heart rate calculation unit configured to calculate, for each heartbeat time, a heart rate from the heartbeat time calculated by the heartbeat time calculation unit, and a skip period calculation unit configured to calculate, based on the heart rate calculated by the heart rate calculation unit, a length of a skip period every time the heartbeat time is calculated, wherein if a time difference between a latest time calculated from the sampling data string and an immediately preceding heartbeat time is not longer than the length of the skip period calculated from the immediately preceding heartbeat time, the heartbeat time calculation unit does not adopt, as a heartbeat time, the latest time calculated from the sampling data string.
According to embodiments of the present invention, there is also provided a heartbeat detection program causing a computer to execute a first step of calculating a heartbeat time from a sampling data string of an electrocardiographic waveform of a living body, a second step of calculating, for each heartbeat time, a heart rate from the heartbeat time calculated in the first step, and a third step of calculating, based on the heart rate calculated in the second step, a length of a skip period every time the heartbeat time is calculated, wherein the first step includes a step in which if a time difference between a latest time calculated from the sampling data string and an immediately preceding heartbeat time is not longer than the length of the skip period calculated from the immediately preceding heartbeat time, the latest time calculated from the sampling data string is not adopted as a heartbeat time.
According to embodiments of the present invention, a heart rate is calculated, for each heartbeat time, from the calculated heartbeat time, and the length of a skip period is calculated based on the heart rate. If a time difference between the latest time calculated from a sampling data string and an immediately preceding heartbeat time is equal to or shorter than the length of the skip period calculated from the immediately preceding heartbeat time, the latest time calculated from the sampling data string is not adopted as a heartbeat time, thereby making it possible to accurately detect a heartbeat even from an electrocardiographic waveform in which information other than the heartbeat is often mixed.
A heartbeat detection method according to embodiments of the present invention calculates a heartbeat time from time-series data of an ECG waveform of a living body. However, by providing a period (skip period) during which the latest time calculated from the time-series data is not adopted as a heartbeat time based on a heart rate (R-R interval) detected from the time-series data of the ECG waveform, it is possible to prevent erroneous detection of noise during the period.
More specifically, while the conventional method detects no R wave during a period corresponding to an R-R interval corresponding to the upper limit of a detected heart rate after detection of a heartbeat, embodiments of the present invention variably set a length tskip of a skip period in accordance with an instantaneous heart rate X [bpm] obtained from the latest R-R interval, as given by equation (1) below.
where Y(X) [bpm] represents a variable corresponding to the value of the instantaneous heart rate X. In consideration of prevention of detection of an abnormal value exceeding the upper limit value of the heart rate, the variable Y(X) takes a value equal to or smaller than the upper limit (the R-R interval as the time interval between an R wave and an immediately preceding R wave) of the instantaneous heart rate X. In consideration of missing an R wave (n−1) times (n is a natural number), the variable Y(X) is calculated by:
Y(X)=nX (2)
In consideration of a variation component ΔX of the instantaneous heart rate X caused by a variation in appearance interval of an R wave, the variable Y(X) may be calculated by:
Y(X)=n(X+ΔX) (3)
In equation (3), n represents a natural number and ΔX is a constant. For example, ΔX can experimentally be obtained in advance from the time-series data of the instantaneous heart rates X.
In consideration of a possible upper limit value X. of the heart rate X, the variable Y(X) may be calculated by equation (4) below.
where r represents a constant satisfying 0≤r<1. Equation (4) means that Y(X)=2X for X≤Xmax/2, Y(X)=(1+r)X for Xmax/2<X≤Xmax/(1+r), and Y(X)=Xmax for X>Xmax/(1+r). Equation (5) below may be used instead of equation (4).
In equation (5), n represents an integer of 2 or more, and m takes each integer from (n−1) to 1. For example, m=3, 2, 1 is obtained for n=4. Equation (5) means that Y(X)=(n+1)X for X≤Xmax/(n+1), Y(X)=(n+r)X for Xmax/(n+1)<X≤Xmax/(n+r), Y(X)=(m+r)X for Xmax/(m+1+r)<X≤Xmax/(m+r), and Y(X)=Xmax for X>Xmax/(1+r). Equation (5) is an equation obtained when considering missing of n R waves, and Equation (4) corresponds to a case in which n=1 set in equation (5). In consideration of missing of R waves, the variation component ΔX of the heart rate X, and the upper limit value Xmax of the heart rate X, the variable Y(X) may be calculated by equation (6) below.
Equation (6) means that Y(X)=2(X+ΔX) for X+ΔX≤Xmax/2, Y(X)=(1+r)(X+ΔX) for Xmax/2<X+ΔX≤Xmax/(1+r), and Y(X)=Xmax for X+ΔX>Xmax/(1+r). Note that equation (7) below may be used instead of equation (6).
In equation (7), n represents an integer of 2 or more. Equation (7) means that Y(X)=(n+1)(X+ΔX) for X+ΔX≤Xmax/(n+1), Y(X)=(n+r)(X+ΔX) for Xmax/(n+1)<X+ΔX≤Xmax/(n+r), Y(X)=(m+r)(X+ΔX) for Xmax/(m+1+r)<X+ΔX≤Xmax/(m+r), and Y(X)=Xmax for X+ΔX>Xmax1+r). Equation (7) is an equation obtained when considering missing of n R waves, and equation (6) corresponds to a case in which n=1 is set in equation (7).
Note that if the variation component ΔX of the heart rate X and the upper limit value Xmax of the heart rate X are considered without considering missing of R waves, the following equation is obtained.
Equation (8) means that Y(X)=X+ΔX for X+ΔX≤Xmax, and Y(X)=Xmax for X+ΔX>Xmax.
X in equations (2) to (8) need not always represent the instantaneous heart rate. As disclosed in Japanese Patent Laid-Open No. 2018-011819, for example, X may represent an average heart rate calculated based on time-series data of the instantaneous heart rates.
According to Japanese Patent Laid-Open No. 2018-011819, when HR(i) represents the ith instantaneous heart rate before averaging processing, X(i−1) represents a value obtained by averaging instantaneous heart rates up to the (i−1)th instantaneous heart rate, and q represents a predetermined averaging factor, the average heart rate X(i) obtained by averaging the instantaneous heart rates up to the ith instantaneous heart rate can be obtained by:
X(i)=q×HR(i)+(1−q)×X(i−1) (9)
As described above, according to embodiments of the present invention, by variably setting, for each heartbeat detection operation, the skip period tskip during which no detection is performed (not adopted as a heartbeat time) when detecting a heartbeat, it is possible to prevent abnormal noise generated during the skip period tskip from being erroneously detected as a heartbeat.
Note that the heartbeat time in the present invention indicates a time at which a heartbeat of the heart of a living body is considered to occur.
An embodiment of the present invention will be described below with reference to the accompanying drawings.
The heartbeat detection method according to this embodiment will be described below. A procedure of detecting one heartbeat and obtaining the heartbeat time thereof will be explained. This heartbeat time calculation processing is repeated for the period of ECG waveform data, thereby obtaining the time-series data of the heartbeat times.
In this embodiment, a data string obtained by sampling an ECG waveform is represented by D(i) where i (i=1, 2, . . . ) is a number added to one sampling data. As the number i is larger, the sampling time is later, as a matter of course.
The electrocardiograph 1 measures the ECG waveform of a living body (human body) (not shown), and outputs the sampling data string D(i) of the ECG waveform. At this time, the electrocardiograph 1 adds sampling time information to each sampling data, and then outputs the sampling data string. Note that a practical measurement method of the ECG waveform is a well-known technique and a detailed description thereof will be omitted.
The storage unit 2 stores the sampling data string D(i) of the ECG waveform and the sampling time information, which have been output from the electrocardiograph 1.
Next, the heartbeat time calculation unit 3 calculates the heartbeat time from the sampling data string D(i) of the ECG waveform stored in the storage unit 2 (step S1 of
Since the potential of the S or R wave changes depending on an ECG lead method, the threshold TL for identifying the S wave is appropriately set to a value of about 60% to 70% of the potential of the typical S wave of the lead method adopted by the electrocardiograph 1, and the threshold TH for identifying the R wave is appropriately set to a value of about 60% to 70% of the potential of the typical R wave of the lead method adopted by the electrocardiograph 1. The threshold TM is preferentially set to a value near the intermediate value between the thresholds TL and TH.
The arrangement of the heartbeat time calculation unit 3 shown in
The time difference value calculation unit 33 acquires, from the storage unit 2, data D(i+1) one sampling operation after the sampling data D(i) and data D(i−1) one sampling operation before the sampling data D(i), and calculates a time difference value DY(i) of the sampling data D(i), as given by:
DY(i)=D(i+1)−D(i−1) (10)
The time difference value determination unit 34 determines whether the time difference value DY(i) is smaller than the threshold TH2. Since the peak of the time difference value DY(i) by an abrupt change from an R wave to an S wave is to be detected, this peak appears as a negative value. Therefore, the threshold TH2 is a negative value. The first time interval defines a time domain before the assumed next heartbeat time, the second time interval defines a time domain assumed to include the peak of the time difference value DY(i), and the third time interval defines a predetermined time domain after the time domain assumed to include the peak of the time difference value DY(i).
The time determination unit 35 sets, as the range of the first time interval, an interval from a time 150 ms shorter than an R-R interval obtained from the immediately preceding heartbeat time to a time obtained by adding 100 ms to the time. The R-R interval indicates a time obtained by subtracting the second preceding heartbeat time from the immediately preceding heartbeat time. Alternatively, the time determination unit 35 sets, as the range of the first time interval, the time domain from the immediately preceding heartbeat time to a time immediately before the time difference value DY(i) exceeds the threshold TH2 next. The second time interval preferably has a time width enough to cover the peak of the time difference value, and is preset to, for example, 50 ms. The third time interval is preset to, for example, 100 ms.
Furthermore, a condition that a ratio Min2/Min1 of the minimum value Min2 to the minimum value Min1 and a ratio Min2/Min3 of the minimum value Min2 to the minimum value Min3 exceed a predetermined value is set as the heartbeat time confirmation condition.
The arrangement of the heartbeat time calculation unit 3 shown in
The predetermined time domains before and after the sampling point i are, for example, a domain of −112.5 ms to −12.5 ms and a domain of +12.5 ms to +112.5 ms with respect to the time of the sampling point i.
The arrangement of the heartbeat time calculation unit 3 shown in
Subsequently, the heartbeat time calculation unit 3 determines whether the time calculated in step S1 is appropriate, and confirms a heartbeat time. More specifically, the heartbeat time calculation unit 3 determines whether a time difference ΔT between the latest time calculated in step S1 and an immediately precedingly calculated/confirmed heartbeat time is longer than the length tskip of the skip period immediately precedingly calculated by the skip period calculation unit 5 (step S2 of
Furthermore, if the time difference ΔT is longer than the length tskip of the skip period (YES in step S2), the heartbeat time calculation unit 3 determines the time calculated in step S1 as a heartbeat time (step S3 of
Next, the heart rate calculation unit 4 calculates the heart rate X [bpm] from the latest heartbeat time calculated/confirmed by the heartbeat time calculation unit 3 (step S4 of
X=60000/RRI (11)
The heart rate calculation unit 4 may calculate the average heart rate X by equation (9), instead of the instantaneous heart rate.
Subsequently, the skip period calculation unit 5 calculates the length tskip of the skip period by equation (1) and one of equations (2) to (8) based on the heart rate X (instantaneous heart rate or average heart rate) calculated by the heart rate calculation unit 4 (step S5 of
The time-series data of the heartbeat times are obtained by repeating the processes in step S1 to S5.
As described above, according to this embodiment, it is demonstrated that it is possible to accurately detect a heartbeat even from an ECG waveform in which information other than the heartbeat (R wave) is often mixed.
Note that in this embodiment, the methods disclosed in patent literature 1 to 4 are each used as the heartbeat time calculation method. The present invention, however, is applicable regardless of the heartbeat time calculation method.
The storage unit 2, heartbeat time calculation unit 3, heart rate calculation unit 4, and skip period calculation unit 5 of the heartbeat detection device described in this embodiment can be implemented by a computer including a CPU (Central Processing Unit), a storage device, and an interface, and a program for controlling these hardware resources.
Embodiments of the present invention are applicable to a technique of detecting a heartbeat of a living body.
Explanation of the Reference Numerals and Signs
1 . . . electrocardiograph, 2 . . . storage unit, 3 . . . heartbeat time calculation unit, 4 . . . heart rate calculation unit, 5 . . . skip period calculation unit, 30 . . . R-wave detection unit, 31 . . . S-wave detection unit, 32 . . . time calculation unit, 33,40 . . . time difference value calculation unit, 34 . . . time difference value determination unit, 35 . . . time determination unit, 36 . . . minimum value holding unit, 37, 43 . . . time decision unit, 41 . . . minimum value acquisition unit, 42 . . . index value calculation unit
Number | Date | Country | Kind |
---|---|---|---|
2018-203544 | Oct 2018 | JP | national |
This application is a national phase entry of PCT Application No. PCT/JP2019/041644, filed on Oct. 24, 2019, which claims priority to Japanese Application No. 2018-203544, filed on Oct. 30, 2018, which applications are hereby incorporated herein by reference.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/041644 | 10/24/2019 | WO | 00 |