ECG Algorithm

Humans have conducted research on the electrocardiogram for nearly a hundred years, summarizing the correlation between the electrocardiogram and heart-related diseases. The ECG algorithm is to calculate and analyze the ECG data collected by the ECG hardware acquisition device. Based on the analysis ability of the computer, it can identify the potential risks of the human heart.

After decades of development of ECG algorithm, as computing power becomes stronger and stronger, the accuracy of ECG analysis is gradually improving.

The main analysis processes of the ECG algorithm are as follows:

1) Filtering to baseline ECG algorithm

Calculate the baseline drift value and remove the baseline drift in the ECG waveform.

2) QRS wave algorithm

QRS complex inspection, RR interval, and real-time heart rate calculation.

3) Atrial fibrillation analysis

Detect the start, end, and duration of each occurrence of atrial fibrillation.

4) HRV analysis algorithm

Time-domain analysis, SDNN\SDSD\RMSSD\PNN50, etc.; frequency domain analysis, high frequency, low frequency, and over frequency, etc.

5) R wave classification algorithm

Normal, ventricular early, long pause, escape beat, and RonT.

6) Analysis of joint law types

Single ventricular premature, paired ventricular premature, ventricular double rhythm, supraventricular triple rhythm, arrest, atrial fibrillation, arrhythmia, tachycardia, and bradycardia.


ECG algorithm HRV analysis

Medical-grade ECG, blood oxygen, blood pressure, heart rate four-in-one module solution, ECG+PPG ECG and blood oxygen module solution, ECG watch solution

ECG algorithm related standards

a) AHA, MIT, NST, CU standard database indicators required by YY0885-2013;

b) AHA, MIT, NST, CU, ESC standard database indicators required by IEC60601-2-47

Description of other indicators of the algorithm

Heart rate

The heart rate is related to a person’s age, gender, and health. For adults, generally the lower the heart rate, the stronger the heart function.

However, a low heart rate may also be a sign of an abnormal heart. This algorithm divides the resting heart rate into the following categories according to the user’s age and gender: athlete, excellent, good, above average, average, below average, bad.

Note: This algorithm is only applicable to people with normal hearts.

Heart age

The algorithm uses the user’s actual physical age as the basis and calculates the “heart age” value based on the user’s cardiac parameter values ​​(such as heart rate and heart rate variability) compared with data from population studies.

Heart vitality

Heart vitality is a comprehensive analysis of human heart rate variability.

Heart rate variability is closely related to heart health. Many large-scale clinical studies have consistently found that as age increases, the heart rate variability rate gradually decreases.

Lack of exercise or smoking can also cause a decrease in heart rate variability. When the heart rate variability is very low, the risk of heart attack increases.

Keep your heart in a young and healthy state through reasonable exercise and a healthy lifestyle.

Furthermore, it is possible to calculate the heart rate variability of the user and the population of which age is equivalent by comparing the data of the user and the crowd.

When the heart rate variability rate is low, the algorithm prompts the user that a low heart rate variability rate is related to a high risk of a heart attack.

It is recommended that users take measurements under different conditions every day. For example, users can take measurements after waking up, after meals, after exercise, and before going to bed to obtain comprehensive indicators and more complete data analysis.

Sentiment index

The emotion algorithm is based on analyzing the user’s ECG measurement over a period of time. The measurement period is at least 30 seconds, preferably one minute, and more than one hour is the best. Each person’s heart rate and heart rate variability are controlled by the combination of sympathetic and parasympathetic nerves of the person’s autonomic nervous system (ANS).

The algorithm measures the relationship between high-frequency heart rate variability and low-frequency heart rate variability. High-frequency heart rate variability is related to the parasympathetic nerve activity of ANS, while low-frequency heart rate variability is related to sympathetic nerve activity. Some researchers associate parasympathetic activity with relaxation and tension sympathetic activity.

The algorithm returns the “emotion” level, ranging from 1 to 100. High values ​​tend to indicate stress or fatigue or “tension/excitement” emotions, and low values ​​tend to indicate a relaxed/calm state.


Stress index

The stress index is to obtain the current body pressure value through the heart rate contained in the ECG signal and the correlation between the heart rate variability and the body pressure. A lot of scientific research has concluded that the heart rate and heart rate variability information contained in the ECG signal is directly related to the body pressure. Further research has also shown that the degree of physical stress is also reflected in the high and low-frequency components of the heart rate variability.

The stress index algorithm was developed on the basis of these scientific discoveries and conducted long-term and large numbers of follow-up studies through people of different ages and genders, and rigorously verified using standard tests commonly used in academia.
The pressure index algorithm can monitor and track current pressure (precise pressure) and long-term pressure (pressure trend).


HRV heart rate variability


The algorithm uses a value from 1 to 100 to represent the user’s HRV heart rate variability health status index. A low value represents a state of calm and relaxation, and a high value represents a state of excitement or tension. The system can suggest that the user try to maintain a high-value state and stay away from sub-health.

Our heartbeat is controlled by the autonomic nervous system. The autonomic nervous system is the control center of the body’s organs, in charge of metabolism, breathing, cardiovascular, digestion, hormones, and the immune system.

The two major branches of the autonomic nervous system include the sympathetic (excitation) and parasympathetic (relaxation) systems. The sympathetic nerve is stimulated by fear, stress, coffee, or other exciting factors, which makes our heart beat faster, blood pressure rises, and gastrointestinal peristalsis slows down to mobilize the energy of the whole body to cope with stressful activities.

The role of the parasympathetic nervous system is opposite to that of the sympathetic nervous system. It saves the body’s energy consumption by slowing down the heartbeat and lowering blood pressure while promoting the secretion of the digestive glands and the activity of the immune system.

The long-term excitement of the sympathetic nervous system can inhibit human immune function, leading to the emergence of sub-health state and even disease. The parasympathetic nervous system helps the body rest and recover.

After monitoring by the ECG monitoring bracelet or watch of the ECG chip, the collected data will generate a report through the professional ECG algorithm.

The report will show the monitor’s HRV heart rate variability (heart rate variability, HRV), the average heart rate value.

Heart rate variability (HRV) reflects the activity of the autonomic nervous system and quantitatively evaluates the tension and balance of the cardiac sympathetic nerve and vagus nerve, so as to determine its condition and prevention of cardiovascular disease.

It may be used to predict sudden cardiac death and arrhythmic events A valuable indicator.

HRV Heart Rate Variability Analysis

Heart rate variability (HRV) refers to the phenomenon that the RR interval fluctuates from heartbeat to heartbeat. The mechanism is the coordination of sympathetic nerves and vagus nerves to control the pacing of the sinus node. The rules change.

The heart rate variability signal contains a lot of information about cardiovascular control and body fluid regulation. Extracting and analyzing this information can quantitatively evaluate the balance of the sympathetic nerve and the vagus nerve.

The mechanism and significance of HRV

The production of HRV is mainly due to the regulation of the sympathetic and vagus nerve, nerve center, baroreflex, respiratory activity, and other factors of the autonomic activity of the sinus node of the heart, which makes the heartbeat interval generally have a difference of tens of milliseconds.

In the resting state, the electrocardiogram of normal people shows periodic changes in the RR interval, and sinus arrhythmia is caused by the vagus nerve response fluctuations mediated by different phases of breathing.

This causes the heart rate to increase during inhalation and slow down during exhalation. Many other factors can also cause changes in heart rate, such as body position, body temperature, catecholamines in blood circulation, endocrine hormones, nutrition, environment, drugs, various diseases, etc., all affect heart rate.

Due to extensive and in-depth research on the physiological and pathological significance of HRV, the results show that the heart rate variability signal contains important information about cardiovascular regulation.

The analysis of HRV can indirectly quantitatively evaluate myocardial sympathy, vagus nerve tension, and balance. It can also analyze the activity of the autonomic nervous system. In a variety of cardiovascular diseases, the heart rate variability of patients has a tendency to decrease.

Heart rate variability can also be used as an independent predictor of the risk of sudden cardiac death. Heart rate variability analysis has a guiding role in the prognostic judgment of a variety of malignant arrhythmias and the analysis of drug treatment effects.

In short, the physiological basis of HRV is attributed to the sympathetic and vagus nervous system, among which the vagus nerve plays a major decisive role in HRV.

Therefore, when the vagus nerve function is healthy, the degree of heart rate variability is large, and when the vagus nerve function is impaired, the degree of heart rate variability is small.

HRV analysis method

The ECG signal analyzed by HRV has long and short. The short-term is only 5 minutes, and the longest is 1 hour; the long-term can reach 24-48 hours. Recording can be performed in different body positions (supine, inclined, upright, or inverted position) and movements (calm breathing, deep breathing, Valsalva movements, exercise).

The current methods of HRV analysis are time-domain analysis and frequency-domain analysis. The time-domain analysis uses mathematical statistics to measure HRV in the time domain, including simple and statistical methods.

The principle of frequency-domain or spectrum analysis is to combine The randomly changing RR interval or instantaneous heart rate signal is decomposed into a variety of frequency domain components of different energy for analysis, which can simultaneously evaluate the level of cardiac sympathetic and vagus nerve activity.

The above two analysis methods are linear analysis methods, and the biological processes in the human body are non-linear processes. For this reason, a third analysis method is proposed, that is, the non-linear (chaotic) analysis method is used to describe the heart rate variability. characteristic.

Time-domain analysis method-R-R interval histogram

The R-R interval of the electrocardiogram is quite different when an arrhythmia occurs. Even in sinus rhythm, there are certain fluctuations due to the influence of activity and body fluid factors.

Analyzing the changes in the R-R interval of the ECG can provide a lot of psychological and physiological information. The shape of the histogram can reflect the size of the HRV. When the R-R interval histogram is high and narrow, the HRV is small, and when the R-R interval histogram is low and wide, the HRV is large.

Comparative analysis of HRV heart rate variability

Time-domain method: Four detection indicators: SDNN, HRV triangle index, SDANN, RMSSD

SDNN and HRV triangle index are used to evaluate the overall change in heart rate: SDANN is used to evaluate the long-term slow change component of the heart rate change; RMSSD reflects the size of the fast change in heart rate.

·SDNN: Standard deviation, that is, the standard deviation of all NN intervals, in ms.

· HRV triangle index: the total number of NN intervals divided by the height of the histogram of NN intervals. When calculating the NN interval histogram, the standard of the abscissa scale interval is 7.8125ms (1/128s), which is dimensionless.

·SDANN: All recorded NN intervals, according to the time sequence of the record, every 5 minutes as a time period, continuously divided into several time periods (such as 24 hours, a total of 288), first calculate the time period of every 5 minutes The average value of the inner NN interval, and then calculate the standard deviation of these several average values, the unit is ms.

RMSSD: The root means the square value of the difference between adjacent NN intervals throughout the entire process, in ms.

Frequency domain analysis

The frequency-domain analysis of heart rate variability is to analyze the law of heart rate changes from another angle, that is, from the angle of spectrum analysis. It is not only related to time-domain analysis but also reveals more complicated changes in heart rate.

The frequency-domain analysis method is to perform a fast Fourier transform (FFT) or autoregressive parameter model method (AR) operation on a relatively stable RR interval or instantaneous heart rate variability signal (usually greater than 256 heartbeat points) to obtain the frequency (Hz) ) Is the abscissa, and the power spectrum density is the ordinate power spectrum for analysis.

HRV spectrogram

Nonlinear (chaotic) analysis of heart rate variability-RR interval scatter plot

The RR interval scatters plot is also called Lorenz Plot or Poincare Plot, which reflects the changes of adjacent RR intervals.

ECG scatter plots of different sinus rhythms

The shape of the Poincare scatter chart directly reflects the characteristics of the instantaneous heart rate change curve. Taking a normal comet-shaped scatter chart as an example, the scatter points are mostly concentrated near a straight line at a 45-degree angle in the figure.

This shows that the RR intervals of adjacent sinus heartbeats in normal people are roughly equal, but spread around the 45-degree line, indicating that normal people have sinus arrhythmia.

When the heart rate is slow (corresponding to a longer RR interval, that is, the upper part of the scatter graph) sinus arrhythmia increases and the lower end of the scatter graph (corresponding to a fast heart rate) the scatter graph is narrower, indicating that when the heart rate increases, Sinus arrhythmia is reduced, these conclusions are consistent with clinical phenomena.

Scatter plots of common clinical arrhythmia

Take a torpedo-shaped scatter chart as an example. Its length in the direction of the 45-degree line is short, and its width in the direction perpendicular to the 45-degree line is also narrow. This shows that when a torpedo-like scatter chart is presented, both the average heart rate change within 24 hours or the rapid change of the instantaneous heart rate are small, that is, the heart rate variability is low.

Please contact us to discuss the ECG algorithm, or go shopping for some creative and innovative products on HIFCARE.