CN112656392B - Low-power PPG heart rate calculation method and electronic equipment - Google Patents
Low-power PPG heart rate calculation method and electronic equipment Download PDFInfo
- Publication number
- CN112656392B CN112656392B CN202011518429.1A CN202011518429A CN112656392B CN 112656392 B CN112656392 B CN 112656392B CN 202011518429 A CN202011518429 A CN 202011518429A CN 112656392 B CN112656392 B CN 112656392B
- Authority
- CN
- China
- Prior art keywords
- heart rate
- ppg
- data
- value
- peak
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention relates to the technical field of embedded application software, in particular to a low-power PPG heart rate calculation method and electronic equipment, wherein PPG heart rate data are acquired by human body heart rate acquisition terminal equipment and are preprocessed; traversing all PPG heart rate waveform data, and searching a peak value in a PPG waveform; detecting the peak value by adopting a median detection method, and recording the x-axis position corresponding to the new peak value queue; detecting the R wave interval of the new peak value queue by using a distribution detection method, and determining whether the PPG data peak value is effective or not; and comparing the R wave intervals in the peak interval queue with the median value to finally obtain the heart rate value of the PPG heart rate waveform. Compared with the traditional methods such as frequency domain filtering detection and mean value detection, the method provided by the invention can obtain a more accurate heart rate, is simple in algorithm, small in occupied resource, more beneficial to long-time use of the bracelet, and has good practicability and application prospect.
Description
Technical Field
The invention relates to the technical field of embedded application software, in particular to a low-power PPG heart rate calculation method and electronic equipment.
Background
PPG (plethysmography) is the mainstream method for measuring the heart rate of a human body adopted by the current bluetooth bracelet, and uses a photoelectric detection method to irradiate an LED light source into skin tissues of the human body, and then converts a received optical signal into an electric signal through a photoelectric receiving tube at a receiving end.
Currently, there are two main methods for filtering the PPG signal to obtain the heart rate, one is frequency domain filtering and one is time domain filtering. The frequency domain filtering mainly adopts the steps of carrying out FFT (fast Fourier transform) on a PPG (photoplethysmography) waveform to obtain a frequency domain waveform of a signal, and calculating to obtain a heart rate; the time domain filtering obtains a heart rate value by processing the number of peak values in a PPG time domain waveform within a certain time.
As an external heart rate detection device, the influence of factors such as the contact tightness between the skin of a wearer and the bracelet, the movement of a measurement part, the interference of nature and other artificial light sources on the PPG waveform measured by the bracelet is large, so that the PPG waveform must be filtered. The purpose of filtering is to reduce the interference of other signals to the PPG waveform and improve the accuracy of the heart rate measurement result.
The filtering methods adopted in the current mainstream bracelet market comprise low-pass filter filtering, fast sliding average filtering, self-adaptive filtering and the like, and have the defects that the method cannot adapt to heart rate change well, the hardware resource consumption is large, the bracelet use time is reduced and the like due to the fact that a fixed threshold mean value is set.
Disclosure of Invention
Aiming at the defects of the prior art, the invention discloses a low-power PPG heart rate calculation method and electronic equipment.
The invention is realized by the following technical scheme:
in a first aspect, the invention discloses a low-power consumption PPG heart rate calculation method, which comprises the following steps:
s1, acquiring PPG heart rate data from a human body heart rate acquisition terminal device, and preprocessing the PPG heart rate data;
s2 traversing all PPG heart rate waveform data, and searching a peak value in the PPG waveform;
s3, detecting the peak value by a median detection method, and recording the x-axis position corresponding to the new peak value queue;
s4, detecting the R wave interval of the new peak value queue by using a distribution detection method, and determining whether the PPG data peak value is effective;
and S5, comparing the R wave intervals in the peak interval queue with the median value to finally obtain the heart rate value of the PPG heart rate waveform.
Furthermore, in the method, the PPG heart rate data acquired by the human body heart rate acquisition terminal equipment is stored in a text file, and during preprocessing, the PPG heart rate data is read at a proper time interval according to the sampling frequency characteristic of the human body heart rate acquisition terminal equipment.
Furthermore, in the method, a peak value in the PPG waveform is searched by traversing all data points, data [0] is taken as an initial maximum value mx, and when data [1] is greater than data [0], data [1] is assigned to mx;
setting an amplitude detection threshold value as N, if the data [2] < mx-N, considering the data [1] as a peak point at the moment, otherwise, comparing the data [1] with the data [2], and assigning a larger value of the two values to mx;
and repeating the steps, traversing all data, searching all peak values in the PPG heart rate waveform, and storing the x-axis position record of the peak values in peakArray [ ], wherein N is a positive integer.
Furthermore, in the method, if the number of peaks is less than N/2, the PPG data of the packet is considered to be poor in quality and cannot be used for subsequent processing, the next PPG data packet is read, and if the number of peaks is greater than or equal to N/2, the algorithm performs subsequent processing.
Furthermore, in the method, a median detection method is adopted to detect the peak values, data corresponding to the maximum N/2 peak values in peakArray is stored in orderArray, the orderArray is sorted according to the numerical values from large to small, then the median value is taken, the peak values lower than the peak value detection threshold are removed, a new peak value queue emi _ peaks is obtained, and the x-axis position corresponding to the peak values is recorded.
Furthermore, in the method, when performing distribution detection, firstly, an average peak interval averageInterval in the PPG waveform is calculated once, and emi _ peaks [ i ] are checked to see whether the average peak interval [ j +1] falls within an averageInterval [ j ] or not, if there is no emi _ peaks [ i ] in the interval, blankNum +1 is calculated, and finally, a blank rate blankNum/L of the whole waveform is calculated, where L is the number of peaks
Furthermore, in the method, when the blank rate exceeds 15% during distribution detection, the peak value of the PPG data read at this time is determined to be invalid.
Furthermore, in the method, when the R wave interval is compared with the median, the peak interval queue of adjacent peaks in the peak queue emi _ peaks is obtained through calculation, the largest N/2 numerical values are found and stored in RR _ interval according to the arrangement from large to small, RR _ interval [7] -minRR is taken as the median, wherein minRR is an algorithm self-defined numerical value, and N is a positive integer.
Further, the R-wave interval in the peak interval queue is compared with RR _ interval [7] -minRR, if the interval is greater than the median, the heart rate count is +1, and finally the heart rate value of the PPG heart rate waveform is obtained.
In a second aspect, an electronic device is disclosed that includes at least one processor and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the low power consumption PPG heart rate calculation method of the first aspect.
The invention has the beneficial effects that:
according to the invention, the peak values in all PPG waveforms are detected by detecting the peak values of the heart rate waveforms, abnormal data in the peak values are eliminated by using median detection, and the heart rate interval median detection is carried out again, so that more accurate heart rate numerical values can be obtained. Compared with the traditional methods such as frequency domain filtering detection and mean value detection, the method has the advantages that the more accurate heart rate can be obtained, meanwhile, the algorithm is simple, the occupied resource is small, the method is more beneficial to long-time use of the bracelet, and the method has good practicability and application prospect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is a diagram of PPG heart rate peaks after peak finding according to an embodiment of the present invention;
FIG. 3 is a plot of the peaks marked after applying a median detection method to the heart rate peaks in accordance with an embodiment of the present invention;
fig. 4 is a heart rate labeling result diagram after error data is removed in R-wave interval median detection according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
The embodiment discloses a low-power consumption PPG heart rate calculation method, which comprises the following steps:
s1, PPG heart rate data is acquired from a human body heart rate acquisition terminal device and is preprocessed;
s2 traversing all PPG heart rate waveform data, and searching a peak value in the PPG waveform;
s3, detecting the peak value by adopting a median detection method, and recording the x-axis position corresponding to the new peak value queue;
s4, detecting the R wave interval of the new peak value queue by using a distribution detection method, and determining whether the PPG data peak value is effective;
and S5, comparing the R wave intervals in the peak interval queue with the median value to finally obtain the heart rate value of the PPG heart rate waveform.
This embodiment detects out the peak value in all PPG waveforms through the peak value detection to the rhythm of the heart waveform, rejects the abnormal data in the peak value through median detection, carries out rhythm of the heart interval median detection once more, can obtain comparatively accurate rhythm of the heart numerical value, compares in traditional frequency domain filtering detection, methods such as mean value detection, can obtain more accurate rhythm of the heart.
Example 2
The embodiment discloses that an algorithm shown in fig. 1 mainly includes the following steps to detect the heart rate:
preprocessing PPG heart rate data;
peak search of PPG data;
3. calculating a PPG heart rate peak threshold by adopting a median detection method;
4. detecting R wave intervals by adopting a distribution detection method;
5. detecting R wave intervals by adopting a median detection method;
in this embodiment, the preprocessing of the PPG heart rate data is specifically that the PPG heart rate data acquired by the bluetooth bracelet is stored in the bracelet as a text file, the preprocessing method is to sample the PPG heart rate at 62.5Hz according to the bracelet, the human heart rate range is 45-200 per minute, and the bracelet can only measure the heart rate beat peak value for 3 times at most in 1s, so that the data is read in a manner of processing the heart rate data once in 20s, and 1250 pieces of PPG data are processed each time, namely data [ ].
In this embodiment, a result of peak search of the PPG data is shown in fig. 2, and a method of traversing all data points is used to search for a peak in the PPG waveform. Taking data [0] as an initial maximum value mx, assigning the data [1] to the mx when the data [1] is larger than the data [0], setting an amplitude detection threshold value 30 by the algorithm, if the data [2] < mx-30, considering the data [1] as a peak point, and otherwise, comparing the data [1] with the data [2], and assigning the larger value of the two values to the mx. And repeating the steps of traversing all 1250 data, searching to obtain all peak values in the PPG heart rate waveform, recording and storing the x-axis position of the peak values in a peakArray [ ], if the number of the peak values is less than 15, the obtained heart rate is 60s/20s 15-45 times, the PPG data is considered to be poor in quality and cannot be used for subsequent processing, the algorithm reads the next packet of PPG data, and if the number of the peak values is more than or equal to 15, the algorithm performs the subsequent processing.
In this embodiment, a median detection method is used to calculate the PPG heart rate peak threshold, and the peak value marked after the median detection method is performed on the heart rate peak is shown in fig. 3.
The peak value obtained by the peak value detection method is not completely the R wave peak value of the heart rate, and the observation of the PPG waveform shows that the PPG signal has less large signal interference, and more interference is smaller than the amplitude of the R wave, so the peak value is detected by adopting a median detection method. Taking the data corresponding to the maximum 15 peak values in peakArray [ ] and storing the data in orderArray [ ], sorting orderArray [ ] according to the numerical values from large to small, then taking the median value, namely orderArray [7], defining orderArray [7] -100 as a peak value detection threshold, removing the peak values lower than the value, obtaining a new peak value queue emi _ peaks [ ], and recording the x-axis position corresponding to the peak value.
In this embodiment, a distribution detection method is used to detect R-wave intervals, and the heart rate labeling result after error data is removed from the median detection of the R-wave intervals is shown in fig. 4.
The heart rate is characterized by being regular and moderate, and the heart rate is basically distributed evenly on the PPG waveform, so that the peak value queue obtained in the step 3 is subjected to distribution detection, firstly, the average peak value interval averageInterval in the PPG waveform is calculated once, emi _ peaks [ i ] are checked whether to fall within an averageInterval [ j +1] to averageInterval [ j ], if no emi _ peaks [ i ] exist in the interval, blankNum +1 is determined, finally, the blank rate blankNum/L of the whole waveform is calculated, wherein L is the number of peaks, and when the blank rate exceeds 15%, the peak value of the PPG data read at this time is considered to be invalid.
In this embodiment, a median detection method is used to detect the R wave intervals, and after distribution detection, the R wave intervals of the peak value queue emi _ peaks [ ] are processed, so that the accuracy of heart rate measurement can be further improved. The algorithm firstly calculates to obtain a peak interval queue of adjacent peaks in a peak queue emi _ peaks [ ], finds the maximum 15 values and stores the values in an RR _ interval [ ] in a descending order, takes RR _ interval [7] -minRR as a median value, wherein minRR is an algorithm self-defined value, compares the R wave interval in the peak interval queue with the median value, and counts the heart rate by +1 if the interval is larger than the median value. Finally, the heart rate value of the 20 sPG heart rate waveform is obtained.
Example 3
The embodiment discloses an electronic device, which comprises at least one processor and a memory which is in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a low power PPG heart rate calculation method.
In conclusion, the invention detects the peak values in all PPG waveforms by detecting the peak values of the heart rate waveforms, eliminates abnormal data in the peak values by using median detection, and performs the heart rate interval median detection once again, thereby obtaining more accurate heart rate numerical values. Compared with the traditional methods such as frequency domain filtering detection and mean value detection, the method has the advantages that the more accurate heart rate can be obtained, meanwhile, the algorithm is simple, the occupied resource is small, the method is more beneficial to long-time use of the bracelet, and the method has good practicability and application prospect.
The above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (5)
1. A low-power PPG heart rate calculation method is characterized by comprising the following steps:
s1, PPG heart rate data is acquired from a human body heart rate acquisition terminal device and is preprocessed;
s2 traversing all PPG heart rate data points, and searching a peak value in the PPG waveform;
s3, detecting the peak value by a median detection method, and recording the x-axis position corresponding to the new peak value queue;
s4, detecting the R wave interval of the new peak value queue by using a distribution detection method, and determining whether the PPG data peak value is effective;
s5, comparing the R wave interval in the peak interval queue with the median value to obtain the heart rate value of the PPG heart rate waveform,
in the method, a peak value in a PPG waveform is searched by traversing all data points, data [0] is taken as an initial maximum value mx, and when data [1] is larger than data [0], data [1] is assigned to mx;
setting an amplitude detection threshold value as N, if the data [2] < mx-N, considering the data [1] as a peak point at the moment, otherwise, comparing the data [1] with the data [2], and assigning a larger value of the two values to mx;
and so on, traversing all data, finding out all peak values in the PPG heart rate waveform and storing the x-axis position record in peakArray [ ], wherein N is a positive integer,
in the method, a median detection method is adopted to detect peak values, data corresponding to the maximum N/2 peak values in peakArray is stored in orderArray, orderArray is sorted according to numerical values from large to small, then the median value is taken, the peak values lower than a peak value detection threshold are removed, a new peak value queue emi _ peaks is obtained, and the x-axis position corresponding to the peak values is recorded,
in the method, when distribution detection is carried out, firstly, an average peak value interval averageInterval in a PPG waveform is calculated once, and whether emi _ peaks [ i ] fall within an averageInterval [ j +1] to averageInterval [ j ] interval is checked, if no emi _ peaks [ i ] exists in the interval, blankNum +1 is calculated, finally, blank rate blankNum/L of the whole waveform is calculated, wherein L is the number of peaks,
in the method, when the R wave interval is compared with the median, the peak interval queue of adjacent peaks in the peak queue emi _ peaks is obtained by calculation, the maximum 15 values are found and are stored in RR _ interval according to the arrangement from large to small, RR _ interval [7] -minRR is taken as the median, wherein minRR is an algorithm self-defined value, N is a positive integer,
and comparing the R wave interval in the peak interval queue with RR _ interval [7] -minRR, and counting the heart rate by +1 if the interval is greater than the median value to finally obtain the heart rate value of the PPG heart rate waveform.
2. The low-power consumption PPG heart rate calculation method according to claim 1, wherein in the method, PPG heart rate data acquired by human body heart rate acquisition terminal equipment is stored in a text file, and during preprocessing, the PPG heart rate data is read by selecting a proper time interval according to the sampling frequency characteristics of the human body heart rate acquisition terminal equipment.
3. The low-power consumption PPG heart rate calculation method according to claim 1, wherein if the number of peaks is less than N/2, the PPG data of the packet is considered to be poor in quality and cannot be used for subsequent processing, the next packet of PPG data is read, and if the number of peaks is greater than or equal to N/2, the algorithm performs subsequent processing.
4. The low-power consumption PPG heart rate calculation method according to claim 1, wherein when the blank rate exceeds 15% during distribution detection, the PPG data peak value read this time is determined to be invalid.
5. An electronic device comprising at least one processor and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the low power consumption PPG heart rate calculation method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011518429.1A CN112656392B (en) | 2020-12-21 | 2020-12-21 | Low-power PPG heart rate calculation method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011518429.1A CN112656392B (en) | 2020-12-21 | 2020-12-21 | Low-power PPG heart rate calculation method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112656392A CN112656392A (en) | 2021-04-16 |
CN112656392B true CN112656392B (en) | 2022-08-19 |
Family
ID=75406762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011518429.1A Active CN112656392B (en) | 2020-12-21 | 2020-12-21 | Low-power PPG heart rate calculation method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112656392B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114190912B (en) * | 2021-12-27 | 2024-02-20 | 东莞市猎声电子科技有限公司 | Method for reducing power consumption of PPG heart rate electronic detection device |
CN115886756A (en) * | 2022-11-18 | 2023-04-04 | 上海艾康菲医疗器械技术有限公司 | Anti-interference processing method and device for pulse wave signals in electronic blood pressure measurement |
CN117752315A (en) * | 2024-02-22 | 2024-03-26 | 天津大学温州安全(应急)研究院 | method and device for detecting arrhythmia by using photoelectric volume pulse wave data |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2821008A4 (en) * | 2012-02-28 | 2015-11-25 | Konica Minolta Inc | Bioinformation processing apparatus and signal processing method |
CN106175742A (en) * | 2016-07-19 | 2016-12-07 | 北京心量科技有限公司 | A kind of heart sign acquisition methods and device |
US10939875B2 (en) * | 2018-01-26 | 2021-03-09 | Fujitsu Limited | Optimized real peak detection in cyclic biological data signals |
CN109009052A (en) * | 2018-07-02 | 2018-12-18 | 南京工程学院 | The embedded heart rate measurement system and its measurement method of view-based access control model |
CN110881958B (en) * | 2019-12-25 | 2022-12-06 | 福州数据技术研究院有限公司 | Pulse signal non-physiological signal removing method for traditional Chinese medicine pulse diagnosis instrument |
CN111588367A (en) * | 2020-06-05 | 2020-08-28 | 青岛歌尔智能传感器有限公司 | Heart rate detection method and device and computer readable storage medium |
-
2020
- 2020-12-21 CN CN202011518429.1A patent/CN112656392B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112656392A (en) | 2021-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112656392B (en) | Low-power PPG heart rate calculation method and electronic equipment | |
CN110664390B (en) | Heart rate monitoring system and method based on wrist strap type PPG and deep learning | |
CN107041743B (en) | Real-time R wave detection method for electrocardiosignals | |
CN117033911B (en) | Step counting analysis method based on intelligent glasses data | |
US10602944B2 (en) | Detecting artifacts in a signal | |
CN110477906B (en) | Electrocardiosignal QRS wave start and stop point positioning method | |
CN114886388B (en) | Evaluation method and device for quality of electroencephalogram signal in anesthesia depth monitoring process | |
EP2688468A1 (en) | Apparatus and method for measuring physiological signal quality | |
CN108888259A (en) | A kind of real-time QRS wave detection method of electrocardiosignal | |
CN108903929B (en) | Heart rate detection correction method, device, storage medium and system | |
CN110742599B (en) | Electrocardiosignal feature extraction and classification method and system | |
CN112545472B (en) | PPG signal quality evaluation method, device, equipment and storage medium | |
CN102885616A (en) | Method for removing baseline drift from pulse wave signal | |
WO2023226223A1 (en) | Ppg signal quality evaluation method and apparatus and ppg signal processing method and system | |
CN109009085A (en) | A kind of R wave of electrocardiosignal detection method and system | |
US20190365268A1 (en) | Method and apparatus for processing ecg signals, and ecg machine | |
CN106214143B (en) | Transient motion interference identification method and heart rate confidence calculations method | |
CN108042107A (en) | A kind of PPG signals puppet difference correcting method | |
KR101510522B1 (en) | System for classification electrocardiogram signals | |
CN103239223A (en) | Pace-making signal detection method and device and medical instrument | |
CN113647925A (en) | Heart rate determination method and device based on heart attack signal | |
CN109745034A (en) | Atrial fibrillation real time scan method and device based on range normalization fuzzy mearue entropy | |
CN108992063A (en) | A kind of Quality estimation method and system of electrocardiosignal | |
CN111419219A (en) | PPG heart beat signal preprocessing method and device and atrial fibrillation detection equipment | |
CN109091140A (en) | A kind of R wave of electrocardiosignal detection method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |