[go: up one dir, main page]

CN115944303B - Method, system and storage medium for online compression of electrocardiogram pulse signal - Google Patents

Method, system and storage medium for online compression of electrocardiogram pulse signal Download PDF

Info

Publication number
CN115944303B
CN115944303B CN202310014669.5A CN202310014669A CN115944303B CN 115944303 B CN115944303 B CN 115944303B CN 202310014669 A CN202310014669 A CN 202310014669A CN 115944303 B CN115944303 B CN 115944303B
Authority
CN
China
Prior art keywords
data
pulse signal
buffer
amplitude
ecg
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310014669.5A
Other languages
Chinese (zh)
Other versions
CN115944303A (en
Inventor
丑永新
周妍
杨海萍
朱培逸
鲁明丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changshu Institute of Technology
Original Assignee
Changshu Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changshu Institute of Technology filed Critical Changshu Institute of Technology
Priority to CN202310014669.5A priority Critical patent/CN115944303B/en
Publication of CN115944303A publication Critical patent/CN115944303A/en
Application granted granted Critical
Publication of CN115944303B publication Critical patent/CN115944303B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

The invention discloses an on-line electrocardio pulse signal compression method, which comprises the following steps: the method comprises the steps of collecting electrocardiosignals and pulse signals, performing analog-to-digital conversion and real-time filtering processing on the signals, firstly improving the existing adaptive filter, and adding a high-frequency noise estimation part; then, combining the data updating process of the cache region of the microprocessor system with the self-adaptive filtering principle, and calculating in a sliding window iteration mode to realize real-time filtering of the pulse signals of the first points; key points of the electrocardio pulse signals are extracted, compressed, encoded and transmitted on line; and after the upper computer decodes the received data, recovering the electrocardio pulse signals by adopting a cubic spline interpolation method, and performing performance evaluation by utilizing the minimum mean square error and the compression ratio. The compression ratio is effectively improved, and the compressed data can be applied to heart rate and pulse rate extraction of the electrocardio pulse signals. The intelligent wearable device with high real-time requirements can be used for intelligent wearable devices such as a bracelet and a watch.

Description

心电脉搏信号在线压缩方法、系统及存储介质Method, system and storage medium for online compression of electrocardiogram pulse signal

技术领域Technical Field

本发明涉及信号处理和压缩领域,尤其涉及一种心电脉搏信号在线压缩方法、系统及存储介质。The present invention relates to the field of signal processing and compression, and in particular to an online compression method, system and storage medium for an electrocardiogram pulse signal.

背景技术Background technique

心电脉搏信号中含有人体丰富的生理和病理信息,用于监测血氧饱和度、心率、心率变异性、血压等临床生理参数。目前,一些可穿戴设备,如智能手表,手环,从脉搏信号中提取脉律,用于日常生活状态下人体健康状况的评估。长时间的数据采集会产生海量的数据,对存储容量和处理速度有限的可穿戴设备来说,大量的数据给系统的传输、储存和处理等问题带来了沉重的负担。因此,目前,考虑到可穿戴设备存储空间有限、CPU处理速度及数据传输量、电池容量等因素,可穿戴设备只能进行脉率或血氧饱和度的计算及远传,而不长时间存储原始心电脉搏信号。然而,原始心电脉搏信号中还有大量有关人体健康的信息。因此,缓存并远传原始心电脉搏信号十分重要。The ECG pulse signal contains rich physiological and pathological information of the human body, which is used to monitor clinical physiological parameters such as blood oxygen saturation, heart rate, heart rate variability, and blood pressure. At present, some wearable devices, such as smart watches and bracelets, extract pulse rhythm from pulse signals for the assessment of human health in daily life. Long-term data collection will generate massive amounts of data. For wearable devices with limited storage capacity and processing speed, a large amount of data brings a heavy burden to the system's transmission, storage, and processing. Therefore, at present, considering the limited storage space of wearable devices, CPU processing speed and data transmission volume, battery capacity and other factors, wearable devices can only calculate and transmit pulse rate or blood oxygen saturation, but not store the original ECG pulse signal for a long time. However, there is still a lot of information about human health in the original ECG pulse signal. Therefore, it is very important to cache and transmit the original ECG pulse signal.

目前生物医学数据压缩技术分为三种:直接压缩法、基于变换的压缩技术、基于参数提取的压缩技术。直接压缩法压缩数据耗费的时间较长且压缩比较低;基于变换的压缩技术往往需要复杂的计算,且直接压缩技术和基于变换的压缩技术两种方法压缩后的数据不能直接处理,需要在解压恢复后才能处理;基于参数提取的压缩技术易受噪声的影响,同时,参数的选择对压缩结果影响很大。At present, there are three types of biomedical data compression technologies: direct compression, transformation-based compression, and parameter extraction-based compression. Direct compression takes a long time to compress data and has a low compression ratio; transformation-based compression often requires complex calculations, and the data compressed by direct compression and transformation-based compression cannot be processed directly and must be processed after decompression and recovery; parameter extraction-based compression technology is easily affected by noise, and the choice of parameters has a great influence on the compression results.

发明内容Summary of the invention

本申请实施例通过提供一种心电脉搏信号在线压缩方法、系统及存储介质,解决了现有技术中可穿戴设备的心电脉搏信号数据其高压缩比和压缩结果准确难以兼具的技术问题,实现了心电脉搏信号在经过高压缩比处理后,其压缩结果受压缩影响程度小,仍可准确使用。The embodiments of the present application provide an online compression method, system and storage medium for ECG pulse signals, thereby solving the technical problem in the prior art that it is difficult to achieve both a high compression ratio and accurate compression results for ECG pulse signal data of wearable devices. This ensures that after the ECG pulse signal is processed with a high compression ratio, its compression result is less affected by the compression and can still be used accurately.

一种心电脉搏信号在线压缩方法,包括以下步骤:An online compression method for an electrocardiogram pulse signal comprises the following steps:

S01:采集心电信号和脉搏信号,对信号进行模数转换,获取人体体表处的心电脉搏信号;S01: Collecting ECG signals and pulse signals, performing analog-to-digital conversion on the signals, and obtaining ECG pulse signals on the human body surface;

S02:设计自适应滤波器,改进现有的自适应滤波器,增加高频噪声估计部分;S02: Design an adaptive filter, improve the existing adaptive filter, and add a high-frequency noise estimation part;

S03:在线自适应滤波,将微处理器系统缓存区内的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波;S03: Online adaptive filtering, combining the data update process in the microprocessor system cache with the adaptive filtering principle, and using a sliding window iteration method to perform calculations to achieve real-time filtering of the ECG pulse signal;

S04:对心电脉搏信号的压缩及编码,将心电脉搏信号中的极值点和拐点统称为关键点,对心电脉搏信号的关键点在线提取,实现对心电脉搏信号的压缩;心电脉搏信号的压缩过程如下:根据极值点的定义确定极值,通过拉格朗日中值定理对相邻两个极值点间的直线进行计算,将心电脉搏信号与直线作差,得到差值曲线,提取差值曲线的极值点,实现对心电脉搏信号的压缩;对压缩后的心电脉搏信号编码,心电脉搏信号编码过程如下:将心电脉搏信号关键参数对应的位置和幅值根据微处理器的传输规则进行编码,保证编码后的数据长度是1个字节的整数倍,如果一个数据点的长度不是1个字节的整数倍,则给数据高位补0,直至满足条件。对于电压分辨率是10位的微处理器,编码后的每一个关键参数对应的位置和幅值占用3个字节,按照先位置后幅值的顺序对编码后的数据进行发送;S04: Compression and encoding of ECG pulse signal, the extreme points and inflection points in the ECG pulse signal are collectively referred to as key points, the key points of the ECG pulse signal are extracted online to achieve compression of the ECG pulse signal; the compression process of the ECG pulse signal is as follows: determine the extreme value according to the definition of the extreme point, calculate the straight line between two adjacent extreme points by Lagrange's middle value theorem, subtract the ECG pulse signal from the straight line to obtain the difference curve, extract the extreme points of the difference curve, and achieve compression of the ECG pulse signal; encode the compressed ECG pulse signal, the ECG pulse signal encoding process is as follows: encode the position and amplitude corresponding to the key parameters of the ECG pulse signal according to the transmission rules of the microprocessor to ensure that the encoded data length is an integer multiple of 1 byte. If the length of a data point is not an integer multiple of 1 byte, fill the high bit of the data with 0 until the condition is met. For a microprocessor with a voltage resolution of 10 bits, the position and amplitude corresponding to each key parameter after encoding occupy 3 bytes, and the encoded data is sent in the order of position first and amplitude later;

S05:解码与恢复,对压缩后的心电脉搏信号解码,心电脉搏信号解码过程如下:根据包头包尾的位置对接收到的数据进行提取划分,每3个字节的数据对应一个关键参数,其中,第1个字节对应的是关键参数的位置,第2个字节对应的是关键参数幅值的高8位,第3个字节对应的是关键参数幅值的低8位;根据高8位和低8位的信息对关键参数的幅值进行恢复,实现对心电脉搏信号的解码;所述的对心电脉搏信号恢复:采用三次样条插值的方法,对解码后的心电脉搏信号关键参数进行插值,实现对心电脉搏信号的恢复;S05: decoding and recovery, decoding the compressed ECG pulse signal, the ECG pulse signal decoding process is as follows: extracting and dividing the received data according to the position of the packet header and the packet tail, each 3 bytes of data corresponds to a key parameter, wherein the first byte corresponds to the position of the key parameter, the second byte corresponds to the high 8 bits of the key parameter amplitude, and the third byte corresponds to the low 8 bits of the key parameter amplitude; recovering the amplitude of the key parameter according to the high 8 bits and the low 8 bits of information to achieve decoding of the ECG pulse signal; recovering the ECG pulse signal: using a cubic spline interpolation method to interpolate the decoded ECG pulse signal key parameters to achieve recovery of the ECG pulse signal;

S06:对算法性能进行评估并对算法进行应用,采用均方根误差和压缩比对算法的性能进行评估,同时基于提取到的关键点,计算出脉搏主波波峰和脉搏波的主波间期,对心率进行计算。S06: Evaluate the performance of the algorithm and apply the algorithm. Use root mean square error and compression ratio to evaluate the performance of the algorithm. At the same time, based on the extracted key points, calculate the pulse main wave peak and the pulse wave main wave interval, and calculate the heart rate.

优选的,步骤S02中对信号进行高频噪声估计,包括:根据均值滤波可以有效滤除信号中高频噪声的特点,将均值滤波和微处理器数据更新过程相结合,当缓存区长度为M时,去除当前缓存区的最大值和最小值,对剩余的M-2个数据计算均值完成对信号中的高频噪声估计。Preferably, high-frequency noise estimation is performed on the signal in step S02, including: based on the characteristic that mean filtering can effectively filter out high-frequency noise in the signal, mean filtering is combined with a microprocessor data update process; when the buffer length is M, the maximum and minimum values of the current buffer are removed, and the mean of the remaining M-2 data is calculated to complete the high-frequency noise estimation in the signal.

优选的,步骤S03在线自适应滤波,将微处理器系统缓存区的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波,具体为:Preferably, step S03 is online adaptive filtering, which combines the data update process of the microprocessor system cache with the principle of adaptive filtering, and uses a sliding window iteration method to perform calculations to achieve real-time filtering of the ECG pulse signal, specifically:

基于滑窗迭代,将对数据的实时滤波转化为对当前整个缓存区的滤波;当新的采样点滑入数据缓存区时,缓存区内的数据完成更新,在原有的M-1个采样点的基础上完成对新采样点的数据处理。Based on sliding window iteration, the real-time filtering of the data is converted into filtering of the entire current buffer area; when a new sampling point slides into the data buffer area, the data in the buffer area is updated, and the data processing of the new sampling point is completed based on the original M-1 sampling points.

优选的,在线自适应滤波,具体包括,初始化过程和迭代过程:Preferably, the online adaptive filtering specifically includes an initialization process and an iteration process:

初始化过程:当前数据采样点小于等于数据缓存区的长度时(0≤n≤M-1),每个最新的采样点放在缓存区的第n个字节;然后,将数据缓存区内的采样值按升序的方式排列,计算均值对数据进行高频噪声估计;高频噪声估计结果记为[0,…,x0,…,xn];将滤除高频噪声后的输出作为自适应滤波器的参考输入端xn,进一步对数据进行在线自适应滤波运算,结果记为[0,…,y0,…,yn];然后,对滤波器的系数进行更新,直至采样点n=M-1时,完成初始化过程;Initialization process: When the current data sampling point is less than or equal to the length of the data buffer (0≤n≤M-1), each latest sampling point is placed in the nth byte of the buffer; then, the sampling values in the data buffer are arranged in ascending order, and the mean is calculated to estimate the high-frequency noise of the data; the high-frequency noise estimation result is recorded as [0,…,x 0 ,…,x n ]; the output after filtering out the high-frequency noise is used as the reference input x n of the adaptive filter, and the data is further subjected to online adaptive filtering operation, and the result is recorded as [0,…,y 0 ,…,y n ]; then, the filter coefficients are updated until the sampling point n=M-1, completing the initialization process;

迭代过程:当前数据采样点大于数据缓存区的长度时(n>M),缓存区内的数据均左移一位,每个最新的采样点放在缓存区的第M个字节;然后,将数据缓存区内的采样值按升序的方式排列,计算均值对数据进行高频噪声估计;高频噪声估计结果记为[xn(n-M+1),…,xn(M),…,xn(n)];将滤除高频噪声后的输出作为自适应滤波器的参考输入端xn,进一步对数据进行在线自适应滤波运算,结果记为[yn(n-M+1),…,yn(M),…,yn(n)];然后,对滤波器的系数进行更新,直至采样结束,完成迭代过程。Iterative process: When the current data sampling point is greater than the length of the data buffer (n>M), the data in the buffer are shifted left by one bit, and each latest sampling point is placed in the Mth byte of the buffer; then, the sampling values in the data buffer are arranged in ascending order, and the mean is calculated to estimate the high-frequency noise of the data; the high-frequency noise estimation result is recorded as [ xn (n-M+1),…, xn (M),…, xn (n)]; the output after filtering out the high-frequency noise is used as the reference input xn of the adaptive filter, and the data is further subjected to online adaptive filtering operation, and the result is recorded as [ yn (n-M+1),…, yn (M),…, yn (n)]; then, the filter coefficients are updated until the sampling is completed, and the iterative process is completed.

优选的步骤S04中对心电脉搏信号的压缩是通过提取信号中的关键点来实现的:Preferably, the compression of the ECG pulse signal in step S04 is achieved by extracting key points in the signal:

信号中的关键点由极值点和拐点组成;根据极值点的定义,至少通过三个点来判断极值;将当前数据缓存区记为buffer,如果buffer(M-2)均大于buffer(M-1)和buffer(M-3),则buffer(M-2)为极大值;如果buffer(M-2)均小于buffer(M-1)和buffer(M-3),则buffer(M-2)为极小值;设置两个数组E和L分别来存储极值点对应的幅值和位置;buffer(j)是已知的极值点,其中,buffer(j)的幅值和位置分别被存储在E(3)和L(3)中;在数据不断采集处理的过程中,如果buffer(M-2)不是极值点,则上一个极值点buffer(j)的幅值E(3)保持不变,位置L(3)减1;如果buffer(M-2)是极值点,则上一个极值点buffer(j)的幅值E(3)左移三位被存储在E(0),位置L(3)左移三位被存储在L(0),当前极值点buffer(M-2)的幅值和位置被存储在E(3)和L(3)中;The key points in the signal are composed of extreme points and inflection points. According to the definition of extreme points, at least three points are used to judge the extreme values. The current data buffer is recorded as buffer. If buffer(M-2) is greater than buffer(M-1) and buffer(M-3), then buffer(M-2) is the maximum value. If buffer(M-2) is less than buffer(M-1) and buffer(M-3), then buffer(M-2) is the minimum value. Two arrays E and L are set to store the amplitude and position corresponding to the extreme points respectively. Buffer(j) is a known extreme point. , the amplitude and position of buffer(j) are stored in E(3) and L(3) respectively; in the process of continuous data acquisition and processing, if buffer(M-2) is not an extreme point, the amplitude E(3) of the previous extreme point buffer(j) remains unchanged, and the position L(3) decreases by 1; if buffer(M-2) is an extreme point, the amplitude E(3) of the previous extreme point buffer(j) is shifted left by three bits and stored in E(0), and the position L(3) is shifted left by three bits and stored in L(0), and the amplitude and position of the current extreme point buffer(M-2) are stored in E(3) and L(3);

拐点的提取过程如下,极值点确定后,通过拉格朗日中值定理对相邻两个极值点间的直线进行计算,将心电脉搏信号与直线作差,得到差值曲线,对插值曲线的极值点进行计算,即为心电脉搏信号的拐点,其对应的参数存储在E(1)、E(2)以及L(1)、L(2)中。The process of extracting the inflection point is as follows: after the extreme point is determined, the straight line between two adjacent extreme points is calculated using the Lagrange middle value theorem, the ECG pulse signal is subtracted from the straight line to obtain a difference curve, and the extreme point of the interpolation curve is calculated, which is the inflection point of the ECG pulse signal. Its corresponding parameters are stored in E(1), E(2) and L(1), L(2).

优选的,微处理器是按照1个字节的整数倍对数据进行传输发送的,在编码过程中,要保证编码后的数据是1个字节的整数倍,如果一个数据的长度不是1个字节的整数倍,则给高位补零,直至满足条件;心电脉搏信号在微处理器中经过滤波处理后,数据类型变成了浮点型,强制将数据类型转为整型,进一步对数据进行关键参数提取;对于输入电压分辨率是10位的微处理器来说,编码后的每一个关键参数的位置和幅值占用3个字节,其中,第1个字节对应的是关键参数的位置,后两个字节对应的是关键参数的幅值。Preferably, the microprocessor transmits and sends data in integer multiples of 1 byte. During the encoding process, it is necessary to ensure that the encoded data is an integer multiple of 1 byte. If the length of a data is not an integer multiple of 1 byte, the high bit is padded with zeros until the condition is met; after the ECG pulse signal is filtered in the microprocessor, the data type becomes a floating point type, and the data type is forced to be converted into an integer type, and key parameters are further extracted from the data; for a microprocessor with an input voltage resolution of 10 bits, the position and amplitude of each key parameter after encoding occupy 3 bytes, among which the first byte corresponds to the position of the key parameter, and the last two bytes correspond to the amplitude of the key parameter.

优选的,微处理器将编码后的关键参数按照先位置后幅值的顺序进行发送与接收,根据包头包尾的位置对接收到的数据进行划分,每3个字节对应一个关键点的特征参数;设置数组D和数组P来存储解码后关键点的位置和幅值,其中,第1个字节对应的关键参数的位置被存储在D(M-1),第2个字节对应的是关键参数幅值的高8位,第3个字节对应的是关键参数幅值的低8位,根据高8位和低8位的信息对关键参数的幅值进行恢复,恢复后的关键参数的幅值被存储在P(M-1)。Preferably, the microprocessor sends and receives the encoded key parameters in the order of position first and amplitude later, divides the received data according to the position of the packet header and the packet tail, and every 3 bytes correspond to the characteristic parameters of a key point; sets array D and array P to store the position and amplitude of the key point after decoding, wherein the position of the key parameter corresponding to the first byte is stored in D(M-1), the second byte corresponds to the high 8 bits of the key parameter amplitude, and the third byte corresponds to the low 8 bits of the key parameter amplitude; the amplitude of the key parameter is restored according to the high 8 bits and the low 8 bits of information, and the restored amplitude of the key parameter is stored in P(M-1).

一种心电脉搏信号在线压缩系统,包括:数据采集模块,可完成心电信号和脉搏信号的采集;滤波处理模块,对信号进行自适应滤波;压缩模块,进行信号压缩、编码并发送;解压缩模块,对信号进行接收、储存、解码。An online compression system for electrocardiograph pulse signals comprises: a data acquisition module for collecting electrocardiograph signals and pulse signals; a filtering processing module for adaptively filtering signals; a compression module for compressing, encoding and sending signals; and a decompression module for receiving, storing and decoding signals.

优选的,滤波处理模块包括:高频噪声估计模块、自适应滤波算法模块、滤波器模块。Preferably, the filtering processing module includes: a high-frequency noise estimation module, an adaptive filtering algorithm module, and a filter module.

一种计算机存储介质,其上存储有计算机程序,计算机程序被执行时实现上述的心电脉搏信号在线压缩方法。A computer storage medium stores a computer program, which realizes the above-mentioned online compression method of electrocardiogram pulse signal when executed.

本申请实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

1、不依赖于任何复杂的数学变换,算法速度快;采用心电脉搏信号对所提出的算法进行验证,用时间作为衡量速度的标准,所提出的方法有望用于手环、手表等实时性要求较高的只能可穿戴设备。1. It does not rely on any complex mathematical transformation and has a fast algorithm. The proposed algorithm is verified using ECG pulse signals and time is used as a measure of speed. The proposed method is expected to be used in smart wearable devices with high real-time requirements such as bracelets and watches.

2、根据心电脉搏信号的波形特征,提出一种基于时域特征的压缩方法;压缩后的信号保持原始信号中的关键特征(极值和拐点),通过这些特征可以衍生出更多的特征信息,如脉搏波传播时间、脉搏波传播速度等。这些特征信息包含了心率、脉率、波高、面积等关键信号参数。2. According to the waveform characteristics of the ECG pulse signal, a compression method based on time domain characteristics is proposed; the compressed signal retains the key features (extreme values and inflection points) of the original signal, and more characteristic information can be derived from these features, such as pulse wave propagation time, pulse wave propagation speed, etc. These characteristic information includes key signal parameters such as heart rate, pulse rate, wave height, and area.

3、将微处理器系统缓存区的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波。对心电脉搏信号的特征参数在线提取,提高了压缩比,且压缩后的数据影响较小,在恢复数据与原始数据可接受的误差范围内。3. The data update process of the microprocessor system cache is combined with the principle of adaptive filtering, and the sliding window iteration method is used for calculation to realize real-time filtering of the ECG pulse signal. The characteristic parameters of the ECG pulse signal are extracted online, which improves the compression ratio, and the compressed data has little impact, within the acceptable error range between the restored data and the original data.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请的心电脉搏信号在线压缩方法流程图;FIG1 is a flow chart of an online compression method for an electrocardiogram pulse signal of the present application;

图2为本申请的自适应滤波流程图;FIG2 is a flowchart of the adaptive filtering of the present application;

图3为本申请的微处理器数据缓存更新过程;FIG3 is a microprocessor data cache update process of the present application;

图4是脉搏信号中的关键点组成示意图Figure 4 is a schematic diagram of the key points in the pulse signal

图5是关键点保存示意图;Fig. 5 is a schematic diagram of key point preservation;

图6是极值提取过程示意图;FIG6 is a schematic diagram of an extreme value extraction process;

图7是关键点提取过程流程图;FIG7 is a flowchart of a key point extraction process;

图8是拐点提取过程示意图;FIG8 is a schematic diagram of an inflection point extraction process;

图9是关键点参数编码过程示意图;FIG9 is a schematic diagram of a key point parameter encoding process;

图10是关键点参数解码过程示意图;FIG10 is a schematic diagram of a key point parameter decoding process;

图11是不同插值方法下信号恢复对比示意图;FIG11 is a schematic diagram showing the comparison of signal recovery under different interpolation methods;

图12是脉搏信号、心电信号分别在压缩前、重构后的波形对比;FIG12 is a waveform comparison of the pulse signal and the ECG signal before compression and after reconstruction;

图13是动态阈值法提取峰值的流程图;FIG13 is a flow chart of a dynamic threshold method for extracting peak values;

图14是压缩前后脉率对比图;Figure 14 is a comparison of pulse rates before and after compression;

图15是硬件系统中得到的实时脉率;Figure 15 is the real-time pulse rate obtained in the hardware system;

图16是信号压缩和解压缩的过程。Figure 16 shows the process of signal compression and decompression.

具体实施方式Detailed ways

本申请实施例通过提供一种心电脉搏信号在线压缩方法、系统及存储介质,解决了现有技术中可穿戴设备的心电脉搏信号数据其高压缩比和压缩结果准确难以兼具的技术问题,The embodiments of the present application provide a method, system and storage medium for online compression of electrocardiogram pulse signals, which solve the technical problem in the prior art that it is difficult to achieve both high compression ratio and accurate compression results for electrocardiogram pulse signal data of wearable devices.

本申请实施例中的技术方案为解决上述串扰的问题,总体思路如下:对传统的自适应滤波器进行改进,增加高频噪声估计部分;将微处理器系统缓存区的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波;对心电脉搏信号的关键点在线提取,实现对心电脉搏信号的压缩与编码;对关键参数进行解码,采用三次样条插值的方法对心电脉搏信号进行恢复。The technical solution in the embodiment of the present application is to solve the above-mentioned crosstalk problem, and the overall idea is as follows: improve the traditional adaptive filter and add a high-frequency noise estimation part; combine the data update process of the microprocessor system cache area with the adaptive filtering principle, and use a sliding window iteration method to perform calculations to achieve real-time filtering of the ECG pulse signal; extract the key points of the ECG pulse signal online to achieve compression and encoding of the ECG pulse signal; decode the key parameters and use the cubic spline interpolation method to restore the ECG pulse signal.

根据自适应滤波方法的特点,对信号中的噪声进行抑制有效地提高了压缩比,且压缩后的数据能应用于心电脉搏信号的心率和脉率提取。According to the characteristics of the adaptive filtering method, the noise in the signal is suppressed to effectively improve the compression ratio, and the compressed data can be used to extract the heart rate and pulse rate of the ECG pulse signal.

为了更好的理解上述技术方案,下面将结合说明书附图以及具体的实施方式对上述技术方案进行详细的说明。In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

如图16所示,心电脉搏信号压缩和恢复的过程分为数据采样压缩和数据解压缩。在信号处理过程中,前半部分在下位机工作,包括:信号采样、自适应滤波、信号压缩、信号编码和发送;后半部分在上位机工作,包括:信号接收存储、信号解压缩和信号恢复。As shown in Figure 16, the process of ECG pulse signal compression and recovery is divided into data sampling compression and data decompression. In the signal processing process, the first half works on the lower computer, including: signal sampling, adaptive filtering, signal compression, signal encoding and sending; the second half works on the upper computer, including: signal reception and storage, signal decompression and signal recovery.

如图1所示,一种心电脉搏信号在线压缩方法包括以下步骤:As shown in FIG1 , an online compression method for an electrocardiogram pulse signal comprises the following steps:

S01:采集心电信号和脉搏信号,对信号进行模数转换,获取人体体表处的心电脉搏信号。S01: Collecting ECG signals and pulse signals, performing analog-to-digital conversion on the signals, and obtaining ECG pulse signals at the human body surface.

心电信号和脉搏信号由光学传感器捕获,在下位机模块经过放大和滤波电,然后被采样和压缩。The ECG and pulse signals are captured by optical sensors, amplified and filtered in the lower computer module, and then sampled and compressed.

采用脉搏信号采集系统对30名测试者进行信号采集。实验前,事先征得实验对象的同意并签署了书面同意书,确保测试者的健康状况。在医院伦理委员会的监督下,以1000Hz的采样频率对30名测试者分别进行4分钟的信号采样。The pulse signal acquisition system was used to collect signals from 30 test subjects. Before the experiment, the consent of the test subjects was obtained in advance and a written consent form was signed to ensure the health of the test subjects. Under the supervision of the hospital ethics committee, the signal sampling of the 30 test subjects was carried out for 4 minutes at a sampling frequency of 1000 Hz.

采用高斯函数构建脉搏信号,脉搏信号由三个高斯函数合成。记一个脉搏波为x(k),根据脉搏信号特点,干净的脉搏波由三个高斯函数合成,对应实际脉搏波的主波、重搏前波和重搏波,其表达式为:Gaussian function is used to construct the pulse signal, which is synthesized by three Gaussian functions. Let a pulse wave be x(k). According to the characteristics of the pulse signal, the clean pulse wave is synthesized by three Gaussian functions, corresponding to the main wave, pre-dicrotic wave and dicrotic wave of the actual pulse wave, and its expression is:

其中,Ai决定高斯函数图像的高度,A1=0.8,A2=0.5,A3=0.4;pi决定图像峰值位置,p1=0.25,p2=0.45,p3=0.70;bi决定图像宽度,b1=0.012,b2=0.010,b3=0.030;Among them, Ai determines the height of the Gaussian function image, A1 = 0.8, A2 = 0.5, A3 = 0.4; pi determines the image peak position, p1 = 0.25, p2 = 0.45, p3 = 0.70; bi determines the image width, b1 = 0.012, b2 = 0.010, b3 = 0.030;

采用高斯函数构建心电信号,心电信号由六个高斯函数合成。记一个脉搏波为E(k)计算公式如下,The electrocardiogram signal is constructed by using Gaussian function, and the electrocardiogram signal is synthesized by six Gaussian functions. Let a pulse wave be E(k) and the calculation formula is as follows:

其中,Ai决定高斯函数图像的高度,A1=0.04,A2=-0.01,A3=0.95,A4=-0.14,A5=0.01,A6=0.17;μi为图像期望值,μ1=68.6,μ2=95.4,μ3=100.5,μ4=106.2,μ5=126.9,μ6=170.4;σLi、σ1i为图像标准差,σL1=12,σL2=0,σL3=4.9,σL4=7.3,σL5=0,σL6=0、σ11=12.3,σ12=337.1,σ13=9.6,σ14=2.2,σ15=42.9,σ16=60.3;Wherein, Ai determines the height of the Gaussian function image, A1 = 0.04, A2 = -0.01, A3 = 0.95, A4 = -0.14, A5 = 0.01, A6 = 0.17; μi is the expected value of the image, μ1 = 68.6, μ2 = 95.4, μ3 = 100.5, μ4 = 106.2, μ5 = 126.9, μ6 = 170.4; σLi , σ1i are the standard deviations of the image, σL1 = 12, σL2 = 0, σL3 = 4.9, σL4 = 7.3, σL5 = 0, σL6 = 0, σ11 = 12.3, σ12 = 337.1, σ13 = 9.6, σ14 = 2.2, σ15 =42.9,σ 16 =60.3;

S02:心电信号和脉搏信号滤波处理,首先对信号进行高频噪声估计,然后通过自适应滤波算法和滤波器去除信号中的噪声。S02: Filtering of ECG and pulse signals. First, the high-frequency noise of the signal is estimated, and then the noise in the signal is removed by an adaptive filtering algorithm and a filter.

如图2所示,本申请的滤波方法器由高频噪声估计、系数可调的数字滤波器和用来修正滤波器参数的自适应算法三部分构成。As shown in FIG. 2 , the filtering method of the present application is composed of three parts: high-frequency noise estimation, a digital filter with adjustable coefficients, and an adaptive algorithm for correcting filter parameters.

对实际采集到的含有噪声的信号进行高频噪声估计,由公式(3)表示:The high-frequency noise of the actually collected noisy signal is estimated, which is expressed by formula (3):

其中,xn为滤除高频噪声后的输出,即自适应滤波器的输入端;buffer为微处理器数据缓存区且buffer内的数据按升序方式排列;M是数据缓存区的长度。Among them, xn is the output after filtering out high-frequency noise, that is, the input end of the adaptive filter; buffer is the data buffer of the microprocessor and the data in the buffer are arranged in ascending order; M is the length of the data buffer.

通过自适应滤波器去除信号中的噪声,即寻找系统输出误差en的最小值,en是自适应滤波器的输出误差,其表达式为:The noise in the signal is removed by the adaptive filter, that is, the minimum value of the system output error en is found. En is the output error of the adaptive filter, and its expression is:

en=dn-yn (4)e n = d n - yn (4)

其中,dn为自适应滤波器的主输入;yn为自适应滤波器的输出。Among them, d n is the main input of the adaptive filter; y n is the output of the adaptive filter.

最小均方误差(LMS)算法是初始信号和参考信号之间的一种迭代方法,它通过连续迭代使均方误差最小,LMS算法通过滤波器在n时刻的系数来更新和修正n+1时刻的参数,计算公式如下:The least mean square error (LMS) algorithm is an iterative method between the initial signal and the reference signal. It minimizes the mean square error through continuous iteration. The LMS algorithm updates and corrects the parameters at time n+1 through the coefficients of the filter at time n. The calculation formula is as follows:

wn+1=wn+2uxnsn (5)w n+1 = w n +2ux n s n (5)

其中,u代表自适应滤波器的收敛因子,控制LMS算法的稳定性和收敛速度;wn是采样点对应的滤波器的系数,表示为wn=[w0(n),w1(n)…,wM-1(n)]T,M是滤波器的阶数;sn和输入信号x(k)中的噪声相关。Among them, u represents the convergence factor of the adaptive filter, which controls the stability and convergence speed of the LMS algorithm; w n is the coefficient of the filter corresponding to the sampling point, expressed as w n =[w 0 (n),w 1 (n)…,w M-1 (n)] T , M is the order of the filter; s n is related to the noise in the input signal x(k).

权向量wn的更新依赖于输入数据sn,因此,若假定相继的输入数据是独立的,即有wn与sn独立,由此可得LMS滤波算法的权向量的数学期望为:The update of the weight vector w n depends on the input data sn . Therefore, if it is assumed that the successive input data are independent, that is, w n and sn are independent, the mathematical expectation of the weight vector of the LMS filtering algorithm can be obtained as follows:

其中,w0为权向量的最佳维纳解;R为输入向量的自相关矩阵E[x(n)xT(n);令vn=E(wn)-w0,则式(6)可以表示为:Where w0 is the optimal Wiener solution of the weight vector; R is the autocorrelation matrix E[x(n)x T (n) of the input vector; let vn = E( wn ) -w0 , then equation (6) can be expressed as:

vn+1=(I-2uR)vn (7)v n+1 =(I-2uR)v n (7)

用特征值分解可将相关矩阵R分解为:The correlation matrix R can be decomposed into:

R=QΛQT (8)R=QΛQ T (8)

其中,矩阵Q为变换的酉矩阵,其每列向量与矩阵R的特征值相关的一组正交特征向量;矩阵Λ为一对角矩阵,且矩阵R的所有特征值作为它的对角元素,这些特征值均为正实数,记为[λ12,…,λn];将式(7)左乘QT可得:Wherein, the matrix Q is a transformed unitary matrix, and each column vector thereof is a set of orthogonal eigenvectors related to the eigenvalues of the matrix R; the matrix Λ is a diagonal matrix, and all the eigenvalues of the matrix R are its diagonal elements, and these eigenvalues are all positive real numbers, denoted as [λ 12 ,…,λ n ]; multiplying equation (7) by Q T on the left yields:

QTvn+1=(I-2uR)QTvn (9)Q T v n+1 = (I-2uR)Q T v n (9)

令cn=QTvn,cn的初始值为c0,则式(9)可简化为:Let c n =Q T v n , the initial value of c n is c 0 , then equation (9) can be simplified to:

cn=(I-2uΛn)c0 (10)c n =(I-2uΛ n )c 0 (10)

将式(10)展开,可得到M个互相独立的标量方程,即:Expanding equation (10) yields M independent scalar equations, namely:

为了保证系数在平均意义上的收敛,则必须满足解之得到LMS算法的步长因子满足收敛的条件为:In order to ensure the convergence of the coefficients in the average sense, it is necessary to satisfy The solution is that the step size factor of the LMS algorithm meets the convergence condition:

其中,λmax为相关矩阵R的最大特征值。当迭代次数趋于无穷时,滤波器的权向量wn逼近维纳解w0Where λ max is the maximum eigenvalue of the correlation matrix R. When the number of iterations tends to infinity, the weight vector w n of the filter approaches the Wiener solution w 0 .

在数据采集过程中,一些噪声不可避免地被采集,信号中的噪声主要是基线漂移、工频干扰和肌电干扰。通过上述方法进行信号采集后、压缩前的噪声抑制,可有效地避免工频干扰和肌电干扰,即可避免噪声对极值信息的干扰。In the process of data acquisition, some noise is inevitably collected. The noise in the signal is mainly baseline drift, power frequency interference and electromyographic interference. By using the above method to suppress noise after signal acquisition and before compression, power frequency interference and electromyographic interference can be effectively avoided, that is, the interference of noise on extreme value information can be avoided.

S03:采用滑窗迭代进行计算,实现对脉搏信号的实时滤波。S03: Using sliding window iteration to perform calculations to achieve real-time filtering of the pulse signal.

将微处理器系统缓存区的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对脉搏信号的实时滤波。根据当前数据采样点与数据缓存区长度的关系,实时滤波分为两步:初始化过程和迭代过程。The data update process of the microprocessor system cache is combined with the principle of adaptive filtering, and the sliding window iteration method is used for calculation to achieve real-time filtering of the pulse signal. According to the relationship between the current data sampling point and the length of the data cache, the real-time filtering is divided into two steps: initialization process and iteration process.

如图3所示,假设缓存区可存储M个采样点,每采集一个新的采样点,就需要进行数据更新。首先,移除最早缓存(最左端)的采样点data(0);然后,将data(1)~data(M-1)向左移动一位;最后,将新的采样点data(M)放在最右端。如果数据流固定,则缓存区就像一个窗口逐位在数据流中滑动,该过程称为滑窗。每次滑窗,缓存区内只有最左端和最右端的数值改变,其它采样点仅仅改变了位置而数值保持不变。As shown in Figure 3, assuming that the buffer can store M sampling points, each time a new sampling point is collected, data needs to be updated. First, remove the earliest cached (leftmost) sampling point data(0); then, move data(1) to data(M-1) one position to the left; finally, place the new sampling point data(M) at the rightmost end. If the data stream is fixed, the buffer is like a window that slides bit by bit in the data stream. This process is called sliding window. Each time the window slides, only the leftmost and rightmost values in the buffer change, and the other sampling points only change their positions while the values remain unchanged.

初始化过程:Initialization process:

当采样点的数量小于或等于缓冲区的长度时(0≤n≤M-1),最新的采样点被放在缓冲区的第n个字节中。然后,根据公式(3)对高频噪声进行估计,根据公式(5)对滤波器的系数进行更新,并将滤波后的结果记为[0,…,y0,…,yn],直至采样点n=M-1时,完成初始化过程。When the number of sampling points is less than or equal to the length of the buffer (0≤n≤M-1), the latest sampling point is placed in the nth byte of the buffer. Then, the high-frequency noise is estimated according to formula (3), the filter coefficients are updated according to formula (5), and the filtered result is recorded as [0,…,y 0 ,…,y n ] until the sampling point n=M-1, completing the initialization process.

迭代过程:Iteration process:

当采样点的数量大于缓冲区的长度时(n>M-1),就进入了迭代过程。与初始化过程相同,缓冲区的数据和中间变量通过滑动窗口更新。数据更新完成后,对数据缓存区内的数据进行处理,计算过程与初始化过程相同,将自适应滤波后的结果记为[yn(n-M+1),…,yn(M),…,yn(n)];直至采样结束,完成迭代过程。When the number of sampling points is greater than the length of the buffer (n>M-1), the iteration process begins. As in the initialization process, the data in the buffer and the intermediate variables are updated through the sliding window. After the data update is completed, the data in the data buffer is processed, and the calculation process is the same as the initialization process. The result after adaptive filtering is recorded as [y n (n-M+1),…,y n (M),…,y n (n)]; until the sampling is completed, the iteration process is completed.

基于滑窗迭代,将对数据的实时滤波转化为对当前整个缓存区的滤波;当新的采样点滑入数据缓存区时,缓存区内的数据完成更新,在原有的M-1个采样点的基础上完成对新采样点的数据处理;根据均值滤波可以有效滤除信号中高频噪声的特点,将均值滤波和微处理器数据更新过程相结合,去除当前缓存区的最大值和最小值,对剩余的M-2个数据计算均值完成对信号中的高频噪声估计。Based on sliding window iteration, the real-time filtering of data is converted into filtering of the entire current buffer area; when a new sampling point slides into the data buffer area, the data in the buffer area is updated, and the data processing of the new sampling point is completed on the basis of the original M-1 sampling points; according to the characteristic that mean filtering can effectively filter out high-frequency noise in the signal, mean filtering and microprocessor data update process are combined to remove the maximum and minimum values of the current buffer area, and the mean of the remaining M-2 data is calculated to complete the estimation of high-frequency noise in the signal.

S04:从滤波后的信号中提取关键点,进行信号压缩,在微处理单元中编码和发送。S04: extract key points from the filtered signal, perform signal compression, encode and send in the microprocessing unit.

对于常见的无间断点的信号(如正余弦、三角波等有拐点及极值点的随机曲线),在信号处理中,信号中的极值和拐点等特征在信号进一步处理中有着十分重要的作用。压缩信号时尽可能的保留这些特征,使得在信号恢复后保持这些特征十分重要。For common signals without discontinuities (such as random curves with inflection points and extreme points such as sine, cosine, triangle waves, etc.), in signal processing, the extreme values and inflection points in the signal play a very important role in further signal processing. It is very important to retain these features as much as possible when compressing the signal so that these features can be maintained after the signal is restored.

较佳的实现中,步骤S04中的关键点包括极值点。In a preferred implementation, the key points in step S04 include extreme value points.

如图4所示,所提出的压缩算法保留了信号中的极值特征,极值的提取容易受工频干扰和肌电干扰的影响,通过设计的自适应滤波器来抑制这些噪声对极值信息的干扰。极值点通过起点A,主波波峰B,主波波谷C,潮波波峰D,潮波波谷E,重搏波波峰以及终点A’确定。脉搏波在时域的幅值信息用Hi表示,ti为Hi对应的位置信息,PPI指的是脉搏波的长度或者脉搏波的周期。而且,通过这些特征信息可以衍生出更多的特征信息,比如,主波相位周期比t1/H1,脉搏波的传播时间,脉搏波的传播速度等。这些衍生出来的特征信息可以用于血压和其它生理指标的监测。因此,将极值点作为压缩结果的一部分。As shown in Figure 4, the proposed compression algorithm retains the extreme value features in the signal. The extraction of extreme values is easily affected by power frequency interference and electromyographic interference. The designed adaptive filter is used to suppress the interference of these noises on the extreme value information. The extreme point is determined by the starting point A, the main wave peak B, the main wave trough C, the tidal wave peak D, the tidal wave trough E, the dicrotic wave peak and the end point A'. The amplitude information of the pulse wave in the time domain is represented by Hi , ti is the position information corresponding to Hi , and PPI refers to the length of the pulse wave or the period of the pulse wave. Moreover, more characteristic information can be derived from these characteristic information, such as the main wave phase period ratio t1 / H1 , the propagation time of the pulse wave, the propagation speed of the pulse wave, etc. These derived characteristic information can be used to monitor blood pressure and other physiological indicators. Therefore, the extreme point is used as part of the compression result.

如图5所示,特征点的位置和幅值信息被存储在初始化数组E和数组L中。由极值点的定义可知,至少需要三个点判断采样点是否为极值。如图6所示,如果y(N-2)是极小值,则有:As shown in Figure 5, the position and amplitude information of the feature points are stored in the initialization array E and array L. From the definition of extreme points, we know that at least three points are needed to determine whether the sampling point is an extreme value. As shown in Figure 6, if y(N-2) is a minimum value, then:

y(N-2)≤y(N-1) (13)y(N-2)≤y(N-1) (13)

y(N-2)≤y(N-3) (14)y(N-2)≤y(N-3) (14)

如果y(N-2)是极大值,则有:If y(N-2) is a maximum value, then:

y(N-2)≥y(N-1) (15)y(N-2)≥y(N-1) (15)

y(N-2)≥y(N-3) (16)y(N-2)≥y(N-3) (16)

式中:N为数据缓存区buffer的长度。Where: N is the length of the data buffer.

如图7所示,进行数据的更新。y(j)是已知的极值点,y(j)的幅值和位置分别被存储E(3)和L(3)中。当最新采样点滤波完成后,通过三个采样点来判断y(N-2)是否为极值点。如果y(N-2)是极值点,则E(3)和L(3)左移四位,y(N-2)的幅值和位置信息被存储在E(3)和L(3)中。并且,E(0)和L(3)中其它的特征点y(p)和y(q)的信息也可以被计算出来。如果y(N-2)不是极值点,数组E保持不变,L(3)减1。运算结束后,数据缓存区内的所有数据都左移一位完成更新。As shown in Figure 7, the data is updated. y(j) is a known extreme point, and the amplitude and position of y(j) are stored in E(3) and L(3) respectively. After the latest sampling point filtering is completed, three sampling points are used to determine whether y(N-2) is an extreme point. If y(N-2) is an extreme point, E(3) and L(3) are shifted left by four bits, and the amplitude and position information of y(N-2) are stored in E(3) and L(3). In addition, the information of other feature points y(p) and y(q) in E(0) and L(3) can also be calculated. If y(N-2) is not an extreme point, array E remains unchanged and L(3) is reduced by 1. After the operation is completed, all data in the data buffer are shifted left by one bit to complete the update.

较佳的实现中,步骤S04中的关键点包括拐点。In a preferred implementation, the key point in step S04 includes an inflection point.

如图4所示,相邻极值点间的曲线上仍有一些关键点对信号的恢复起着重要的作用,比如,曲线AB上的点a和点b,将这些点统称为拐点。因此,拐点也作为压缩结果的一部分。As shown in Figure 4, there are still some key points on the curve between adjacent extreme points that play an important role in signal recovery, such as point a and point b on curve AB, which are collectively referred to as inflection points. Therefore, inflection points are also part of the compression result.

如图8所示,将曲线AB减去点AB间的直线得到了一条新的差值曲线,点a和点b是差值曲线的波峰和波谷的位置。因此,差值曲线的波峰点和波谷点作为压缩结果的一部分。As shown in Figure 8, a new difference curve is obtained by subtracting the straight line between points AB from curve AB, and points a and b are the peak and trough positions of the difference curve. Therefore, the peak and trough points of the difference curve are used as part of the compression result.

较佳的实现中,步骤S04中的关键点在微处理单元中被编码发送。In a preferred implementation, the key points in step S04 are encoded and sent in the micro-processing unit.

从信号中提取到的关键参数的位置和幅值在微处理单元(MCU)中被编码和发送。众所周知,MCU以一个字节(8位)来存储和发送数据,需要注意的是应确保编码后的数据长度是1个字节的整数倍,如果数据的长度不是1个字节的整数倍,则给高位补0,直至满足条件。比如,En和Ln为第n个特征点的幅值和位置,如果输入电压的分辨率是10位,信号的采样频率是200Hz,则存储第n个特征点的信息需要占用24位。因此,一个关键点的参数占用3个字节。如图9所示,避免传输过程中数据发生丢包的现象,给编码后的数据加上包头包尾,采用无线或者有线的方式将编码后的数据发送到上位机模块。The position and amplitude of the key parameters extracted from the signal are encoded and sent in the microprocessor unit (MCU). As we all know, MCU stores and sends data in one byte (8 bits). It should be noted that the length of the encoded data should be an integer multiple of 1 byte. If the length of the data is not an integer multiple of 1 byte, the high bit is filled with 0 until the condition is met. For example, En and Ln are the amplitude and position of the nth feature point. If the resolution of the input voltage is 10 bits and the sampling frequency of the signal is 200Hz, the information of the nth feature point needs to occupy 24 bits. Therefore, the parameters of a key point occupy 3 bytes. As shown in Figure 9, in order to avoid data loss during transmission, add a header and a tail to the encoded data, and send the encoded data to the host computer module wirelessly or wired.

S05:上位机对心电脉搏信号接收、储存、解码,恢复数据样本。S05: The host computer receives, stores, and decodes the ECG pulse signal and recovers the data sample.

接收、存储和解码压缩后的信号在上位机模块完成。微处理器将编码后的关键参数按照先位置后幅值的顺序进行发送与接收,根据包头包尾的位置对接收到的数据进行划分,每3个字节对应一个关键点的特征参数,其过程如图10所示。数组P和数组D用来存储解码后关键点的幅值和位置,例如,根据电压分辨率接收到的3字节的数据,其中,第一个字节的数据对应的是关键点的位置,存储在D(M-1)中,后两个字节分别对应的是关键参数幅值的高8位和低8位,将第二个字节的数据乘以256与第三个字节的数据相加得到关键点参数的幅值,存储在P(M-1)中。Receiving, storing and decoding the compressed signal are completed in the host computer module. The microprocessor sends and receives the encoded key parameters in the order of position first and amplitude second, and divides the received data according to the position of the packet header and the packet tail. Every 3 bytes correspond to the characteristic parameters of a key point. The process is shown in Figure 10. Arrays P and D are used to store the amplitude and position of the decoded key points. For example, according to the 3-byte data received according to the voltage resolution, the first byte of data corresponds to the position of the key point, which is stored in D(M-1), and the last two bytes correspond to the high 8 bits and low 8 bits of the key parameter amplitude respectively. The second byte of data is multiplied by 256 and added to the third byte of data to obtain the amplitude of the key point parameter, which is stored in P(M-1).

较佳的实现中,步骤S05中恢复数据样本采用三次样条插值法In a preferred implementation, the data samples are restored in step S05 using a cubic spline interpolation method.

三次样条插值法是一种在查询点插入的值基于邻点网格点处数值的保形分段三次插值的方法。如图11所示,根据压缩结果用不同插值方法对曲线AB恢复结果的示意图,三次样条插值在原始信号和重构信号之间产生的误差最小,因此,可将三次样条插值方法用于压缩后信号的恢复。压缩后的数据通过三次样条插值恢复,并用于进一步分析和处理。The cubic spline interpolation method is a method of shape-preserving piecewise cubic interpolation based on the values at the neighboring grid points at the interpolation value at the query point. As shown in Figure 11, the schematic diagram of the recovery results of curve AB using different interpolation methods based on the compression results shows that the cubic spline interpolation method produces the smallest error between the original signal and the reconstructed signal. Therefore, the cubic spline interpolation method can be used to recover the compressed signal. The compressed data is recovered by cubic spline interpolation and used for further analysis and processing.

S06:利用最小均方差和压缩比对性能进行评估。S06: Evaluate performance using minimum mean square error and compression ratio.

为了评估算法的性能,引用了一些指标,如最小均方误差(MSE)和压缩比(CR),计算公式如下:In order to evaluate the performance of the algorithm, some indicators are cited, such as the minimum mean square error (MSE) and compression ratio (CR), which are calculated as follows:

式中:其中,n是数据的索引,N是信号的长度,Rn和Sn分别对应于原始信号和重构信号。Where: n is the index of the data, N is the length of the signal, R n and S n correspond to the original signal and the reconstructed signal respectively.

而在CR相同的情况下,MSE越小,方法的性能就越好。同样,在MES相同的情况下,CR越大,方法的性能越好。When CR is the same, the smaller the MSE, the better the performance of the method. Similarly, when MES is the same, the larger the CR, the better the performance of the method.

采用另外两种压缩方法,如转折点压缩(TP)算法和小波分解压缩(WT)算法被用来和所提出的算法进行比较来评估算法的性能。其中,对于TP压缩,保留第一个采样点,从第一个点开始选择三个点(y1,y2,y3),并找出这三个点的幅值差(y2-y1,y3-y2)。如果(y2-y1)(y3-y2)<0。采样点y2是转折点,保留y2。否则,最后一个采样点y3被保留。通过三次样条插值对信号进行恢复。对于WT压缩,采样信号被'db4'小波分成高频和低频成分。低频分量被保留,用来恢复信号。Two other compression methods, such as turning point compression (TP) algorithm and wavelet decomposition compression (WT) algorithm, are used to compare with the proposed algorithm to evaluate the performance of the algorithm. Among them, for TP compression, the first sampling point is retained, three points (y1, y2, y3) are selected from the first point, and the amplitude difference (y2-y1, y3-y2) of these three points is found. If (y2-y1)(y3-y2)<0. The sampling point y2 is a turning point, and y2 is retained. Otherwise, the last sampling point y3 is retained. The signal is restored by cubic spline interpolation. For WT compression, the sampled signal is separated into high-frequency and low-frequency components by the 'db4' wavelet. The low-frequency component is retained and used to restore the signal.

将所提出的方法和上述两种方法对心电脉搏信号进行处理,结果如表1所示。从表中可以看到,所提出方法的压缩比明显优于另外两种方法。在脉搏信号中,所提出方法的压缩比可以达到14.571;在心电信号中,所提出方法的压缩比可以达到52.786。考虑到TP压缩算法在压缩过程中需要三个参考点进行比较,当数据量过大时,严重影响到算法的实时性,以及WT压缩算法在压缩过程中需要复杂的数学计算,运算量也影响到了算法的实时性。虽然所提出方法的MSE是三种方法中最大的,但是在误差允许的范围内,所提出方法的实时性更容易实现。The proposed method and the above two methods are used to process ECG pulse signals, and the results are shown in Table 1. As can be seen from the table, the compression ratio of the proposed method is significantly better than that of the other two methods. In the pulse signal, the compression ratio of the proposed method can reach 14.571; in the ECG signal, the compression ratio of the proposed method can reach 52.786. Considering that the TP compression algorithm requires three reference points for comparison during the compression process, when the amount of data is too large, the real-time performance of the algorithm is seriously affected, and the WT compression algorithm requires complex mathematical calculations during the compression process, the amount of calculation also affects the real-time performance of the algorithm. Although the MSE of the proposed method is the largest among the three methods, the real-time performance of the proposed method is easier to achieve within the allowable error range.

表1心电脉搏信号压缩结果Table 1 ECG pulse signal compression results

如图12所示,是所提出方法应用在心电脉搏信号中压缩前和恢复后的对比图,图12中的(a)所示,恢复后的脉搏信号与原始信号基本保持一致。虽然所提出方法在心电信号中的压缩比要明显大于脉搏信号,但是在图12中的(b)中可以观察到重构后的信号在点A处与原始信号存在着较大的偏差。As shown in Figure 12, it is a comparison of the proposed method before and after compression in the ECG pulse signal. As shown in Figure 12 (a), the restored pulse signal is basically consistent with the original signal. Although the compression ratio of the proposed method in the ECG signal is significantly greater than that of the pulse signal, it can be observed in Figure 12 (b) that the reconstructed signal has a large deviation from the original signal at point A.

进一步,将所提出的方法应用于用自主研制的采集系统采集到的脉搏信号中,统计结果如表2所示。30组采样数据的统计结果采用“均值±标准差”的形式表示。从表中可以看到,三种方法对应的压缩比分别为2.81±0.33、10.15±0.10、41.36±7.49,所提出方法的压缩比最大,但是根据每个人生理特征的不同,每次处理的信号也有所区别,以较大的标准差反映出来。相对来说,该方法在实际应用中可达到一个显著的结果。Furthermore, the proposed method was applied to the pulse signal collected by the self-developed acquisition system, and the statistical results are shown in Table 2. The statistical results of 30 sets of sampling data are expressed in the form of "mean ± standard deviation". As can be seen from the table, the compression ratios corresponding to the three methods are 2.81 ± 0.33, 10.15 ± 0.10, and 41.36 ± 7.49, respectively. The compression ratio of the proposed method is the largest, but according to the different physiological characteristics of each person, the signal processed each time is also different, which is reflected in the larger standard deviation. Relatively speaking, this method can achieve a significant result in practical applications.

表2实测脉搏信号压缩结果Table 2 Measured pulse signal compression results

本实施例所提出的压缩方法包含压缩前信号的时域特征点,可用于心电脉搏信号的时域特征分析,例如心率、脉率。心率是定义为每分钟的心跳次数,即正常成年人的心率范围为60-100次/分钟平静的状态。一些研究表明,脉率可以替代心率对人体健康状况进行评估。脉率可以通过相邻波峰之间的差值进行运算,其计算公式如下:The compression method proposed in this embodiment includes the time domain feature points of the signal before compression, which can be used for time domain feature analysis of ECG pulse signals, such as heart rate and pulse rate. Heart rate is defined as the number of heart beats per minute, that is, the heart rate range of a normal adult is 60-100 beats/minute in a calm state. Some studies have shown that pulse rate can replace heart rate to assess human health. The pulse rate can be calculated by the difference between adjacent peaks, and its calculation formula is as follows:

式中:fs为采样频率,PPI为脉搏波主波间期。Where: fs is the sampling frequency, PPI is the pulse wave main wave interval.

如图13所示,首先将读取数据最大值与平均值和的0.3倍作为最终的阈值。然后将数据中大于阈值的点置1,将小于阈值的点置0得到一个新的数组X,再用读取的原数据与X点乘就得到了大于阈值的曲线。对数组X进行差分,值为-1的点便是大于阈值曲线的起点和终点,求出两点间的最大就是P波的峰值点。As shown in Figure 13, first, 0.3 times the sum of the maximum and average values of the read data is used as the final threshold. Then, the points in the data that are greater than the threshold are set to 1, and the points that are less than the threshold are set to 0 to obtain a new array X. Then, the original data read is multiplied by X to obtain a curve greater than the threshold. The array X is differentiated, and the point with a value of -1 is the starting point and end point of the curve greater than the threshold. The maximum between the two points is the peak point of the P wave.

由于脉搏信号的幅值不稳定,这样找到的波峰点会有许多的误检测的,多数误检测的波峰点为潮波的波峰点,因此还需清除误检测的波峰点。根据脉搏信号的性质发现,在同一时间段每个人的脉搏宽度变化不大,且P波波峰点与潮波的波峰点二者的差值不会超过一个脉搏波宽度的一半,我们便将两个波峰点间的差值作为筛选条件,筛选出差值大于脉搏平均宽度0.6倍的两点,比较两点的幅值大小,幅值大的点便是P波的波峰点。Since the amplitude of the pulse signal is unstable, there will be many false detections of the peak points found in this way. Most of the falsely detected peak points are the peak points of the tidal wave, so the falsely detected peak points need to be removed. According to the properties of the pulse signal, it is found that the pulse width of each person does not change much in the same time period, and the difference between the peak point of the P wave and the peak point of the tidal wave will not exceed half of the width of a pulse wave. We use the difference between the two peak points as the screening condition, and screen out two points with a difference greater than 0.6 times the average pulse width. Compare the amplitudes of the two points, and the point with a larger amplitude is the peak point of the P wave.

压缩结果中已经包含了计算脉率所需的极值信息,所以在从压缩结果中提取脉率时,就是找到大于阈值的关键点,并进行比较以进行误检。如果有误测峰值点,如图13所示的示意流程图去除误测点,并根据公式(19)计算脉率。如果没有误检点,直接根据脉率方程计算脉率。对于实验数据中的任意一组脉搏信号,所提出方法计算出的脉率与压缩前的结果是一致的,如图14所示。此外,采用wemos D1 mini(ESP8266)验证了所提出方法基于Arduino开发环境的准确性。如图15所示,“->”的两侧是采样信号的采样时间和脉率。结果表明,该方法在实际应用中是可行的。因此,它有望用于可穿戴设备中进行健康监测。The compression result already contains the extreme value information required for calculating the pulse rate, so when extracting the pulse rate from the compression result, it is to find the key points greater than the threshold and compare them for false detection. If there is a false detection peak point, the false detection point is removed according to the schematic flow chart shown in Figure 13, and the pulse rate is calculated according to formula (19). If there is no false detection point, the pulse rate is calculated directly according to the pulse rate equation. For any set of pulse signals in the experimental data, the pulse rate calculated by the proposed method is consistent with the result before compression, as shown in Figure 14. In addition, wemos D1 mini (ESP8266) is used to verify the accuracy of the proposed method based on the Arduino development environment. As shown in Figure 15, the two sides of "->" are the sampling time and pulse rate of the sampled signal. The results show that the method is feasible in practical applications. Therefore, it is expected to be used for health monitoring in wearable devices.

本具体实施方式的实施例均为本发明的较佳实施例,并非依此限制本发明的保护范围,故:凡依本发明的结构、形状、原理所做的等效变化,均应涵盖于本发明的保护范围之内。The embodiments of this specific implementation method are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, all equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (8)

1.一种心电脉搏信号在线压缩方法,其特征在于包括以下步骤:1. A method for online compression of an electrocardiogram pulse signal, characterized in that it comprises the following steps: S01:采集心电信号和脉搏信号,对信号进行模数转换,获取人体体表处的心电脉搏信号;S01: Collecting ECG signals and pulse signals, performing analog-to-digital conversion on the signals, and obtaining ECG pulse signals on the human body surface; S02:设计自适应滤波器,改进现有的自适应滤波器,增加高频噪声估计部分;S02: Design an adaptive filter, improve the existing adaptive filter, and add a high-frequency noise estimation part; S03:在线自适应滤波,将微处理器系统缓存区内的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波;所述在线自适应滤波,将微处理器系统缓存区的数据更新过程与自适应滤波原理相结合,采用滑窗迭代的方式进行计算,实现对心电脉搏信号的实时滤波,具体为:S03: Online adaptive filtering, combining the data update process in the microprocessor system cache with the adaptive filtering principle, and using a sliding window iteration method to perform calculations to achieve real-time filtering of the ECG pulse signal; The online adaptive filtering, combining the data update process in the microprocessor system cache with the adaptive filtering principle, and using a sliding window iteration method to perform calculations to achieve real-time filtering of the ECG pulse signal, is specifically: 基于滑窗迭代,将对数据的实时滤波转化为对当前整个缓存区的滤波;当新的采样点滑入数据缓存区时,缓存区内的数据完成更新,在原有的M-1个采样点的基础上完成对新采样点的数据处理;Based on sliding window iteration, the real-time filtering of data is converted into filtering of the entire current buffer area; when a new sampling point slides into the data buffer area, the data in the buffer area is updated, and the data processing of the new sampling point is completed on the basis of the original M-1 sampling points; 所述的在线自适应滤波,具体包括,初始化过程和迭代过程:The online adaptive filtering specifically includes an initialization process and an iteration process: 初始化过程:当前数据采样点小于等于数据缓存区的长度时(0≤n≤M-1),每个最新的采样点放在缓存区的第n个字节;然后,将数据缓存区内的采样值按升序的方式排列,计算均值对数据进行高频噪声估计;高频噪声估计结果记为[0,…,x0,…,xn];将滤除高频噪声后的输出作为自适应滤波器的参考输入端xn,进一步对数据进行在线自适应滤波运算,结果记为[0,…,y0,…,yn];然后,对滤波器的系数进行更新,直至采样点n=M-1时,完成初始化过程;Initialization process: When the current data sampling point is less than or equal to the length of the data buffer (0≤n≤M-1), each latest sampling point is placed in the nth byte of the buffer; then, the sampling values in the data buffer are arranged in ascending order, and the mean is calculated to estimate the high-frequency noise of the data; the high-frequency noise estimation result is recorded as [0,…,x0,…,xn]; the output after filtering out the high-frequency noise is used as the reference input xn of the adaptive filter, and the data is further subjected to online adaptive filtering operation, and the result is recorded as [0,…,y0,…,yn]; then, the filter coefficients are updated until the sampling point n=M-1, completing the initialization process; 迭代过程:当前数据采样点大于数据缓存区的长度时(n>M),缓存区内的数据均左移一位,每个最新的采样点放在缓存区的第M个字节;然后,将数据缓存区内的采样值按升序的方式排列,计算均值对数据进行高频噪声估计;高频噪声估计结果记为[xn(n-M+1),…, xn(M),…, xn(n)];将滤除高频噪声后的输出作为自适应滤波器的参考输入端xn,进一步对数据进行在线自适应滤波运算,结果记为[yn(n-M+1),…, yn(M),…, yn(n)];然后,对滤波器的系数进行更新,直至采样结束,完成迭代过程;Iterative process: when the current data sampling point is greater than the length of the data buffer (n>M), the data in the buffer are all shifted left by one bit, and each latest sampling point is placed in the Mth byte of the buffer; then, the sampling values in the data buffer are arranged in ascending order, and the mean is calculated to estimate the high-frequency noise of the data; the high-frequency noise estimation result is recorded as [xn(n-M+1),…, xn(M),…, xn(n)]; the output after filtering out the high-frequency noise is used as the reference input xn of the adaptive filter, and the data is further subjected to online adaptive filtering operation, and the result is recorded as [yn(n-M+1),…, yn(M),…, yn(n)]; then, the coefficients of the filter are updated until the sampling is completed, and the iterative process is completed; S04:对心电脉搏信号的压缩及编码,将心电脉搏信号中的极值点和拐点统称为关键点,对心电脉搏信号的关键点在线提取,实现对心电脉搏信号的压缩;心电脉搏信号的压缩过程如下:根据极值点的定义确定极值,通过拉格朗日中值定理对相邻两个极值点间的直线进行计算,将心电脉搏信号与直线作差,得到差值曲线,提取差值曲线的极值点,实现对心电脉搏信号的压缩;对压缩后的心电脉搏信号编码,心电脉搏信号编码过程如下:将心电脉搏信号关键参数对应的位置和幅值根据微处理器的传输规则进行编码,保证编码后的数据长度是1个字节的整数倍,如果一个数据点的长度不是1个字节的整数倍,则给数据高位补0,直至满足条件;对于电压分辨率是10位的微处理器,编码后的每一个关键参数对应的位置和幅值占用3个字节,按照先位置后幅值的顺序对编码后的数据进行发送;S04: compress and encode the ECG pulse signal, refer to the extreme points and inflection points in the ECG pulse signal as key points, extract the key points of the ECG pulse signal online, and realize the compression of the ECG pulse signal; the compression process of the ECG pulse signal is as follows: determine the extreme value according to the definition of the extreme point, calculate the straight line between two adjacent extreme points by Lagrange's middle value theorem, subtract the ECG pulse signal from the straight line to obtain the difference curve, extract the extreme points of the difference curve, and realize the compression of the ECG pulse signal; encode the compressed ECG pulse signal, the ECG pulse signal encoding process is as follows: encode the position and amplitude corresponding to the key parameters of the ECG pulse signal according to the transmission rules of the microprocessor, and ensure that the encoded data length is an integer multiple of 1 byte. If the length of a data point is not an integer multiple of 1 byte, fill the high bit of the data with 0 until the condition is met; for a microprocessor with a voltage resolution of 10 bits, the position and amplitude corresponding to each key parameter after encoding occupy 3 bytes, and the encoded data is sent in the order of position first and amplitude later; S05:解码与恢复,对压缩后的心电脉搏信号解码,心电脉搏信号解码过程如下:根据包头包尾的位置对接收到的数据进行提取划分,每3个字节的数据对应一个关键参数,其中,第1个字节对应的是关键参数的位置,第2个字节对应的是关键参数幅值的高8位,第3个字节对应的是关键参数幅值的低8位;根据高8位和低8位的信息对关键参数的幅值进行恢复,实现对心电脉搏信号的解码;所述的对心电脉搏信号恢复:采用三次样条插值的方法,对解码后的心电脉搏信号关键参数进行插值,实现对心电脉搏信号的恢复;S05: decoding and recovery, decoding the compressed ECG pulse signal, the ECG pulse signal decoding process is as follows: extracting and dividing the received data according to the position of the packet header and the packet tail, each 3 bytes of data corresponds to a key parameter, wherein the first byte corresponds to the position of the key parameter, the second byte corresponds to the high 8 bits of the key parameter amplitude, and the third byte corresponds to the low 8 bits of the key parameter amplitude; recovering the amplitude of the key parameter according to the high 8 bits and the low 8 bits of information to achieve decoding of the ECG pulse signal; recovering the ECG pulse signal: using a cubic spline interpolation method to interpolate the decoded ECG pulse signal key parameters to achieve recovery of the ECG pulse signal; S06:对算法性能进行评估并对算法进行应用,采用均方根误差和压缩比对算法的性能进行评估,同时基于提取到的关键点,计算出脉搏主波波峰和脉搏波的主波间期,对心率进行计算。S06: Evaluate the performance of the algorithm and apply the algorithm. Use root mean square error and compression ratio to evaluate the performance of the algorithm. At the same time, based on the extracted key points, calculate the pulse main wave peak and the pulse wave main wave interval, and calculate the heart rate. 2.如权利要求1所述的心电脉搏信号在线压缩方法,其特征在于,所述步骤S02中对信号进行高频噪声估计,包括:2. The method for online compression of an electrocardiogram pulse signal according to claim 1, wherein the step S02 estimates the high-frequency noise of the signal, comprising: 根据均值滤波可以有效滤除信号中高频噪声的特点,将均值滤波和微处理器数据更新过程相结合,当缓存区长度为M时,去除当前缓存区的最大值和最小值,对剩余的M-2个数据计算均值完成对信号中的高频噪声估计。According to the characteristic that mean filtering can effectively filter out high-frequency noise in the signal, mean filtering is combined with the microprocessor data update process. When the buffer length is M, the maximum and minimum values of the current buffer are removed, and the mean of the remaining M-2 data is calculated to complete the estimation of the high-frequency noise in the signal. 3.如权利要求1所述的心电脉搏信号在线压缩方法,其特征在于,所述步骤S04中对心电脉搏信号的压缩是通过提取信号中的关键点来实现的:3. The online compression method for ECG pulse signal according to claim 1, characterized in that the compression of the ECG pulse signal in step S04 is achieved by extracting key points in the signal: 信号中的关键点由极值点和拐点组成;根据极值点的定义,至少通过三个点来判断极值;将当前数据缓存区记为buffer,如果buffer(M-2)均大于buffer(M-1)和buffer(M-3),则buffer(M-2)为极大值;如果buffer(M-2)均小于buffer(M-1)和buffer(M-3),则buffer(M-2)为极小值;设置两个数组E和L分别来存储极值点对应的幅值和位置;buffer(j)是已知的极值点,其中,buffer(j)的幅值和位置分别被存储在E(3)和L(3)中;在数据不断采集处理的过程中,如果buffer(M-2)不是极值点,则上一个极值点buffer(j)的幅值E(3)保持不变,位置L(3)减1;如果buffer(M-2)是极值点,则上一个极值点buffer(j)的幅值E(3)左移三位被存储在E(0),位置L(3)左移三位被存储在L(0),当前极值点buffer(M-2)的幅值和位置被存储在E(3)和L(3)中;The key points in the signal are composed of extreme points and inflection points. According to the definition of extreme points, at least three points are used to judge the extreme values. The current data buffer is recorded as buffer. If buffer(M-2) is greater than buffer(M-1) and buffer(M-3), then buffer(M-2) is the maximum value. If buffer(M-2) is less than buffer(M-1) and buffer(M-3), then buffer(M-2) is the minimum value. Two arrays E and L are set to store the amplitude and position corresponding to the extreme points respectively. Buffer(j) is a known extreme point. , the amplitude and position of buffer(j) are stored in E(3) and L(3) respectively; in the process of continuous data acquisition and processing, if buffer(M-2) is not an extreme point, the amplitude E(3) of the previous extreme point buffer(j) remains unchanged, and the position L(3) decreases by 1; if buffer(M-2) is an extreme point, the amplitude E(3) of the previous extreme point buffer(j) is shifted left by three bits and stored in E(0), and the position L(3) is shifted left by three bits and stored in L(0), and the amplitude and position of the current extreme point buffer(M-2) are stored in E(3) and L(3); 拐点的提取过程如下,极值点确定后,通过拉格朗日中值定理对相邻两个极值点间的直线进行计算,将心电脉搏信号与直线作差,得到差值曲线,对插值曲线的极值点进行计算,即为心电脉搏信号的拐点,其对应的参数存储在E(1)、E(2)以及L(1)、L(2)中。The process of extracting the inflection point is as follows: after the extreme point is determined, the straight line between two adjacent extreme points is calculated using the Lagrange middle value theorem, the ECG pulse signal is subtracted from the straight line to obtain a difference curve, and the extreme point of the interpolation curve is calculated, which is the inflection point of the ECG pulse signal. Its corresponding parameters are stored in E(1), E(2) and L(1), L(2). 4.如权利要求1所述的心电脉搏信号在线压缩方法,其特征在于,所述微处理器是按照1个字节的整数倍对数据进行传输发送的,在编码过程中,要保证编码后的数据是1个字节的整数倍,如果一个数据的长度不是1个字节的整数倍,则给高位补零,直至满足条件;心电脉搏信号在微处理器中经过滤波处理后,数据类型变成了浮点型,强制将数据类型转为整型,进一步对数据进行关键参数提取;对于输入电压分辨率是10位的微处理器来说,编码后的每一个关键参数的位置和幅值占用3个字节,其中,第1个字节对应的是关键参数的位置,后两个字节对应的是关键参数的幅值。4. The online compression method for ECG pulse signal as described in claim 1 is characterized in that the microprocessor transmits and sends data according to an integer multiple of 1 byte. During the encoding process, it is necessary to ensure that the encoded data is an integer multiple of 1 byte. If the length of a data is not an integer multiple of 1 byte, the high bit is padded with zero until the condition is met; after the ECG pulse signal is filtered in the microprocessor, the data type becomes a floating point type, and the data type is forcibly converted to an integer type, and key parameters are further extracted from the data; for a microprocessor with an input voltage resolution of 10 bits, the position and amplitude of each key parameter after encoding occupy 3 bytes, among which the first byte corresponds to the position of the key parameter, and the last two bytes correspond to the amplitude of the key parameter. 5.如权利要求1所述的心电脉搏信号在线压缩方法,其特征在于,所述微处理器将编码后的关键参数按照先位置后幅值的顺序进行发送与接收,根据包头包尾的位置对接收到的数据进行划分,每3个字节对应一个关键点的特征参数;设置数组D和数组P来存储解码后关键点的位置和幅值,其中,第1个字节对应的关键参数的位置被存储在D(M-1),第2个字节对应的是关键参数幅值的高8位,第3个字节对应的是关键参数幅值的低8位,根据高8位和低8位的信息对关键参数的幅值进行恢复,恢复后的关键参数的幅值被存储在P(M-1)。5. The online compression method for electrocardiogram pulse signal as described in claim 1 is characterized in that the microprocessor sends and receives the encoded key parameters in the order of position first and amplitude later, divides the received data according to the position of the packet header and the packet tail, and each 3 bytes correspond to the characteristic parameters of a key point; sets array D and array P to store the position and amplitude of the decoded key point, wherein the position of the key parameter corresponding to the first byte is stored in D(M-1), the second byte corresponds to the high 8 bits of the key parameter amplitude, and the third byte corresponds to the low 8 bits of the key parameter amplitude, and the amplitude of the key parameter is restored according to the high 8 bits and the low 8 bits of information, and the restored amplitude of the key parameter is stored in P(M-1). 6.一种实施如权利要求1-5任一项所述的心电脉搏信号在线压缩方法的压缩系统,其特征在于,包括:6. A compression system for implementing the online compression method for electrocardiogram pulse signal according to any one of claims 1 to 5, characterized in that it comprises: 数据采集模块,可完成心电信号和脉搏信号的采集;Data acquisition module, which can complete the acquisition of ECG signals and pulse signals; 滤波处理模块,对信号进行自适应滤波;A filtering processing module performs adaptive filtering on the signal; 压缩模块,进行信号压缩、编码并发送;Compression module, which compresses, encodes and sends signals; 解压缩模块,对信号进行接收、储存、解码。The decompression module receives, stores and decodes the signal. 7.如权利要求6所述的压缩系统,其特征在于,所述滤波处理模块包括:高频噪声估计模块、自适应滤波算法模块、滤波器模块。7. The compression system as described in claim 6 is characterized in that the filtering processing module includes: a high-frequency noise estimation module, an adaptive filtering algorithm module, and a filter module. 8.一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被执行时实现权利要求1-5任一项所述的心电脉搏信号在线压缩方法。8. A computer storage medium having a computer program stored thereon, wherein when the computer program is executed, the online compression method for electrocardiogram pulse signal according to any one of claims 1 to 5 is implemented.
CN202310014669.5A 2023-01-05 2023-01-05 Method, system and storage medium for online compression of electrocardiogram pulse signal Active CN115944303B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310014669.5A CN115944303B (en) 2023-01-05 2023-01-05 Method, system and storage medium for online compression of electrocardiogram pulse signal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310014669.5A CN115944303B (en) 2023-01-05 2023-01-05 Method, system and storage medium for online compression of electrocardiogram pulse signal

Publications (2)

Publication Number Publication Date
CN115944303A CN115944303A (en) 2023-04-11
CN115944303B true CN115944303B (en) 2024-05-14

Family

ID=87296667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310014669.5A Active CN115944303B (en) 2023-01-05 2023-01-05 Method, system and storage medium for online compression of electrocardiogram pulse signal

Country Status (1)

Country Link
CN (1) CN115944303B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117598710B (en) * 2024-01-23 2024-05-14 富纳德科技(北京)有限公司 Remote electrocardiosignal monitoring method and system
CN117785818B (en) * 2024-02-26 2024-05-10 山东惠分仪器有限公司 A method and system for optimizing storage of gas chromatograph data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4947858A (en) * 1989-01-31 1990-08-14 Hewlett-Packard Company Method and apparatus for data compression in an ECG monitoring system
CN101099669A (en) * 2007-07-13 2008-01-09 天津大学 ECG Data Compression Method and Decoding Method Based on Optimal Time-Frequency Space Structure Code
CN101268936A (en) * 2008-02-27 2008-09-24 天津大学 ECG compression method and decoding method for wireless ECG monitor
KR20100067364A (en) * 2008-12-11 2010-06-21 충북대학교 산학협력단 Method for encoding and decoding of ecg signal
CN102440768A (en) * 2010-10-13 2012-05-09 兰州理工大学 Extraction Method of Pulse Waveform Feature Points
CN107846225A (en) * 2017-10-30 2018-03-27 成都心吉康科技有限公司 Heart real time lossless date-compress, the methods, devices and systems of decompression
CN114587291A (en) * 2022-03-14 2022-06-07 常熟理工学院 A pulse rate variability signal extraction method and system
WO2022237222A1 (en) * 2021-05-14 2022-11-17 深圳技术大学 Pulse wave acquisition method and system based on signal-to-noise ratio improvement technology, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4947858A (en) * 1989-01-31 1990-08-14 Hewlett-Packard Company Method and apparatus for data compression in an ECG monitoring system
CN101099669A (en) * 2007-07-13 2008-01-09 天津大学 ECG Data Compression Method and Decoding Method Based on Optimal Time-Frequency Space Structure Code
CN101268936A (en) * 2008-02-27 2008-09-24 天津大学 ECG compression method and decoding method for wireless ECG monitor
KR20100067364A (en) * 2008-12-11 2010-06-21 충북대학교 산학협력단 Method for encoding and decoding of ecg signal
CN102440768A (en) * 2010-10-13 2012-05-09 兰州理工大学 Extraction Method of Pulse Waveform Feature Points
CN107846225A (en) * 2017-10-30 2018-03-27 成都心吉康科技有限公司 Heart real time lossless date-compress, the methods, devices and systems of decompression
WO2022237222A1 (en) * 2021-05-14 2022-11-17 深圳技术大学 Pulse wave acquisition method and system based on signal-to-noise ratio improvement technology, and storage medium
CN114587291A (en) * 2022-03-14 2022-06-07 常熟理工学院 A pulse rate variability signal extraction method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种快速的数学形态学滤波方法及其在脉搏信号处理中的应用;丑永新;张爱华;顾亚;刘继承;冯玉峰;;仪器仪表学报;20200215(第02期);第255-264页 *
动态脉搏信号的采集与处理;丑永新;中国医疗器械杂志;20120330;第79-84页 *
单片机心电数据无损压缩方法研究与实现;张跃;徐廷松;;医疗卫生装备;20080215(第02期);第30-33页 *

Also Published As

Publication number Publication date
CN115944303A (en) 2023-04-11

Similar Documents

Publication Publication Date Title
CN115944303B (en) Method, system and storage medium for online compression of electrocardiogram pulse signal
Rakshit et al. An efficient ECG denoising methodology using empirical mode decomposition and adaptive switching mean filter
Kumar et al. Heart rate monitoring and therapeutic devices: a wavelet transform based approach for the modeling and classification of congestive heart failure
CN110680308B (en) ECG signal denoising method based on fusion of improved EMD and threshold method
TW201338756A (en) Electrocardiogram signal compression and de-compression system
KR20140139564A (en) Systems and methods for ecg monitoring
Chandra et al. Computationally efficient cosine modulated filter bank design for ECG signal compression
Jha et al. Tunable Q-wavelet based ECG data compression with validation using cardiac arrhythmia patterns
CN110141215B (en) Training method for noise reduction autoencoder, noise reduction method for ECG signal, and related devices and equipment
Ranjeet et al. ECG signal compression using optimum wavelet filter bank based on kaiser window
Bui et al. Design of a nearly linear-phase IIR filter and JPEG compression ECG signal in real-time system
CN114098656B (en) Signal noise reduction method and system based on empirical mode decomposition and bit plane conversion
Yang et al. An effective morphological-stabled denoising method for ECG signals using wavelet-based techniques
CN118845034A (en) A method for denoising ECG signals based on wavelet transform and quadratic variation reduction based on soft threshold
CN106686029B (en) A physiological signal compression transmission, reconstruction method and device
Baliarsingh et al. Unsupervised technique for cardiac data compression with β wavelet transform for telemedicine
López et al. EOG signal compression using turning point algorithm
Baliarsingh et al. An optimal transform based technique for ECG signal compression
US9326734B1 (en) Method of compressing electrocardiography signal and electrocardiography signal sensing apparatus thereof
CN114504326A (en) Binary amplitude coding method for electrocardiosignal
Ali Hassan et al. Efficient Data Compression of ECG Signal Based on Modified Discrete Cosine Transform.
Brito et al. An ECG compression approach based on a segment dictionary and bezier approximations
Pratap et al. ECG compression using Compressed Sensing with Lempel-Ziv-Welch Technique
Aliabadi et al. The Effect of Photoplethysmography Signal Denoising on Compression Quality.
Yadav et al. Efficient ecg approximation using chebyshev polynomials

Legal Events

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
GR01 Patent grant
GR01 Patent grant