Heart rate detection method and device based on ballistocardiogram signal and storage medium
By converting the BCG signal into AMDF curve, using its periodic sensitivity characteristics to accurately locate the JJ interval, the problem of insufficient central rate detection accuracy and efficiency of existing methods is solved, and high-precision heart rate and HRV detection is achieved, suitable for embedded devices and health monitoring.
Patent Information
- Application Number
- CN202510780361.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-08-05
AI Technical Summary
The existing heart rate detection methods based on BCG signals have insufficient accuracy and calculation efficiency, and cannot meet the needs of high-precision heart rate detection and HRV calculation. Especially due to the significant differences in J wave patterns between individuals, the accuracy of heart rate calculation is difficult to ensure.
The heart rate detection method based on the heart impact signal is adopted, and the signal is acquired and preprocessed and converted into a short-term average amplitude difference curve is determined, and the first average JJ interval is filtered based on this to obtain the envelope signal. The heart rate and heart rate variability are determined in combination with the peak detection, and the JJ interval is accurately positioned using the AMDF curve to reduce the frequency domain transformation and calculation process.
It improves the accuracy and efficiency of heart rate detection, adapts to the BCG signal forms of different individuals, reduces the computational complexity, is suitable for embedded device applications, and provides a reliable basis for disease warning and health management, improving the intelligence level of health monitoring.
Smart Images

Figure CN120419948A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of heart rate detection technology, and in particular to a heart rate detection method, device and storage medium based on a heartbeat signal. Background Art
[0002] Against the backdrop of the rapid development of smart healthcare and home health monitoring technologies, non-contact physiological parameter detection has become a research hotspot in the field of biomedical engineering. Ballistocardiogram (BCG), an important carrier reflecting cardiac mechanical activity, exhibits unique application value in scenarios such as smart mattresses and vital sign monitoring chairs due to its unconstrained detection characteristics. Furthermore, heart rate variability (HRV), a core biomarker for assessing autonomic nervous system function, plays multiple roles in health testing, from disease warning to health management. By analyzing subtle fluctuations in heartbeat intervals, it can identify cardiovascular disease risks (such as myocardial ischemia and arrhythmias) in advance, quantify psychological stress levels, optimize exercise training intensity, and provide a basis for early screening for certain chronic diseases. Therefore, HRV calculation based on BCG signals has important application value.
[0003] Currently, the main heart rate detection methods based on BCG signals include spectral methods and time-domain waveform methods. The spectral method converts the time-domain BCG signal into frequency-domain features through fast Fourier transform (FFT), and estimates the heart rate value based on the frequency corresponding to the peak of the main frequency energy. However, this method is computationally intensive and highly complex. The time-domain method utilizes the periodic characteristics of the J wave of the BCG signal and uses a peak detection algorithm to calculate the interval between adjacent J wave peaks to estimate the instantaneous heart rate. Although the algorithm complexity is low, the significant differences in J wave morphology between individuals make it difficult to ensure the accuracy of heart rate calculation. Existing methods have deficiencies in accuracy and computational efficiency, and cannot fully meet the needs of high-precision heart rate detection and subsequent HRV calculation in practical applications. Summary of the Invention
[0004] Based on this, it is necessary to provide a heart rate detection method based on a heartbeat signal to address the above technical issues, so as to solve at least one problem existing in the above-mentioned prior art.
[0005] In a first aspect, a heart rate detection method based on a heartbeat signal is provided, comprising:
[0006] Acquiring a cardiac shock signal and preprocessing the cardiac shock signal;
[0007] Converting the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determining a first average JJ interval based on the short-time average amplitude difference curve;
[0008] Based on the first average JJ interval, filtering the preprocessed ballistocardial signal to obtain an envelope signal;
[0009] Performing peak detection on the envelope signal to obtain a target J peak;
[0010] Based on the target J-peak, heart rate and heart rate variability are determined.
[0011] In a possible implementation, after obtaining the ballistocardiographic signal and preprocessing the ballistocardiographic signal, the method further includes:
[0012] detecting whether the preprocessed ballistocardiographic signal has body motion interference;
[0013] If body motion interference exists, it is marked in the ballistocardiographic signal.
[0014] In a possible implementation, detecting whether the preprocessed ballistocardiographic signal has body motion interference includes:
[0015] Splitting the preprocessed cardiac ballistic signal into a plurality of cardiac ballistic signal segments;
[0016] Determine the variance corresponding to each cardiac ballistic signal segment;
[0017] determining the number of cardiac ballistoic signal segments having amplitudes greater than a preset amplitude threshold;
[0018] Based on the variance and the number of cardiac ballistic signal segments, it is determined whether the preprocessed cardiac ballistic signal has body motion interference.
[0019] In one possible implementation, converting the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determining the first average JJ interval based on the short-time average amplitude difference curve, includes:
[0020] Converting the pre-processed ballistocardial signal into a short-time average amplitude difference curve based on a short-time average amplitude difference function;
[0021] Searching the short-time average amplitude difference curve for all troughs within a preset JJ interval and the corresponding index of each trough;
[0022] Combine all the found troughs into a trough array;
[0023] determining the first average JJ interval based on the index corresponding to the first trough in the trough array that meets a preset condition;
[0024] The preset conditions include that the trough protrusion height exceeds a set threshold and the trough position is within a reasonable range of the JJ interval.
[0025] In a possible implementation, filtering the preprocessed ballistocardial signal based on the first average JJ interval to obtain an envelope signal includes:
[0026] performing differential processing on the pre-processed ballistocardial signal;
[0027] Based on the first average JJ interval, a filtering window time length is obtained;
[0028] The ballistocardial signal after the difference processing is filtered using the filtering window time length to obtain the envelope signal.
[0029] In a possible implementation, performing peak detection on the envelope signal to obtain a target J peak includes:
[0030] Determine all peaks in the envelope signal and use all peaks as candidate J peaks;
[0031] Based on the signal quality and the first average JJ interval, pseudo J peaks are eliminated from the candidate J peaks to obtain the target J peak.
[0032] In a possible implementation, eliminating pseudo J peaks from the candidate J peaks based on signal quality and the first average JJ interval includes:
[0033] Based on the first average JJ interval, a peak detection window time length is obtained;
[0034] Retaining the candidate J peak corresponding to the maximum peak value within the peak detection window time length;
[0035] Determine whether the peak amplitude of the retained candidate J peak is greater than the first preset peak amplitude and less than the second preset peak amplitude, if so, retain it, otherwise, eliminate it; and
[0036] Peaks with body motion interference are eliminated from the retained candidate J peaks.
[0037] In one possible implementation, determining the heart rate and heart rate variability based on the target J peak includes:
[0038] performing differential processing on the target J peak position array to obtain a JJ interval array;
[0039] determining a second average JJ interval based on the JJ interval array;
[0040] determining a relative deviation between the second average JJ interval and the first average JJ interval;
[0041] If the relative deviation is less than the preset threshold, the heart rate and heart rate variability are calculated based on the second average JJ interval.
[0042] In a second aspect, a heart rate detection device based on a heartbeat signal is provided, comprising:
[0043] a signal preprocessing unit, configured to obtain a ballistocardiogram signal and preprocess the ballistocardiogram signal;
[0044] a first average JJ interval determining unit, configured to convert the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determine a first average JJ interval based on the short-time average amplitude difference curve;
[0045] an envelope signal acquisition unit, which obtains a filter window time length based on the first average JJ interval, and filters the preprocessed ballistocardial signal using the filter window time length to obtain an envelope signal;
[0046] a target J-peak determining unit, configured to perform peak detection on the envelope signal to obtain a target J-peak;
[0047] A heart rate detection unit is used to determine the heart rate and heart rate variability based on the target J peak.
[0048] In a third aspect, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the heart rate detection method based on the cardiac ballistic signal as described above are implemented.
[0049] The above-mentioned heart rate detection method, device and storage medium based on the cardiac impact signal, its method implementation includes: obtaining the cardiac impact signal and preprocessing the cardiac impact signal; converting the preprocessed cardiac impact signal into a short-time average amplitude difference curve, and determining a first average JJ interval based on the short-time average amplitude difference curve; filtering the preprocessed cardiac impact signal based on the first average JJ interval to obtain an envelope signal; performing peak detection on the envelope signal to obtain a target J peak; and determining the heart rate and heart rate variability based on the target J peak. In an embodiment of the present application, by converting the BCG signal into an AMDF curve and utilizing its sensitive characteristics to the periodicity of the signal, the JJ interval is accurately located, avoiding errors caused by individual J wave morphology differences. Compared with the traditional time domain method, the accurate J wave position can be obtained more stably, thereby significantly improving the accuracy of heart rate detection. The first mean JJ interval is determined based on the AMDF curve, and then filtered to obtain the envelope signal. This reduces complex frequency domain transformations and extensive computational processes, effectively reducing computational complexity and improving detection efficiency. This makes the method more suitable for embedded devices. Dynamic analysis of signal periodicity using the AMDF curve, combined with adaptive filtering, can adapt to BCG signals of varying forms, avoiding the detection failures associated with individual differences in traditional methods. Furthermore, it can provide a reliable basis for disease early warning, health management, and other areas, significantly enhancing the intelligent level of health monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0051] Figure 1 This is a flow chart of a heart rate detection method based on a heartbeat signal in one embodiment of the present application;
[0052] Figure 2 This is a signal diagram of a pre-processed ballistocardial signal in one embodiment of the present application;
[0053] Figure 3 This is a schematic diagram of a short-time average amplitude difference curve in one embodiment of the present application;
[0054] Figure 4 2 is a schematic diagram of an absolute value signal after variance processing of a pre-processed ballistocardial signal in one embodiment of the present application;
[0055] Figure 5 1 is a schematic diagram of a signal after an absolute value signal is processed by SG filtering in one embodiment of the present application;
[0056] Figure 6 This is a structural diagram of a heart rate detection device based on a heartbeat signal in one embodiment of the present application;
[0057] Figure 7 Schematic diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0059] In one embodiment, if Figure 1 As shown, a heart rate detection method based on a heartbeat signal is provided, comprising the following steps:
[0060] In step S110, a ballistic heart signal is acquired and preprocessed;
[0061] Optionally, the cardiac impact signal can be collected by contact or non-contact means. The contact method can be used to directly contact the object to be measured, such as the surface of the human body, through a contact sensor (such as a piezoelectric sensor, a piezoresistive sensor, etc.), to sense the mechanical vibration or pressure change generated by the heartbeat, thereby collecting the cardiac impact signal. The non-contact collection method can indirectly sense the physical signals caused by cardiac activity through optical, acoustic or mechanical principles. For example, a high-frame rate camera is used to capture the subtle color changes (volume pulse waves) or micro-displacements caused by the heartbeat on the surface of the human body (such as the face, fingertips), and the BCG signal is extracted through image processing algorithms. Alternatively, by irradiating the human body surface with a laser, the reflected light produces a Doppler frequency shift due to the micro-vibration of the skin, and the mechanical activity information of the heart is obtained through frequency shift analysis.
[0062] It should be noted that since the cardiac signal is easily contaminated by noise, after the cardiac signal is collected, it can be preprocessed to eliminate noise interference, correct signal distortion, and improve signal quality. For example, the filter frequency range can be set to 1-20Hz based on the main frequency range of the heart rate signal, and 50 and 60Hz notch filters can be used to remove power frequency interference. Then, a sliding window can be added to the filtered BCG signal, with the window starting position being t s The end position is t e , the window length is N, and the J peak detection can be performed using data of length N, and the sliding window step length is w s , the filtered heartbeat signal is as follows Figure 2 As shown in the figure, the horizontal axis represents the sampling points at a sampling rate of 200 Hz, and the vertical axis represents the signal amplitude. Since BCG signals are continuous time series, setting a sliding window can segment the continuous signal into small segments of length N. Each small segment is relatively independent, facilitating subsequent detailed signal analysis.
[0063] Here, an IIR type butterworth filter can be used as the filter.
[0064] In step S120, the pre-processed ballistocardial signal is converted into a short-time average amplitude difference curve, and a first average JJ interval is determined based on the short-time average amplitude difference curve;
[0065] It's important to note that the Average Magnitude Difference Function (AMDF) measures signal periodicity by averaging the amplitude differences at different time points within a short window. The J-J interval is the time interval between two consecutive J peaks. The J peak corresponds to the onset of the rapid ventricular filling phase and is an important indicator for assessing cardiac function. Using the AMDF instead of the traditional FFT to estimate the average J-J interval reduces algorithm complexity and is more suitable for embedded devices.
[0066] Optionally, a short-time window is selected to slide on the preprocessed BCG signal. For the signal within each short-time window, the amplitude difference between different time points is calculated. All amplitude differences within the window are averaged to obtain the AMDF value corresponding to the short-time window. As the short-time window slides on the BCG signal, a series of AMDF values are obtained. These values are connected to form a short-time average amplitude difference curve. The short-time average amplitude difference curve is shown as Figure 3 As shown in Figure 1, where the abscissa is milliseconds and the ordinate is signal amplitude. On the resulting AMDF curve, find all troughs within the range of the JJ interval (i.e., points with relatively small AMDF values). After finding the troughs, determine the indexes corresponding to these troughs. Then, determine the first average JJ interval using the index of the first trough in the trough array.
[0067] In step S130, filtering the pre-processed ballistocardial signal based on the first average JJ interval to obtain an envelope signal;
[0068] Optionally, the pre-processed cardiac ballistic signal can be differentially processed and its absolute value taken. Then, a preset proportion of the first average JJ interval is used as the filter window time length, for example, 1 / 2 of the first average JJ interval is used as the filter window time length. The obtained cardiac ballistic signal is filtered through a Savitzky-Golay filter (SG) to obtain an envelope signal. The envelope signal reflects the overall change trend and amplitude change of the signal. By extracting the envelope signal, the fluctuation characteristics of the BCG signal, such as the peak change and periodic change of the signal, can be more intuitively observed, providing a clearer signal basis for the subsequent accurate detection of target J peak and other features.
[0069] In step S140, peak detection is performed on the envelope signal to obtain a target J peak;
[0070] Optionally, the envelope signal is traversed at each point, and the amplitude value of the current point is compared with the amplitude values of adjacent points. If the amplitude value of the point is greater than the amplitude values of the points within a certain range to its left and right, then the point is determined to be a peak point. Alternatively, an amplitude threshold can be set based on the overall amplitude distribution of the envelope signal, for example, taking the signal amplitude mean plus a certain multiple of the standard deviation. When the amplitude value of a point is not only greater than the adjacent amplitude values but also greater than the amplitude threshold, it is considered a peak point. In this way, all peak points can be found in the envelope signal. Then, based on signal quality, such as body motion interference and the first average JJ interval, pseudo-peak points are eliminated, and the remaining peak points are used as target J peaks.
[0071] In step S150 , the heart rate and heart rate variability are determined based on the target J-peak.
[0072] Optionally, after obtaining all target J peaks, a second average JJ interval can be calculated and compared with the first average JJ interval. Based on the comparison result, the confidence of the second average JJ interval is determined. If the confidence is greater than the preset confidence, the average heart rate and heart rate variability can be calculated for the signal segments with high confidence.
[0073] In an embodiment of the present application, a heart rate detection method based on a cardiac impact signal is provided, comprising: obtaining a cardiac impact signal and preprocessing the cardiac impact signal; converting the preprocessed cardiac impact signal into a short-time average amplitude difference curve, and determining a first average JJ interval based on the short-time average amplitude difference curve; filtering the preprocessed cardiac impact signal based on the first average JJ interval to obtain an envelope signal; performing peak detection on the envelope signal to obtain a target J peak; and determining heart rate and heart rate variability based on the target J peak. In an embodiment of the present application, by converting the BCG signal into an AMDF curve and utilizing its sensitive characteristics to signal periodicity, the JJ interval is accurately located, avoiding errors caused by individual J wave morphology differences. Compared with the traditional time domain method, the accurate J wave position can be obtained more stably, thereby significantly improving the accuracy of heart rate detection. The first mean JJ interval is determined based on the AMDF curve, and then filtered to obtain the envelope signal. This reduces complex frequency domain transformations and extensive computational processes, effectively reducing computational complexity and improving detection efficiency. This makes the method more suitable for embedded devices. Dynamic analysis of signal periodicity using the AMDF curve, combined with adaptive filtering, can adapt to BCG signals of varying forms, avoiding the detection failures associated with individual differences in traditional methods. Furthermore, it can provide a reliable basis for disease early warning, health management, and other areas, significantly enhancing the intelligent level of health monitoring.
[0074] In one embodiment of the present application, after obtaining the ballistocardiogram signal and preprocessing the ballistocardiogram signal, the method further includes:
[0075] detecting whether the preprocessed ballistocardiographic signal has body motion interference;
[0076] If body motion interference exists, it is marked in the ballistocardiographic signal.
[0077] Alternatively, the ballistocardi signal is susceptible to interference from body motion (e.g., limb movement, breathing, and changes in body position), which can lead to noise mixing into the signal and affect the accuracy of subsequent analysis of parameters such as heart rate and cardiac function. Therefore, it is possible to detect whether there is body motion interference in the preprocessed ballistocardi signal and mark the interfering segments, for example by adding metadata tags to the corresponding signal segments or generating an interference mask (e.g., 0 for no interference, 1 for interference), thereby providing a basis for subsequent signal correction or elimination.
[0078] In one embodiment of the present application, detecting whether the preprocessed ballistocardiographic signal has body motion interference includes:
[0079] Splitting the preprocessed cardiac ballistic signal into a plurality of cardiac ballistic signal segments;
[0080] Determining the variance corresponding to each cardiac ballistic signal segment;
[0081] determining the number of cardiac ballistic signal segments having amplitudes greater than a preset amplitude threshold;
[0082] Based on the variance and the number of cardiac ballistic signal segments, it is determined whether the preprocessed cardiac ballistic signal has body motion interference.
[0083] Optionally, the cardiac shock signal is framed by a sliding window technique, and then the signal within each sliding window is further cut into smaller cardiac shock signal segments of a fixed duration (e.g., 2 seconds). The starting position of the sliding window is t s The end position is t e , the window length is N, and the J peak detection can be performed using data of length N, and the sliding window step length is w s .
[0084] Then calculate the variance of each heartbeat signal segment, the variance S 2 It can be calculated by the following formula:
[0085]
[0086] Among them, x i represents the amplitude value of the i-th cardiac impulse signal in the cardiac impulse signal segment, represents the average amplitude value of the cardiac shock signal segment, and N represents the signal length of the cardiac shock signal segment.
[0087] The number of cardiac ballistic signal segments with amplitudes greater than a preset amplitude threshold is determined by the following formula, specifically expressed as:
[0088] M a =max(x(t)),t∈[t s ,t e ];
[0089] Among them, x(t) represents the amplitude value of the cardiac signal at time t, t represents the time variable, and t s , is the starting time of the time interval, t e is the end time, and max represents the maximum value operation.
[0090] Then, combined with the variance S within the sliding window 2 and M a The number of cardiac ballistic signal segments greater than a preset amplitude threshold is used to determine whether the cardiac ballistic signal within the sliding window is interfered by body motion using the following formula, as shown below:
[0091]
[0092] Among them, 1 represents the preset threshold of variance, 2 represents the preset threshold of amplitude, Num1 is the quantity threshold when judging body motion interference based on variance, Num2 is the quantity threshold when judging body motion interference based on amplitude, and || represents "or".
[0093] It should be noted that if Motion is 1, there is body motion interference, and if Motion is 0, there is no body motion interference. A composite judgment condition based on variance and amplitude threshold is adopted to eliminate body motion interference in real time, thus preventing it from affecting the calculation results.
[0094] In one embodiment of the present application, converting the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determining the first average JJ interval based on the short-time average amplitude difference curve, includes:
[0095] Converting the pre-processed ballistocardial signal into a short-time average amplitude difference curve based on a short-time average amplitude difference function;
[0096] Searching the short-time average amplitude difference curve for all troughs within a preset JJ interval and the corresponding index of each trough;
[0097] Combine all the found troughs into a trough array;
[0098] determining the first average JJ interval based on an index corresponding to a first trough in the trough array that meets a preset condition;
[0099] The preset conditions include that the trough protrusion height exceeds a set threshold and the trough position is within a reasonable range of the JJ interval.
[0100] Optionally, the ballistocardiographic signal data may be converted into an AMDF curve according to a short-time average amplitude difference function, which may be as follows:
[0101]
[0102] Where k is the delay time in sampling points, m is the index of the signal sampling point, N is the number of samples of the heartbeat signal, and x is the number of samples of the heartbeat signal. n (m) represents the amplitude value of the heartbeat signal at the mth sampling point, x n (m+k) represents the amplitude value after a delay of k sampling points (i.e., the m+kth sampling point). K is the maximum value that the delay time k can take.
[0103] Then, based on the heart rate range of 40-180bpm, the corresponding JJ interval range is 330-1500ms (JJ interval = 60000 / heart rate). All troughs within the range of 330-1500ms are found in the AMDF curve, and the indexes corresponding to these troughs are recorded. The index reflects the relative position of the trough on the entire curve. Then the average value of the trough values corresponding to the troughs within the normal JJ interval range (330-1500ms) is calculated. This average value comprehensively reflects the overall level of the trough within the interval and can be used to subsequently determine the relative significance of other troughs (for example, a trough value that is less than a certain percentage of the average value can be considered a valid heartbeat cycle). By comparing the found trough with the average value, it is possible to determine whether there are any abnormalities in the trough. For example, if a trough value deviates significantly from the average value, it may mean that the corresponding heartbeat cycle is abnormal, such as interference or physiological abnormalities of the heart itself.
[0104] The found trough values are formed into an array [v1,v2,…,v n ], since the trough in the AMDF curve is associated with the cardiac interval, the first trough that meets the preset conditions usually corresponds to the most significant periodic feature in the signal. Its index position can be used as the estimated value of the first average JJ interval after sampling rate conversion. Therefore, the first trough v in the range of 330-1500ms in the AMDF curve can be m The corresponding index is defined as the mean JJ interval The estimated value is used for subsequent heart rate detection.
[0105] It should be noted that the preset conditions include the trough protrusion height exceeding the set threshold and the trough position being within the reasonable range of the JJ interval, which can be in the array [v1, v2, ..., v n ] Select the first trough value and compare it with the preset threshold. If the trough protrusion height exceeds the set threshold and the trough position is within the reasonable range of the JJ interval, its index position can be converted by sampling rate and used as the estimated value of the first average JJ interval. Otherwise, the default value is used as the first average JJ interval. The default value can be pre-set and can be configured and adjusted according to actual conditions.
[0106] In one embodiment of the present application, filtering the pre-processed ballistocardial signal based on the first average JJ interval to obtain an envelope signal includes:
[0107] performing differential processing on the pre-processed ballistocardial signal;
[0108] Based on the first average JJ interval, a filtering window time length is obtained;
[0109] The ballistocardial signal after the difference processing is filtered using the filtering window time length to obtain the envelope signal.
[0110] Optionally, the pre-processed ballistocardial signal is subjected to differential processing and its absolute value is taken, which can be specifically expressed by the following formula:
[0111] y i =|x i -x i-1 |
[0112] Among them, x i represents the amplitude value of the heartbeat signal at the i-th sampling point after preprocessing, x i-1 Represents the amplitude value of the preprocessed heartbeat signal at the i-1th sampling point.
[0113] After differential processing, the absolute value data is as follows Figure 4 As shown, the horizontal axis is the sampling point, the sampling rate is 200Hz, the vertical axis is the signal amplitude, and the absolute value data is subjected to Savitzky-Golay (SG) filtering, and the filter window length is The envelope signal can be obtained. Figure 5 As shown in the figure, the horizontal axis represents the sampling points at a sampling rate of 200 Hz, and the vertical axis represents the signal amplitude. Using SG filtering based on an adaptive filter window, the BCG signal is reconstructed, enabling accurate calculation of the J-peak position. This allows for accurate J-peak position calculation, not only for heart rate estimation but also for tasks requiring precise J-peak position calculation, such as HRV calculation.
[0114] In one embodiment of the present application, performing peak detection on the envelope signal to obtain a target J peak includes:
[0115] Determine all peaks in the envelope signal and use all peaks as candidate J peaks;
[0116] Based on the signal quality and the first average JJ interval, pseudo J peaks are eliminated from the candidate J peaks to obtain the target J peak.
[0117] Optionally, in the envelope signal, a peak indicates that the signal has a local maximum at that point compared to adjacent points. By traversing the envelope signal data points, comparing the value of each data point with the values of N points (e.g., N = 2) adjacent to it on the left and right, and comparing the signal data points with larger values with a preset peak point threshold (set according to empirical values), if it is greater than the preset peak point threshold, it can be determined as a peak point. By the above method, after finding all the peak points, all the peak points can be used as candidate J peaks. Then, through the pre-calculated first average JJ interval and signal quality, such as body movement interference, signal-to-noise ratio (SNR), etc., the candidate J peaks are screened to remove false J peaks, thereby obtaining the target J peak. Or, after finding all the peak points, first remove the candidate J peaks with a signal-to-noise ratio lower than the threshold or within the body movement interference segment, and then according to the first average JJ interval, remove the false peaks with abnormal intervals, and finally obtain the target J peak.
[0118] In an embodiment of the present application, the removing false J peaks from the candidate J peaks based on the signal quality and the first average JJ interval includes:
[0119] Based on the first average JJ interval, obtain the time length of the peak detection window;
[0120] Retain the candidate J peak corresponding to the maximum peak within the time length of the peak detection window;
[0121] Remove the peaks with body movement interference from the retained candidate J peaks;
[0122] Determine whether the peak amplitude of the retained candidate J peak is greater than the first preset peak amplitude and less than the second preset peak amplitude. If so, retain it; otherwise, remove it.
[0123] Optionally, multiply the first average JJ interval by a coefficient ɑ to obtain a width w. Only retain one maximum peak within the sliding window with a width of w, and delete the other candidate J peaks as false peaks. Perform body movement interference detection on the pre-processed ballistocardiogram signal in advance. If body movement interference is detected, it can be marked. When there is a body movement interference mark in the retained candidate J peaks, it can be removed. And count the numerical set of the amplitudes of the currently retained candidate J peaks, and then calculate the median of this set. The median is obtained by sorting a set of data from smallest to largest. Based on the calculated median, calculate the thresholds thr1 and thr2, for example, by multiplying by different coefficients, such as 0.8 and 1.2, to obtain the thresholds thr1 and thr2. If the amplitude of any retained candidate J peak satisfies thr1 < J amp < thr2, retain this candidate J peak, and remove the other candidate J peaks as abnormal. After the above screening, the target J peak can be obtained.
[0124] Alternatively, the candidate J peaks located in the interference segment can be eliminated first; then, among the remaining candidate J peaks, the first average JJ interval is multiplied by the coefficient ɑ to obtain the sliding window width, and only the maximum peak is retained in each window, and other pseudo peaks are deleted; finally, the median amplitude of the retained candidate J peaks is counted, and the thresholds thr1 and thr2 are calculated, and abnormal peaks whose amplitudes are not within the range of (thr1, thr2) are eliminated to obtain the target J peak.
[0125] In one embodiment of the present application, determining the heart rate and heart rate variability based on the target J peak includes:
[0126] performing differential processing on the target J peak position array to obtain a JJ interval array;
[0127] determining a second average JJ interval based on the JJ interval array;
[0128] determining a relative deviation between the second average JJ interval and the first average JJ interval;
[0129] If the relative deviation is less than the preset threshold, the heart rate and heart rate variability are calculated based on the second average JJ interval.
[0130] Optionally, all the obtained target J peaks are arranged according to their positions to obtain a target J peak array, and a differential operation is performed on the obtained target J peak array to obtain the time intervals between adjacent target J peaks, that is, the JJ interval array [JJi1, JJi2, ..., JJi n ]. Filter the data in the obtained JJ interval array, remove abnormal JJ interval values, and retain JJ intervals within a reasonable range. For example, retain JJi values greater than 330ms and less than 1500ms, and remove the rest as abnormal JJi. Then, according to [JJi1, JJi2, …, JJi n ] Take the average value to get the second average JJ interval The calculated second average JJ interval The first mean JJ interval estimated by AMDF curve Comparison is performed. If the relative deviation between the two is greater than or equal to a preset threshold, such as 30%, the signal quality of the segment is poor, and the confidence level of the calculated JJ interval is low. If the relative deviation between the two is less than the preset threshold, the signal quality of the segment is high, and the confidence level of the calculated JJ interval is high. In this case, metrics such as average heart rate and heart rate variability can be calculated based on this signal segment. Initial estimate verification is used to compare the AMDF interval estimate with the interval estimate calculated from the envelope signal, ensuring more accurate and confident calculations.
[0131] Among them, the heart rate can be calculated by the following formula:
[0132]
[0133] in, is the second average JJ interval.
[0134] The calculation method of RMSSD in HRV time domain measurement can refer to the following formula:
[0135]
[0136] Among them, JJ i represents the i-th JJ interval.
[0137] In the embodiment of the present application, by converting the BCG signal into an AMDF curve and utilizing its sensitive characteristics to the signal interval, the JJ interval is accurately located, avoiding errors caused by individual J wave morphology differences. Compared with the traditional time domain method, the accurate J wave position can be obtained more stably, thereby significantly improving the heart rate detection accuracy. The first average JJ interval is determined based on the AMDF curve, and then the envelope signal is obtained by combining the filtering process, which reduces the complex frequency domain transformation and a large number of calculation processes, effectively reduces the computational complexity, improves the detection efficiency, and is more suitable for application in embedded devices. The signal periodic characteristics are dynamically analyzed by the AMDF curve, combined with adaptive filtering processing, and can adapt to BCG signals of different forms, avoiding the detection failure problem caused by individual differences in traditional methods. Moreover, to a certain extent, it can provide a reliable basis for disease warning, health management, etc., greatly improving the intelligent level of health monitoring.
[0138] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0139] In one embodiment, a heart rate detection device based on a heartbeat signal is provided. The heart rate detection device based on a heartbeat signal corresponds to the heart rate detection method based on a heartbeat signal in the above embodiment. Figure 6 As shown, the heart rate detection device based on the heart ballistic signal includes a signal preprocessing unit 10, a first average JJ cycle determination unit 20, an envelope signal acquisition unit 30, a target J peak determination unit 40 and a heart rate detection unit 50. The functional modules are described in detail as follows:
[0140] The signal preprocessing unit 10 is used to obtain a cardiac ballistic signal and preprocess the cardiac ballistic signal;
[0141] A first average JJ period determination unit 20 is configured to convert the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determine a first average JJ interval based on the short-time average amplitude difference curve;
[0142] An envelope signal acquisition unit 30 is configured to filter the preprocessed ballistocardial signal based on the first average JJ interval to obtain an envelope signal;
[0143] a target J-peak determining unit 40, configured to perform peak detection on the envelope signal to obtain a target J-peak;
[0144] The heart rate detection unit 50 is configured to determine the heart rate and heart rate variability based on the target J peak.
[0145] In one embodiment of the present application, the device further includes a body motion interference detection unit, configured to:
[0146] detecting whether the preprocessed ballistocardiographic signal has body motion interference;
[0147] If body motion interference exists, it is marked in the ballistocardiographic signal.
[0148] In one embodiment of the present application, the body motion interference detection unit is further configured to:
[0149] Splitting the preprocessed cardiac ballistic signal into a plurality of cardiac ballistic signal segments;
[0150] Determining the variance corresponding to each cardiac ballistic signal segment;
[0151] determining the number of cardiac ballistic signal segments having amplitudes greater than a preset amplitude threshold;
[0152] Based on the variance and the number of cardiac ballistic signal segments, it is determined whether the preprocessed cardiac ballistic signal has body motion interference.
[0153] In one embodiment of the present application, the first average JJ interval determining unit 20 is further configured to:
[0154] Converting the pre-processed ballistocardial signal into a short-time average amplitude difference curve based on a short-time average amplitude difference function;
[0155] Searching the short-time average amplitude difference curve for all troughs within a preset JJ interval and the corresponding index of each trough;
[0156] Combine all the found troughs into a trough array;
[0157] The first average JJ interval is determined based on the index corresponding to the first trough meeting the condition in the trough array.
[0158] In one embodiment of the present application, the envelope signal acquisition unit 30 is further configured to:
[0159] performing differential processing on the pre-processed ballistocardial signal;
[0160] Based on the first average JJ interval, a filtering window time length is obtained;
[0161] The ballistocardial signal after the difference processing is filtered using the filtering window time length to obtain the envelope signal.
[0162] In one embodiment of the present application, the target J peak determination unit 40 is further configured to:
[0163] Determine all peaks in the envelope signal and use all peaks as candidate J peaks;
[0164] Based on the signal quality and the first average JJ interval, pseudo J peaks are eliminated from the candidate J peaks to obtain the target J peak.
[0165] In one embodiment of the present application, the target J peak determination unit 40 is further configured to:
[0166] Based on the first average JJ interval, a peak detection window time length is obtained;
[0167] Retaining the candidate J peak corresponding to the maximum peak value within the peak detection window time length;
[0168] Eliminating peaks with body motion interference from the retained candidate J peaks;
[0169] Determine whether the peak amplitude of the retained candidate J peak is greater than the first preset peak amplitude and less than the second preset peak amplitude. If so, retain it; otherwise, remove it.
[0170] In one embodiment of the present application, the heart rate detection unit 50 is further configured to:
[0171] performing differential processing on the target J peak position array to obtain a JJ interval array;
[0172] determining a second average JJ interval based on the JJ interval array;
[0173] determining a relative deviation between the second average JJ interval and the first average JJ interval;
[0174] If the relative deviation is less than the preset threshold, the heart rate and heart rate variability are calculated based on the second average JJ interval.
[0175] In the embodiment of the present application, by converting the BCG signal into an AMDF curve and utilizing its sensitive characteristics to the periodicity of the signal, the JJ interval is accurately located, avoiding errors caused by individual J wave morphological differences. Compared with the traditional time domain method, the accurate J wave position can be obtained more stably, thereby significantly improving the accuracy of heart rate detection. The first average JJ interval is determined based on the AMDF curve, and then the envelope signal is obtained by combining the filtering process, which reduces the complex frequency domain transformation and a large number of calculation processes, effectively reduces the computational complexity, improves the detection efficiency, and is more suitable for application in embedded devices. The signal periodicity characteristics are dynamically analyzed by the AMDF curve, combined with adaptive filtering processing, and can adapt to BCG signals of different forms, avoiding the detection failure problem caused by individual differences in traditional methods. Moreover, to a certain extent, it can provide a reliable basis for disease warning, health management, etc., greatly improving the intelligent level of health monitoring.
[0176] For the specific limitations of the heart rate detection device based on the cardiac ballistic signal, please refer to the limitations of the heart rate detection method based on the cardiac ballistic signal above, which will not be repeated here. The various modules in the above-mentioned heart rate detection device based on the cardiac ballistic signal can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0177] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer-readable instructions are executed by the processor, a heart rate detection method based on a cardiac shock signal is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0178] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the heart rate detection method based on the cardiac impact signal as described above are implemented.
[0179] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the heart rate detection method based on the cardiac ballistic signal are implemented.
[0180] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include processes in the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0181] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0182] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A heart rate detection method based on a heartbeat signal, characterized in that: The method comprises: Acquiring a cardiac shock signal and preprocessing the cardiac shock signal; Converting the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determining a first average JJ interval based on the short-time average amplitude difference curve; Based on the first average JJ interval, filtering the preprocessed ballistocardial signal to obtain an envelope signal; Performing peak detection on the envelope signal to obtain a target J peak; Based on the target J-peak, heart rate and heart rate variability are determined.
2. The heart rate detection method based on the heartbeat signal according to claim 1, wherein: After obtaining the cardiac shock signal and preprocessing the cardiac shock signal, the method further includes: detecting whether the preprocessed ballistocardiographic signal has body motion interference; If body motion interference exists, it is marked in the ballistocardiographic signal.
3. The heart rate detection method based on the heartbeat signal according to claim 2, wherein: The detecting whether the pre-processed ballistocardiographic signal has body motion interference comprises: Splitting the preprocessed cardiac ballistic signal into a plurality of cardiac ballistic signal segments; Determine the variance corresponding to each cardiac ballistic signal segment; determining the number of cardiac ballistoic signal segments having amplitudes greater than a preset amplitude threshold; Based on the variance and the number of cardiac ballistic signal segments, it is determined whether the preprocessed cardiac ballistic signal has body motion interference.
4. The heart rate detection method based on the heartbeat signal according to claim 1, wherein: The converting the pre-processed ballistocardial signal into a short-time average amplitude difference curve, and determining a first average JJ interval based on the short-time average amplitude difference curve, comprises: Converting the pre-processed ballistocardial signal into a short-time average amplitude difference curve based on a short-time average amplitude difference function; Searching the short-time average amplitude difference curve for all troughs within a preset JJ interval and the corresponding index of each trough; Combine all the found troughs into a trough array; determining the first average JJ interval based on the index corresponding to the first trough in the trough array that meets a preset condition; The preset conditions include that the trough protrusion height exceeds a set threshold and the trough position is within a reasonable range of the JJ interval.
5. The heart rate detection method based on the heartbeat signal according to claim 1, wherein: The filtering process of the pre-processed ballistocardial signal based on the first average JJ interval to obtain an envelope signal includes: performing differential processing on the pre-processed ballistocardial signal; Based on the first average JJ interval, a filtering window time length is obtained; The ballistocardial signal after the difference processing is filtered using the filtering window time length to obtain the envelope signal.
6. The heart rate detection method based on the heartbeat signal according to claim 1, wherein: The performing peak detection on the envelope signal to obtain a target J peak includes: Determine all peaks in the envelope signal and use all peaks as candidate J peaks; Based on the signal quality and the first average JJ interval, pseudo J peaks are eliminated from the candidate J peaks to obtain the target J peak.
7. The heart rate detection method based on the heartbeat signal according to claim 6, wherein: Eliminating pseudo J peaks from the candidate J peaks based on the signal quality and the first average JJ interval includes: Based on the first average JJ interval, a peak detection window time length is obtained; Retaining the candidate J peak corresponding to the maximum peak value within the peak detection window time length; Determine whether the peak amplitude of the retained candidate J peak is greater than the first preset peak amplitude and less than the second preset peak amplitude, if so, retain it, otherwise, eliminate it; and Peaks with body motion interference are eliminated from the retained candidate J peaks.
8. The heart rate detection method based on the heartbeat signal according to any one of claims 1 to 7, characterized in that: The determining of the heart rate and heart rate variability based on the target J peak includes: performing differential processing on the target J peak position array to obtain a JJ interval array; determining a second average JJ interval based on the JJ interval array; determining a relative deviation between the second average JJ interval and the first average JJ interval; If the relative deviation is less than the preset threshold, the heart rate and heart rate variability are calculated based on the second average JJ interval.
9. A heart rate detection device based on a heartbeat signal, characterized in that: The device comprises: a signal preprocessing unit, configured to obtain a ballistocardiogram signal and preprocess the ballistocardiogram signal; a first average JJ interval determining unit, configured to convert the preprocessed ballistocardial signal into a short-time average amplitude difference curve, and determine a first average JJ interval based on the short-time average amplitude difference curve; an envelope signal acquiring unit, configured to filter the preprocessed ballistocardial signal based on the first average JJ interval to obtain an envelope signal; a target J-peak determining unit, configured to perform peak detection on the envelope signal to obtain a target J-peak; A heart rate detection unit is used to determine the heart rate and heart rate variability based on the target J peak.
10. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the heart rate detection method based on the heart ballistic signal are implemented as described in any one of claims 1 to 8.
Citation Information
Cited By
Anti-reverberation sound source positioning method, device, equipment and medium
CN121522573A