










技术领域Technical Field
本发明涉及心电信号处理方法、心电信号处理装置、计算机可读存储介质以及计算机程序产品。The invention relates to an electrocardiogram signal processing method, an electrocardiogram signal processing device, a computer-readable storage medium and a computer program product.
背景技术Background Art
以往存在一种获取生物体的心电信号(Electrocardiogram)的方法,该方法通过在一些可穿戴设备上或者与人体间接接触的装置(例如汽车的座位等)上设置的多个传感器隔着衣服而获取生物体的心电信号。In the past, there was a method for obtaining the electrocardiogram (Electrocardiogram) of a living body. This method obtains the electrocardiogram (Electrocardiogram) of a living body through clothes by installing multiple sensors on some wearable devices or devices that are in indirect contact with the human body (such as car seats, etc.).
但是,由于传感器(例如,电容式的非接触传感器)的电极不与生物体的皮肤直接接触,在使用中容易受到各种噪声的干扰。例如,对于在汽车的座椅上设置了多个电容式非接触传感器的情况下,由于人的坐姿的不同,有时上述多个传感器中的一部分传感器不与身体接触或处于接触不良的状态,有时座椅、衣服、生物体之间的互相摩擦还会引起静电干扰。对于不与身体接触或处于接触不良状态的传感器而言,通过电极获得的检测信号中可能只含有噪声(不包含任何心电信号),也可能在心电信号中包含了不同种类及程度的噪声。However, since the electrodes of sensors (e.g., capacitive non-contact sensors) are not in direct contact with the skin of a living body, they are easily interfered by various noises during use. For example, when multiple capacitive non-contact sensors are installed on a car seat, due to different sitting postures of people, sometimes some of the multiple sensors are not in contact with the body or are in a poor contact state, and sometimes the mutual friction between the seat, clothes, and the living body can cause static interference. For sensors that are not in contact with the body or are in a poor contact state, the detection signal obtained through the electrode may contain only noise (not including any ECG signal), or the ECG signal may contain noise of different types and degrees.
针对上述情况,优选在对检测信号进行分析处理之前判断信号的噪声程度,仅在信噪比(S/N或SNR)高时进行后续的处理,从而能够得到更加正确的心电分析结果。由于存在传感器一边工作一边执行检测信号的分析处理的情况,在该情况下需要实时地判断信号的S/N。通常,通过判断信号的周期性来估计信号的S/N,因此如何检测信号的周期性是非常重要的。作为检测心电信号的周期性的方法有计算自相关函数(autocorrelation)的方法。在自相关函数的计算结果中存在显著的峰值的情况下,认为信号是周期性的,而且该峰值的位置与信号周期一致。In view of the above situation, it is preferred to judge the noise level of the signal before analyzing and processing the detection signal, and perform subsequent processing only when the signal-to-noise ratio (S/N or SNR) is high, so as to obtain more accurate ECG analysis results. Since there is a situation where the sensor performs analysis and processing of the detection signal while working, it is necessary to judge the S/N of the signal in real time in this case. Usually, the S/N of the signal is estimated by judging the periodicity of the signal, so how to detect the periodicity of the signal is very important. As a method for detecting the periodicity of the ECG signal, there is a method of calculating the autocorrelation function. When there is a significant peak in the calculation result of the autocorrelation function, it is considered that the signal is periodic, and the position of the peak is consistent with the signal period.
但是,在自相关函数的计算过程中发现,由于有的检测信号可能只含有噪声(不包含任何心电信号)或者在心电信号中包含了不同种类及程度的噪声,因此存在计算结果中不存在显著的峰值的问题,或者虽然存在显著的峰值但该峰值的位置与信号周期不一致的问题。However, during the calculation of the autocorrelation function, it was found that some detection signals may only contain noise (not including any ECG signals) or the ECG signals may contain noise of different types and degrees. Therefore, there is a problem of no significant peak in the calculation results, or although there is a significant peak, the position of the peak is inconsistent with the signal period.
此外,通常每规定时间(例如每1秒)对来自传感器的信号数据流进行一次处理,在一次处理的信号长度需要限制在数秒以内(例如每次处理最近的三秒以内的信号)。限制信号长度是为了使该计算程序在低性能的嵌入式处理器上也能够运行,从而增加该处理方法的应用范围。如果每次处理的信号长度越长,处理时间也会变长,对于存储器的需求也会变大。此外,在传感器的电极没有固定在身体上的情况下,噪声的发生率高。人的心跳频率一般在0.5Hz到3Hz之间,噪声的频率比心跳频率大的可能性也高。实际上经常存在对信号时间长度短且噪声的频率比信号频率高的信号进行处理的情况。In addition, the signal data stream from the sensor is usually processed once every specified time (for example, every 1 second), and the length of the signal processed once needs to be limited to within a few seconds (for example, the signal within the last three seconds is processed each time). The signal length is limited so that the calculation program can also run on low-performance embedded processors, thereby increasing the application range of the processing method. If the length of the signal processed each time is longer, the processing time will also be longer, and the demand for memory will also increase. In addition, when the electrodes of the sensor are not fixed on the body, the incidence of noise is high. The human heart rate is generally between 0.5Hz and 3Hz, and the possibility that the frequency of noise is greater than the heart rate is also high. In fact, there are often situations where signals with short signal time length and higher noise frequency than signal frequency are processed.
在对信号时间长度短且噪声的频率比信号频率高的心电信号进行处理时,自相关函数的计算结果中显著峰值的位置偏离心电信号的周期,甚至与噪声的周期一致,因此无法准确地判断其周期性。由此,存在无法基于信号的周期性准确地过滤掉噪声大的信号、难以获得准确的心跳信息的问题。When processing ECG signals with short signal time length and higher noise frequency than signal frequency, the position of significant peak in the calculation result of autocorrelation function deviates from the period of ECG signal and even coincides with the period of noise, so its periodicity cannot be accurately determined. As a result, there is a problem that it is impossible to accurately filter out the signal with large noise based on the periodicity of the signal and it is difficult to obtain accurate heartbeat information.
发明内容Summary of the invention
鉴于上述问题,本发明提供一种能够准确地获得心跳信息的心电信号处理方法、心电信号处理装置、计算机可读存储介质以及计算机程序产品。In view of the above problems, the present invention provides an electrocardiogram signal processing method, an electrocardiogram signal processing device, a computer-readable storage medium and a computer program product, which can accurately obtain heartbeat information.
一种心电信号处理方法,其特征在于,包括:检测信号取得步骤,由传感器对生物体的心电信号进行检测而取得检测信号;信号预处理步骤,以规定时间长度将所述检测信号分割成多个分段信号,求出每个所述分段信号中所含多个信号的平均值,将所述分段信号中所含的每个信号样本点分别减去该分段信号的所述平均值而得到预处理信号;自相关计算步骤,计算所述预处理信号的自相关函数。A method for processing electrocardiogram signals, characterized in that it includes: a detection signal acquisition step, in which a sensor detects the electrocardiogram signal of a biological body to obtain a detection signal; a signal preprocessing step, in which the detection signal is divided into multiple segmented signals with a specified time length, the average value of the multiple signals contained in each segmented signal is calculated, and each signal sample point contained in the segmented signal is subtracted from the average value of the segmented signal to obtain a preprocessed signal; and an autocorrelation calculation step, in which the autocorrelation function of the preprocessed signal is calculated.
根据该心电信号处理方法,通过在计算自相关函数之前针对分段信号执行减平均值的处理,减小了自相关函数的计算结果逐渐衰减的趋势,突出了心电信号的波峰,从而能够准确地判断心电信号的周期性。进而,能够通过筛除掉不具有周期性的噪声大的信号来获得准确的心跳信息。According to the electrocardiogram signal processing method, by performing mean-subtraction processing on the segmented signal before calculating the autocorrelation function, the tendency of the calculation result of the autocorrelation function to gradually decay is reduced, and the peak of the electrocardiogram signal is highlighted, so that the periodicity of the electrocardiogram signal can be accurately determined. Furthermore, accurate heartbeat information can be obtained by filtering out the signal with large noise that does not have periodicity.
在上述心电信号处理方法中,在所述检测信号为连续信号x(t),所述分段信号为y(t),所述平均值为时,所述预处理信号为所述自相关函数为Rss(τ)的计算公式如下,In the above ECG signal processing method, the detection signal is a continuous signal x(t), the segmented signal is y(t), and the average value is When the preprocessed signal is The calculation formula of the autocorrelation function Rss (τ) is as follows:
Rss(τ)=∫0s(t)s(t+τ)dtRss (τ)=∫0 s(t)s(t+τ)dt
其中,t为积分变量,τ为延迟,T为预处理信号s(t)的时间长度。Where t is the integration variable, τ is the delay, and T is the time length of the preprocessed signal s(t).
由此,该心电信号处理方法能够应用于连续信号的自相关计算。Therefore, the ECG signal processing method can be applied to the autocorrelation calculation of continuous signals.
在上述心电信号处理方法中,在所述检测信号为按照固定频率fs采集的离散信号x[n],所述分段信号为y[n],所述平均值为时,所述预处理信号为所述自相关函数为Rss[m]的计算公式如下,In the above ECG signal processing method, the detection signal is a discrete signal x[n] collected at a fixed frequency fs, the segmented signal is y[n], and the average value is When the preprocessed signal is The calculation formula of the autocorrelation function Rss [m] is as follows,
其中,n是求和变量,m是平移量,L是所述预处理信号s[n]的信号长度,s[n]中n的取值范围是0≤n≤L-1。Wherein, n is the summation variable, m is the translation amount, L is the signal length of the preprocessed signal s[n], and the value range of n in s[n] is 0≤n≤L-1.
由此,该心电信号处理方法能够应用于离散信号的自相关计算。此外,上述式子中的L符合如下关系:L=fs·T,其中,T为所述分段信号y[n]的时间长度。Therefore, the ECG signal processing method can be applied to the autocorrelation calculation of discrete signals. In addition, L in the above formula meets the following relationship: L=fs·T, where T is the time length of the segmented signal y[n].
在上述心电信号处理方法中,还包括:信号周期性判断步骤,在所述自相关计算步骤之后,在每个所述分段信号所对应的自相关系数波形中搜索最高波峰,并计算所述最高波峰与前后相邻的其他波峰间的差值,所述差值代表信号与噪声的强度对比,在所述差值小于第一预定值时,将该分段信号认定为噪声并丢弃,其中所述自相关系数是对所述自相关函数进行归一化处理后而得到的值。The above-mentioned ECG signal processing method also includes: a signal periodicity judgment step. After the autocorrelation calculation step, the highest peak is searched in the autocorrelation coefficient waveform corresponding to each segmented signal, and the difference between the highest peak and other adjacent peaks is calculated. The difference represents the intensity comparison between the signal and the noise. When the difference is less than a first predetermined value, the segmented signal is identified as noise and discarded. The autocorrelation coefficient is a value obtained after normalizing the autocorrelation function.
在上述心电信号处理方法中,还包括:信号周期性判断步骤,在所述自相关计算步骤之后,在每个所述分段信号所对应的自相关系数波形中搜索最高波峰,并计算所述最高波峰与前后相邻的其他波峰间的差值,所述差值代表信号与噪声的强度对比,在所述差值大于等于第一预定值时,将该分段信号认定为有效,其中所述自相关系数是对所述自相关函数进行归一化处理后而得到的值。The above-mentioned ECG signal processing method also includes: a signal periodicity judgment step. After the autocorrelation calculation step, the highest peak is searched in the autocorrelation coefficient waveform corresponding to each segmented signal, and the difference between the highest peak and other adjacent peaks is calculated. The difference represents the intensity comparison between the signal and the noise. When the difference is greater than or equal to a first predetermined value, the segmented signal is deemed valid. The autocorrelation coefficient is a value obtained by normalizing the autocorrelation function.
根据该心电信号处理方法,针对每个分段信号所对应的自相关系数波形比较最高波峰与其余峰值,利用噪声的波峰差值与心电信号的波峰差值的区别,来确定各分段信号的可靠性。所述差值越大代表噪声越小,所述差值越小代表噪声越大,通过丢弃噪声大的分段信号能够筛选分段信号。进而,通过使用可靠性高的分段信号来进行后续的心跳信息的提取等处理,从而提高心电信号的处理结果的准确性。According to the ECG signal processing method, the highest peak and the remaining peaks are compared for the autocorrelation coefficient waveform corresponding to each segmented signal, and the difference between the peak difference of the noise and the peak difference of the ECG signal is used to determine the reliability of each segmented signal. The larger the difference, the smaller the noise, and the smaller the difference, the larger the noise. The segmented signals with large noise can be discarded to filter the segmented signals. Furthermore, by using the segmented signals with high reliability to perform subsequent processing such as extraction of heartbeat information, the accuracy of the processing results of the ECG signals can be improved.
在上述心电信号处理方法中,所述第一预定值设置为0.1。该第一预定值是基于噪声的波峰差值与心电信号的波峰差值的区别而预先设定的。In the above-mentioned ECG signal processing method, the first predetermined value is set to 0.1. The first predetermined value is preset based on the difference between the peak difference of the noise and the peak difference of the ECG signal.
在上述心电信号处理方法中,在所述信号周期性判断步骤中,根据每个所述自相关系数波形中的最高波峰所在的位置,计算该波形所对应的所述预处理信号的周期Ts,所述预处理信号的周期Ts与所述分段信号的周期Ty相同。In the above-mentioned ECG signal processing method, in the signal periodicity judgment step, the period Ts of the preprocessed signal corresponding to each autocorrelation coefficient waveform is calculated according to the position of the highest peak in the waveform, and the period Ts of the preprocessed signal is the same as the period Ty of the segmented signal.
由此,能够通过自相关系数波形中的最高波峰所在的位置来确定预处理信号的周期Ts以及分段信号的周期Ty。Thus, the period Ts of the preprocessing signal and the period Ty of the segmented signal can be determined by the position of the highest peak in the autocorrelation coefficient waveform.
在上述心电信号处理方法中,判断在所述信号周期性判断步骤中计算出的所述分段信号的周期Ty是否满足条件0.3s<Ty<1.5s,将不满足该条件的分段信号认定为噪声并丢弃。In the above ECG signal processing method, it is determined whether the period Ty of the segmented signal calculated in the signal periodicity determination step satisfies the condition 0.3s<Ty<1.5s, and the segmented signal that does not meet the condition is identified as noise and discarded.
根据该心电信号处理方法,能够利用心跳信号可能的周期范围0.3~1.5s来进一步排除噪声,由此能够进一步提高分段信号的可靠性。According to the electrocardiogram signal processing method, the possible period range of the heartbeat signal, 0.3 to 1.5 s, can be used to further eliminate noise, thereby further improving the reliability of the segmented signal.
在上述心电信号处理方法中,在所述信号周期性判断步骤中,计算多个连续的所述分段信号的周期Ty的样本方差S,在S<0.0052时,将该分段信号认定为噪声并丢弃。In the above ECG signal processing method, in the signal periodicity determination step, the sample variance S of the period Ty of a plurality of continuous segmented signals is calculated, and when S<0.0052 , the segmented signal is identified as noise and discarded.
根据该心电信号处理方法,能够使用固定频率的系统噪声的特性来进一步排除噪声,由此进一步提高分段信号的可靠性。According to the electrocardiographic signal processing method, the characteristics of the fixed-frequency system noise can be used to further eliminate the noise, thereby further improving the reliability of the segmented signal.
在上述心电信号处理方法中,所述规定时间长度T根据人体心跳可能的周期范围而设置,所述规定时间长度T为至少包含两个以上的心跳周期TR的长度。In the above-mentioned ECG signal processing method, the prescribed time length T is set according to the possible cycle range of the human heartbeat, and the prescribed time length T is a length that includes at least two or more heartbeat cyclesTR .
根据该心电信号处理方法,通过设定为每个分段信号中至少出现两周期的心跳信号,从而确保了计算后得到的自相关系数波形中的最高峰值与心电信号的周期一致。According to the electrocardiogram signal processing method, by setting each segmented signal to have at least two cycles of heartbeat signals, it is ensured that the highest peak value in the autocorrelation coefficient waveform obtained after calculation is consistent with the cycle of the electrocardiogram signal.
在上述心电信号处理方法中,所述规定时间长度T为满足3s≤T≤5s的任意数值。In the above-mentioned electrocardiogram signal processing method, the prescribed time length T is any value satisfying 3s≤T≤5s.
根据该心电信号处理方法,在一般情况下,考虑人的心跳周期低于1.5s,此时将规定时间长度T设为3s即可。即使考虑到非常极端的情况,人的心跳周期也不会超过2.5s,所以最高将规定时间长度T设为5s。According to the electrocardiogram signal processing method, in general, considering that the human heartbeat cycle is less than 1.5 seconds, the prescribed time length T can be set to 3 seconds. Even in extreme cases, the human heartbeat cycle will not exceed 2.5 seconds, so the maximum prescribed time length T is set to 5 seconds.
在上述心电信号处理方法中,在所述自相关计算步骤中,对所述预处理信号s[n]中所含的波峰进行提取,并且使得提取的所述波峰中的相邻的两个波峰之间的间隔大于等于规定时间间隔Ls,由此获得信号Sd;将上述信号Sd转化为方波计算上述方波的自相关函数In the above-mentioned ECG signal processing method, in the autocorrelation calculation step, the peaks contained in the preprocessed signal s[n] are extracted, and the interval between two adjacent peaks in the extracted peaks is greater than or equal to the specified time intervalLs , thereby obtaining a signalSd ; the above-mentioned signalSd is converted into a square wave Calculate the above square wave The autocorrelation function
根据该心电信号处理方法,与不进行转化方波的情况相比,大幅减少了自相关计算步骤的计算量、计算时间和内存开销等,而且在方波的自相关系数波形中几乎完全保留了自相关函数Rss[m]的与周期性有关的特征,从而能够在不降低准确性的情况下更加快速地判断心电信号的周期性。According to the electrocardiogram signal processing method, compared with the case where the square wave is not converted, the amount of calculation, calculation time and memory overhead of the autocorrelation calculation step are greatly reduced, and the square wave The autocorrelation coefficient waveform almost completely retains the periodicity-related characteristics of the autocorrelation function Rss [m], so that the periodicity of the ECG signal can be judged more quickly without reducing the accuracy.
在上述心电信号处理方法中,所述方波的幅宽Lp满足Lε<Lp<Ls/2,其中,Lε为大于0且大于最大周期差ΔTR的预定值(经验值),所述最大周期差ΔTR为在所述规定时间长度T内心跳周期TR之间可能出现的最大差异。此外,规定时间间隔Ls是规定时间长度T内的最小心跳周期。In the above-mentioned ECG signal processing method, the square wave The width Lp satisfies Lε <Lp <Ls /2, wherein Lε is a predetermined value (empirical value) greater than 0 and greater than a maximum cycle differenceΔTR , wherein the maximum cycle differenceΔTR is the maximum difference that may occur between the heartbeat cyclesTR within the specified time length T. In addition, the specified time interval Ls is the minimum heartbeat cycle within the specified time length T.
如果幅宽Lp小于等于预定值Lε,则可能会出现无论方波怎样平移,都不能同时满足规定时间长度T内的所有峰值互相重合,这样的结果会降低方波的自相关函数与预处理信号s[n]的自相关函数为Rss[m]之间的近似性。另一方面,如果幅宽Lp大于等于Ls/2,则平移后方波中的一个方波可能同时与方波中的两个以上的方波有重叠,这样会导致方波搜索变得复杂,继而增加了运算开销。If the width Lp is less than or equal to the predetermined value Lε , then the square wave may appear regardless of No matter how the translation is done, it is impossible to satisfy the requirement that all peaks within the specified time length T coincide with each other. This will result in a decrease in the square wave The autocorrelation function The autocorrelation function of the preprocessed signal s[n] is similar to Rss [m]. On the other hand, if the width Lp is greater than or equal to Ls /2, the square wave after translation A square wave in may be simultaneously There is overlap between two or more square waves in the image, which makes the square wave search complicated and increases the computational overhead.
根据该心电信号处理方法,由于基于与心跳周期TR相关的值来设定幅宽Lp的上限和下限,能够避免因幅宽Lp过窄而导致方波的自相关函数与预处理信号s[n]的自相关函数为Rss[m]之间的近似性降低,而且能够避免因幅宽Lp大于等于Ls/2而导致方波搜索变复杂、运算开销增加的情况。According to the electrocardiographic signal processing method, since the upper and lower limits of the widthLp are set based on the value related to the heartbeat cycleTR , the square wave caused by the widthLp being too narrow can be avoided. The autocorrelation function The approximation between the autocorrelation functionRss [m] of the preprocessed signal s[n] is reduced, and the situation in which the square wave search becomes complicated and the calculation cost increases due to the widthLp being greater than or equal toLs /2 can be avoided.
在上述心电信号处理方法中,所述幅宽Lp为0.06s<Lp<0.1s中的任意值。In the above electrocardiogram signal processing method, the width Lp is any value within the range of 0.06 s<Lp <0.1 s.
根据经验,预定值Lε一般为0.05秒,人的最小心跳周期(规定时间间隔Ls)一般为0.3秒。如果规定时间间隔Ls大于0.3秒,则在波峰提取的过程中可能出现漏掉部分波峰的情况。由此,0.06s<Lp<0.1s是基于经验值并且考虑了一定余量后的推荐值。According to experience, the predetermined value Lε is generally 0.05 seconds, and the minimum heartbeat cycle of a person (prescribed time interval Ls ) is generally 0.3 seconds. If the prescribed time interval Ls is greater than 0.3 seconds, some peaks may be missed during the peak extraction process. Therefore, 0.06s<Lp <0.1s is a recommended value based on experience and taking into account a certain margin.
在上述心电信号处理方法中,所述自相关函数的计算包含如下步骤:(1)将所述方波进行平移后得到平移后方波(2)搜索在同一时间所述方波与所述平移后方波的方波重叠部分R1~Rr;(3)采用如下公式计算所述重叠部分R1~Rr的乘积和;In the above-mentioned ECG signal processing method, the autocorrelation function The calculation of includes the following steps: (1) transform the square wave After translation, the translated square wave is obtained (2) Search for the square wave at the same time With the translation back square wave The square wave overlapping parts R1 to Rr; (3) using the following formula to calculate the product sum of the overlapping parts R1 to Rr;
其中,R为方波重叠部分R1~Rr的个数,virvjr是各方波重叠部分R1~Rr的高度,tirjr为各方波重叠部分R1~Rr的宽度。Among them, R is the number of square wave overlapping parts R1~Rr, vir vjr is the height of each square wave overlapping part R1~Rr, and tirjr is the width of each square wave overlapping part R1~Rr.
一种心电信号处理装置,其特征在于,包括:检测信号取得单元,由传感器对生物体的心电信号进行检测而取得检测信号;信号预处理单元,以规定时间长度将所述检测信号分割成多个分段信号,求出每个所述分段信号中所含多个信号的平均值,将所述分段信号中所含的每个信号样本点分别减去该分段信号的所述平均值而得到预处理信号;自相关计算单元,计算所述预处理信号的自相关函数。An electrocardiogram signal processing device, characterized in that it includes: a detection signal acquisition unit, which detects the electrocardiogram signal of a biological body by a sensor to acquire a detection signal; a signal preprocessing unit, which divides the detection signal into multiple segmented signals with a specified time length, calculates the average value of the multiple signals contained in each segmented signal, and subtracts the average value of the segmented signal from each signal sample point contained in the segmented signal to obtain a preprocessed signal; and an autocorrelation calculation unit, which calculates the autocorrelation function of the preprocessed signal.
一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现上述心电信号处理方法的步骤。A computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above-mentioned electrocardiogram signal processing method when executed by a processor.
一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现上述心电信号处理方法的步骤。A computer program product includes a computer program, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned electrocardiogram signal processing method are implemented.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是表示本发明的心电信号处理装置的构成的图。FIG. 1 is a diagram showing the configuration of an electrocardiographic signal processing device according to the present invention.
图2是表示第一实施方式的心电信号处理方法的流程图。FIG. 2 is a flowchart showing the electrocardiographic signal processing method according to the first embodiment.
图3是表示第一实施方式中的一个分段信号y[n]以及预处理信号s[n]的例子。FIG. 3 shows an example of a segmented signal y[n] and a preprocessed signal s[n] in the first embodiment.
图4是图3中的分段信号y[n]以及预处理信号s[n]分别对应的自相关系数波形的例子。FIG. 4 is an example of the autocorrelation coefficient waveforms corresponding to the segmented signal y[n] and the pre-processed signal s[n] in FIG. 3 .
图5是表示第一实施方式中的信号周期性判断步骤的详细步骤的图。FIG. 5 is a diagram showing detailed steps of the signal periodicity determination step in the first embodiment.
图6是表示第一实施方式的变形例2的信号周期性判断步骤的详细步骤的图。FIG. 6 is a diagram showing detailed steps of a signal periodicity determination step according to
图7是表示第二实施方式中的自相关计算步骤的详细步骤的图。FIG. 7 is a diagram showing the detailed procedure of the autocorrelation calculation step in the second embodiment.
图8是表示对预处理信号s[n]中所含的波峰进行提取后获得信号Sd的示意图。FIG. 8 is a schematic diagram showing a signal Sd obtained by extracting peaks included in the preprocessed signal s[n].
图9是表示将上述信号Sd转化为方波的示意图。FIG. 9 is a diagram showing the conversion of the above signal Sd into a square wave Schematic diagram of .
图10是表示方波重叠部分所对应的vir,vjr,tirjr的示意图。FIG10 is a schematic diagram showing vir , vjr , and tirjr corresponding to the overlapping portion of the square wave.
图11是第一实施方式中的自相关系数ρss[m]的波形与第二实施方式中的自相关系数的波形的对比图。FIG. 11 is a diagram showing the waveform of the autocorrelation coefficient ρss [m] in the first embodiment and the waveform of the autocorrelation coefficient ρ ss [m] in the second embodiment. Comparison chart of the waveforms.
具体实施方式DETAILED DESCRIPTION
(第一实施方式)(First Embodiment)
第一实施方式中的心电信号处理装置1例如包含于未图示的车载系统中。这样的车载系统至少具备如下功能:通过设置于车辆座位的多个电容式的非接触传感器来获得驾驶员或者乘客的心电信号,并对心电信号进行处理。The electrocardiographic
图1是表示本发明的心电信号处理装置1的构成的图。心电信号处理装置1包括检测信号取得单元10、信号预处理单元20、自相关计算单元30、信号周期性判断单元40以及心跳信息提取单元50。此外,本实施方式中,心电信号处理装置1还具备了用于显示心跳信息的心跳信息输出单元60。Fig. 1 is a diagram showing the structure of an electrocardiogram
检测信号取得单元10通过设置于车辆座椅的多个传感器对生物体的心电信号进行检测而取得检测信号。通常希望实时地了解驾驶员或者乘客的心跳信息等,因此在检测到有驾驶员或者乘客的情况下,各传感器以规定的间隔(例如以0.1秒的间隔)不断地取得心电信号,并作为检测信号。The detection
在进行自相关函数计算之前,信号预处理单元20对检测信号进行预处理。信号预处理单元20以规定时间长度将取得的检测信号分割成多个分段信号,求出每个分段信号中所含多个信号的平均值,将分段信号中所含的每个信号样本点分别减去该分段信号的平均值而得到预处理信号。Before calculating the autocorrelation function, the
自相关计算单元30计算由信号预处理单元20处理后得到的预处理信号的自相关函数。在计算自相关函数之后,对该自相关函数进行归一化处理,能够获得每个分段信号所对应的自相关系数波形。The
信号周期性判断单元40在每个分段信号所对应的自相关系数波形中搜索最高波峰,并计算该最高波峰与前后相邻的其他波峰间的差值,在该差值小于第一预定值时,将该分段信号认定为噪声并丢弃,在该差值大于等于第一预定值时,将该分段信号认定为有效。The signal
此外,信号周期性判断单元40还可以根据每个自相关系数波形中的最高波峰所在的位置,计算与该自相关系数波形对应的预处理信号的周期,各预处理信号的周期与对应的分段信号的周期相同。由此,能够根据该预处理信号的周期来判断该分段信号是否有效。In addition, the signal
心跳信息提取单元50使用由信号周期性判断单元40判断为有效的分段信号来提取心跳信息。心跳信息例如包含心跳数、心跳周期、心跳时刻等。关于提取心跳信息的方法不作限定,例如可以使用findpeak函数在分段信号中搜索波峰,波峰的时间点对应于心跳信号中的R波波峰时刻,相邻波峰的时间间隔对应于心跳周期。The heartbeat
心跳信息输出单元60例如是设置于车辆中的液晶显示器、平视显示器(Head UpDisplay,HUD)等,对心跳信息提取单元50所提取的心跳信息进行显示。The heartbeat
图2是表示第一实施方式的心电信号处理方法的流程图。FIG. 2 is a flowchart showing the electrocardiographic signal processing method according to the first embodiment.
在步骤S1(检测信号取得步骤)中,检测信号取得单元10通过传感器对生物体的心电信号进行检测而取得检测信号。本实施方式中的检测信号为按照固定频率fs采集的离散信号x[n]。此外,除了离散信号之外,检测信号也可以是连续信号x(t)。In step S1 (detection signal acquisition step), the detection
在步骤S2(信号预处理步骤)中,信号预处理单元20以规定时间长度T将检测信号分割成多个分段信号,求出每个所述分段信号中所含多个信号的平均值,将分段信号中所含的每个信号样本点分别减去该分段信号的平均值而得到预处理信号。这里的规定时间长度T根据人体心跳可能的周期范围而进行设置,规定时间长度T为至少包含两个以上的心跳周期TR的长度。这是因为假如一个分段信号中所包含的心跳周期TR的个数小于2,那么该分段信号本身是不具有周期性的。规定时间长度T优选满足3s≤T≤5s的任意数值。In step S2 (signal preprocessing step), the
在分段信号为y[n],所述平均值为时,预处理信号为图3是表示第一实施方式中的一个分段信号y[n]以及预处理信号s[n]的例子。图3中的纵坐标表示信号值,横坐标表示信号的取得时间。这里的分段信号的时间长度为3秒。如图3所示,在经过了预处理之后,分段信号为y[n]的波形整体向下方移动了的量,由此预处理信号s[n]中的一部分值成为了小于0的负值。而且,图3中示出的分段信号中包含有噪声,具体而言,包括了3个由心电信号引起的峰值PR1~PR3以及8个由噪声引起的峰值PN1~PN8。这里,噪声的频率比心电信号的频率高。When the segmented signal is y[n], the average value is When the preprocessed signal is FIG3 shows an example of a segmented signal y[n] and a preprocessed signal s[n] in the first embodiment. The ordinate in FIG3 represents the signal value, and the abscissa represents the time when the signal is acquired. The time length of the segmented signal here is 3 seconds. As shown in FIG3, after the preprocessing, the waveform of the segmented signal y[n] moves downward as a whole. The amount of the preprocessed signal s[n] is such that some of the values in the preprocessed signal s[n] become negative values less than 0. Moreover, the segmented signal shown in FIG3 contains noise, specifically, 3 peaksPR1 toPR3 caused by the ECG signal and 8 peaksPN1 toPN8 caused by the noise. Here, the frequency of the noise is higher than the frequency of the ECG signal.
接着,在步骤S3(自相关计算步骤)中,自相关计算单元30计算预处理信号的自相关函数。Next, in step S3 (autocorrelation calculation step), the
自相关函数为Rss[m]的计算公式如下,The autocorrelation function is calculated asRss [m] as follows,
其中,n是求和变量,m是平移量,L是预处理信号s[n]的信号长度,s[n]中n的取值范围是0≤n≤L-1。此外,上述式子中的L符合如下关系:L=fs·T,其中,T为分段信号y[n]的时间长度。例如,在固定频率fs为560Hz且T为3秒的情况下,信号长度L=560×3=1680。即,每个预处理信号s[n]中包含1680个离散点。Where n is the summation variable, m is the translation amount, L is the signal length of the preprocessed signal s[n], and the value range of n in s[n] is 0≤n≤L-1. In addition, L in the above formula conforms to the following relationship: L=fs·T, where T is the time length of the segmented signal y[n]. For example, when the fixed frequency fs is 560 Hz and T is 3 seconds, the signal length L=560×3=1680. That is, each preprocessed signal s[n] contains 1680 discrete points.
在计算自相关函数Rss[m]之后,能够获得每个分段信号所对应的自相关系数波形。After calculating the autocorrelation function Rss [m], the autocorrelation coefficient waveform corresponding to each segmented signal can be obtained.
自相关系数ρss是对上述自相关函数Rss[m]进行归一化处理后得到的,这里的归一化处理是对Rss[m]除以Rss[0]的处理。自相关系数ρss的取值范围是-1≤ρss≤1。The autocorrelation coefficient ρss is obtained by normalizing the above autocorrelation function Rss [m], where the normalization is to divide Rss [m] by Rss [0]. The value range of the autocorrelation coefficient ρss is -1≤ρss ≤1.
图4是图3中的分段信号y[n]以及预处理信号s[n]分别对应的自相关系数波形的例子。图4中的纵坐标表示自相关系数的值,横坐标表示平移量m。其中,分段信号y[n]所对应的自相关系数ρyy[m]的波形位于图4中的靠上方的位置,预处理信号s[n]所对应的自相关系数ρss[m]的波形位于图4中的靠下方的位置。FIG4 is an example of the autocorrelation coefficient waveforms corresponding to the segmented signal y[n] and the preprocessed signal s[n] in FIG3. The ordinate in FIG4 represents the value of the autocorrelation coefficient, and the abscissa represents the translation amount m. The waveform of the autocorrelation coefficient ρyy [m] corresponding to the segmented signal y[n] is located at the upper position in FIG4, and the waveform of the autocorrelation coefficient ρss [m] corresponding to the preprocessed signal s[n] is located at the lower position in FIG4.
在对信号长度短且噪声的频率比心电信号的频率高的分段信号进行计算时,由于自相关系数波形存在下降趋势,信号的频率越高,自相关系数波形中的与该信号对应的波峰位置越位于前侧(即图4中的左侧),信号的频率越低,自相关系数波形中的与该信号对应的波峰位置越位于后侧(即图4中的右侧)。When calculating a segmented signal with a short signal length and a noise frequency higher than the frequency of the ECG signal, due to the downward trend of the autocorrelation coefficient waveform, the higher the signal frequency, the closer the peak position corresponding to the signal in the autocorrelation coefficient waveform is to the front (i.e., the left side in Figure 4), and the lower the signal frequency, the closer the peak position corresponding to the signal in the autocorrelation coefficient waveform is to the back (i.e., the right side in Figure 4).
关于自相关系数波形的下降趋势起因与自相关函数自身的性质以及对象信号的长度有关。由于自相关函数是一个信号于其自身在不同时间点的互相关,函数值是信号与其平移信号(延迟信号)重叠部分的积分值。随着信号的延迟量的增加,信号与其平移信号(延迟信号)重叠部分逐渐减小,其积分值也逐渐减小。因此,在对信号长度短的信号进行处理时,其自相关系数波形必然会呈现图4所示那样的下降趋势。而且,信号长度越短,其下降趋势越明显。The reason for the downward trend of the autocorrelation coefficient waveform is related to the properties of the autocorrelation function itself and the length of the target signal. Since the autocorrelation function is the cross-correlation of a signal with itself at different time points, the function value is the integral value of the overlapping part of the signal and its translation signal (delayed signal). As the delay amount of the signal increases, the overlapping part of the signal and its translation signal (delayed signal) gradually decreases, and its integral value also gradually decreases. Therefore, when processing a signal with a short signal length, its autocorrelation coefficient waveform will inevitably show a downward trend as shown in Figure 4. Moreover, the shorter the signal length, the more obvious its downward trend.
对于图3中示出的分段信号y[n]而言,在图4中的靠上方的自相关系数ρyy[m]的波形中,由于噪声的频率比心电信号的频率高,与PN1、PN2对应的波峰PRyN1、PRyN2位于该波形的靠前侧的位置,与PR1对应的波峰PRy1位于该波形中比PRyN1、PRyN2更靠后的位置。换言之,在自相关系数的下降趋势以及信号频率的因素的影响下,与PN1、PN2对应的波峰PRyN1、PRyN2变得比与PR1对应的波峰PRy1高。这样的情况会给后续的信号周期性的判断带来不好的影响。For the segmented signal y[n] shown in FIG3 , in the waveform of the autocorrelation coefficient ρyy [m] at the top in FIG4 , since the frequency of the noise is higher than the frequency of the electrocardiographic signal, the peaksPRyN1 andPRyN2 corresponding toPN1 andPN2 are located at the front side of the waveform, and the peakPRy1 corresponding toPR1 is located at the back side of the waveform compared withPRyN1 andPRyN2 . In other words, under the influence of the downward trend of the autocorrelation coefficient and the signal frequency factor, the peaksPRyN1 andPRyN2 corresponding toPN1 andPN2 become higher than the peakPRy1 corresponding toPR1 . Such a situation will have a bad influence on the subsequent judgment of the periodicity of the signal.
另一方面,对于图3中示出的预处理信号s[n]而言,在图4中的靠下方的自相关系数ρss[m]的波形中,由于噪声的频率比心电信号的频率高,与PN1、PN2对应的波峰PRsN1、PRsN2位于该波形的靠前侧的位置,与PR1对应的波峰PRs1位于该波形中比PRsN1、PRsN2更靠后的位置。但是与自相关系数ρss[m]的波形不同的是,即使在自相关系数的下降趋势以及信号频率的因素的影响下,与PN1、PN2对应的波峰PRsN1、PRsN2也没有比与PR1对应的波峰PRs1高。On the other hand, for the preprocessed signal s[n] shown in FIG3 , in the waveform of the autocorrelation coefficient ρss [m] at the bottom in FIG4 , since the frequency of the noise is higher than the frequency of the electrocardiographic signal, the peaksPRsN1 andPRsN2 corresponding toPN1 andPN2 are located at the front side of the waveform, and the peakPRs1 corresponding toPR1 is located at the back side of the waveform compared withPRsN1 andPRsN2 . However, unlike the waveform of the autocorrelation coefficient ρss [m], even under the influence of the decreasing trend of the autocorrelation coefficient and the signal frequency factor, the peaksPRsN1 andPRsN2 corresponding toPN1 andPN2 are not higher than the peakPRs1 corresponding toPR1 .
接着,在步骤S4(信号周期性判断步骤)中,信号周期性判断单元40判断每个分段信号是否具有周期性,并根据判断结果决定分段信号的有效或无效。Next, in step S4 (signal periodicity determination step), the signal
图5中示出了信号周期性判断步骤的详细步骤。FIG5 shows the detailed steps of the signal periodicity determination step.
在步骤S41中,在每个分段信号的自相关系数波形中搜索最高波峰,并计算该最高波峰与前后相邻的其他波峰间的差值。这里的“最高波峰与前后相邻的其他波峰间的差值”可以是最高波峰与前后分别相邻的一个以上其他波峰间的最小差值,也可以是最高波峰与前后分别相邻的一定区间内所包含的一个以上其他波峰间的最小差值。此外,最高波峰与前后相邻的其他波峰间的差值代表了信号与噪声的强度对比,差值越大代表噪声越小,差值越小代表噪声越大,甚至只包含噪声信号。In step S41, the highest peak is searched in the autocorrelation coefficient waveform of each segmented signal, and the difference between the highest peak and other adjacent peaks is calculated. Here, the "difference between the highest peak and other adjacent peaks" can be the minimum difference between the highest peak and one or more other peaks adjacent to the front and back, or the minimum difference between the highest peak and one or more other peaks contained in a certain interval adjacent to the front and back. In addition, the difference between the highest peak and other adjacent peaks represents the intensity comparison between the signal and the noise. The larger the difference, the smaller the noise, and the smaller the difference, the greater the noise, or even only the noise signal.
在步骤S42中,判断该差值是否小于第一预定值。为了去除噪声大的分段信号,优选将第一预定值设置为0.1。In step S42, it is determined whether the difference is less than a first predetermined value. In order to remove the segmented signal with large noise, the first predetermined value is preferably set to 0.1.
在该差值大于等于第一预定值时(S42,是),前进至步骤S43,判断为该分段信号具有周期性,将该分段信号认定为有效。When the difference is greater than or equal to the first predetermined value (S42, Yes), the process proceeds to step S43, where it is determined that the segmented signal has periodicity and the segmented signal is deemed valid.
在该差值小于第一预定值时(S42,否),前进至步骤S44,判断为该分段信号不具有周期性,将该分段信号认定为噪声并丢弃。根据研究得知,在针对仅包括噪声信号或者噪声大的信号进行计算后,该差值会小于第一预定值。When the difference is less than the first predetermined value (S42, No), proceed to step S44, determine that the segmented signal is not periodic, identify the segmented signal as noise and discard it. According to research, after calculating a signal that only includes a noise signal or a signal with large noise, the difference will be less than the first predetermined value.
下面,以图4中示出的自相关系数ρss[m]的波形为例说明信号周期性判断步骤。Next, the signal periodicity determination step is described by taking the waveform of the autocorrelation coefficient ρss [m] shown in FIG. 4 as an example.
在步骤S41中,信号周期性判断单元40在该自相关系数ρss[m]的波形中搜索到波峰PRs1是该波形中的最高波峰,并计算该最高波峰与前后相邻的一定区间(例如以最高波峰为中心的1秒区间)内的其他波峰间的最小差值Ws。在图4中,以波峰PRs1为中心的1秒区间内包含有波峰PRsN1、波峰PRsN2、波峰PRsN3、波峰PRsN4这四个其他波峰,各波峰所对应的值为:波峰PRs1=0.50,波峰PRsN1=0.20,波峰PRsN2=0.19,波峰PRsN3=0.17,波峰PRsN4=0.15。通过计算可知,最高波峰与前后相邻的一定区间内的其他波峰间的最小差值Ws(即图4中波峰PRs1与PRsN1间的差值)为0.3。由于该差值Ws大于等于第一预定值(在步骤S42中,0.3>0.1),因此将该分段信号认定为有效(步骤S43)。In step S41, the signal
返回至图2,接着,在步骤S5(心跳信息提取步骤)中,心跳信息提取单元50使用由信号周期性判断单元40判断为有效的分段信号来提取心跳信息。心跳信息例如包含心跳数、心跳周期、心跳信号中的R波波峰时刻等。关于提取心跳信息的方法不做限定,例如可以使用findpeak函数在分段信号中搜索波峰,波峰的时间点对应于心跳信号中的R波波峰时刻,相邻波峰的时间间隔对应于心跳周期TR。Returning to FIG. 2 , then, in step S5 (heartbeat information extraction step), the heartbeat
接着,在步骤S6(心跳信息输出步骤)中,心跳信息输出单元60通过设置于车辆中的液晶显示器、平视显示器等对所提取的心跳信息进行显示。Next, in step S6 (heartbeat information output step), the heartbeat
此外,对于心电信号处理方法而言,也可以不包括心跳信息输出步骤。由心跳信息提取步骤提取的心跳信息也可以用于与其他功能模块联动,例如可以将心跳信息作为异常情况监控模块的一个监控指标、或者将心跳信息作为动态健康评价的输入数据之一等。In addition, the electrocardiogram signal processing method may not include the heartbeat information output step. The heartbeat information extracted by the heartbeat information extraction step may also be used to link with other functional modules, for example, the heartbeat information may be used as a monitoring indicator of an abnormal situation monitoring module, or the heartbeat information may be used as one of the input data of a dynamic health evaluation.
根据第一实施方式的心电信号处理装置及方法,通过在计算自相关函数之前针对分段信号y[n]执行减平均值的处理(即,预处理信号),减小了自相关函数的计算结果逐渐衰减的趋势,突出了心电信号的波峰,从而能够准确地判断心电信号的周期性。进而,能够通过筛除掉不具有周期性的噪声大的信号来获得准确的心跳信息。According to the electrocardiographic signal processing device and method of the first embodiment, by performing mean subtraction on the segmented signal y[n] before calculating the autocorrelation function, processing (i.e., preprocessing the signal ), the trend of the calculation result of the autocorrelation function gradually decays, and the peak of the ECG signal is highlighted, so that the periodicity of the ECG signal can be accurately determined. Furthermore, accurate heartbeat information can be obtained by filtering out the signal with large noise that does not have periodicity.
此外,针对每个分段波形比较最高波峰与其余峰值,利用噪声的波峰差值与心电信号的波峰差值的区别,来确定各分段信号的可靠性。差值越大代表噪声越小,差值越小代表噪声越大,通过丢弃噪声大的分段信号能够筛选分段信号。进而,通过使用可靠性高的分段信号来进行后续的心跳信息的提取等处理,从而提高心电信号的处理结果的准确性。In addition, for each segmented waveform, the highest peak is compared with the remaining peaks, and the difference between the peak difference of the noise and the peak difference of the ECG signal is used to determine the reliability of each segmented signal. The larger the difference, the smaller the noise, and the smaller the difference, the greater the noise. By discarding the segmented signals with large noise, the segmented signals can be screened. Furthermore, by using the segmented signals with high reliability to perform subsequent processing such as extraction of heartbeat information, the accuracy of the processing results of the ECG signal can be improved.
(第一实施方式的变形例1)(
第一实施方式的变形例1是第一实施方式的变形,与第一实施方式之间的不同点仅在于图2中的步骤S2的处理,其他步骤与第一实施方式基本相同,下面仅针对不同点进行说明。
在第一实施方式的心电信号处理方法中检测信号是离散信号,在第一实施方式的变形例1中检测型号是连续信号。In the electrocardiographic signal processing method of the first embodiment, the detection signal is a discrete signal, and in the first modification of the first embodiment, the detection signal is a continuous signal.
在图2的步骤S2中,在检测信号为连续信号x(t),分段信号为y(t),分段信号y(t)的平均值为时,预处理信号为这时,自相关函数为Rss(τ)的计算公式如下,In step S2 of FIG. 2 , when the detection signal is a continuous signal x(t), the segmented signal is y(t), and the average value of the segmented signal y(t) is When the preprocessed signal is At this time, the calculation formula of the autocorrelation function is Rss (τ) as follows,
Rss(τ)=∫0Ts(t)s(t+τ)dtRss (τ)=∫0T s(t)s(t+τ)dt
其中,t为积分变量,τ为延迟,T为预处理信号s(t)的时间长度。Where t is the integration variable, τ is the delay, and T is the time length of the preprocessed signal s(t).
(第一实施方式的变形例2)(
第一实施方式的变形例1是第一实施方式的变形,与第一实施方式之间的不同点仅在于图2中的步骤S4的处理,其他步骤与第一实施方式基本相同,下面仅针对不同点进行说明。
图6中示出了第一实施方式的变形例2的信号周期性判断步骤(步骤S4)的详细步骤。如图6所示,变形例2的信号周期性判断步骤中除了包含图5中示出的步骤S41~步骤S44之外,还包含了进一步判断信号是否有效的步骤S45~步骤S48。Detailed steps of the signal periodicity determination step (step S4) of the second variant of the first embodiment are shown in Fig. 6. As shown in Fig. 6, the signal periodicity determination step of the second variant includes steps S45 to S48 for further determining whether the signal is valid in addition to steps S41 to S44 shown in Fig. 5.
在步骤S45中,信号周期性判断单元40根据每个自相关系数波形中的最高波峰所在的位置,计算该波形所对应的预处理信号的周期Ts,预处理信号的周期Ts与该预处理信号所对应的分段信号的周期Ty相同。更详细地讲,每个自相关系数波形中的最高波峰所对应的横坐标位置代表了该预处理信号的周期Ts以及该预处理信号所对应的分段信号的周期Ty。In step S45, the signal
基于该步骤,能够通过自相关系数波形中的最高波峰所在的位置来确定预处理信号的周期Ts以及分段信号的周期Ty。Based on this step, the period Ts of the preprocessing signal and the period Ty of the segmented signal can be determined by the position of the highest peak in the autocorrelation coefficient waveform.
接着,在步骤S46中,判断在步骤S45中计算出的分段信号的周期Ty是否满足条件0.3s<Ty<1.5s,将满足该条件的分段信号认定为有效,将不满足该条件的分段信号认定为噪声并丢弃。Next, in step S46, it is determined whether the period Ty of the segmented signal calculated in step S45 satisfies the condition 0.3s<Ty<1.5s, and the segmented signal satisfying this condition is considered valid, and the segmented signal not satisfying this condition is considered as noise and discarded.
基于该步骤,能够利用心跳信号可能的周期0.3~1.5s来进一步排除噪声,由此能够进一步提高分段信号的可靠性。Based on this step, the possible period of the heartbeat signal of 0.3 to 1.5 s can be used to further eliminate noise, thereby further improving the reliability of the segmented signal.
接着,在步骤S47中,计算多个连续的分段信号的周期Ty的样本方差S。Next, in step S47 , the sample variance S of the period Ty of a plurality of continuous segmented signals is calculated.
接着,在步骤S48中,将S<0.0052以外的分段信号认定为有效,将S<0.0052的分段信号认定为噪声并丢弃。Next, in step S48, the segment signals other than those with S<0.0052 are considered valid, and the segment signals with S<0.0052 are considered noise and discarded.
通常,固定频率的系统噪声具有周期的样本方差比心跳周期的样本方差小的特性。如果周期的样本方差小于0.0052则不符合人的心跳特征,心跳周期的样本方差一定大于等于0.0052。由此,能够使用固定频率的系统噪声的这一特性来进一步排除噪声,从而进一步提高分段信号的可靠性。Generally, the fixed-frequency system noise has the characteristic that the sample variance of the period is smaller than the sample variance of the heartbeat period. If the sample variance of the period is less than 0.0052 , it does not conform to the human heartbeat characteristics, and the sample variance of the heartbeat period must be greater than or equal to 0.0052. Therefore, this characteristic of the fixed-frequency system noise can be used to further eliminate noise, thereby further improving the reliability of the segmented signal.
(第二实施方式)(Second Embodiment)
第二实施方式是第一实施方式及其变形例的变形,与第一实施方式及其变形例1、2之间的不同点仅在于图2中的步骤S3(自相关计算步骤)的处理,下面参照图7针对不同点进行说明。The second embodiment is a variation of the first embodiment and its variation examples, and the difference between the second embodiment and the first embodiment and its variation examples 1 and 2 is only the processing of step S3 (autocorrelation calculation step) in FIG. 2 . The difference will be described below with reference to FIG. 7 .
图7是表示第二实施方式中的自相关计算步骤的详细步骤的图。FIG. 7 is a diagram showing the detailed procedure of the autocorrelation calculation step in the second embodiment.
在步骤S31中,自相关计算单元30对预处理信号s[n]中所含的波峰进行提取,并且使得提取的所述波峰中的相邻的两个波峰之间的间隔大于等于规定时间间隔Ls,由此获得信号Sd。图8是表示对预处理信号s[n]中所含的波峰进行提取后获得信号Sd的示意图。图8的纵坐标表示信号值,横坐标表示信号的取得时间。图中的实心圆点表示所提取到的波峰,各个实心圆点构成了信号Sd。In step S31, the
接着,在步骤S32中,自相关计算单元30将上述信号Sd转化为方波图9是表示将上述信号Sd转化为方波的示意图。图9的纵坐标表示信号值,横坐标表示信号的取得时间。Next, in step S32, the
该方波的幅宽Lp满足Lε<Lp<Ls/2,其中,Lε为大于0且大于最大周期差ΔTR的预定值,最大周期差ΔTR为在所述规定时间长度T内所包含的多个心跳周期TR之间可能出现的最大差异。例如,在一个规定时间长度T为3秒的分段信号预处理信号s[n]中包含了3个心跳周期TR1~TR3,其中TR1=0.98秒,TR2=0.96秒,TR3=1.00秒,那么最大周期差ΔTR为0.04秒。根据经验,预定值Lε一般为0.05秒。The square wave The width Lp satisfies Lε <Lp <Ls /2, where Lε is a predetermined value greater than 0 and greater than the maximum cycle differenceΔTR , and the maximum cycle differenceΔTR is the maximum difference that may occur between multiple heartbeat cyclesTR contained in the specified time length T. For example, a segmented signal preprocessing signal s[n] with a specified time length T of 3 seconds contains 3 heartbeat cyclesTR1 toTR3 , whereTR1 = 0.98 seconds,TR2 = 0.96 seconds, andTR3 = 1.00 seconds, then the maximum cycle differenceΔTR is 0.04 seconds. According to experience, the predetermined value Lε is generally 0.05 seconds.
此外,规定时间间隔Ls是规定时间长度T内的最小心跳周期。根据经验,人的最小心跳周期一般为0.3秒。如果规定时间间隔Ls大于0.3秒,则在波峰提取的过程中可能出现漏掉部分波峰的情况。由此,幅宽Lp优选为0.06s<Lp<0.1s中的任意值。即,0.06s<Lp<0.1s是基于经验值并且考虑了一定余量后的推荐值。In addition, the prescribed time intervalLs is the minimum heartbeat cycle within the prescribed time length T. According to experience, the minimum heartbeat cycle of a person is generally 0.3 seconds. If the prescribed time intervalLs is greater than 0.3 seconds, some peaks may be missed during the peak extraction process. Therefore, the widthLp is preferably any value within 0.06s<Lp <0.1s. That is, 0.06s<Lp <0.1s is a recommended value based on experience and after considering a certain margin.
接着,在步骤S33~步骤S35中,计算上述方波的自相关函数Next, in steps S33 to S35, the square wave The autocorrelation function
在步骤S33中,自相关计算单元30将所述方波进行平移后得到平移后方波In step S33, the
在步骤S34中,搜索在同一时间所述方波与所述平移后方波的方波重叠部分R1~Rr。In step S34, the square wave is searched at the same time With the translation back square wave The square wave overlapping part R1~Rr.
在步骤S35中,采用如下公式计算重叠部分R1~Rr的乘积和。In step S35, the sum of the products of the overlapping parts R1 to Rr is calculated using the following formula.
其中,R为方波重叠部分R1~Rr的个数,virvjr是各方波重叠部分R1~Rr的高度,tirjr为各方波重叠部分R1~Rr的宽度。Among them, R is the number of square wave overlapping parts R1~Rr, vir vjr is the height of each square wave overlapping part R1~Rr, and tirjr is the width of each square wave overlapping part R1~Rr.
图10是表示方波重叠部分所对应的vir,vjr,tirjr的示意图。FIG10 is a schematic diagram showing vir , vjr , and tirjr corresponding to the overlapping portion of the square wave.
假设是由N个方波pi[n]组成,可以写成如图10所示,pi[n]是中的第i个方波,方波pj[n+m]是中的第j个方波,假设这两个方波在时间上有重合,则方波pi[n]和方波pj[n+m]的乘积也是一个方波pi[n]pj[n+m]。该方波pi[n]pj[n+m]的宽度是tirjr,即方波pi[n]和方波pj[n+m]的重叠部分,并且其高度是virvjr,即方波pi[n]的高度vir和方波pj[n+m]的高度vjr的乘积。Assumptions is composed of N square wavespi [n], which can be written as As shown in Figure 10, pi [n] is The ith square wave in the equation, square wave pj [n+m] is For the j-th square wave in , assuming that the two square waves overlap in time, the product of square wave pi [n] and square wave pj [n+m] is also a square wave pi [n]pj [n+m]. The width of the square wave pi [n]pj [n+m] is tirjr , that is, the overlapping part of the square wave pi [n] and the square wave pj [n+m], and its height is vir vjr , that is, the product of the height vir of the square wave pi [n] and the height vjr of the square wave pj [n+m].
在计算自相关函数之后,能够获得每个分段信号所对应的自相关系数波形。图11是第一实施方式中的自相关系数ρss[m]的波形与第二实施方式中的自相关系数的波形的对比图。图11中的纵坐标表示自相关系数的值,横坐标表示平移量m。In calculating the autocorrelation function After that, the autocorrelation coefficient waveform corresponding to each segmented signal can be obtained. FIG11 is a waveform of the autocorrelation coefficient ρss [m] in the first embodiment and the autocorrelation coefficient in the second embodiment. The vertical axis in FIG11 represents the value of the autocorrelation coefficient, and the horizontal axis represents the translation amount m.
虽然自相关系数的波形不是一个连续的曲线,而是由多个点(图11中的实心圆点)构成,但经过对比第一实施方式中的自相关系数ρss[m]的波形与第二实施方式中的自相关系数的波形发现两者近似,尤其是两者的主要特征(即,最高波峰的位置和大小)几乎重合。因此,在后续的步骤S4(信号周期性判断步骤)中,能够准确地判断信号的周期性。Although the autocorrelation coefficient The waveform is not a continuous curve, but is composed of multiple points (solid circles in FIG. 11 ). However, by comparing the waveform of the autocorrelation coefficient ρss [m] in the first embodiment with the waveform of the autocorrelation coefficient ρ ss [m] in the second embodiment, The waveforms of the two are found to be similar, especially the main features of the two (ie, the position and size of the highest peak) are almost the same. Therefore, in the subsequent step S4 (signal periodicity determination step), the periodicity of the signal can be accurately determined.
实际上,在图11中,自相关系数ρss[m]的波形也是由多个点构成,只是点的密度比较大,图示中m=0,1,2,…,L-1,所以自相关系数ρss[m]的各个点看起来是连续的。而本实施例中,为了进一步提高运算效率,在不影响精度的情况下,我们降低了自相关系数的平移颗粒度。例如,在把平移的颗粒度定为0.05秒的情况下,可以每隔28个点计算一个自相关系数的值,即只计算m=0,28,56,…时的自相关系数的值。因此图11中自相关系数的各个点看起来比自相关系数ρss[m]更稀疏。In fact, in FIG11 , the waveform of the autocorrelation coefficient ρss [m] is also composed of multiple points, but the density of the points is relatively large. In the figure, m = 0, 1, 2, ..., L-1, so the points of the autocorrelation coefficient ρss [m] appear to be continuous. In this embodiment, in order to further improve the calculation efficiency, we reduce the autocorrelation coefficient without affecting the accuracy. For example, if the translation granularity is set to 0.05 seconds, an autocorrelation coefficient can be calculated every 28 points. The value of m = 0, 28, 56, ... is calculated only when the autocorrelation coefficient Therefore, the autocorrelation coefficient in Figure 11 The points of appear to be sparser than the autocorrelation coefficient ρss [m].
根据第二实施方式的心电信号处理装置及方法,与第一实施方式中的不进行转化方波的情况相比,大幅减少了自相关计算步骤的计算量、计算时间和内存开销等,而且在方波的自相关系数的波形中几乎完全保留了自相关函数Rss[m]的与周期性有关的特征,从而能够在不降低准确性的情况下更加快速地判断心电信号的周期性。According to the electrocardiographic signal processing device and method of the second embodiment, compared with the case where the square wave conversion is not performed in the first embodiment, the amount of calculation, calculation time and memory overhead of the autocorrelation calculation step are greatly reduced, and the square wave The autocorrelation coefficient The periodicity-related features of the autocorrelation function Rss [m] are almost completely preserved in the waveform, so that the periodicity of the ECG signal can be determined more quickly without reducing the accuracy.
此外,如果幅宽Lp小于等于预定值Lε,则可能会出现无论方波怎样平移,都不能同时满足规定时间长度T内的所有峰值互相重合,这样的结果会降低方波的自相关函数与预处理信号s[n]的自相关函数为Rss[m]之间的近似性。另一方面,如果幅宽Lp大于等于Ls/2,则平移后方波中的一个方波可能同时与方波中的两个以上的方波有重叠,这样会导致方波搜索变得复杂,继而增加了运算开销。In addition, if the width Lp is less than or equal to the predetermined value Lε , the square wave may appear regardless of No matter how the translation is done, it is impossible to satisfy the requirement that all peaks within the specified time length T coincide with each other. This will result in a decrease in the square wave The autocorrelation function The autocorrelation function of the preprocessed signal s[n] is similar to Rss [m]. On the other hand, if the width Lp is greater than or equal to Ls /2, the square wave after translation A square wave in may be simultaneously There is overlap between two or more square waves in the image, which makes the square wave search complicated and increases the computational overhead.
由于基于与心跳周期TR相关的值来设定波峰间隔Ls和方波幅宽Lp的上限和下限,能够避免因幅宽Lp过窄而导致方波的自相关函数与预处理信号s[n]的自相关函数为Rss[m]之间的近似性降低,而且能够避免因幅宽Lp大于等于Ls/2而导致方波搜索变复杂、运算开销增加的情况。Since the upper and lower limits of the peak intervalLs and the square wave widthLp are set based on the values related to the heartbeat cycleTR, the square wave can be prevented from being too narrow due to the widthLp being too narrow. The autocorrelation function The approximation between the autocorrelation functionRss [m] of the preprocessed signal s[n] is reduced, and the situation in which the square wave search becomes complicated and the calculation cost increases due to the widthLp being greater than or equal toLs /2 can be avoided.
对本发明的几个实施方式进行了说明,但这些实施方式是作为例子提出的,意图并不是限定发明的范围。这些新的实施方式能够以其他各种各样的方式实施,在不脱离发明的主旨的范围内,能够进行各种省略、置换、变更。这些实施方式及其变形包含在发明的范围、主旨中,并且包含在权利要求书记载的发明及其等同的范围中。Several embodiments of the present invention have been described, but these embodiments are presented as examples and are not intended to limit the scope of the invention. These new embodiments can be implemented in various other ways, and various omissions, substitutions, and changes can be made without departing from the scope of the subject matter of the invention. These embodiments and their variations are included in the scope and subject matter of the invention, and are included in the invention described in the claims and the scope of their equivalents.
例如,本发明的第二实施方式与第一实施方式相同包含了信号预处理步骤,在该步骤中将分段信号中所含的每个信号样本点分别减去该分段信号的平均值而得到预处理信号。但是,即使不执行该信号预处理步骤,与不进行方波转换的情况相比,也至少能够更加低开销地快速地判断心电信号的周期性。For example, the second embodiment of the present invention includes a signal preprocessing step like the first embodiment, in which the average value of the segmented signal is subtracted from each signal sample point contained in the segmented signal to obtain a preprocessed signal. However, even if the signal preprocessing step is not performed, the periodicity of the electrocardiogram signal can at least be determined more quickly with lower overhead than when the square wave conversion is not performed.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111416971.0ACN116172566A (en) | 2021-11-26 | 2021-11-26 | ECG signal processing method, device, storage medium and program product |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111416971.0ACN116172566A (en) | 2021-11-26 | 2021-11-26 | ECG signal processing method, device, storage medium and program product |
| Publication Number | Publication Date |
|---|---|
| CN116172566Atrue CN116172566A (en) | 2023-05-30 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111416971.0APendingCN116172566A (en) | 2021-11-26 | 2021-11-26 | ECG signal processing method, device, storage medium and program product |
| Country | Link |
|---|---|
| CN (1) | CN116172566A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118749993A (en)* | 2024-07-30 | 2024-10-11 | 万瞬医学技术(苏州)有限公司 | Method, device, equipment and medium for evaluating quality of electrocardiogram signal |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4456959A (en)* | 1980-07-17 | 1984-06-26 | Terumo Corporation | Period measurement system |
| US4569356A (en)* | 1984-11-05 | 1986-02-11 | Nihon Kohden Corporation | Method and apparatus for detecting fetal heart rate by autocorrelation |
| EP3301461A1 (en)* | 2016-09-28 | 2018-04-04 | Siemens Aktiengesellschaft | Method for detection of harmonics of a univariate signal |
| CN107980151A (en)* | 2017-02-22 | 2018-05-01 | 清华大学深圳研究生院 | A kind of access control system and its authentication method based on electrocardio certification |
| CN109691994A (en)* | 2019-01-31 | 2019-04-30 | 英菲泰克(天津)科技有限公司 | A kind of rhythm of the heart analysis method based on electrocardiogram |
| CN110327036A (en)* | 2019-07-24 | 2019-10-15 | 东南大学 | The method of breath signal and respiratory rate is extracted from wearable ECG |
| US20200178902A1 (en)* | 2017-05-04 | 2020-06-11 | Koninklijke Philips N.V. | A system and method for extracting a physiological information from video sequences |
| US20200397365A1 (en)* | 2015-07-17 | 2020-12-24 | Feng Zhang | Method, apparatus, and system for wireless sleep monitoring |
| CN113171073A (en)* | 2021-05-18 | 2021-07-27 | 南京润楠医疗电子研究院有限公司 | Non-inductive heart rate detection method based on detector |
| CN113468989A (en)* | 2021-06-18 | 2021-10-01 | 南京润楠医疗电子研究院有限公司 | Non-contact personnel identification method using heart radar signals |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4456959A (en)* | 1980-07-17 | 1984-06-26 | Terumo Corporation | Period measurement system |
| US4569356A (en)* | 1984-11-05 | 1986-02-11 | Nihon Kohden Corporation | Method and apparatus for detecting fetal heart rate by autocorrelation |
| US20200397365A1 (en)* | 2015-07-17 | 2020-12-24 | Feng Zhang | Method, apparatus, and system for wireless sleep monitoring |
| EP3301461A1 (en)* | 2016-09-28 | 2018-04-04 | Siemens Aktiengesellschaft | Method for detection of harmonics of a univariate signal |
| CN107980151A (en)* | 2017-02-22 | 2018-05-01 | 清华大学深圳研究生院 | A kind of access control system and its authentication method based on electrocardio certification |
| US20200178902A1 (en)* | 2017-05-04 | 2020-06-11 | Koninklijke Philips N.V. | A system and method for extracting a physiological information from video sequences |
| CN109691994A (en)* | 2019-01-31 | 2019-04-30 | 英菲泰克(天津)科技有限公司 | A kind of rhythm of the heart analysis method based on electrocardiogram |
| CN110327036A (en)* | 2019-07-24 | 2019-10-15 | 东南大学 | The method of breath signal and respiratory rate is extracted from wearable ECG |
| CN113171073A (en)* | 2021-05-18 | 2021-07-27 | 南京润楠医疗电子研究院有限公司 | Non-inductive heart rate detection method based on detector |
| CN113468989A (en)* | 2021-06-18 | 2021-10-01 | 南京润楠医疗电子研究院有限公司 | Non-contact personnel identification method using heart radar signals |
| Title |
|---|
| 毛威: "PCG/ECG采集电路设计与信号分析研究", 中国优秀硕士学位论文全文数据库 医药卫生科技, no. 9, 15 September 2015 (2015-09-15), pages 062 - 3* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118749993A (en)* | 2024-07-30 | 2024-10-11 | 万瞬医学技术(苏州)有限公司 | Method, device, equipment and medium for evaluating quality of electrocardiogram signal |
| Publication | Publication Date | Title |
|---|---|---|
| Asgari et al. | Automatic detection of atrial fibrillation using stationary wavelet transform and support vector machine | |
| Jezewski et al. | A novel technique for fetal heart rate estimation from Doppler ultrasound signal | |
| EP1545309B1 (en) | Procedure for detection of stress by segmentation and analysing a heart beat signal | |
| US9042973B2 (en) | Apparatus and method for measuring physiological signal quality | |
| US7970459B2 (en) | Sleepiness level detection method and apparatus | |
| JP2003310562A (en) | Heartbeat detecting device and method using PPG | |
| US11344246B2 (en) | Long QT syndrome diagnosis and classification | |
| US20170027464A1 (en) | Detecting Artifacts in a Signal | |
| Dingab et al. | Derivation of respiratory signal from single channel ECGs based on source statistics | |
| US20170224239A1 (en) | Cycle length iteration for the detection of atrial activations from electrogram recordings of atrial fibrillation | |
| CN116172566A (en) | ECG signal processing method, device, storage medium and program product | |
| Zhu et al. | Feature extraction from a novel ECG model for arrhythmia diagnosis | |
| EP2962638A1 (en) | Dozing prevention method, and dozing prevention device | |
| JP2025123222A (en) | Biological information monitoring system, biological information monitoring method and program | |
| WO2020133562A1 (en) | Mobile monitoring device, and physiological signal adjustment and processing method | |
| KR101420345B1 (en) | System and Method for Detecting R Wave of ECG Signal based on SOM | |
| CN109350050B (en) | Heartbeat interval detection method and device | |
| JP7222973B2 (en) | Method and device for determining signal quality of dysphagia classification model | |
| KR20200087540A (en) | Method for measuring heart rate based on Vision System | |
| WO2023108331A1 (en) | Adaptive real-time electrocardiogram signal quality evaluation method | |
| KR20230161443A (en) | Method and system for heart rate extraction from RBB images | |
| JP4609539B2 (en) | Sleepiness detection device | |
| CN113180627A (en) | Non-contact drunk driving identification method based on rPPG technology | |
| US20240252122A1 (en) | Sleep apnea-hypopnea index estimation apparatus, method, and computer-executable instructions | |
| CN115530787B (en) | Signal processing method and device for vehicle and vehicle |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |