An Improved Multisensor Self-Adaptive Weighted Fusion Algorithm Based on Discrete Kalman Filtering

. When the multisensor self-adaptive weighted fusion algorithm fuses the data sources that were severely interfered by noise, its fusion precision, data smoothness, and algorithm stability will be reduced. To overcome this drawback, the idea was proposed with respect to an improved algorithm which optimized acquisition of fusion data sources with discrete Kalman ﬁltering technique, thus reducing the negative impact on the fusion performance from noise. To verify the eﬀectiveness of the improved algorithm, this paper simulated the fusion process of soil moisture data with fusion samples. The result proved that, under the same circumstance, the improved algorithm has a stronger restrain ability to noise and a better performance in fusion precision, data smoothness, and algorithm stability compared with the general algorithm.


Introduction
Multisensor adaptive weight fusion algorithm (or simply as adaptive weight fusion algorithm) is widely used in various measurement occasions as a commonly used data fusion algorithm. Taking obtaining data of various soil moisture from the intelligent water-saving irrigation system as an example [1], the adaptive algorithm [2][3][4][5][6][7][8][9][10][11][12] fused the measuring data (such as humidity and temperature) of several same kinds of sensors [13,14] to reduce data ambiguity of the individual sensor and improve the confidence level of data. However, the measurement data of the sensor were polluted due to harsh working conditions in the field which caused the affected fusion precision and data smoothness of the conventional adaptive weight fusion algorithm to a certain extent. Aiming at this problem, the paper improves the adaptive weight data fusion algorithm based on discrete Kalman filtering. It was developed by the American Kalman in 1960. It was originally used only for the linear system; after many years, people designed new Kalman filtering theory for the nonlinear system. As the development of the artificial neural network, intelligent algorithm, and information technology, people began to combine to use them. It is a recursive linear minimum variance estimation method, and it can process the measured values which are only related to some states, so as to obtain the state estimation with the least estimation error [15][16][17]. As shown in Figure 1, the improved algorithm [17] runs on the host computer system and fuses the raw measurement data (including noise) [18][19][20][21][22][23][24][25] which are sent to the host computer through the ZigBee wireless sensor [26][27][28][29][30][31][32][33] network (ZigBee WSN). e fused data are used as the decision of the irrigation control. Based on this, the irrigation actuator is then driven to perform irrigation operations. e computer simulation result shows that the improved adaptive weight fusion algorithm not only inherits the advantages of all preimproved algorithms but also has stronger noise suppression ability, higher data smoothness, and higher fusion precision than the preimproved algorithm. the host computer through the ZigBee WSN. Due to the limitation of switching frequency and data transmission mode for the D/A converter, it is destined that sampling will only be performed in a series of discrete moments. erefore, the process of collecting soil moisture data can be abstracted into a discrete process as described in the following: where the first equation is the state equation of the data acquisition system, x k is the system state at time k, and Φ is the system state transition matrix, and Φ is a constant when in the single model. e second equation is the measurement equation, z k is the measured value at time k, and H is the measurement matrix of the measurement system, and H is a constant when in the single model. w k is the process noise, and v k is the measurement noise. In engineering, zero-mean Gaussian white noise is usually applied to simulate v k and w k , and the covariance of these two parameters is Q and R, and they are uncorrelated. at is, for all of the following k, j are In the initial state of the measurement system, the statistical characteristics are set as follows: Based on the previous system state, we can get (3) x k|k−1 is the estimated value of the current system state, and x k−1|k−1 is the optimal estimation result of the previous state.
After obtaining the estimated value x k|k−1 of the current state in the system, combined with the measured value z k of the current time, the optimal estimated value x k|k of the current time state of the system is obtained as where K k is the Kalman gain matrix, which keeps the estimated error variance matrix P k extremely small. To find K k , the following formulas are defined: Equation (5) is the system estimation error before the k th measurement data, namely, z k , are obtained, and equation (6) is the system estimation error after z k is obtained. Substituting (1) and (5) into (6), the following is obtained: en, the variance matrix of the estimated error can be expressed as  Figure 1: Schematic diagram of the intelligent irrigation system.

Complexity
Definition: e aforementioned definition is the estimated covariance matrix corresponding to x k|k−1 . Also, because of Substituting (9)-(11) into (8), the following is obtained: Since the purpose of K k is to minimize the estimated error variance matrix P k , therefore, P k can be transformed by formula (12) to It can be known from (13) that if P k is kept to the minimum, corresponding K k should be as follows: At this time, the error correlation matrix P k|k used to measure the accuracy of the estimated value can be written as Equation (15) is the iterative formula of the error equation. erefore, from the Kalman filter recursive formula, not only the filter estimation formula can be obtained but also the error analysis can be operated. is is where its advantage lies. If the iterative formula is required to be iterated constantly, the recursive formula of the error correlation matrix P k−1|k−1 to P k|k−1 corresponding to x k−1|k−1 should be obtained. Subtracting x k from both sides of equation (3), the following is obtained: Substituting (1) and (5) into (16), In summary, the model of the discrete Kalman filter shown in Figure 2 can be derived.
Based on Figure 2 and according to formulas (3), (4), (14), (15), and (18), the discrete Kalman filter algorithm subroutine module can be programmed on the computer. e program flowchart is shown in Figure 3.

Principle of the Adaptive Weight Fusion Algorithm.
Suppose that the same unknown quantity Y is observed by N sensors, and the observation value of each sensor is Y j (j � 1, 2, . . ., N). en, the observed value of the jth sensor is where W j is the weight and satisfies e corresponding estimated variance is where σ 2 j represents the measurement variance of each sensor. In order to find w j at the time when the variance in equation (21) reaches a minimum value, the following auxiliary functions are constructed as (22), the partial derivatives are, respectively, obtained, and equation (20) is used as the constraint: After organizing, the following is obtained: en, the conditional extreme value σ 2 min for σ 2 is Substituting (25) into (24), the simultaneous equations are Complexity e above estimation process for the true value Y is based on all of the measurement data obtained by N sensors in a single measurement process. When the state of the measured object remains relatively constant for a certain period of time, in order to improve the estimation accuracy, when the k th estimation of the true value Y is performed, the average value of the previous measurement data for k times may be used: To make estimation, the estimation equation can be written as follows: Since Y j is an unbiased estimation of Y, it is also an unbiased estimate of Y. e estimated total variance at this time is e same as the solution process of σ 2 min , the conditional extreme values are From (30), it can be concluded that, as the number of measurement k increases, the overall variance of the true value Y estimation will become smaller, thereby achieving the purpose of estimation accuracy improvement.

Calculation Method of σ 2
j . Since the optimal weighting factor w j is determined by the variance σ 2 j of each sensor, σ 2 j is generally not known, so it is necessary to indirectly pass the measured values provided by the sensors, and find it according to the following algorithm. ere are any two different sensors i and j, in which the measured values are Y i and Y j , respectively, and the corresponding observation errors are n i , n j , that is, Y i � Y + n i and Y j � Y + n j . Because the mean value of n i , n j is zero and is not related to each other and is not related to Y, Y j is the autocorrelation coefficient R jj , and the correlation coefficient R ij between Y i and Y j , respectively, satisfies Substituting (31) into (32),

Complexity
For the calculation of R jj and R ij , they can be solved by the time-domain estimation: set R jj (k) as the time-domain estimation value of R jj at time k and R ij (k) as the timedomain estimation value of R ij at time k; then, To reduce the error, the average value of R ij (k), namely R ij (k), is usually taken instead of R ij (k): Substituting (32) into (35),

Drawbacks of the Current Algorithms.
It is not difficult to conclude from (25), (26), and (30) that both of the conditional extremes of the estimation error and the sensor weights are closely related to the measurement variance of the sensor. e smaller the sensor measurement variance is, the smaller the conditional extreme of the error is estimated and the larger the corresponding sensor weight is, which reflect the characteristics that the sensor weight is autoadaptive to the sensor measurement variance. However, it is precisely because of the direct impact of the sensor measurement variance on these parameters; if the sensor measurement variance has frequent and severe jitter, the corresponding sensor weight will certainly have jitter, which will finally affect the effect of data fusion. Taking the measurement of soil moisture as an example, three humidity sensors are provided to simultaneously measure soil moisture in a certain area, and the true value of soil moisture in this area is set as 21RH% (constantly considered to be constant in a certain period of time). Based on this true value, Gaussian white noise with a mean value of 0 and variances of 0.2, 0.5, and 0.7 was added to simulate different levels of noise pollution of the three sensors, and 100 fusion processes were simulated on a computer.
As shown in Figure 4, because the autoadaptive weight fusion algorithm before improvement directly uses the raw measurement data of the noise-contaminated sensor as its fusion data source, the measurement variance of the sensor will experience severe jitter caused by a small sample size (sample capacity is less than 15). After this severe jitter, there is still a relatively frequent small jitter, which further leads to the frequent and random jitter of the corresponding sensor weight curve in Figure 5 within a certain range. Although this kind of sensor weight jitter reflects the dynamic adjustment characteristic of sensor weight according to the sensor measurement variance by the autoadaptive weight fusion algorithm, too much jitter will eventually affect the fusion effect. As shown in Figure 6, the frequent and irregular sensor weight jitter makes smoothness decrease the smoothed data.
e data curve has more glitch, and the convergence speed is slower (the fusion curve in the figure becomes flat after 60 times of fusion).

Improved Autoadaptive Weight Fusion
Algorithm. It can be found from the analysis in Section 4.1 that the main reason for this drawback is that the fusion data source used by the algorithm contains a lot of noise that affect the measurement variance of the sensor. Moreover, in the fusion process, the noise which was contained in the fused data source has not been processed. It shows that the sensor measurement variance shown in Figure 4 always shakes around a certain value without significant drop after entering a relatively stable phase. If the noise in the data source can be suppressed to a certain extent, the sensor measurement variance σ 2 j will decrease. It can be known from equations (25) and (30) that the decrease of σ 2 j eventually causes the conditional extreme value σ 2 min of the overall estimated variance to decrease, and with the increase in the number of estimates k, the trend of this decline will become more apparent.
Considering that the core of the discrete Kalman filtering algorithm consists of only five formulas and the algorithm logic is clear (shown in Figure 3), it is easy to be programmed by the computer. It also has advantages of rapid convergence, good stability, high precision, and low program memory overhead. erefore, the discrete Kalman filtering algorithm can be used as an ideal data preprocessing method. e original measurement data sent by the data acquisition terminal to the host computer are filtered as follows.
Set the jth (j � 1, 2, . . ., N) sensor of the N sensors at time k (k ≥ 1) to have the original measured value as Y j (k), the initial estimated value of the filtering algorithm as Y j (0), and the filtered output value as Y j (k); then, the discrete Kalman filter formula can be written as

Complexity
According to the flowchart shown in Figure 3, after the calculations of equation (37), Y j (k)} (j � 1, 2, . . ., N; k � 1, 2, and 3) is used as the fusion data source of autoadaptive weight fusion to replace the original Y j (k) , thus achieving the purpose of suppressing the noise and reducing σ 2 j . e improved fusion algorithm is shown in Figure 7.

Simulation and Analysis of Improved Algorithms
As described in Section 4.1, there were 3 humidity sensors (type: RS485) to measure soil moisture in a certain area at the same time. e true value of soil moisture at this moment was set to 21RH% (can be considered constant in a certain period of time), and based on this, true value Gaussian white noise (white noise launcher type: Noisecom NC6000A/ NC8000A) with a mean of zero and a variance of 0.2, 0.5, and 0.7 was added, respectively, to simulate the noise pollution of   Calculate R jj (k), R ij (k) according to (33) and (34) Calculate the mean value of R ij (k) according to (35) Calculate the variance of each sensor according to (36) Calculate the average of historical measurement data of each sensor according to (26) Calculate the weight value of each sensor according to (25) Calculate the estimated value according to (27) Start Running is over the sensor. A total of three sets of measurements were generated, and every group contained 100 times of measurements. en, discrete Kalman filtering was used for the three sets of measured values, and the three sets of filtered measured values were used as the data source of the autoadaptive weight fusion algorithm, and the variance of the filtered measured data (fused data source) is as shown in Figure 8. e initial parameters of the discrete Kalman filtering algorithm (see Table 1) can be determined from experimental data. e sensor weight curve and the fusion output curve of the improved algorithm are shown in Figures 9 and 10.
As shown in Figure 8, at the beginning of the discrete Kalman filtering algorithm, compared with the variance of the measured values of the prefiltered sensors (see Figure 4), the variance of the measured values of the three groups of sensors is significantly reduced after filtration, and the variance can be controlled relatively faster and maintained at a lower level (after about 30 filtering, the variance is below 0.1). is indicates that the noise contained in the sensor raw data is significantly suppressed. erefore, using the filtered three sets of sensor measurements as the fused data source of the autoadaptive weight fusion algorithm will significantly reduce σ 2 j (j � 1, 2, and 3). Moreover, since the variance curve of the measured value from the filtered sensor becomes smoother with the increase of the number of filtration times, the linkage effect on the sensor weight and the fused output caused by the frequent jitter of the sensor variance can be better avoided. As shown in Figure 9, the improved algorithm has better suppression ability for the sensor weight jitter: after 15 fusions on average, the weight of each sensor has no obvious jitter, which avoids the influence on fusion precision due to frequent jitter of sensor weight and thus significantly improves the fusion accuracy and convergence speed. As shown in Figure 10, after about 35 fusions, the fusion output is already stable and extremely close to the true value, and the fused output curve has fairly high smoothness and substantially no jitter occurrence.
is improved algorithm is significantly better than the algorithm before improvement shown in Figure 6.

Conclusion
e paper uses the discrete Kalman filtering algorithm to improve the acquisition approach of the fusion data source in the autoadaptive weight fusion algorithm. e original measurement data of the sensor after discrete Kalman filtration are treated as a new fusion data source, which substitute the traditional method that obtains sensor measurement data directly as fusion data source. e fusion output results have faster convergence speed, better data smoothness, and higher fusion accuracy than improved before. e improved algorithm can avoid the interference of disturbance data and mutation data, provide a new method for time-series data fusion in the same space, and lay a foundation for the next research of soil data.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this article.