Background
The electrocardio data wireless transmission system generally comprises a sensor node (ECG sensor), a sink node (coordinator) and a background base station. The sensor node firstly sends the acquired electrocardiogram data to the sink node. The coordinator serves as a display platform to display the obtained data, and meanwhile, the data are continuously sent to the background base station. Typically the coordinator may be a cell phone or PDA and the base station is typically a medical facility. Because the wearable wireless transmission system has limitations on the volume and weight of the equipment, the electrocardio data acquired by the sensor needs to be compressed when the energy efficiency design of the system is required. The traditional compression mode is generally used for wired electrocardio equipment, and when packet loss occurs in wireless transmission, data loss occurs in the general compression mode. The compressed sensing technology has two main characteristics: undifferentiated sampling and distributed simple coding, which makes it a new method for data acquisition in sensor networks. If the data collected by the compressed samples are lost in transmission, the loss of the source data can not occur, and the data are represented on the decompressed data in the form of errors.
Many previous works indicate that sparsity-based compression can be used for ECG signals as well as other body parameter signals. When the compressive sensing method is applied to the compression of the electrocardiograph signals, an important assumption is that the sparsity of the electrocardiograph signals is constant, which can be established when the length of the data frame is sufficient, but also increases the response time of the system. In fact, for a real-time ECG diagnostic system, the response time should be less than 300 ms, which requires less sampling time for each frame of data. When the length of the data frame is reduced, the data sparsity changes greatly. In addition to sparsity variation, estimation of reconstruction errors is another challenge for compressive sensing-based electrocardiographic monitoring systems. Theoretically, when the system meets certain conditions (for example, data is K sparse, the sampling rate meets the requirements of certain empirical formulas, the measurement matrix meets the principle of limiting the equidistance, and the like), the reconstruction error has an upper bound. However, for a real-time electrocardiographic detection system, the sparsity of the data varies as described above. Furthermore, an unstable wireless channel may cause an increase in packet loss rate, so that data is undersampled, which may also affect the reconstruction quality of the system. Therefore, with the conventional compressed sensing architecture, the reconstruction error fluctuates greatly. In addition, it is difficult to obtain an accurate value of the reconstruction error since the original data is not available to the coordinator.
The patent application with the domestic application number of 201410428685.X and the name of 'a portable ECG monitor with wireless transmission function' processes a sampling signal through a single chip microcomputer, transmits data to a PDA through a Bluetooth module and realizes uploading of the data, and the whole system does not consider the compression of the data and the design of energy effectiveness. The patent with the domestic application number of 201110206698.9 and the name of a wavelet algorithm-based electrocardiosignal transmission method and system provides an electrocardiosignal compression method through wavelet coding, and the patent application with the domestic application number of 201510974314.6 and the name of an electrocardiosignal compression transmission method and an electrocardio monitoring system thereof provides an electrocardiosignal compression and transmission method through convolution compression coding, and the two methods can improve the data transmission efficiency but do not consider the influence of packet loss on decompression quality.
In the prior art, a traditional coding compression mode is adopted for general data, and whether the general data is suitable for wireless transmission is not considered; in addition, when packet loss occurs in wireless transmission, the data reconstruction quality cannot be guaranteed; the compression method does not set an upper limit on the time delay of the data, and real-time monitoring cannot be realized. Therefore, those skilled in the art are dedicated to develop a compression sensing-based electrocardiosignal compression rate adaptive adjustment wireless transmission method, and the characteristics of a data coding compression mode and wireless transmission are combined to ensure the data reconstruction quality and meet the requirement of real-time monitoring of electrocardio data.
Disclosure of Invention
In view of the above defects in the prior art, the technical problem to be solved by the present invention is how to ensure the quality of data reconstruction and meet the requirement of real-time monitoring of the electrocardiographic data, and specifically how to not affect the transmission of the electrocardiographic data when packet loss occurs in wireless transmission; how to estimate the reconstruction error of the data without the original data; how to guarantee the data delay of the system.
In order to achieve the above object, the present invention provides an adaptive modulation wireless transmission system for an electrocardiographic signal compression ratio, comprising a sensor node and a coordinator, wherein the sensor node is configured to acquire an original signal, sample and compress data, and send the compressed data to the coordinator; the coordinator is configured to receive the compressed data and recover the compressed data; the sensor node further comprises a sparsity estimation module, and the coordinator further comprises a wireless compensation module and an error control module; the sparsity estimation module is configured to calculate sparsity of data and estimate a sampling rate according to the sparsity, the wireless compensation module is configured to compensate for packet loss in a wireless communication process, and the error control module is configured to control reconstruction errors.
Further, the sparsification method adopted by the sensor node is one of fast fourier transform, discrete cosine transform or wavelet transform.
Further, the sparsity estimation module is configured to obtain a sampling rate required by each frame of data according to the sparsity classification and the corresponding model of each frame of data and according to packet loss information sent by the coordinator.
Further, the sensor node is configured to generate guidance data from the raw data; the pilot data is configured to estimate a reconstruction error when recovering data; randomly selecting 10% of data in the compressed data as the boot data.
Further, the sensor node is configured to generate control data from the raw data.
Further, the sensor node is configured to send compressed data, boot data, and control data to the coordinator in a packet, the control data being a header in a wireless transmission process.
The invention also provides a wireless transmission method for adaptively adjusting the compression rate of the electrocardiosignals, which comprises the following steps:
step 1, at a sensor node, obtaining original electrocardiogram data XN*1Is first thinned to obtain XS N*1Wherein N is the length of original data to be compressed in each frame;
step 2, according to XSTo calculate a random observation matrix AM*NObtaining the relation between M and K through off-line modeling;
step 3, compressing the data into Y through the observation matrix AM*1,
Y=A·Xs
Step 4, generating guide data according to the original data, wherein the guide data is used for estimating a reconstruction error when recovering the data, and randomly selecting 10% of data in the compressed data Y as the guide data;
step 5, generating control data according to the original data, wherein the control data is a packet header in the wireless transmission process;
step 6, the sensor node packs the compressed data, the guide data and the control data and sends the packed data to the coordinator node through a wireless network;
and 7, recovering the compressed data after the coordinator node receives the data packet.
Further, the method of sparsifying is one of fast fourier transform, discrete cosine transform or wavelet transform.
Further, the off-line modeling method in step 2 is:
firstly, classifying data frames according to different sparsity, acquiring more than 10000 data frames D of a user offline, and dividing the data into two types by adopting a rapid clustering algorithm;
secondly, modeling is carried out according to the sparsity and the distribution of the sampling rate of the data, and the established model is a piecewise linear model:
wherein omegai(i ═ 1,2) determined by the classification method described above, parameter Ci(i ═ 1,2,3,4) is obtained by solving an optimization problem:
s.t.si-ari-b≥0
wherein s isiRepresenting the sparsity, r, of each data frameiRepresenting the sampling rate of each frame, a and b being coefficients in the piecewise function;
finally, according to the sparsity classification and the corresponding model of each frame of data, the sampling rate Ms required by each frame of data can be obtained, and according to the packet loss information PLR sent by the coordinator, the sampling rate Ms is obtained
M=Ms/(1-PLR);
From this, the dimension M × N of the random observation array a is determined.
Further, step 7 further comprises the steps of:
firstly, whether the compressed data, the guide data and the control data are complete or not is confirmed, and if part of the compressed data is lost, the wireless compensation module estimates the channel condition; if the pilot data or the control data is lost, the sampling rate of the next frame is determined only by the sparsity estimation module;
secondly, at the sensor node end, the input of the sparsity estimation module is the sparsity of the next frame data, and the output is the compression ratio estimation M of the next frameS(ii) a At the coordinator end, the input of the error control module is historical data of errors, and the error control module can adjust the sampling rate of the next frame according to the historical data;
finally, the wireless compensation module can acquire the packet loss rate PLR of the current wireless channel and then send the packet loss rate PLR to the sensor node.
The invention discloses a self-adaptive compressed sensing engine for real-time electrocardiogram monitoring, aiming at solving the problems of time delay limitation and error estimation in a wireless electrocardiogram monitoring system. At a sensor node end, an offline sparsity model is adopted to obtain the sampling rate of data, meanwhile, the wireless packet loss rate is detected, and an online updating model based on packet loss and reconstruction quality is designed at a coordinator end. The invention designs a closed-loop control engine to ensure reconstruction quality. The system can adjust the sampling rate according to the change of the data sparsity and the wireless packet loss. The delay of the system does not exceed 300 milliseconds. The method analyzes the time-varying characteristic of the sparsity of the electrocardiosignals, establishes an off-line model between the sampling rate and the sparsity, and is applied to the sensor node end, so that the calculated amount of the sensor node is hardly increased. The invention introduces guide data and estimates the reconstruction error of the data. And establishing a model of the relation between the error change and the compression ratio change. The reconstruction error is stabilized by on-line updating.
The architecture of the wireless transmission system based on compressed sensing is shown in fig. 1 and comprises two parts, namely a sensor node and a coordinator. The sensor nodes are mainly responsible for acquiring raw signals, compressing data and sending to the coordinator. The coordinator is responsible for receiving the compressed data and recovering the data. The upper part of fig. 1 is a block diagram of a conventional compressed sensing module. At the sensor node end, the input of the compressed sensing module is originalThe initial cardiac electrical data X. After the thinning and sampling, the output of the sensor node is Y, and then sent to the coordinator. The coordinator receives Y (some data is lost in transmission) and recovers the original data. In general, Ψ, K, and M are constants. The data X' recovered by the coordinator calculation is an estimate of the original signal X. If the data sparsity and wireless channel variation are large, the recovered data X′And is very different from the original data X. The lower part of fig. 1 is an adaptive compressed sensing engine proposed by the present invention, which includes 3 parts: the device comprises a sparsity estimation module, a wireless compensation module and an error control module. The sparsity estimation module is used for calculating sparsity of data and estimating a sampling rate according to the sparsity. The wireless compensation module is used for compensating packet loss in the wireless communication process. The error control module is used for controlling the reconstruction error.
The electrocardiosignal compression ratio self-adaptive adjustment wireless transmission system comprises the following steps:
step 1: at the sensor node, the original electrocardiogram data XN*1Is first thinned to obtain XS N*1Where N is the original data length that needs to be compressed per frame. The methods generally adopted by the sparsification method are fast fourier transform, discrete cosine transform, wavelet transform or the like.
Xs ═ fft (x) or Xs ═ dct (x) or Xs ═ dwt (x)
Step 2: according to XSTo calculate a random observation matrix AM*NFirstly, obtaining the relation between M and K through off-line modeling, wherein the modeling method comprises the following steps:
first, data frames are classified according to different sparsity. A certain number of data frames D (the number is more than 10000) of a user are acquired offline, and the data are divided into two types by adopting a fast clustering algorithm:
secondly, modeling is carried out according to the distribution of the sparsity and the sampling rate of the data. Determining the model as a piecewise linear model:
wherein omegai(i ═ 1,2) was determined by the above classification method, parameter Ci(i ═ 1,2,3,4) is obtained by solving an optimization problem:
s.t.si-ari-b≥0
wherein s isiRepresenting the sparsity, r, of each data frameiRepresenting the sampling rate of each frame, a and b are coefficients in the piecewise function.
According to the sparsity classification and the corresponding model of each frame of data, the sampling rate Ms required by each frame of data can be obtained, and the sampling rate Ms is obtained according to the packet loss information PLR sent by the coordinator
M=Ms/(1-PLR)
From this, the dimension M × N of the random observation array a is determined.
And step 3: data compression into Y by observation matrix AM*1。
Y=A·Xs
And 4, step 4: the guidance data is generated from the raw data. The pilot data is used to estimate the reconstruction error when recovering the data. 10% of the data in the compressed data Y is randomly selected as the boot data.
And 5: control data is generated from the raw data. The control byte is a header in the wireless transmission process. These three types of data are simultaneously transmitted to the coordinator. The coordinator receives the data while determining the integrity of the data.
Step 6: and the sensor node packs the compressed data, the guide data and the control data and sends the packed data to the coordinator node through a wireless network.
And 7: after receiving the data packet, the coordinator node firstly confirms whether the three parts of data are complete. If part of the compressed data is lost, the wireless compensation module will estimate the channel conditions. If pilot data or control data is lost, the sampling rate of the next frame will be determined only by the sparsity estimation module. At the sensor node end, the input of the sparsity estimation module is the sparsity of the next frame dataThe output is a compression ratio estimate M for the next frameS. At the coordinator, the input of the error control module is historical data of errors, and the error control module can adjust the sampling rate of the next frame according to the historical data. The wireless compensation module can acquire the packet loss rate PLR of the current wireless channel and then send the PLR to the sensor node.
The invention has the advantages that: the wireless electrocardio transmission system is realized by adopting a compressed sensing technology and closed-loop control, so that different compressed sampling rates can be effectively realized aiming at different data sparsity of different patients; meanwhile, the compression rate can be adaptively adjusted according to the condition of the wireless channel, and the electrocardio data is not lost when packet loss occurs.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the protection scope of the present invention is not limited to the following embodiments.
The hardware structure diagram of the embodiment is shown in fig. 2, and the sensor-side microprocessor in the system adopts ADSP-BP 592; the Bluetooth module adopts an HC-06 wireless Bluetooth serial port transparent transmission slave module; the memory module adopts flash on an ADSP-BP592 chip; the electrocardio sampling module adopts an AD8232 operational amplifier front end; the AD sampling chip adopts PCF 8591T; the communication between the sensor and the coordinator adopts a CC2530 node; the coordinator is served by the PDA.
The hardware system of the embodiment operates as follows:
the first step is as follows: equipment wear
Step 11: the electrocardio-sensor device is worn in front of the chest.
Step 12: connect ECG bluetooth module through panel computer. The sensor collects human body electrocardio data in real time at the frequency of 360Hz, and the coordinator sends the real-time condition of the wireless channel to the sensor.
The second step is that: modeling process
Step 21: the sensor first collects 10000 sets of (at least) user data, and an observation matrix a is randomly generated. And compressing the user data by using the observation matrix at a constant compression rate of 50%, sending the original data and the compressed data to the coordinator, decompressing the data by the coordinator, obtaining the data reconstruction quality, and generating a user database D. Each data of D includes a compression rate of the data frame and a sparsity of the data.
Step 22: clustering by adopting a rapid clustering algorithm:
inputting: data set D
And (3) outputting: center of cluster mu'1,μ'2
1) Calculating the occurrence frequency of sparsity of each frame in the data set, and obtaining two peak values mu with the maximum occurrence frequency1,μ2As initial clustering center;
2) judging if | mu is satisfiedj-μ'jIf not, executing the step (5);
3) according to c(i):=argmin||d(i)-μj||2Dividing the data set into two types;
4) recalculating cluster centers for each class
5) Output mu'1,μ'2。
Step 23: and modeling according to the sparsity of the data and the distribution of the sampling rate. Determining the model as a piecewise linear model:
wherein omegai(i ═ 1,2) was determined by the above classification method, parameter Ci(i ═ 1,2,3,4) is obtained by solving an optimization problem:
s.t.si-ari-b≥0
wherein s isiRepresenting the sparsity, r, of each data frameiRepresenting the sampling rate of each frame, a and b are coefficients in the piecewise function.
The third step: normal operation
Step 31: at the sensor node, the original electrocardiogram data XN*1Is first thinned to obtain XS N*1Where N is the original data length that needs to be compressed per frame. The sparsification method employs discrete cosine.
Xs=dct(X)
Step 32: calculating a random observation matrix A according to the obtained model of the relation between the sparsity K and the sampling rate MsM*NMs.
The calculation formula of the sparsity K is as follows:
K=||Xs||0
step 33: according to the sparsity classification and the corresponding model of each frame of data, the sampling rate Ms required by each frame of data can be obtained, and the sampling rate Ms is obtained according to the packet loss information PLR sent by the coordinator
M=Ms/(1-PLR)
This determines the dimension M × N of the random observation array a.
Step 34: data compression into Y by observation matrix AM*1。
Y=A·Xs
Step 35: the sensor node sends the compressed data Y to the coordinator node through the wireless network.
Step 36: after receiving the data packet, the coordinator node first determines whether the data is complete. If part of the compressed data is lost, the wireless compensation module will estimate the channel conditions. If pilot data or control data is lost, the sampling rate of the next frame will be determined only by the sparsity estimation module. At the sensor node end, the input of the sparsity estimation module is the sparsity of the next frame data, and the output is the compression ratio estimation MS of the next frame. At the coordinator, the input of the error control module is historical data of errors, and the error control module can adjust the sampling rate of the next frame according to the historical data. The wireless compensation module can acquire the packet loss rate PLR of the current wireless channel and then send the PLR to the sensor node.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.