Heart rate and heart rate variability feature extraction method and system based on electrocardiosignal
By using a method for extracting heart rate and heart rate variability features based on electrocardiogram signals, the problem of short-range and real-time monitoring in existing technologies is solved. This method enables simultaneous extraction and dynamic monitoring of multiple indicators, and supports real-time display and offline analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AEROSPACE LIFE SUPPORT IND LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-07-03
AI Technical Summary
Existing HRV analysis methods are insufficient to meet the needs of short-range, sliding, or real-time monitoring, lack the ability to extract multiple indicators simultaneously, and lack modular design and online update capabilities.
A heart rate and heart rate variability feature extraction method based on electrocardiogram signals is adopted. The signal is preprocessed, R peaks are detected, NN interval sequences are calculated, time windows are set, and various feature indicators are extracted and the changing trends are displayed in real time or offline.
It meets the needs of dynamic monitoring, can extract multiple heart rate and heart rate variability features within a short time window, supports real-time display and offline analysis, and is adaptable to rapid physiological change monitoring in scenarios such as exercise and emotional fluctuations.
Smart Images

Figure SMS_2 
Figure SMS_5 
Figure SMS_8
Abstract
Description
Technical Field
[0001] This invention belongs to the field of physiological characteristic monitoring, specifically relating to a method and system for extracting heart rate and heart rate variability features based on electrocardiogram signals. Background Technology
[0002] Electrocardiogram (ECG) signals are important physiological parameters of a person's condition. Heart rate (HR) and heart rate variability (HRV) can assess autonomic nervous system (ANS) activity and human health status. Existing HRV analysis methods generally follow international standards, detecting R-peaks in the acquired ECG signals and calculating standard time-domain and frequency-domain indices. However, existing HRV analysis methods mostly rely on fixed 5-minute long-term HRV analyses, which are insufficient for short-term, sliding, or real-time monitoring needs. For example, in scenarios such as exercise, emotional fluctuations, or brief stress, shorter analysis windows are required to capture rapid physiological changes. Furthermore, existing HRV analysis methods only support one type of time-domain or frequency-domain indices, lacking simultaneous extraction of multiple indices. Moreover, most existing HRV analysis methods are single offline analysis modes, lacking configurable modular designs and the ability to display trends or update online. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for extracting heart rate and heart rate variability features based on electrocardiogram (ECG) signals. This application is adapted to the needs of dynamic monitoring and can jointly calculate multiple types of feature indicators.
[0004] The technical solution adopted in this invention is: A method for extracting heart rate and heart rate variability features based on electrocardiogram (ECG) signals includes the following steps: S1) Acquire ECG signals and perform preprocessing to improve the accuracy of subsequent R-peak detection; S2) Perform R-peak detection: Locate the R-peak in the preprocessed ECG signal, calculate the continuous RR interval sequence, and identify, interpolate, or remove outliers in the RR interval sequence to obtain the NN interval sequence; S3) Set a time window and calculate the characteristic indicators of heart rate and heart rate variability based on the NN interval sequence: the time window is set to a standard duration of 5 minutes or a short duration of 1-2 minutes; calculate the instantaneous heart rate and the average heart rate within the time window; extract the time domain indicators and frequency domain indicators of heart rate variability. The time domain indicators include the standard deviation of all NN intervals SDNN and the root mean square of the difference between adjacent NN intervals RMSSD. The frequency domain indicators include low-frequency power LF, high-frequency power HF and the LF / HF ratio. S4) Feature Output and Dynamic Display: Output heart rate and heart rate variability feature indicators at predetermined time intervals and form time series data, display the trend of change in real time or perform offline analysis.
[0005] Preferably, in step S1), the preprocessing method is to use a Butterworth bandpass filter of 0.5 Hz to 20 Hz to eliminate high-frequency noise and baseline drift.
[0006] Preferably, in step S2), the Pan-Tompkins algorithm or the differential + threshold method is used to locate the R peak.
[0007] Preferably, in step S2), the abnormal value is caused by premature beats or missing R peaks.
[0008] Preferably, in step S3), the instantaneous heart rate The formula for calculation is:
[0009] in, The time interval between adjacent R peaks, in times per minute; Average heart rate is the instantaneous heart rate within a set time window. The average value.
[0010] Preferably, in step S3), the standard deviation SDNN of all NN intervals is calculated as follows:
[0011] Where n is the number of N-N intervals. For the i-th N-th interval, This represents the average value of the N-N interval.
[0012] Preferably, in step S3), the root mean square (RMSSD) of the period difference between adjacent N and N intervals is calculated as follows:
[0013] Where n is the number of N-N intervals. For the (i+1)th NN interval, Let be the i-th NN interval.
[0014] Preferably, in step S3), the low-frequency power LF ranges from 0.04 Hz to 0.15 Hz and the high-frequency power HF ranges from 0.15 Hz to 0.40 Hz.
[0015] Preferably, in step S4), the predetermined time interval is 5 seconds.
[0016] A system for extracting heart rate and heart rate variability features based on electrocardiogram (ECG) signals includes: The signal acquisition and preprocessing module is used to acquire the raw electrocardiogram signal and perform filtering to eliminate high-frequency noise and baseline drift. The R-peak detection module is used to locate the R-peak in the preprocessed ECG signal, calculate the continuous RR interval sequence, and identify, interpolate, or remove outliers in the RR interval sequence to obtain the NN interval sequence. The time window setting module is used to select and set a time window of 5 minutes or 1-2 minutes short duration. The feature index calculation module is used to calculate the feature indexes of heart rate and heart rate variability based on the NN interval sequence. The heart rate feature indexes include instantaneous heart rate and average heart rate within the time window. The heart rate variability feature indexes include time domain indexes and frequency domain indexes. The time domain indexes include the standard deviation of all NN intervals SDNN and the root mean square difference of adjacent NN intervals RMSSD. The frequency domain indexes include low frequency power LF, high frequency power HF and LF / HF ratio. The output and display module is used to output characteristic indicators of heart rate and heart rate variability at predetermined time intervals and form time series data, displaying the changing trend in real time or performing offline analysis.
[0017] The beneficial effects of this invention are: This application allows users to select and set standard or short-duration analysis windows to meet dynamic monitoring needs; it can jointly calculate various characteristic indicators such as instantaneous heart rate, average heart rate, SDNN, RMSSD, low-frequency power (LF), high-frequency power (HF), and LF / HF ratio; and it can display trends in real time or perform offline analysis to meet dynamic monitoring needs. Detailed Implementation
[0018] The present application will be further described below with reference to the embodiments.
[0019] Example 1 This embodiment discloses a method for extracting heart rate and heart rate variability features based on electrocardiogram signals, including the following steps: S1) Acquire electrocardiogram signals and perform preprocessing to improve the accuracy of subsequent R-peak detection. Preferably, the preprocessing method is to use a Butterworth bandpass filter of 0.5 Hz to 20 Hz to eliminate high-frequency noise (e.g., electromyographic interference) and baseline drift.
[0020] S2) R-peak detection The R-peak of the preprocessed ECG signal is located, a continuous RR interval sequence is calculated, and outliers in the RR interval sequence are identified, interpolated, or removed to obtain the NN interval sequence.
[0021] Preferably, the Pan-Tompkins algorithm or the differential + threshold method is used for R-peak localization.
[0022] Preferably, the outlier is caused by premature beats or missing R peaks.
[0023] S3) Set a time window and calculate characteristic indicators of heart rate and heart rate variability based on the NN interval sequence. The time window is set to a standard duration of 5 minutes or a short duration of 1-2 minutes; the instantaneous heart rate and the average heart rate within the time window are calculated; the time-domain and frequency-domain indicators of heart rate variability are extracted. The time-domain indicators include the standard deviation of all NN intervals (SDNN, used to assess total heart rate variability) and the root mean square of successive differences (RMSSD, used to assess parasympathetic activity). The frequency-domain indicators include low-frequency power (LF), high-frequency power (HF), and the LF / HF ratio (the LF / HF ratio is used to assess the balance between sympathetic and parasympathetic activity).
[0024] Preferably, instantaneous heart rate The formula for calculation is:
[0025] in, The time interval between adjacent R peaks, in times per minute; Average heart rate is the instantaneous heart rate within a set time window. The average value.
[0026] Preferably, the standard deviation of all NN intervals, SDNN, is calculated as follows:
[0027] Where n is the number of N-N intervals. For the i-th N-th interval, This represents the average value of the N-N interval.
[0028] Preferably, the root mean square SD of the period difference between adjacent N and N intervals is calculated as follows:
[0029] Where n is the number of N-N intervals. For the (i+1)th NN interval, Let be the i-th NN interval.
[0030] Preferably, the low-frequency power LF ranges from 0.04 Hz to 0.15 Hz and the high-frequency power HF ranges from 0.15 Hz to 0.40 Hz.
[0031] S4) Feature Output and Dynamic Display The system outputs characteristic indicators of heart rate and heart rate variability at predetermined time intervals to form time series data, and displays the changing trend in real time or performs offline analysis.
[0032] Preferably, the predetermined time interval is 5 seconds.
[0033] Example 2 A system for extracting heart rate and heart rate variability features based on electrocardiogram (ECG) signals includes a signal acquisition and preprocessing module, an R-peak detection module, a time window setting module, a feature index calculation module, and an output and display module. The signal acquisition and preprocessing module acquires the raw ECG signal and filters it to eliminate high-frequency noise and baseline drift. The R-peak detection module locates the R-peak in the preprocessed ECG signal, calculates a continuous RR interval sequence, and identifies, interpolates, or removes outliers in the RR interval sequence to obtain the NN interval sequence. The time window setting module allows you to select a time window with a standard duration of 5 minutes or a short duration of 1-2 minutes. The feature index calculation module calculates feature indices of heart rate and heart rate variability based on the NN interval sequence. Heart rate feature indices include instantaneous heart rate and average heart rate within the time window. Heart rate variability feature indices include time-domain and frequency-domain indices. Time-domain indices include the standard deviation SDNN of all NN intervals and the root mean square difference RMSSD between adjacent NN intervals. Frequency-domain indices include low-frequency power LF, high-frequency power HF, and the LF / HF ratio. The output and display module outputs the feature indices of heart rate and heart rate variability at predetermined time intervals to form time-series data, displaying the trend in real time or performing offline analysis.
[0034] This application allows users to select and set standard or short-duration analysis windows to meet dynamic monitoring needs; it can jointly calculate various characteristic indicators such as instantaneous heart rate, average heart rate, SDNN, RMSSD, low-frequency power (LF), high-frequency power (HF), and LF / HF ratio; and it can display trends in real time or perform offline analysis to meet dynamic monitoring needs.
[0035] The embodiments described above are some, but not all, of the embodiments of this application. The detailed description of the embodiments of this application is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
Claims
1. A heart rate and heart rate variability feature extraction method based on electrocardiogram signals, characterized by, Includes the following steps: S1) Acquire ECG signals and perform preprocessing to improve the accuracy of subsequent R-peak detection; S2) Perform R-peak detection: Locate the R-peak in the preprocessed ECG signal, calculate the continuous RR interval sequence, and identify, interpolate, or remove outliers in the RR interval sequence to obtain the NN interval sequence; S3) Set a time window and calculate the characteristic indicators of heart rate and heart rate variability based on the NN interval sequence: the time window is set to a standard duration of 5 minutes or a short duration of 1-2 minutes; calculate the instantaneous heart rate and the average heart rate within the time window; Extract time-domain and frequency-domain metrics of heart rate variability. The time-domain metrics include the standard deviation of all NN intervals SDNN and the root mean square of the difference between adjacent NN intervals RMSSD. The frequency-domain metrics include low-frequency power LF, high-frequency power HF, and the LF / HF ratio. S4) Feature Output and Dynamic Display: Output heart rate and heart rate variability feature indicators at predetermined time intervals and form time series data, display the trend of change in real time or perform offline analysis.
2. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that: In step S1), the preprocessing method is to use a Butterworth bandpass filter from 0.5 Hz to 20 Hz to eliminate high-frequency noise and baseline drift.
3. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that: In step S2), the Pan-Tompkins algorithm or the differential + threshold method is used to locate the R peak.
4. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that: In step S2), the abnormal value is caused by premature beats or missing R peaks.
5. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that, In step S3), instantaneous heart rate The formula for calculation is: in, The time interval between adjacent R peaks, in times per minute; Average heart rate is the instantaneous heart rate within a set time window. The average value.
6. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that, In step S3), the standard deviation SDNN of all NN intervals is calculated as follows: Where n is the number of N-N intervals. For the i-th N-th interval, This represents the average value of the N-N interval.
7. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that, In step S3), the root mean square (RMSSD) of the period difference between adjacent N and N intervals is calculated as follows: Where n is the number of N-N intervals. For the (i+1)th NN interval, Let be the i-th NN interval.
8. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that: In step S3), the low-frequency power LF ranges from 0.04 Hz to 0.15 Hz, and the high-frequency power HF ranges from 0.15 Hz to 0.40 Hz.
9. The method for extracting heart rate and heart rate variability features based on electrocardiogram signals as described in claim 1, characterized in that: In step S4), the predetermined time interval is 5 seconds.
10. A system for extracting heart rate and heart rate variability features based on electrocardiogram (ECG) signals, characterized in that, include: The signal acquisition and preprocessing module is used to acquire the raw electrocardiogram signal and perform filtering to eliminate high-frequency noise and baseline drift. The R-peak detection module is used to locate the R-peak in the preprocessed ECG signal, calculate the continuous RR interval sequence, and identify, interpolate, or remove outliers in the RR interval sequence to obtain the NN interval sequence. The time window setting module is used to select and set a time window of 5 minutes or 1-2 minutes short duration. The feature index calculation module is used to calculate the feature indexes of heart rate and heart rate variability based on the NN interval sequence. The heart rate feature indexes include instantaneous heart rate and average heart rate within the time window. The heart rate variability feature indexes include time domain indexes and frequency domain indexes. The time domain indexes include the standard deviation of all NN intervals SDNN and the root mean square difference of adjacent NN intervals RMSSD. The frequency domain indexes include low frequency power LF, high frequency power HF and LF / HF ratio. The output and display module is used to output characteristic indicators of heart rate and heart rate variability at predetermined time intervals and form time series data, displaying the changing trend in real time or performing offline analysis.