Disclosure of Invention
The invention aims to provide a method for calculating a pure dynamic heart rate signal in intelligent wearing, which can calculate a pure PPG signal without noise in a motion state according to a PPG signal and an acceleration signal which can be obtained at present, and is convenient for a user to calculate and analyze in various scenes according to the pure PPG signal; another object of the present invention is to provide an apparatus, an intelligent wearable device and a computer-readable storage medium based on the above method.
In order to solve the technical problem, the invention provides a method for calculating a pure dynamic heart rate signal in intelligent wearing, which comprises the following steps:
acquiring a photoplethysmograph (PPG) signal and an acceleration signal of intelligent wearable equipment in real time, and distinguishing the current user state; the user state comprises a static state and a motion state;
when the user state is the motion state, extracting a PPG signal in a static state within a preset time range before entering the motion state;
and constructing to obtain the pure PPG signal according to the PPG signal in the static state, the PPG signal in the motion state and the acceleration signal.
Preferably, the preset time range is a last preset time period before entering the motion state.
Preferably, the process of constructing and obtaining the pure PPG signal according to the PPG signal in the stationary state, the PPG signal in the moving state, and the acceleration signal specifically includes:
performing Fourier transform on the PPG signal in the static state to obtain a first main frequency and a first amplitude;
judging whether the difference value of the main frequencies of the PPG signal and the acceleration signal in the motion state is smaller than a preset threshold value or not, if so, filtering the PPG signal in the motion state to obtain an initial pure PPG signal, and if not, taking the PPG signal in the motion state as the initial pure PPG signal;
performing Fourier transform on the initial pure PPG signal to obtain a second main frequency and a second amplitude;
and adjusting the PPG signal in the static state according to the first main frequency and the first amplitude and the second main frequency and the second amplitude to obtain the pure PPG signal.
Preferably, the adjusting the PPG signal in the resting state according to the first dominant frequency and the first amplitude, and the second dominant frequency and the second amplitude to obtain the pure PPG signal specifically includes:
adjusting the time length of the acquired PPG signal in the static state and the amplitude of the signal sequence according to a preset adjustment relation; the preset adjustment relation is as follows:
adjusted signal sequence (y) (n) (a2/a 1);
time t2 f1/f 2;
wherein y (n) is a signal sequence of the PPG signal in the resting state, a1 is the first amplitude, a2 is the second amplitude, t2 is the time length for acquiring the PPG signal in the resting state, f1 is the first main frequency, and f2 is the second main frequency.
Preferably, the filtering process is specifically a least mean square adaptive filter LMS filtering process.
In order to solve the above technical problem, the present invention further provides an intelligent wearable pure dynamic heart rate signal calculation device, including:
the data acquisition module is used for acquiring a PPG signal and an acceleration signal of the intelligent wearable device in real time and distinguishing the current user state; the user state comprises a static state and a motion state;
the extraction module is used for extracting the PPG signal in the static state within a preset time range before entering the motion state when the user state is the motion state;
and the pure PPG signal calculation module is used for constructing and obtaining the pure PPG signal according to the PPG signal in the static state, the PPG signal in the motion state and the acceleration signal.
In order to solve the above technical problem, the present invention further provides an intelligent wearable device, including:
the photoplethysmograph is used for acquiring a PPG signal of the intelligent wearable device in real time;
the acceleration acquisition equipment is used for acquiring an acceleration signal of the intelligent wearable equipment in real time;
a memory for storing a computer program;
a processor for implementing the steps of the method of calculating a clean dynamic heart rate signal in smart wear according to any of the above when executing the computer program.
Preferably, the intelligent wearable device is a smart wristband.
Preferably, the acceleration acquisition device is an accelerometer.
In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for calculating a pure dynamic heart rate signal in smart wearing according to any one of the above.
The invention provides a method for calculating a pure dynamic heart rate signal in intelligent wearing, which is characterized in that a pure PPG signal without noise in a motion state is constructed and obtained through a PPG signal and an acceleration signal of intelligent wearing equipment in the obtained motion state and a static state, a user can conveniently obtain a noise signal in the PPG signal in the motion state according to the pure PPG signal, the user can realize calculation and analysis under various application requirements according to the pure PPG signal and the noise signal, and the data analysis capability of intelligent wearing is improved. The invention also provides a device based on the method, intelligent wearing equipment and a computer readable storage medium, which also have the advantages and are not described herein again.
Detailed Description
The core of the invention is to provide a method for calculating a pure dynamic heart rate signal in intelligent wearing, which can calculate a pure PPG signal without noise in a motion state according to a PPG signal and an acceleration signal which can be obtained at present, and is convenient for a user to calculate and analyze in various scenes according to the pure PPG signal; the other core of the invention is to provide a device, an intelligent wearing device and a computer readable storage medium based on the method.
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.
The invention provides a method for calculating a pure dynamic heart rate signal in intelligent wearing, which is shown in fig. 1, wherein fig. 1 is a flow chart of a process of the method for calculating the pure dynamic heart rate signal in intelligent wearing provided by the invention; the method comprises the following steps:
step s 1: acquiring a photoplethysmograph (PPG) signal and an acceleration signal of intelligent wearable equipment in real time, and distinguishing the current user state; the user state comprises a static state and a motion state;
when the user wears intelligent wearing equipment, there may be two kinds of states, quiescent condition and motion state, and acceleration signal can reflect the relative motion condition between user and intelligent wearing equipment, so can acquire acceleration signal only under the motion state, because acceleration signal can carry the motion interference in making the PPG signal, has the noise promptly, so only under the motion state, just can contain noise signal in the PPG signal. When the intelligent wearable device is in a motion state, the PPG signal directly acquired by the intelligent wearable device contains motion artifact interference, so that the acquired PPG signal is pure PPG signal + noise.
Step s 2: when the user state is a motion state, extracting a PPG signal in a static state within a preset time range before entering the motion state;
in order to extract the PPG signals in the stationary state within the preset time range before entering the motion state, the user state, the PPG signals, and the acceleration signals acquired in real time need to be buffered, stored in a buffer, and then when pure PPG signals are constructed, data in a corresponding time period is extracted from the buffer.
It can be understood that the purpose of the present invention to jointly construct a pure PPG signal using the PPG signal in the resting state and the PPG signal in the moving state is because: in a static state, as there is no motion, that is, there is no relative motion between the wrist strap and the arm, the collected PPG signal can be considered as being caused by pure heart pulsation, that is, there is no noise signal, and the signal is pure enough; however, in the static state, the heartbeat frequency and amplitude are different from those in the motion state, so that the PPG signal in the static state cannot be directly used as the pure PPG signal in the motion state, and the pure PPG signal in the motion state is obtained by adjusting the PPG signal in the static state according to the PPG signal in the motion state.
Step s 3: and constructing to obtain a pure PPG signal according to the PPG signal in the static state, the PPG signal in the motion state and the acceleration signal.
After the pure PPG signal is obtained, the PPG signal acquired in the motion state is the pure PPG signal + noise, so the pure PPG signal-the PPG signal in the motion state is the noise signal.
And calculating the signal-to-noise ratio of the dynamic heart rate according to the noise signal and the PPG signal in the motion state.
It is understood that the signal-to-noise ratio relationship is:
SNR is the signal-to-noise ratio. The signal refers to a PPG signal acquired by the intelligent wearable device in a motion state.
According to the signal-to-noise ratio relation, the signal power and the noise power need to be known at the same time when the signal-to-noise ratio is required to be obtained. Since power is energy-dependent, a simplified formula for the energy of a discrete signal (energy is directly related to the square of the amplitude value) is: discrete signal energy
Then, the relation is integrated according to the total signal, noise and pure signal, and the power, energy and time, so as to obtain the invented productTo improved signal-to-noise ratio relation:
the invention calculates the signal-to-noise ratio according to the relation. Where x (n) is a discrete sequence of PPG signals in motion, y (n) refers to a discrete sequence of useful signals (i.e. pure PPG signals in motion); n1 is the total number of points of the discrete signal; n 1/sampling frequency is the total sampling time of the discrete signal; n2 represents the total number of useful signal points as the total sampling time of the useful signal.
In addition, the method for distinguishing the current motion state of the invention is realized by using an acceleration signal, and according to the characteristics of the acceleration signal, key parameters of acceleration data, such as variance, entropy, kurtosis value and the like, are calculated, so that the motion state of the user at the moment is distinguished, for example: rest, running, walking, etc. The present invention refers to motion in general, except for stationary. The classification method is called a decision tree, and the classification method can be realized by various classification algorithms, which is not limited by the invention.
In a preferred embodiment, the preset time range is the last preset time period before entering the motion state.
Since the user always experiences the process of 'still-motion' when wearing the wrist band, the reason for selecting the PPG data in the last preset time period before entering the motion state in the invention is that the still PPG data in the time period is closest to the motion PPG data in the following motion state, and the still PPG data in the time period is selected, so that the constructed pure PPG signal in the motion state is closer to the actual situation, and the accuracy is higher.
In addition, it should be noted that, each time the user is in a new static state, the PPG data in the static state is updated, and therefore, each extracted PPG signal in the static state needs to be data in a last preset time period before the current motion state.
The preset time period may be 6s, and of course, other time length values may also be set, and the present invention does not limit the specific value of the preset time period.
It is further understood that, referring to fig. 2, fig. 2 is a flowchart illustrating a process of another method for calculating a pure dynamic heart rate signal in an intelligent wearable according to the present invention; the process of step s3 specifically includes:
step s 31: performing Fourier transform on the PPG signal in a static state to obtain a first main frequency and a first amplitude;
in the invention, the PPG signal used in calculating the signal-to-noise ratio is a discrete signal, so the Fourier transform is a discrete Fourier transform. The fourier transform is a method of analyzing a signal, which can analyze components of the signal, and thus, by performing the fourier transform, a main frequency and an amplitude of the PPG signal can be analyzed.
Step s 32: judging whether the difference value of the main frequencies of the PPG signal and the acceleration signal in the motion state is smaller than a preset threshold value or not, if so, filtering the PPG signal in the motion state to obtain an initial pure PPG signal, and if not, taking the PPG signal in the motion state as the initial pure PPG signal;
it will be appreciated that the dominant frequency is the frequency of motion that is most dominant in response to motion, and that the amplitude of the signal is greatest at the point of the dominant frequency. The main frequency of the PPG signal is influenced by two aspects of heart beat and motion of the intelligent wearable device, under the condition of small motion interference, the main frequency of the PPG signal is mainly related to the main frequency of the heart beat, and under the condition of large motion interference, the PPG signal is mainly influenced by the motion, for example, the original frequency of the heart beat at a certain point is very small, but because the point is just the main frequency of the motion, the amplitude corresponding to the point frequency is also reflected to be large on the PPG signal. The acceleration signal is only related to the motion condition of the intelligent wearable device, and the main frequency of the acceleration signal is caused by the motion. Therefore, the dominant frequency of the PPG signal is the heart pulse on the bottom, or the PPG signal is caused by the motion, whether the dominant frequency is coincided with the accelerometer or not is mainly seen, when the coincidence is carried out, the dominant frequency of the PPG signal is shown to be caused by the common interference of the pulse and the motion, the dominant frequency is influenced by noise and is not accurate, therefore, the PPG signal in the motion state needs to be filtered, the initial pure PPG signal is obtained, and the accurate dominant frequency is obtained. When the PPG signals do not coincide with each other, the main frequency of the PPG signals is only caused by heart pulses and is accurate enough, so that the PPG signals in the motion state do not need to be filtered.
Step s 33: performing Fourier transform on the initial pure PPG signal to obtain a second main frequency and a second amplitude;
step s 34: and adjusting the PPG signal in the static state according to the first main frequency and the first amplitude and the second main frequency and the second amplitude to obtain a pure PPG signal.
It can be understood that the purpose of adjusting the PPG signal in the stationary state by using the parameter of the initial pure PPG signal in the moving state, rather than directly using the initial pure PPG signal as the pure PPG signal in the moving state, is that it cannot be ensured that the filtered signal reaches a sufficient purity level by the filtering operation in step s222, and therefore, in order to improve the accuracy of the pure PPG signal, the present invention is implemented by using a mode of adjusting the main frequency and the amplitude.
The filtering process is specifically an LMS (Least Mean Square adaptive filter) filtering process. Of course, other signal filters may be used for filtering, and the filtering method is not particularly limited in the present invention.
Of course, the above is only a preferred embodiment, and in other embodiments, if the filtering effect can be ensured to be good enough, the initial pure PPG signal may also be directly used as the pure PPG signal desired by the present invention.
Specifically, the process of step s34 specifically includes:
adjusting the time length of the acquired PPG signal in a static state and the amplitude of the signal sequence according to a preset adjustment relation; the preset adjustment relation is as follows:
adjusted signal sequence (y) (n) (a2/a 1);
time t2 f1/f 2;
wherein y (n) is a signal sequence of the PPG signal in the resting state, a1 is a first amplitude, a2 is a second amplitude, t2 is a time length for acquiring the PPG signal in the resting state, f1 is a first main frequency, and f2 is a second main frequency.
It can be understood that since the original amplitude of the PPG signal in the resting state is a1, and the adjusted amplitude is a2, the multiple of the amplitude transformation is a2/a1, so the original signal sequence of the PPG signal in the resting state is multiplied by a2/a1, which is the amplitude-adjusted PPG signal.
For the time length of obtaining the PPG signal in the resting state, the frequency of the PPG signal in the resting state is actually adjusted, that is, the original frequency of the PPG signal in the resting state is adjusted from f1 tof 2. Since the improved snr relation uses the concept of accumulation and has a value of dividing by time, the frequency adjustment is equivalent to adjusting the denominator time, that is, if the frequency is increased, the time for the same waveform will be shortened (the period is small), and the shortened ratio is f2/f 1. That is, the time length for originally acquiring the PPG signal in the resting state is t2, and the frequency is adjusted to t2 × f1/f 2.
And substituting the adjusted pure PPG signal into an improved signal-to-noise ratio relation to obtain the following result:
where t1 is the time length for acquiring the PPG signal in the motion state, and t2 is the time length for acquiring the PPG signal in the resting state.
The invention provides a method for calculating a pure dynamic heart rate signal in intelligent wearing, which is characterized in that a pure PPG signal without noise in a motion state is constructed and obtained through a PPG signal and an acceleration signal of intelligent wearing equipment in the obtained motion state and a static state, a user can conveniently obtain a noise signal in the PPG signal in the motion state according to the pure PPG signal, the user can realize calculation and analysis under various application requirements according to the pure PPG signal and the noise signal, and the data analysis capability of intelligent wearing is improved.
The invention provides a pure dynamic heart rate signal calculating device in intelligent wearing, and as shown in fig. 3, fig. 3 is a schematic structural diagram of the pure dynamic heart rate signal calculating device in intelligent wearing provided by the invention. The device includes:
the data acquisition module 1 is used for acquiring a PPG signal and an acceleration signal of the intelligent wearable device in real time and distinguishing a current user state; the user state comprises a static state and a motion state;
theextraction module 2 is configured to extract a PPG signal in a stationary state within a preset time range before entering a motion state when the user state is the motion state;
and the pure PPGsignal calculation module 3 is used for constructing and obtaining the pure PPG signal according to the PPG signal in the static state, the PPG signal in the motion state and the acceleration signal.
The invention provides a pure dynamic heart rate signal calculation device in intelligent wearing, which constructs and obtains a pure PPG signal without noise in a motion state through the PPG signal and an acceleration signal of intelligent wearing equipment in the obtained motion state and a static state.
The invention also provides an intelligent wearable device, comprising:
the photoplethysmograph is used for acquiring a PPG signal of the intelligent wearable device in real time;
the acceleration acquisition equipment is used for acquiring an acceleration signal of the intelligent wearable equipment in real time;
a memory for storing a computer program;
a processor for implementing the steps of the method of calculating a clean dynamic heart rate signal in smart wear as claimed in any one of the above when executing a computer program.
Wherein, intelligence wearing equipment is specifically intelligent wrist strap. Or it may be an intelligent wristwatch or an intelligent neck ring, etc., and the invention is not limited to the specific type of the intelligent wearable device.
Wherein the acceleration acquisition device is an accelerometer. Of course, other devices capable of acquiring acceleration data may be used, and the present invention is not limited thereto.
The invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the method of calculating a clean dynamic heart rate signal in smart wear as claimed in any one of the above.
The above embodiments are only preferred embodiments of the present invention, and the above embodiments can be combined arbitrarily, and the combined embodiments are also within the scope of the present invention. It should be noted that other modifications and variations that may suggest themselves to persons skilled in the art without departing from the spirit and scope of the invention are intended to be included within the scope of the invention as defined by the appended claims.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.