A method, device and readable storage medium for detecting exercise heart rate
By combining filtering processing and spectrum analysis of PPG and ACC signals, and combining frequency tracking algorithms, the accuracy problem of traditional heart rate monitoring in dynamic scenarios is solved, and efficient heart rate monitoring in various sports scenarios is achieved.
Patent Information
- Application Number
- CN202510712501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-30
AI Technical Summary
Traditional heart rate monitoring methods have poor accuracy in dynamic scenarios, severe interference from motion artifacts, and cannot adaptively adjust the heart rate calculation method, making it difficult to meet the needs of diverse sports scenarios.
Combining the PPG signal and ACC signal, the motion state is judged through filtering processing, combined acceleration average value and energy concentration degree, spectrum analysis and spectrum reduction processing are used, and heart rate information is determined by combining frequency tracking algorithm.
Accurate heart rate in various sports scenarios, effectively suppressing movement artifact interference, and improving the accuracy and reliability of heart rate monitoring.
Smart Images

Figure CN120227008B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method, device and readable storage medium for detecting exercise heart rate. Background Art
[0002] Heart rate, as a key physiological indicator, is of great significance in health monitoring and medical diagnosis. Traditional heart rate monitoring methods perform poorly in dynamic scenarios, and motion artifacts can seriously affect the accuracy of heart rate measurements.
[0003] Current solutions for monitoring heart rate during exercise have numerous shortcomings. While accelerometer-based methods can provide a certain degree of insight into exercise status, they struggle to accurately extract heart rate information. Simple photoplethysmography (PPG) technology is susceptible to interference from factors like body movement during exercise, leading to signal degradation and large errors in heart rate calculation. Furthermore, most existing technologies are unable to adaptively select the appropriate heart rate calculation method for complex exercise conditions, making them difficult to meet the needs of diverse exercise scenarios.
[0004] With the increasing popularity of wearable devices, users are increasingly demanding the accuracy and reliability of heart rate monitoring during exercise. Therefore, a technology that can effectively suppress motion artifacts and adaptively adjust heart rate calculation strategies based on exercise status is urgently needed to improve the performance of exercise heart rate monitoring and provide users with more accurate health data. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for detecting heart rate during exercise, aiming to solve the problem of poor performance of existing heart rate detection during exercise. The method for detecting heart rate during exercise provided by the present application includes:
[0006] Obtaining initial PPG signals and initial ACC signals;
[0007] Filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal;
[0008] Calculating a combined acceleration average within a preset time window based on the second ACC signal;
[0009] calculating the energy concentration within the preset time window based on the second PPG signal;
[0010] determining whether the vehicle is in a motion state based on the combined acceleration average value and the energy concentration level;
[0011] If the user is not in the exercise state, determining the heart rate information based on the time domain information;
[0012] If in the motion state, obtain the ACC spectrum and PPG spectrum;
[0013] Determining whether there is a frequency coincidence based on the relationship between the ACC spectrum and the heart rate at the previous moment;
[0014] If the same frequency situation exists, performing spectrum subtraction processing on the PPG spectrum;
[0015] The heart rate information is determined from the PPG spectrum after spectral subtraction and the PPG spectrum without spectral subtraction based on a frequency tracking algorithm.
[0016] Based on the exercise heart rate detection method provided by the first aspect of the embodiment of the present application, optionally, filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal includes:
[0017] The initial PPG signal and the initial ACC signal are processed using a Butterworth bandpass filter to obtain a second ACC signal and an intermediate PPG signal, where the cutoff frequencies of the bandpass filter are 0.5 Hz and 4 Hz, and the order is 6;
[0018] An adaptive filter is used, with the second ACC signal as an input signal and the intermediate PPG signal as a desired signal, to remove motion artifacts and obtain the second PPG signal.
[0019] Based on the exercise heart rate detection method provided by the first aspect of the embodiment of the present application, optionally, calculating the average value of the combined acceleration within a preset time window based on the second ACC signal; and calculating the energy concentration within the preset time window based on the second PPG signal include:
[0020] The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula:
[0021]
[0022] in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction;
[0023] The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ;
[0024] The average value of the combined acceleration is calculated according to the following formula:
[0025]
[0026] in is the average value of the total acceleration is the maximum value of the first combined acceleration per second within the preset time window;
[0027] Calculate the frequency spectrum of the second PPG signal of a specific window duration using a linear frequency modulation Z transform method to obtain the PPG spectrum, and perform maximum normalization on the PPG spectrum to obtain a PPG spectrum with a length of 210;
[0028] The energy concentration is calculated according to the following formula:
[0029]
[0030] in is the frequency corresponding to the maximum amplitude value of the spectrum.
[0031] Based on the exercise heart rate detection method provided by the first aspect of the embodiment of the present application, optionally, determining whether the user is in an exercise state based on the combined acceleration average value and the energy concentration degree includes:
[0032] Determining whether a continuous period during which the average value of the combined acceleration is less than a first preset value and the energy concentration is less than a second preset value exceeds a preset period;
[0033] If exceeded, it is deemed not in motion;
[0034] If it does not exceed, it is considered to be in the preset state.
[0035] Based on the exercise heart rate detection method provided in the first aspect of the embodiment of the present application, optionally, determining whether there is a co-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment; and performing spectral subtraction processing on the PPG spectrum if the co-frequency situation exists, includes:
[0036] Determine multiple ACC spectrum peaks and perform multi-frequency expansion;
[0037] Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment. If so, it is considered that there is a same frequency condition and the flag is recorded as 1; otherwise, the flag is recorded as 0;
[0038] Frequency synchronization is performed based on the following formula:
[0039] ,
[0040] when hour, , when it is a negative number, it is set to 0;
[0041] when hour, , when it is a negative number, it is set to 0;
[0042] when and hour, ;
[0043] when and hour,
[0044] .
[0045] Based on the exercise heart rate detection method provided in the first aspect of the embodiment of the present application, optionally, determining heart rate information in the PPG spectrum after spectral subtraction and the PPG spectrum before spectral subtraction based on a frequency tracking algorithm includes:
[0046] Determine a plurality of spectrum peaks in the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process;
[0047] Calculate the evaluation value of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value;
[0048] The evaluation value calculation formula is as follows:
[0049]
[0050] is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, is the heart rate at the previous moment.
[0051] Based on the exercise heart rate detection method provided in the first aspect of the embodiment of the present application, optionally, the method further includes:
[0052] Establishing a logistic regression model, wherein the features used in the training of the logistic regression model include: the average value of the combined acceleration, the degree of energy concentration, the standard deviation, kurtosis, and skewness of the PPG spectrum before spectral subtraction, the standard deviation, kurtosis, and skewness of the PPG spectrum after spectral subtraction, the heart rate at the previous moment, the evaluation value, and the amplitude and position of the peak corresponding to the maximum evaluation value; the logistic regression model is used to output an evaluation value for the current heart rate;
[0053] Calculating an evaluation value of the heart rate value;
[0054] If the evaluation value is lower than the preset value, the heart rate value obtained based on the heart rate tracking algorithm and the heart rate value calculated by the neural network model are fused based on the Kalman filtering method to obtain the current heart rate value.
[0055] A second aspect of the present application provides an exercise heart rate detection device, including:
[0056] an acquisition unit, configured to acquire an initial PPG signal and an initial ACC signal;
[0057] a filtering unit, configured to filter the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal;
[0058] a combined acceleration average value calculation unit, configured to calculate a combined acceleration average value within a preset time window based on the second ACC signal;
[0059] an energy concentration degree calculation unit, configured to calculate the energy concentration degree within the preset time window based on the second PPG signal;
[0060] a judgment unit, configured to determine whether the vehicle is in a motion state based on the combined acceleration average value and the energy concentration level;
[0061] a time-domain heart rate determination unit, configured to determine heart rate information based on time-domain information if the user is not in the exercise state;
[0062] a spectrum acquisition unit, configured to acquire an ACC spectrum and a PPG spectrum if the user is in the motion state;
[0063] A same-frequency determination unit, configured to determine whether there is a same-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment;
[0064] a spectrum subtraction processing unit, configured to perform spectrum subtraction processing on the PPG spectrum if the same frequency situation exists;
[0065] The frequency domain heart rate determination unit is used to determine the heart rate information in the PPG spectrum after spectrum subtraction and the PPG spectrum without spectrum subtraction based on the frequency tracking algorithm.
[0066] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally, the filtering unit is specifically configured to:
[0067] The initial PPG signal and the initial ACC signal are processed using a Butterworth bandpass filter to obtain a second ACC signal and an intermediate PPG signal, where the cutoff frequencies of the bandpass filter are 0.5 Hz and 4 Hz, and the order is 6;
[0068] An adaptive filter is used, with the second ACC signal as an input signal and the intermediate PPG signal as a desired signal, to remove motion artifacts and obtain the second PPG signal.
[0069] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally,
[0070] The combined acceleration average value calculation unit is specifically used for:
[0071] The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula:
[0072]
[0073] in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction;
[0074] The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ;
[0075] The average value of the combined acceleration is calculated according to the following formula:
[0076]
[0077] in is the average value of the total acceleration is the maximum value of the first combined acceleration per second within the preset time window;
[0078] The energy concentration degree calculation unit is specifically used for:
[0079] Calculate the frequency spectrum of the second PPG signal of a specific window duration using a linear frequency modulation Z transform method to obtain the PPG spectrum, and perform maximum normalization on the PPG spectrum to obtain a PPG spectrum with a length of 210;
[0080] The energy concentration is calculated according to the following formula:
[0081]
[0082] in is the frequency corresponding to the maximum amplitude value of the spectrum.
[0083] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally, the judgment unit is specifically configured to:
[0084] Determining whether a continuous period during which the average value of the combined acceleration is less than a first preset value and the energy concentration is less than a second preset value exceeds a preset period;
[0085] If exceeded, it is deemed not in motion;
[0086] If it does not exceed, it is considered to be in the preset state.
[0087] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally, the same-frequency determination unit is specifically configured to:
[0088] Determine multiple ACC spectrum peaks and perform multi-frequency expansion;
[0089] Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment. If so, it is considered that there is a same frequency condition and the flag is recorded as 1; otherwise, the flag is recorded as 0;
[0090] The spectrum subtraction processing unit is specifically used for:
[0091] Frequency synchronization is performed based on the following formula:
[0092] ,
[0093] when hour, , when it is a negative number, it is set to 0;
[0094] when hour, , when it is a negative number, it is set to 0;
[0095] when and hour, ;
[0096] when and hour,
[0097] .
[0098] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally, the frequency domain heart rate determination unit is used to:
[0099] Determine a plurality of spectrum peaks in the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process;
[0100] Calculate the evaluation value of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value;
[0101] The evaluation value calculation formula is as follows:
[0102]
[0103] is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, is the heart rate at the previous moment.
[0104] Based on the exercise heart rate detection device provided in the second aspect of the embodiment of the present application, optionally, the device further includes:
[0105] A verification unit, the verification unit being configured to:
[0106] Establishing a logistic regression model, wherein the features used in the training of the logistic regression model include: the average value of the combined acceleration, the degree of energy concentration, the standard deviation, kurtosis, and skewness of the PPG spectrum before spectral subtraction, the standard deviation, kurtosis, and skewness of the PPG spectrum after spectral subtraction, the heart rate at the previous moment, the evaluation value, and the amplitude and position of the peak corresponding to the maximum evaluation value; the logistic regression model is used to output an evaluation value for the current heart rate;
[0107] Calculating an evaluation value of the heart rate value;
[0108] If the evaluation value is lower than the preset value, the heart rate value obtained based on the heart rate tracking algorithm and the heart rate value calculated by the neural network model are fused based on the Kalman filtering method to obtain the current heart rate value.
[0109] A third aspect of the present application further provides an exercise heart rate detection device, comprising:
[0110] CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply;
[0111] The memory is a transient memory or a persistent memory;
[0112] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory on the device to perform the method described in any one of the first aspects of the embodiments of the present application.
[0113] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the method described in any one of the first aspects of the embodiments of the present application.
[0114] A fifth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any one of the methods described in the first aspect of the embodiments of the present application.
[0115] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: The present application provides a method for detecting heart rate during exercise, comprising: obtaining an initial PPG signal and an initial ACC signal; filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal; calculating the combined acceleration average value within a preset time window based on the second ACC signal; calculating the energy concentration within the preset time window based on the second PPG signal; determining whether the user is in an exercise state based on the combined acceleration average value and the energy concentration degree; if the user is not in the exercise state, determining the heart rate information based on time domain information; if the user is in the exercise state, obtaining the ACC spectrum and the PPG spectrum; determining whether there is a co-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment; if the co-frequency situation exists, performing spectral subtraction on the PPG spectrum; and determining the heart rate information from the PPG spectrum after spectral subtraction and the PPG spectrum before spectral subtraction based on a frequency tracking algorithm. This solution combines the combined acceleration average value and the energy concentration degree to determine the exercise state, which is more comprehensive and accurate than single-indicator judgment and can adapt to various exercise scenarios. When not exercising, heart rate is determined based on time-domain information. This method is simple, direct, computationally inefficient, and can quickly yield heart rate results. When exercising, the ACC spectrum is first determined to be frequency-coherent with the previous heart rate, followed by targeted spectral subtraction of the PPG spectrum. A frequency tracking algorithm is then used to determine heart rate information. This effectively eliminates motion artifacts and accurately determines heart rate during exercise. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] To more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. A person of ordinary skill in the art can also derive other drawings based on the provided drawings without inventive effort. It should be understood that the drawings provided in this section are only used to better understand the present solution and do not constitute a limitation of the present application.
[0117] Figure 1 A flowchart of an embodiment of the exercise heart rate detection method provided by this application;
[0118] Figure 2 A schematic diagram of a flow chart of the pre-processing part provided in an embodiment of the present application;
[0119] Figure 3 A schematic diagram of a frequency spectrum during indoor cycling provided in an embodiment of the present application;
[0120] Figure 4 A flowchart of the same-frequency processing process provided by this application;
[0121] Figure 5 A schematic diagram of a spectrum collected during the walking process provided by this application;
[0122] Figure 6 A flowchart of the heart rate determination process provided in this application;
[0123] Figure 7 This is a structural diagram of an embodiment of the exercise heart rate detection device provided by this application;
[0124] Figure 8 This is another structural schematic diagram of an embodiment of the exercise heart rate detection device provided in this application. DETAILED DESCRIPTION
[0125] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application are clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application. At the same time, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0126] The terms "first," "second," "third," "fourth," and so forth (if any) in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that shown or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, product, or apparatus comprising a series of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus.
[0127] Heart rate, as a key physiological indicator, is of great significance in health monitoring and medical diagnosis. Traditional heart rate monitoring methods perform poorly in dynamic scenarios, and motion artifacts can seriously affect the accuracy of heart rate measurements.
[0128] Current solutions for monitoring heart rate during exercise have numerous shortcomings. While accelerometer-based methods can provide a certain degree of insight into exercise status, they struggle to accurately extract heart rate information. Simple photoplethysmography (PPG) technology is susceptible to interference from factors like body movement during exercise, leading to signal degradation and large errors in heart rate calculation. Furthermore, most existing technologies are unable to adaptively select the appropriate heart rate calculation method for complex exercise conditions, making them difficult to meet the needs of diverse exercise scenarios.
[0129] With the increasing popularity of wearable devices, users are increasingly demanding the accuracy and reliability of heart rate monitoring during exercise. Therefore, a technology that can effectively suppress motion artifacts and adaptively adjust heart rate calculation strategies based on exercise status is urgently needed to improve the performance of exercise heart rate monitoring and provide users with more accurate health data.
[0130] To solve the above problems, this application provides a method for detecting heart rate during exercise. Figure 1 , an embodiment of the present application includes: steps 101 to 109.
[0131] 101. Obtain an initial PPG signal and an initial ACC signal.
[0132] Specifically, this solution can be applied to wrist-worn watches and bracelets. The PPG signal, or photoplethysmographic signal, is collected by a photoelectric sensor (such as a green LED + photodiode) to reflect changes in blood vessel volume and heart rate. The ACC signal, or triaxial acceleration signal, is collected by a MEMS acceleration sensor to reflect the wearer's motion state (such as stillness, walking, running, etc.).
[0133] 102. Perform filtering processing on the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal.
[0134] The initial PPG signal and the initial ACC signal are filtered to obtain a second PPG signal and a second ACC signal. Specifically, preprocessing the initial PPG signal and the initial ACC signal may include filtering the initial PPG signal and the initial ACC signal. A 6th-order Butterworth bandpass filter with a cutoff frequency of 0.5 Hz-4 Hz may be used. In actual implementation, the filter form and parameters may be adjusted according to actual conditions and are not limited here. Furthermore, adaptive filtering may be performed to remove motion artifacts, which is not limited here.
[0135] 103. Calculate a combined acceleration average value within a preset time window based on the second ACC signal.
[0136] Specifically, the ACC signal is a 3-axis acceleration sensor signal. By averaging the combined acceleration values of the three axes over a period of time, we can obtain the average level of acceleration of the wearer during that period. This average value can more comprehensively reflect the wearer's exercise intensity, providing a reference for subsequent determination of exercise status and heart rate calculation. For example, a high average combined acceleration value indicates that the wearer may be in a more intense exercise state, which has a significant impact on heart rate and needs to be taken into account during the heart rate calculation process.
[0137] 104. Calculate the energy concentration within the preset time window based on the second PPG signal.
[0138] Specifically, the second PPG signal is analyzed within a preset time window to calculate its energy concentration. Energy concentration can be determined by calculating the signal's energy distribution across different frequency bands. For example, spectral analysis methods (such as Fourier transform) can be used to convert the PPG signal into the frequency domain, and then the proportion of energy in each frequency band to the total energy can be calculated. A high energy concentration indicates that the PPG signal's energy is primarily concentrated in certain frequencies, which may represent the heart rate. A low energy concentration indicates that the signal's energy distribution is more dispersed, potentially indicating the presence of significant interference factors or poor signal quality.
[0139] 105. Determine whether the device is in motion.
[0140] Specifically, the wearer's state of motion is determined based on the combined acceleration average value calculated in steps 103 and 104, as well as the energy concentration. If the combined acceleration average value exceeds a preset threshold and the energy concentration also meets certain conditions, the wearer is determined to be in motion. Step 107 is executed. Otherwise, the wearer is determined to be not in motion and step 106 is executed. The specific judgment rules can be adjusted based on actual conditions and are not limited here.
[0141] 106. Determine heart rate information based on the time domain information.
[0142] If the user is not in the exercise state, the heart rate information is determined based on the time domain information. The time domain heart rate calculation method is to identify the number of peaks and troughs in an 8-second window and then convert it into the corresponding heart rate. The specific implementation method is as follows:
[0143] (1) When ppg(t) is greater than 3000, and ppg(t) is greater than or equal to ppg(t-1), and ppg(t) is greater than or equal to ppg(t+1), then time t is a peak;
[0144] (2) When ppg(t) is less than -2000, and ppg(t) is less than or equal to ppg(t-1), and ppg(t) is less than or equal to ppg(t+1), then time t is a trough;
[0145] (3) Record the number of peaks peaknum and the number of valleys valleynum, by Convert to the corresponding heart rate, where num is the number of peaks or troughs;
[0146] The peak heart rate and trough heart rate are obtained through step (3), and then compared with the heart rate at the previous moment, and the result that is closer to the heart rate at the previous moment is selected as the current heart rate information. In actual implementation, the specific numerical selection and calculation rules can be adjusted according to actual conditions and are not limited here.
[0147] 107. Determine whether there is a same frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment.
[0148] Specifically, if the user is in motion, the ACC and PPG spectra are acquired. A linear chirp Z transform (CZT) method is used to perform spectral analysis on the ACC and PPG signals within a specific window (e.g., 8 seconds). The resulting ACC spectrum is then analyzed based on the relationship between the ACC spectrum and the previous heart rate. The ACC spectrum reflects the energy distribution of motion acceleration at different frequencies. If certain frequency components in the ACC spectrum are close to those corresponding to the previous heart rate, this indicates a possible case of frequency co-occurrence.
[0149] Specifically, the judgment rule is to compare the frequency with higher energy in the ACC spectrum with the frequency corresponding to the previous heart rate. If the difference between the two is within a certain range, it is considered to be the same frequency. In actual implementation, the same frequency judgment rule can be determined based on actual conditions and is not limited here.
[0150] 108. Perform spectrum subtraction processing on the PPG spectrum.
[0151] Specifically, if co-frequency interference exists, spectral subtraction is performed on the PPG spectrum. The motion-generated signal interferes with the PPG signal, causing noise components co-frequency with the ACC spectrum to be mixed into the PPG spectrum. Spectral subtraction removes these interfering components from the PPG spectrum.
[0152] By comparing the PPG spectrum with the ACC spectrum, we identify the frequency points in the PPG spectrum that are subject to co-channel interference. We then adjust the PPG spectrum amplitude at these frequency points according to specific rules. For example, we set the amplitude of frequency points with severe interference to zero, while retaining the amplitude of other frequency points with no or minimal interference. This processed PPG spectrum reduces the impact of motion noise and more accurately reflects true heart rate information. The spectral subtraction rules can be determined based on actual circumstances and are not specified here.
[0153] 109. Determine heart rate information from the PPG spectrum after spectrum subtraction and the PPG spectrum before spectrum subtraction based on a frequency tracking algorithm.
[0154] Specifically, if spectral subtraction is performed, heart rate information is determined from both the subtracted and unsubtracted PPG spectra. Spectral subtraction aims to reduce the interference of motion noise on the PPG spectrum, but this may result in the loss of some useful information (e.g., during walking or running). Therefore, referring to both spectra simultaneously allows for a more comprehensive determination of heart rate. If spectral subtraction is not performed, heart rate information is determined directly from the PPG spectrum. The determination rules include two aspects:
[0155] (1) Highest Energy Principle: The peaks in the spectrum represent the energy distribution of the signal at different frequencies. The higher the energy peak, the more likely it is to correspond to the real heart rate signal. This is because the PPG signal generated by the heartbeat has a strong energy concentration at a specific frequency.
[0156] (2) The principle of keeping the difference from the previous heart rate value small: The change in the human heart rate is a relatively continuous process and will not undergo a sudden and drastic change in a short period of time. Therefore, the current heart rate should be close to the previous heart rate. By screening out the spectral peaks with a small difference from the previous heart rate value, some false spectral peaks caused by noise or other interference can be eliminated, thereby improving the accuracy of heart rate determination.
[0157] That is, the spectrum peak with higher energy and smaller difference from the heart rate value at the previous moment is determined as the current heart rate information. In actual implementation, the operation rules can be determined according to the actual situation and are not limited here.
[0158] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: The present application provides a method for detecting heart rate during exercise, comprising: obtaining an initial PPG signal and an initial ACC signal; filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal; calculating the combined acceleration average value within a preset time window based on the second ACC signal; calculating the energy concentration within the preset time window based on the second PPG signal; determining whether the user is in an exercise state based on the combined acceleration average value and the energy concentration degree; if the user is not in the exercise state, determining the heart rate information based on time domain information; if the user is in the exercise state, obtaining the ACC spectrum and the PPG spectrum; determining whether there is a co-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment; if the co-frequency situation exists, performing spectral subtraction on the PPG spectrum; and determining the heart rate information from the PPG spectrum after spectral subtraction and the PPG spectrum before spectral subtraction based on a frequency tracking algorithm. This solution combines the combined acceleration average value and the energy concentration degree to determine the exercise state, which is more comprehensive and accurate than single-indicator judgment and can adapt to various exercise scenarios. When not exercising, heart rate is determined based on time-domain information. This method is simple, direct, computationally inefficient, and can quickly yield heart rate results. When exercising, the ACC spectrum is first determined to be frequency-coherent with the previous heart rate, followed by targeted spectral subtraction of the PPG spectrum. A frequency tracking algorithm is then used to determine heart rate information. This effectively eliminates motion artifacts and accurately determines heart rate during exercise.
[0159] The above content provides an overall introduction to this solution. The following is a detailed introduction to each link in this solution. First, for the pre-processing filtering part, please refer to Figure 2 , Figure 2 This is a schematic diagram of the pre-processing filtering process provided by this application, including steps 201 to 202.
[0160] 201. Use a Butterworth bandpass filter to process the initial PPG signal and the initial ACC signal to obtain a second ACC signal and an intermediate PPG signal.
[0161] The collected raw PPG and initial ACC signals typically contain a significant amount of noise. To accurately analyze and utilize these signals later, they must be filtered. This step uses a Butterworth bandpass filter to process the initial PPG and ACC signals, generating an intermediate PPG and secondary ACC signal, respectively.
[0162] Considering that the normal range of human heart rate is approximately between [30,240] bpm (beats per minute), after converting this range to frequency, it roughly corresponds to the frequency range of 0.5Hz-4Hz. Therefore, the cutoff frequency of the bandpass filter is set to 0.5Hz and 4Hz, which can effectively retain the frequency components related to the heart rate while filtering out noise interference from other frequencies. However, it should be noted that in actual applications, due to differences in physiological characteristics of different individuals, performance characteristics of the equipment, and specific usage scenarios, parameters such as the cutoff frequency and filter order can be adjusted according to actual conditions. The parameters given here are only common settings and do not constitute a limitation.
[0163] 202. Use an adaptive filter to remove motion artifacts by taking the second ACC signal as an input signal and the intermediate PPG signal as a desired signal to obtain the second PPG signal.
[0164] During exercise, if a smart wearable device is worn loosely, the photodiode receiving the signal will shake with the body's movement, causing motion artifacts to be mixed into the received PPG signal. Furthermore, the more intense the movement, the greater the interference with the PPG signal, so this interference needs to be filtered out.
[0165] Because the ACC signal collected by the smart wearable device can well reflect the human body's motion state, after completing the bandpass filtering processing in step 201, this step further processes the signal using an adaptive filter. Specifically, the second ACC signal is used as the input signal, and the intermediate PPG signal is used as the desired signal. The adaptive filter algorithm is used to remove motion artifacts from the intermediate PPG signal, ultimately obtaining the second PPG signal.
[0166] The combination of bandpass filtering and adaptive filtering can enhance the heart rate component of the PPG signal, facilitating more accurate subsequent analysis of heart rate information. It should be noted that the specific type and parameter settings of the adaptive filter can be selected and adjusted based on actual needs and signal characteristics, and are not specifically limited here. Different adaptive filters may vary in convergence speed and filtering effectiveness, requiring optimization based on specific circumstances in actual applications, and are not specifically limited here.
[0167] The following is an introduction to the process and operation rules of the static state judgment part of this solution:
[0168] (1) Calculate the average value of the combined acceleration.
[0169] The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula:
[0170]
[0171] in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction; Converted to actual acceleration value, for example, the accm value is 4096, corresponding to the actual acceleration of 9.8m / s 2 , i.e. 1g. The specific conversion method is related to the configuration of the ACC sensor. The specific rules can be determined according to the actual situation and are not limited here.
[0172] The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ;
[0173] The average value of the combined acceleration is calculated according to the following formula:
[0174]
[0175] in is the average value of the total acceleration It is the maximum value of the first combined acceleration in each second within the preset time window; the weighting method is that the closer the distance is to the current, the greater the weight, and the farther the distance is, the smaller the weight. This can reduce the impact of outliers and also reduce delays, and reflect the current status in a timely manner.
[0176] (2) Calculate the degree of energy concentration.
[0177] The spectrum of the second PPG signal over a specific window duration is calculated using the linear frequency modulation Z transform method to obtain the PPG spectrum. This PPG spectrum is then normalized to its maximum value, resulting in a PPG spectrum length of 210, corresponding to a heart rate of 31-240 bpm. To calculate energy concentration, first find the position of the PPG spectrum maximum, index 1 (numbering starts at 1; the actual heart rate starts at 31, so index 1 is incremented by 30). Then, obtain the harmonic positions at [31, 240], index 2, index 3, and so on.
[0178] The energy concentration is calculated according to the following formula:
[0179]
[0180] in The upper part of the formula is the sum of the energy of the highest peak and its harmonics, and the lower part is the sum of the energy of the entire spectrum. The ratio of these two values can reflect the degree of energy concentration.
[0181] (3) Determine whether it is in a stationary state.
[0182] The reason for judging whether it is still is based on the energy concentration of the spectrum: Figure 3 As shown, when cycling indoors, the movement amplitude is also small, but the spectrum is greatly affected by the movement. Calculating the heart rate directly from the time domain will result in a large deviation ( Figure 3 The two figures on the right are spectra of the PPG signal, and the two figures on the left are spectra of the ACC signal. Brighter colors represent larger amplitudes at those frequencies. The black line represents the heart rate measurement results of the Polar H10, a recognized gold-standard device. Therefore, this solution uses both amplitude thresholds and energy concentration thresholds of the PPG signal spectrum to more accurately determine whether a person is still.
[0183] Specifically, the judgment rules include:
[0184] Starting from the 8th second, check every second whether the average total acceleration avg_accm is less than or equal to 1.3g. Record the duration t1. If it is greater than 1.3g, t1 is reset to zero. When t1 is greater than 5, check whether the energy concentration E is greater than or equal to 0.7. Record the duration t2. If E is less than 0.7, t2 is reset to zero. When t2 is greater than 5, the state is determined to be stationary and time-domain heart rate calculation is enabled. To reduce power consumption, avg_accm is calculated every second, and E is calculated every 10 seconds. If either avg_accm or E fails to meet these conditions, the state is changed to active, the relevant parameters are reset, and frequency-domain heart rate calculation is enabled. In actual implementation, these judgment rules can be adjusted according to specific circumstances.
[0185] The following is a detailed description of the frequency synchronization process, please refer to Figure 4 , Figure 4 This is a flowchart of the same-frequency processing process provided in this application, including: step 401 to step 403.
[0186] The human heart rate typically ranges from 31 to 240 beats per minute (bpm). To accurately capture heart rate-related signals, this solution retains only the frequency amplitudes between 31 and 240 when calculating the signal spectrum. Specifically, the signal is windowed with an 8-second window length, with a 1-second interval between each slide, and the PPG signal spectrum is calculated using the CZT (linear frequency-modulated Z-transform) method. This method more accurately analyzes the signal's spectral characteristics within a specific frequency range. Compared to traditional spectrum analysis methods, it is more suitable for scenarios such as exercise heart rate monitoring, which require high frequency accuracy.
[0187] In actual monitoring, although adaptive filtering techniques have been used to filter out motion artifacts in the PPG signal to a certain extent, due to the complex and variable nature of motion, the brightest spots in the PPG signal spectrum may not represent the actual heart rate, but rather interference caused by motion artifacts. Therefore, further "spectral subtraction" processing is essential. Before this, the first ACCM signal needs to be bandpass filtered to obtain the second ACCM signal. This bandpass filtering step removes frequency components in the ACCM signal that are not relevant to heart rate monitoring, while retaining the frequency range that may be related to motion artifacts, making subsequent analysis more targeted.
[0188] Afterwards, the spectra of the second PPG signal and the second accumulator signal are calculated every 8 seconds, denoted as p_spectrum and m_spectrum, respectively, and normalized to their maximum values. This normalization maps the frequency amplitudes to a uniform value between [0, 1]. This eliminates the impact of signal amplitude differences on subsequent processing, making spectrum data from different sources at different times comparable and facilitating unified analysis and processing.
[0189] 401. Determine multiple ACC spectrum peaks and perform multi-frequency expansion.
[0190] Motion artifacts can appear anywhere in the p_spectrum. When motion artifacts coincide with heart rate, this phenomenon is called "co-frequency". It is particularly common in walking movements, such as Figure 5 , Figure 5 The upper half shows the determined motion artifact location, and the lower half shows the heart rate spectrum location determined by the gold-standard device. During walking, because the frequency of movement is very close to the person's true heart rate, conventional spectral subtraction not only removes the motion artifact but also weakens or even completely eliminates the frequency components of the true heart rate, making subsequent frequency tracking unable to find the correct frequency. Therefore, this solution addresses this issue by improving spectral subtraction. Specifically:
[0191] The m_spectrum (ACC spectrum) contains a variety of interference components, among which frequencies with smaller amplitudes have a relatively limited impact on the p_spectrum. Based on this characteristic, this solution filters out "spectral peaks" with amplitudes greater than 0.3 from the m_spectrum. To ensure processing efficiency and effectiveness, only the five largest "spectral peaks" are retained for subsequent spectral subtraction, denoted as [mpeak11, mpeak21, mpeak31, mpeak41, mpeak51]. The "spectral peak" defined here is not just a single peak point, but includes the peak location and the range of locations on either side of the peak where the amplitude exceeds 0.3. This definition more comprehensively covers the frequency range that may interfere with the PPG signal. Considering that the harmonics of motion artifacts may also have a significant impact on p_spectrum, in order to more comprehensively suppress motion artifacts, the extracted spectrum peaks need to be expanded to include 1 / 2 and 3 / 2 octaves, that is, the expanded ACC spectrum includes the frequencies of subharmonics, thus obtaining [mpeak11, mpeak21, mpeak31, mpeak41, mpeak51, mpeak12, mpeak22, mpeak32, mpeak42, mpeak52, mpeak13, mpeak23, mpeak33, mpeak43, mpeak53]. The specific expansion rules are as follows:
[0192] First, find five peaks in m_spectrum and record the starting position, ending position, maximum position, and amplitude of each peak. Next, perform 1 / 2 octave expansion, moving each peak to the position corresponding to its maximum peak divided by 2 (rounded to the nearest integer) and then adding the amplitudes to the original positions. If the sum is greater than 1, it is retained as 1 to avoid signal distortion or anomalies caused by excessive amplitude values. Furthermore, any portion outside the heart rate range [30, 240] is discarded as irrelevant to heart rate monitoring. The 3 / 2 octave expansion method is similar to the 1 / 2 octave expansion method, similarly moving the peak to the position corresponding to the maximum peak multiplied by 3 / 2 (rounded to the nearest integer), performing amplitude addition, and performing range determination.
[0193] Finally, the amplitudes of all remaining positions outside the spectral peak are set to 0. This process highlights the impact of possible interfering peaks and their harmonics, reduces interference from other irrelevant frequency components, and makes the spectrum more concise and clear, facilitating subsequent frequency identification and spectral subtraction. m_spectrum is then reorganized by adding the amplitudes of all positions at the same location, retaining any values greater than 1, and setting the amplitudes of all other positions outside the spectral peak to 0, further optimizing the spectral characteristics. This expansion method allows for more accurate distinction between motion artifacts and true heart rate, effectively preserving true heart rate information and reducing the interference of motion artifacts on subsequent frequency tracking and heart rate calculation.
[0194] 402. Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment.
[0195] Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment. The specific judgment method is to check whether there is a value greater than 0 in the range of m_spectrum(hr_pre-10:hr_pre+10), where hr_pre is the heart rate at the previous moment. If there is a value greater than 0 in this range, it means that there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment, which means that there may be a co-frequency phenomenon. At this time, the flag is recorded as 1; conversely, if there is no value greater than 0, the flag is recorded as 0. In this way, the co-frequency situation can be effectively judged, providing an accurate basis for subsequent spectrum subtraction processing. It can be understood that the judgment method and rules can be adjusted according to actual conditions, and are not limited here.
[0196] 403. Perform frequency synchronization processing.
[0197] The specific spectrum subtraction method is as follows:
[0198] ,
[0199] when hour, If it is a negative number, it is set to 0;
[0200] when hour, If it is a negative number, it is set to 0;
[0201] when and hour, ;
[0202] when and hour,
[0203] ;
[0204] The significance of the above formula: The change in human heart rate is a continuous process without large jumps. Therefore, the interval is divided by the heart rate of the previous moment, and the possibility that the current heart rate is less than 0.5 times the heart rate of the previous moment or greater than 1.5 times the heart rate of the previous moment is small. Therefore, the coefficient of spectrum subtraction is (1-1.2*m_spectrum(i)), which makes the frequency amplitude of p_spectrum in this interval smaller; when in [0.5hr_pre,1.5hr_pre], if there is no co-frequency, the spectrum subtraction coefficient is unchanged. If there is co-frequency, the spectrum subtraction coefficient is (1-m_spectrum(i) / 2), which makes the frequency amplitude of p_spectrum in this interval larger. The spectrum subtraction method of this solution makes the frequency amplitude of the heart rate smaller, which may be larger, making the subsequent frequency tracking more accurate.
[0205] Furthermore, considering the co-frequency issue, where the motion component may still be stronger than the heart rate component after spectral subtraction, this solution adopts a special handling strategy to prevent this from continuously interfering with heart rate monitoring: after co-frequency synchronization for 5 consecutive seconds, the system switches to a non-co-frequency spectral subtraction method, then switches back to co-frequency synchronization after 5 seconds, with switching intervals of 5 seconds. This switching mechanism dynamically adjusts between different spectral subtraction methods, ensuring that motion artifacts are effectively suppressed and the true heart rate signal is accurately captured in complex motion environments, thereby achieving high-precision heart rate monitoring.
[0206] The following describes in detail the heart rate determination process of the method provided in the embodiment of the present application. Figure 6 , Figure 6 This is a flowchart of the heart rate determination process provided in this application, including: steps 601 to 606.
[0207] 601. Determine a plurality of spectrum peaks from the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process.
[0208] Frequency tracking is based on the principle that the human heart rate is a continuous process, with small changes per second. Therefore, this solution performs frequency tracking near the previous heart rate. Specifically:
[0209] 1) Find the five largest peaks in p_spectrum without spectrum subtraction, and record them as [ppeak11, ppeak12, ppeak13, ppeak14, ppeak15];
[0210] 2) Find the five largest peaks in p_spectrum after spectrum subtraction, and record them as [ppeak21, ppeak22, ppeak23, ppeak24, ppeak25];
[0211] In actual implementation, the number of peaks selected can be adjusted according to the actual situation and is not limited here. For the case where spectral subtraction is not performed, only 5 peaks can be directly selected.
[0212] 602. Calculate evaluation values of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value.
[0213] The evaluation value calculation formula is as follows:
[0214]
[0215] is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, The upper part of the formula is the maximum amplitude of the peak, and the lower part is the absolute difference between the position of the maximum amplitude and the heart rate at the previous moment.
[0216] Calculate the evaluation value corresponding to each peak, and determine the heart rate corresponding to the peak with the highest evaluation value as the current real-time heart rate.
[0217] 603. Establish a logistic regression model.
[0218] Specifically, the results obtained by frequency tracking based on the above steps 601 to 602 are not necessarily correct, so the results need to be verified. The present application further establishes a logistic regression model, and the features used in the training of the logistic regression model include: the average value of the combined acceleration, the degree of energy concentration, the standard deviation, kurtosis, and skewness of the PPG spectrum before spectral subtraction, the standard deviation, kurtosis, and skewness of the PPG spectrum after spectral subtraction, the heart rate at the previous moment, the evaluation value, and the amplitude and position of the peak corresponding to the maximum evaluation value. The logistic regression model is used to output an evaluation value for the current heart rate. The model outputs an evaluation value for the current heart rate by learning and analyzing these features. This evaluation value can quantify the reliability of the current heart rate result.
[0219] 604. Calculate an evaluation value of the heart rate value.
[0220] Obtain an evaluation value calculated based on the logistic regression model based on the current parameters. And determine the current evaluation value. If the evaluation value is high, it means that the obtained heart rate value meets the expectations and no further processing is required. If the heart rate value is low, execute step 605.
[0221] 605. Perform corresponding processing based on the evaluation value.
[0222] High reliability situation (p ≥ 0.8): When the evaluation value p output by the logistic regression model is greater than or equal to 0.8, it indicates that the currently selected heart rate result has high reliability under model evaluation. This means that judged from a comprehensive consideration of various features, the degree of conformity between this heart rate value and the true heart rate is high, and it can be directly recognized as a valid result without additional processing.
[0223] Medium reliability situation (0.3 < p < 0.8): If the evaluation value is between 0.3 and 0.8, it means that there is a certain degree of uncertainty in the current heart rate result. At this time, the currently selected result and the heart rate at the previous moment are fused using Kalman filtering. Because the change of human heart rate is continuous, the heart rate at the previous moment is an important reference. By fusing the two through Kalman filtering, the heart rate curve can be effectively smoothed, avoiding sudden jumps in the heart rate result caused by data fluctuations or local algorithm errors, making the heart rate value more in line with the human physiological law, and improving the stability of heart rate monitoring.
[0224] Low reliability situation (p ≤ 0.3): When p is less than or equal to 0.3, the reliability of the current heart rate result is low. First, use the heart rate at the previous moment as the current result. This is a conservative strategy based on the continuity of heart rate to prevent the output of incorrect heart rate values. If this situation lasts for 5 seconds, it indicates that it is difficult for the algorithm to obtain a reliable heart rate in a short time. At this time, linear prediction is performed using the heart rate in the previous 20 seconds. Linear prediction is based on the trend of heart rate change and can reasonably infer the current heart rate to a certain extent, replacing the current unreliable result. This not only avoids the bad experience caused by the long-term non-update of the heart rate but also gradually approaches the true heart rate, reflecting the effective response to abnormal situations and the attention to user experience. If the predicted result is used as the heart rate result for more than 15 seconds, it is determined that there is a serious error in the previous heart rate tracking, and all parameters are initialized and reset to get rid of the error tracking state and accurately obtain the heart rate again.
[0225] 606. Perform smoothing processing.
[0226] Specifically, in order to avoid large jumps in the heart rate result, whether it is the heart rate result calculated in the time domain or the heart rate result calculated in the frequency domain needs to be smoothed. Specifically, it is necessary to compare the difference between the heart rate value at the previous moment and the current heart rate value and process them according to different situations.
[0227] Tiny change situation (|hr_current - hr_pre| ≤ 3): When the difference between the current heart rate value (hr_current) and the heart rate value at the previous moment (hr_pre) is less than or equal to 3, no smoothing processing is performed. Because in this case, the heart rate change is within the normal tiny fluctuation range of the human body, directly outputting the current heart rate value can accurately reflect the immediate state of the heart rate, without additional smoothing operations, ensuring the real-time and accuracy of the data.
[0228] Small changes (3 < |hr_current - hr_pre| ≤ 10): If the heart rate difference is greater than 3 and less than or equal to 10, the weighted average of the heart rate results for the previous 3 seconds and the current result is used as the current heart rate result, with data closer to the current moment receiving greater weight. This is because heart rate changes have a certain degree of inertia, and recent data better reflects the current trend. The weighted average smoothes the heart rate curve and reduces the impact of occasional fluctuations, while highlighting the current heart rate trend, making the result more consistent with actual heart rate fluctuations.
[0229] Large heart rate fluctuations (|hr_current - hr_pre| > 10): When the heart rate difference is greater than 10, the average of the previous 7 seconds' heart rate data and the current result is used as the current heart rate result. Large heart rate fluctuations may be caused by interference or algorithm anomalies. In this case, averaging the heart rate data over a longer period (7 seconds) can effectively smooth out large fluctuations, making the heart rate result more stable, avoiding misjudgments caused by abnormal data, and ensuring that the output heart rate value conforms to the physiological characteristics of the continuously changing human heart rate.
[0230] Finally, the system obtains whether it is necessary to continue measuring the heart rate. When the end service flag is received, the heart rate measurement service is ended and the maximum heart rate, minimum heart rate, and average heart rate within the heart rate measurement period are output.
[0231] The above content describes the exercise heart rate detection method provided by this application. To support the implementation of the above embodiment, this application also provides an exercise heart rate detection device, please refer to Figure 7 An embodiment of the exercise heart rate detection device provided by the present application includes:
[0232] An acquisition unit 701 is configured to acquire an initial PPG signal and an initial ACC signal;
[0233] a filtering unit 702, configured to filter the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal;
[0234] a combined acceleration average value calculation unit 703, configured to calculate a combined acceleration average value within a preset time window based on the second ACC signal;
[0235] an energy concentration degree calculation unit 704, configured to calculate the energy concentration degree within the preset time window based on the second PPG signal;
[0236] A judgment unit 705 determines whether the vehicle is in a motion state based on the combined acceleration average value and the energy concentration level;
[0237] a time domain heart rate determination unit 706, configured to determine heart rate information based on the time domain information if the user is not in the exercise state;
[0238] a spectrum acquisition unit 707, configured to acquire an ACC spectrum and a PPG spectrum if the user is in the motion state;
[0239] A same-frequency determination unit 708 is configured to determine whether there is a same-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment;
[0240] a spectrum subtraction processing unit 709, configured to perform spectrum subtraction processing on the PPG spectrum if the same frequency situation exists;
[0241] The frequency domain heart rate determination unit 710 is configured to determine heart rate information from the PPG spectrum after spectrum subtraction and the PPG spectrum before spectrum subtraction based on a frequency tracking algorithm.
[0242] Based on the above Figure 7 Corresponding to the embodiment, optionally, the filtering unit is specifically configured to:
[0243] The initial PPG signal and the initial ACC signal are processed using a Butterworth bandpass filter to obtain a second ACC signal and an intermediate PPG signal, where the cutoff frequencies of the bandpass filter are 0.5 Hz and 4 Hz, and the order is 6;
[0244] An adaptive filter is used, with the second ACC signal as an input signal and the intermediate PPG signal as a desired signal, to remove motion artifacts and obtain the second PPG signal.
[0245] Based on the above Figure 7 Corresponding embodiment, optionally,
[0246] The combined acceleration average value calculation unit is specifically used for:
[0247] The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula:
[0248]
[0249] in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction;
[0250] The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ;
[0251] The average value of the combined acceleration is calculated according to the following formula:
[0252]
[0253] in is the average value of the total acceleration is the maximum value of the first combined acceleration per second within the preset time window;
[0254] The energy concentration degree calculation unit is specifically used for:
[0255] Calculate the frequency spectrum of the second PPG signal of a specific window duration using a linear frequency modulation Z transform method to obtain the PPG spectrum, and perform maximum normalization on the PPG spectrum to obtain a PPG spectrum with a length of 210;
[0256] The energy concentration is calculated according to the following formula:
[0257]
[0258] in is the frequency corresponding to the maximum amplitude value of the spectrum.
[0259] Based on the above Figure 7 In the corresponding embodiment, optionally, the judging unit is specifically configured to:
[0260] Determining whether a continuous period during which the average value of the combined acceleration is less than a first preset value and the energy concentration is less than a second preset value exceeds a preset period;
[0261] If exceeded, it is deemed not in motion;
[0262] If it does not exceed, it is considered to be in the preset state.
[0263] Based on the above Figure 7 In the corresponding embodiment, optionally, the same-frequency determination unit is specifically configured to:
[0264] Determine multiple ACC spectrum peaks and perform multi-frequency expansion;
[0265] Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment. If so, it is considered that there is a same frequency condition and the flag is recorded as 1; otherwise, the flag is recorded as 0;
[0266] The spectrum subtraction processing unit is specifically used for:
[0267] Frequency synchronization is performed based on the following formula:
[0268] ,
[0269] when hour, , when it is a negative number, it is set to 0;
[0270] when hour, , when it is a negative number, it is set to 0;
[0271] when and hour, ;
[0272] when and hour,
[0273] .
[0274] Based on the above Figure 7 In the corresponding embodiment, optionally, the frequency-domain heart rate determination unit is configured to:
[0275] Determine a plurality of spectrum peaks in the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process;
[0276] Calculate the evaluation value of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value;
[0277] The evaluation value calculation formula is as follows:
[0278]
[0279] is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, is the heart rate at the previous moment.
[0280] Based on the above Figure 7 Corresponding to the embodiment, optionally, the device further includes:
[0281] A verification unit, the verification unit being configured to:
[0282] Establishing a logistic regression model, wherein the features used in the training of the logistic regression model include: the average value of the combined acceleration, the degree of energy concentration, the standard deviation, kurtosis, and skewness of the PPG spectrum before spectral subtraction, the standard deviation, kurtosis, and skewness of the PPG spectrum after spectral subtraction, the heart rate at the previous moment, the evaluation value, and the amplitude and position of the peak corresponding to the maximum evaluation value; the logistic regression model is used to output an evaluation value for the current heart rate;
[0283] Calculating an evaluation value of the heart rate value;
[0284] If the evaluation value is lower than the preset value, the heart rate value obtained based on the heart rate tracking algorithm and the heart rate value calculated by the neural network model are fused based on the Kalman filtering method to obtain the current heart rate value.
[0285] In this embodiment, the process executed by each unit in the exercise heart rate detection device is similar to the process of the exercise heart rate detection method described in the embodiment corresponding to the above figures, and will not be repeated here.
[0286] Figure 8 8 is a structural diagram of an exercise heart rate detection device provided in an embodiment of the present application. The exercise heart rate detection device 800 may include one or more central processing units (CPU) 801 and a memory 805, and the memory 805 stores one or more applications or data.
[0287] In this embodiment, the specific functional module division in the central processing unit 801 can be the same as the above Figure 8 The functional module division method of each unit described in is similar and will not be repeated here.
[0288] Memory 805 may be volatile or persistent storage. The program stored in memory 805 may include one or more modules, each of which may include a series of instructions for operating on the server. Furthermore, the central processing unit 801 may be configured to communicate with memory 805 and execute the series of instructions in memory 805 on the server 800.
[0289] The exercise heart rate detection device 800 may further include one or more power supplies 802 , one or more wired or wireless network interfaces 803 , one or more input and output interfaces 804 , and / or one or more operating systems.
[0290] The central processing unit 801 can execute the operations performed by the exercise heart rate detection method in the embodiments corresponding to the above figures, and the details will not be repeated here.
[0291] An embodiment of the present application also provides a computer storage medium for storing computer software instructions used for the above-mentioned exercise heart rate detection method, which includes a program designed for executing the exercise heart rate detection method.
[0292] The exercise heart rate detection method can be as described above Figure 1 The exercise heart rate detection method described in .
[0293] The present application also provides a computer program product, which includes computer software instructions that can be loaded by a processor to implement the above Figure 1 Figure 2 The process of any one of the exercise heart rate detection methods.
[0294] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the equivalent transformation of circuits and the division of units are only a kind of logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0295] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0296] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0297] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting heart rate during exercise, characterized in that: include: Obtaining initial PPG signals and initial ACC signals; Filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal; Calculating a combined acceleration average within a preset time window based on the second ACC signal; calculating the energy concentration within the preset time window based on the second PPG signal; determining whether the vehicle is in a motion state based on the combined acceleration average value and the energy concentration level; If the user is not in the exercise state, determining the heart rate information based on the time domain information; If in the motion state, obtain the ACC spectrum and PPG spectrum; Determining whether there is a frequency coincidence based on the relationship between the ACC spectrum and the heart rate at the previous moment; If the same frequency situation exists, performing spectrum subtraction processing on the PPG spectrum; Determining heart rate information from the PPG spectrum after spectral subtraction and the PPG spectrum without spectral subtraction based on a frequency tracking algorithm; calculating the average value of the combined acceleration within a preset time window based on the second ACC signal; Calculating the energy concentration within the preset time window based on the second PPG signal includes: The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula: in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction; The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ; The average value of the combined acceleration is calculated according to the following formula: in is the average value of the total acceleration is the maximum value of the first combined acceleration per second within the preset time window; Calculate the frequency spectrum of the second PPG signal of a specific window duration using a linear frequency modulation Z transform method to obtain the PPG spectrum, and perform maximum normalization on the PPG spectrum to obtain a PPG spectrum with a length of 210; The energy concentration is calculated according to the following formula: in is the frequency corresponding to the maximum amplitude value of the spectrum; The method of determining the heart rate information from the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process based on the frequency tracking algorithm includes: Determine a plurality of spectrum peaks in the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process; Calculate the evaluation value of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value; The evaluation value calculation formula is as follows: is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, is the heart rate at the previous moment.
2. The exercise heart rate detection method according to claim 1, characterized in that: The filtering the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal includes: The initial PPG signal and the initial ACC signal are processed using a Butterworth bandpass filter to obtain a second ACC signal and an intermediate PPG signal, where the cutoff frequencies of the bandpass filter are 0.5 Hz and 4 Hz, and the order is 6; An adaptive filter is used, with the second ACC signal as an input signal and the intermediate PPG signal as a desired signal, to remove motion artifacts and obtain the second PPG signal.
3. The exercise heart rate detection method according to claim 1, characterized in that: The determining whether the vehicle is in motion based on the combined acceleration average value and the energy concentration degree includes: Determining whether a continuous period during which the average value of the combined acceleration is less than a first preset value and the energy concentration is less than a second preset value exceeds a preset period; If exceeded, it is deemed not in motion; If it does not exceed, it is considered to be in the preset state.
4. The method for detecting heart rate during exercise according to claim 1, wherein: The determining whether there is a same frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment; If the same frequency situation exists, performing spectrum subtraction processing on the PPG spectrum includes: Determine multiple ACC spectrum peaks and perform multi-frequency expansion; Determine whether there is a spectrum peak at the ACC spectrum position corresponding to the heart rate at the previous moment. If so, it is considered that there is a same frequency condition and the flag is recorded as 1; otherwise, the flag is recorded as 0; Frequency synchronization is performed based on the following formula: , when hour, , when it is a negative number, it is set to 0; when hour, , when it is a negative number, it is set to 0; when and hour, ; when and hour, 。 5. The method according to claim 1, wherein The method further comprises: Establishing a logistic regression model, wherein the features used in the training of the logistic regression model include: the average value of the combined acceleration, the degree of energy concentration, the standard deviation, kurtosis, and skewness of the PPG spectrum before spectral subtraction, the standard deviation, kurtosis, and skewness of the PPG spectrum after spectral subtraction, the heart rate at the previous moment, the evaluation value, and the amplitude and position of the peak corresponding to the maximum evaluation value; the logistic regression model is used to output an evaluation value for the current heart rate; Calculating an evaluation value of the heart rate value; If the evaluation value is lower than the preset value, the heart rate value obtained based on the heart rate tracking algorithm and the heart rate value calculated by the neural network model are fused based on the Kalman filtering method to obtain the current heart rate value.
6. A sports heart rate detection device, characterized in that: include: an acquisition unit, configured to acquire an initial PPG signal and an initial ACC signal; a filtering unit, configured to filter the initial PPG signal and the initial ACC signal to obtain a second PPG signal and a second ACC signal; a combined acceleration average value calculation unit, configured to calculate a combined acceleration average value within a preset time window based on the second ACC signal; an energy concentration degree calculation unit, configured to calculate the energy concentration degree within the preset time window based on the second PPG signal; a judgment unit, configured to determine whether the vehicle is in a motion state based on the combined acceleration average value and the energy concentration level; a time-domain heart rate determination unit, configured to determine heart rate information based on time-domain information if the user is not in the exercise state; a spectrum acquisition unit, configured to acquire an ACC spectrum and a PPG spectrum if the user is in the motion state; A same-frequency determination unit, configured to determine whether there is a same-frequency situation based on the relationship between the ACC spectrum and the heart rate at the previous moment; a spectrum subtraction processing unit, configured to perform spectrum subtraction processing on the PPG spectrum if the same frequency situation exists; a frequency domain heart rate determination unit for determining heart rate information in the PPG spectrum after spectral subtraction and the PPG spectrum before spectral subtraction based on a frequency tracking algorithm; The combined acceleration average value calculation unit is specifically used for: The ACC signal is a three-axis acceleration signal. The first combined acceleration of the initial ACC signal is calculated according to the following formula: in is the combined acceleration signal, is the acceleration signal in the X-axis direction, is the acceleration signal in the Y-axis direction, is the acceleration signal in the Z-axis direction; The duration of the preset time window is 8 seconds, and the maximum value of the first combined acceleration is determined for each second within 8 seconds. ; The average value of the combined acceleration is calculated according to the following formula: in is the average value of the total acceleration is the maximum value of the first combined acceleration per second within the preset time window; The energy concentration degree calculation unit is specifically used for: Calculate the frequency spectrum of the second PPG signal of a specific window duration using a linear frequency modulation Z transform method to obtain the PPG spectrum, and perform maximum normalization on the PPG spectrum to obtain a PPG spectrum with a length of 210; The energy concentration is calculated according to the following formula: in is the frequency corresponding to the maximum amplitude value of the spectrum; The frequency domain heart rate determination unit is specifically configured to: Determine a plurality of spectrum peaks in the PPG spectrum after the spectrum subtraction process and the PPG spectrum before the spectrum subtraction process; Calculate the evaluation value of each spectrum peak based on the heart rate value at the previous moment, and determine the frequency corresponding to the highest peak of the evaluation value as the heart rate value; The evaluation value calculation formula is as follows: is the evaluation value, is the maximum amplitude value, is the frequency corresponding to the maximum amplitude value, is the heart rate at the previous moment.
7. A sports heart rate detection device, characterized in that: include: CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply; The memory is a transient memory or a persistent memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory on the device to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The method comprises instructions, which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Real-time heart rate detection method and system
CN110801214A
Heart rate prediction and model training method and system, wearable device and medium
CN119862375A