Disclosure of Invention
The embodiment of the invention aims to provide a heart rate calculation method, wearable electronic equipment and a storage medium, so that the obtained heart rate value calculation result is more accurate.
In order to solve the technical problems, the embodiment of the invention provides a heart rate calculation method which is applied to wearable electronic equipment, wherein an optical volume pulse wave sensor is arranged in the wearable electronic equipment; the heart rate calculation method comprises the following steps: acquiring a first pulse wave signal of a human body by using the optical volume pulse wave sensor; noise reduction processing is carried out on the first pulse wave signal to obtain a second pulse wave signal; acquiring N groups of forward and reverse white noise, and removing residual noise in the second pulse wave signals by using the N groups of forward and reverse white noise to obtain third pulse wave signals, wherein N is a positive integer; and estimating the heart rate value corresponding to the third pulse wave signal by using a spectral peak tracking algorithm.
In addition, the wearable electronic equipment is also internally provided with a triaxial acceleration sensor, an angular velocity sensor and an optical signal sensor; before the noise reduction processing is performed on the first pulse wave signal to obtain a second pulse wave signal, the method further comprises: acquiring a triaxial acceleration signal of the human body by using the triaxial acceleration sensor, acquiring an angular velocity signal of the human body by using the angular velocity sensor, and acquiring an optical signal of an external environment by using the optical signal sensor; the noise reduction processing is performed on the first pulse wave signal to obtain a second pulse wave signal, including: respectively utilizing the angular velocity signal and the light signal of the external environment to carry out data cleaning on the second pulse wave signal; and carrying out self-adaptive filtering on the cleaned pulse wave signals by taking the triaxial acceleration signals as reference signals to obtain the second pulse wave signals. The main purpose of the noise reduction processing of the first pulse wave signal in the scheme is to remove baseline drift, power frequency interference, basic motion artifact noise and the like.
In addition, the data cleaning of the second pulse wave signal by using the angular velocity signal and the light signal of the external environment respectively includes: determining a first voltage threshold range of the angular velocity signal, and removing noise signals exceeding the first voltage threshold range in the second pulse wave signal; and determining a second voltage threshold range corresponding to the light signal of the external environment, and removing noise signals exceeding the second voltage threshold range in the second pulse wave signal. In the scheme, N groups of forward and reverse white noise are utilized to remove residual depth motion artifact noise in the second pulse wave signal so as to obtain a third pulse wave signal.
In addition, the removing residual noise in the second pulse wave signal by using the N sets of forward and reverse white noise to obtain a third pulse wave signal includes: performing modal decomposition on the second pulse wave signal to obtain a high-frequency signal and a low-frequency signal; and removing residual noise in the low-frequency signal by using the N groups of forward and reverse white noise to obtain the third pulse wave signal. In the scheme, the second pulse wave signal is firstly decomposed into a high-frequency signal and a low-frequency signal, the high-frequency signal is abandoned, and N groups of forward and reverse white noise are utilized to remove residual noise in the low-frequency signal so as to obtain the third pulse wave signal, so that the heart rate calculation efficiency is improved.
In addition, the removing residual noise in the low frequency signal by using the N sets of forward and reverse white noise to obtain the third pulse wave signal includes: and respectively utilizing each of the N groups of forward and reverse white noise to perform opposite-direction white noise opposite-direction, and absorbing residual noise in the low-frequency signal in the opposite-direction white noise process to obtain the third pulse wave signal.
In addition, the estimating the heart rate value corresponding to the third pulse wave signal by using a spectral peak tracking algorithm includes: using a classification positioning method to track heart rate spectrum peaks of the third pulse wave signals of each time window by taking the time window as a unit, and positioning the heart rate spectrum peaks of each time window; heart rate values are calculated based on heart rate peak positions of the current time window. In the scheme, the heart rate value corresponding to the third pulse wave signal is estimated by using a spectral peak tracking algorithm, and the motion state of the human body is classified by introducing a classification positioning method, so that the calculated heart rate value is more fit with the true value of the human body.
In addition, the classification positioning method specifically comprises the following steps: in the training stage, taking the third pulse wave signals with different time windows as training samples of a classifier, extracting characteristic information of the third pulse wave signals to construct the classifier, and designating heart rate spectrum peak positions of different classification results; and in the real-time classification processing stage, extracting the characteristic information of the third pulse wave signal of the current time window, inputting the characteristic information into a classifier for classification judgment, and determining the heart rate spectrum peak position of the current time window based on the heart rate spectrum peak position corresponding to the current category.
The embodiment of the invention also provides a heart rate calculation method, which comprises the following steps: an optical volume pulse wave sensor and an acceleration sensor; at least one processor connected to both the optical volume pulse wave sensor and the acceleration sensor; 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 heart rate calculation method described above.
The embodiment of the invention also provides a computer readable storage medium storing a computer program which when executed by a processor realizes the heart rate calculation method.
The embodiment of the invention also provides a wearable electronic device, which comprises a module for executing the heart rate calculation method.
The embodiment of the invention provides a heart rate calculation method, which comprises the steps of acquiring a first pulse wave signal of a human body by using an optical volume pulse wave sensor; firstly, carrying out noise reduction treatment on the first pulse wave signal to obtain a second pulse wave signal, then removing residual noise in the second pulse wave signal by utilizing N groups of forward and reverse white noise to obtain a third pulse wave signal, wherein N is a positive integer, and finally, estimating a heart rate value corresponding to the third pulse wave signal by utilizing a spectral peak tracking algorithm. At present, various noise data, particularly motion artifact noise caused by the change of a gap between skin and wearable equipment, are mixed in the process of collecting the PPG signal, so that inaccuracy of heart rate value calculation based on the PPG signal is caused. In the scheme, N groups of forward and reverse white noise are adopted to deeply remove interference signals such as motion artifact noise and the like in the first pulse wave signals so as to further obtain a third pulse wave signal, and therefore, the obtained heart rate calculation result is more accurate.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings. However, those of ordinary skill in the art will understand that in various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. The claimed application may be practiced without these specific details and with various changes and modifications based on the following embodiments.
Photoplethysmography (Photo plethysmo graphy, PPG) consumes less power and is therefore often used as a heart rate calculation method for smart wearable electronics. Conventional intelligent wearable electronic devices are generally built with a photo-electric volume pulse wave sensor (also known as a PPG sensor), and the pulse wave sensor is used for collecting a human pulse wave signal (also known as a PPG signal) and calculating a heart rate value according to the pulse wave signal. The pulse wave signal of the human body is collected by a light source and a light receiving device, and the reflected light with the light intensity changing along with the pulse is received by irradiating the artery of the human body, so that the pulse signal is finally collected. Various noise data, particularly motion artifact noise caused by gap change between skin and intelligent wearable electronic equipment, are mixed in the process of collecting pulse wave signals, so that calculation of heart rate values based on the pulse wave signals is inaccurate. And the characteristic of motion artifacts in frequency is very close to the real heart rate and cannot be removed through simple filtering, so a heart rate calculation method capable of removing the motion artifacts in the depth removal first pulse wave signal is needed.
The heart rate calculation method is mainly applied to wearable electronic equipment, wherein an optical volume pulse wave sensor is arranged in the wearable electronic equipment; the heart rate calculation method comprises the following steps: acquiring a first pulse wave signal of a human body by using the optical volume pulse wave sensor; noise reduction processing is carried out on the first pulse wave signal to obtain a second pulse wave signal; acquiring N groups of forward and reverse white noise, and removing residual noise in the second pulse wave signals by using the N groups of forward and reverse white noise to obtain third pulse wave signals, wherein N is a positive integer; and estimating the heart rate value corresponding to the third pulse wave signal by using a spectral peak tracking algorithm.
At present, various noise data, particularly motion artifact noise caused by the change of a gap between skin and wearable equipment, are mixed in the process of collecting the PPG signal, so that inaccuracy of heart rate value calculation based on the PPG signal is caused. In the scheme, N groups of forward and reverse white noise are adopted to deeply remove interference signals such as motion artifact noise and the like in the first pulse wave signals so as to further obtain a third pulse wave signal, and therefore, the obtained heart rate calculation result is more accurate.
The implementation details of the heart rate calculation method of the present embodiment are specifically described below, and the following description is merely provided for facilitating understanding, and is not necessary to implement the present embodiment.
A schematic flow chart of the heart rate calculation method in this embodiment is shown in fig. 1:
step 101: a first pulse wave signal of a human body is acquired by using an optical volume pulse wave sensor.
The heart rate calculation method in the embodiment is applied to wearable electronic equipment with an optical volume pulse wave sensor (also called a PPG sensor), and the detection principle of the PPG sensor is as follows: the blood volume change in the artery is caused by pumping the blood through the heart, and the change is detected by light with a specific wavelength and recorded in a reflection mode. When the PPG sensor is used for collecting pulse wave signals, the movement can cause the gaps between the wearable electronic equipment and the skin to generate shadows, and the shadow information is recorded into the pulse wave signals at the same time to form movement artifacts. Therefore, motion artifact noise exists in the first pulse wave signal acquired by the PPG sensor, and the motion artifact noise causes great interference to the extraction of the signal represented by the heart rate in the first pulse wave signal. Particularly, when the user performs intense exercise in life, the motion artifact is very strong, and particularly, different motion artifacts are caused by different motion states, so that the motion artifact in the first pulse wave signal is difficult to completely remove by the conventional self-adaptive filtering method.
Step 102: and carrying out noise reduction processing on the first pulse wave signal to obtain a second pulse wave signal.
In this embodiment, first, noise reduction processing is performed on the first pulse wave signal to remove basic motion artifacts and obtain a second pulse wave signal.
Specifically, the wearable electronic device is further built with a triaxial acceleration sensor, an angular velocity sensor and an optical signal sensor. Before the noise reduction processing is performed on the first pulse wave signal to obtain the second pulse wave signal, the method further comprises the following steps: acquiring a triaxial acceleration signal of a human body by using a triaxial acceleration sensor, acquiring an angular velocity signal of the human body by using an angular velocity sensor, and acquiring an optical signal of an external environment by using an optical signal sensor; noise reduction processing is carried out on the first pulse wave signal to obtain a second pulse wave signal, and the method comprises the following steps: respectively utilizing the angular velocity signal and an external environment light signal to carry out data cleaning on the first pulse wave signal; and carrying out self-adaptive filtering on the cleaned pulse wave signals by taking the triaxial acceleration signals as reference signals to obtain second pulse wave signals.
The means for performing the noise reduction processing on the first pulse wave signal in the present embodiment includes, but is not limited to, the following ways:
(1) And performing data cleaning on the first pulse wave signal by using the angular velocity signal. The angular velocity signal is acquired by an angular velocity sensor (such as a gyroscope) and is used for representing the movement angular velocity of a human body; and performing data cleaning on the first pulse wave signal by using the angular velocity signal to remove noise interference signals caused by the angular velocity of human body movement. Specifically, a first voltage threshold range of the angular velocity signal can be determined, and noise signals exceeding the first voltage threshold range in the second pulse wave signal are removed.
(2) And performing data cleaning on the first pulse wave signal by utilizing an external environment light signal. The light signals of the external environment are acquired by the light signal sensor and are used for representing information such as light intensity of the current external environment. And performing data cleaning on the first pulse wave signal by utilizing an external environment light signal so as to remove noise interference signals brought by the environment light signal. Specifically, a second voltage threshold range corresponding to the light signal of the external environment can be determined, and noise signals exceeding the second voltage threshold range in the second pulse wave signal are removed.
The above-mentioned data cleaning of the first pulse wave signal by using the angular velocity signal and by using the light signal of the external environment may be used simultaneously, or the data cleaning of the first pulse wave signal may be performed by using the angular velocity signal or the light signal of the external environment alone.
(3) And carrying out self-adaptive filtering on the cleaned pulse wave signals by taking the triaxial acceleration signals as reference signals to obtain second pulse wave signals. The triaxial acceleration signals are acquired by a triaxial acceleration sensor to obtain acceleration signals in three directions including x, y and z, and the relations between the acceleration signals in the three directions and the motion artifact are close. Therefore, the cleaned pulse wave signal is filtered by the triaxial acceleration signal, so that the motion artifact related to the acceleration in part of the pulse wave signal can be removed. Specifically, the triaxial acceleration signal is used as a reference signal of the least square adaptive filter, and then the cleaned pulse wave signal and the triaxial acceleration signal are simultaneously input into the adaptive filter, and the triaxial acceleration signal is used for constructing a model for filtering.
As shown in fig. 2, two channel pulse wave signals (PPG signal 1 and PPG signal 2) and three axis acceleration signals (x axis acceleration signal, y axis acceleration signal and z axis acceleration signal) with the same time can be selected, and the PPG signal 1 and PPG signal 2 and the three axis acceleration signals can be simultaneously input into an adaptive filter and a filtering model is constructed for filtering.
It should be noted that, the main purpose of the noise reduction processing of the first pulse wave signal in the step 102 is to remove baseline drift, power frequency interference, basic motion artifact noise, and the like.
Step 103: and acquiring N groups of forward and reverse white noise, and removing residual noise in the second pulse wave signal by using the N groups of forward and reverse white noise to obtain a third pulse wave signal.
And obtaining a second pulse wave signal after performing preliminary noise reduction processing on the first pulse wave signal, wherein noise existing in the second pulse wave signal is mainly depth motion artifact noise. For depth motion artifact noise, N sets of forward and reverse white noise are obtained in the embodiment, N is a positive integer, and the residual depth motion artifact noise in the second pulse wave signal is removed by using the N sets of forward and reverse white noise to obtain a third pulse wave signal.
Specifically, removing residual noise in the second pulse wave signal by using N sets of forward and reverse white noise to obtain a third pulse wave signal, including: performing modal decomposition on the second pulse wave signal to obtain a high-frequency signal and a low-frequency signal; and removing residual noise in the low-frequency signals by using N groups of forward and reverse white noise to obtain third pulse wave signals.
Since normal heart rate signals are typically between 0.05Hz and 100Hz, they are low frequency signals. Therefore, in order to improve the efficiency of heart rate calculation, in this embodiment, the second pulse wave signal is first decomposed into a high frequency signal and a low frequency signal, where a signal with a frequency higher than a preset value in the second pulse wave signal is a high frequency signal, and a signal with a frequency lower than the preset value is a low frequency signal. The preset value may be taken according to the upper limit value of the normal heart rate signal, for example: 110Hz. After the high-frequency signal and the low-frequency signal are decomposed, the high-frequency signal is discarded, and the residual noise in the low-frequency signal is removed by using N groups of forward and reverse white noise to obtain the third pulse wave signal. In this embodiment, each of the N sets of forward and reverse white noise is used for hedging, and residual noise in the low-frequency signal is absorbed during the hedging process, so as to obtain a third pulse wave signal. In this embodiment, through the opposite flushing process of the positive noise and the negative noise, the residual noise in the low-frequency signal is continuously absorbed, and finally the residual noise in the low-frequency signal is gradually reduced, so as to achieve the purpose of deeply removing the depth motion artifact noise in the second pulse wave signal. The identification is worth to be described, N can be 2/3 or 5, and the like, and can be selected according to actual needs.
Step 104: and estimating the heart rate value corresponding to the third pulse wave signal by using a spectral peak tracking algorithm.
In this embodiment, after the third pulse wave signal is obtained, the frequency of the real heartbeat needs to be found out from the third pulse wave signal by using a spectral peak tracking algorithm. Calculating a spectrum value of the PPG signal in unit time by a convolutional neural network algorithm in deep learning, and continuously searching spectrum peak points in each period; and classifying spectral peaks on the frequency spectrum based on the classifier, so as to process the spectral peaks aiming at different motion types, and finally finding out peaks represented by the real heart rate.
Specifically, estimating the heart rate value corresponding to the third pulse wave signal by using a spectral peak tracking algorithm includes: using a classification positioning method to track heart rate spectrum peaks of the third pulse wave signals of each time window by taking the time window as a unit, and positioning the heart rate spectrum peaks of each time window; heart rate values are calculated based on heart rate peak positions of the current time window.
The classification positioning method specifically comprises the following steps: in the training stage, taking third pulse wave signals of different time windows as training samples of a classifier, extracting characteristic information of the third pulse wave signals to construct the classifier, and designating heart rate spectrum peak positions of different classification results; and in the real-time classification processing stage, extracting the characteristic information of the third pulse wave signal of the current time window, inputting the characteristic information into a classifier for classification judgment, and determining the heart rate spectrum peak position of the current time window based on the heart rate spectrum peak position corresponding to the current category.
In this embodiment, a third pulse wave signal is obtained and transformed to obtain a third pulse wave signal spectrum, and then, for each time window, a feature value is extracted from the signal spectrum and a true value is used as a classification of spectrum peaks, and then, a set training learner is used, and finally, the obtained result is put on a test data set to be tested and classified.
Because motion artifacts generated by different motion states are different, real-time heart rate monitoring is extremely difficult under different motion states. In the application, the heart rate value corresponding to the third pulse wave signal is estimated by using a spectral peak tracking algorithm, and a classification positioning method is introduced to classify the motion state of the human body (such as running, sitting, climbing, and the like), so that the calculated heart rate value is more fit with the true value of the human body.
Compared with the related art, the embodiment of the invention provides a heart rate calculation method, which is used for firstly carrying out noise reduction treatment on a first pulse wave signal and mainly aims at removing baseline drift, power frequency interference, basic motion artifact noise and the like; and then, removing residual depth motion artifact noise in the second pulse wave signal by using N groups of forward and reverse white noise to obtain a third pulse wave signal, wherein the obtained third pulse wave signal can effectively reflect the true-to-solid rate value. The heart rate value corresponding to the third pulse wave signal is estimated by using a spectral peak tracking algorithm, and a classification positioning method is introduced to classify the motion state of the human body (such as running, sitting, mountain climbing and the like), so that the calculated heart rate value is more fit with the true value of the human body.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
A second embodiment of the invention relates to a wearable electronic device, as shown in fig. 3, comprising an optical volume pulse wave sensor 3 and an acceleration sensor 4; at least one processor 1 connected to the optical volume pulse wave sensor 3 and the acceleration sensor 4; and a memory communicatively coupled to the at least one processor 1; wherein the memory stores instructions executable by the at least one processor 1, the instructions being executable by the at least one processor 1 to enable the at least one processor 1 to perform the heart rate calculation method described above.
Where the memory and processor 1 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting together the various circuits of the one or more processors 1 and memory. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 1 are transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 1.
The processor 1 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory may be used to store data used by the processor 1 in performing operations.
The third embodiment of the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the heart rate calculation method described above.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The fourth embodiment of the present invention also provides a wearable electronic device, including a module for executing the centering rate calculating method of the first embodiment.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples of carrying out the invention and that various changes in form and details may be made therein without departing from the spirit and scope of the invention.