Noise variance estimation for Kalman filter

In this paper, we propose an algorithm that evaluates noise variance with a numerical integration method. For noise variance estimation, we use Krogh method with a variable integration step. In line with common practice, we limit our study to fourth-order method. First, we perform simulation tests for randomly generated signals, related to the transition state and steady state. Next, we formulate three methodologies (research hypotheses) of noise variance estimation, and then compare their efficiency.


Krogh algorithm
The Krogh algorithm [9] was first described in 1960s and is usually applied for numerical integration. One of its unique features is that it allows for changes in values of determinants in each timestep. At the same time, in spite of the change in determinants, their convergence of the individual processes of differential equation solutions is preserved. The Krogh algorithm is defined as follows [9].
May w determine a polynomial given for time points t n , t n-1 ,…, t n-q+1 . The polynomial is defined by Newton forward differences formulae: where M defines the predictor, while M* determines the corrector. By inserting additional symbols   (4) where i denotes the concurrent sample numbers from equations (1) to (4), we can yield the dependence which defines the range of the polynomial coefficients

Algorithm
Below we present the algorithm for the measurement variance and the hypotheses we aim to test. The algorithms consist of five main steps, which three hypotheses are based on: 1. Calculating coefficients φ according to (5).  (8) where 10 σ denotes the variance of the first 10 samples.
In this paper, we use a modified form of Kalman filter, which can be written in short as follows [6,8] where Q matrix of the process noise, R matrix of the measurement noise depending on the hypothesis, K denotes the Kalman gain, A -state transition matrix, B -control matrix, P -state variance matrix, H -measurement matrix, zmeasurement variables, I -identity matrix, x -estimated state, index k denotes a sample in k-th time point. Next, in order to verify the proposed hypotheses, we have carried out tests for randomly generated signals, both for steady state and transition states.

Simulation results
In this Chapter, we present simulation results for a signal generated randomly for the transition state. The signal was generated by means of the Taylor series ( ) We restricted our calculations to the fourth order derivative (m=4). The value of the parameter a was randomly drawn from the interval <-100, 100>. Following that, a white noise is superimposed on the randomly generated signal.
Next, we estimated the noise using the algorithm from Chapter 3 and the proposed hypotheses. The results are presented in Fig. 1. In addition, in this Figure we show the variance of the noise with and without the source signalsn σ , n σ , respectively. From Fig. 1 we can conclude that, based on Hypothesis 3, we can obtain the most accurate estimation of the noise variance.
where coefficients a 0 , a n and b n are drawn randomly from the interval <-100, 100> and then, consistently, we restricted the series to a fourth order (m=4).

Fig. 2. Verification of the proposed hypotheses for the transition state.
As the former case, we imposed a white noise on the randomly generated signal. The results, along with the variance of the distorted source signal and the variance of the noise itself, are depicted in Fig. 2. The best estimation of the noise variance in the steady state was obtained when Hypothesis 2 was applied.
To confirm that the above conclusions are correct, we carried out additional verification, for distorted signal of sinusoidal, sawtooth, rectangular and constant waveforms. A white noise was superimposed on the sinusoidal signal. Next, we checked the proposed hypotheses. The result is shown in Fig. 3.   Fig. 3. Verification of the proposed hypotheses for the sinusoidal signal with a superimposed white noise.
We repeated the above procedure for the sawtooth signal with a superimposed white noise. The result is presented in Fig. 4. We conclude that by applying either Hypothesis 2 or 3, we yielded the most accurate estimation for sinusoidal and sawtooth shape. We also verified the rectangular and constant signal. We imposed a white noise on both and checked if the algorithm estimates the noise variance correctly. The results are presented in Fig. 5 (for the rectangular signal) and Fig. 6 (constant signal). Both Hypotheses, 2 and 3, estimated the noise variance best.   We can observe that in most cases the proposed hypotheses allow for an accurate estimation of the noise variance, with the best results obtained for Hypotheses 2 and 3. The noise was estimated particularly well in case of randomly generated signals, both for steady state (Hypotheses 2 and 3) and transient state.
Next, we confronted the above results with the results obtained from measurements performed for a real medium-power industrial drive with an SEE355ML4BS frequency inverter. The characteristics of the drive are as follows. U Δ =400 V, I Δ =523 A, P n =315 kW, T n =2020 Nm, n n =1489 rpm, η=96.6 %, I d =6.2 kgm 2 , where U Δ denotes line-to-line voltage, I Δ line current, P n nominal power, T n nominal torque, n n nominal rotary velocity, I d moment of inertia on the motor shaft, η efficiency. The considered object also comprised a 20W39MX3GV pomp of capacity equal to 550m 3 /h, liquid column of 130 m and rotary velocity equal to 1490 rpm.
Next, we performed measurement of the converter drive described above. We used a measurement device consisting of two NI 6133 measurement cards, which enable 16-channel measuring with a maximum sampling rate of 1 MS/s. We applied CWT30LF Rogowski coils from PEM with measurement error of 0.2%. The sampling rate was lowered to 400 kS/s. We yielded a very distorted result. Hence, we applied linear Kalman filter, assuming that the object's model is completely unknown. Therefore, the filtering depending exclusively on the assumed noise variance and measurement results. Figs. 7 and 8 show the measurement results S of the line current i L1 and i L2 , both raw and after Kalman filter has been applied. We assumed that the process noise Q is constant. The measurement noise R is estimated based on the three hypotheses (h 1 , h 2 and h 3 , respectively) and the variance of the measurement resultsvar(S). Such an assumption is frequently applied by engineers; yet, as Figs. 7 and 8 show, it proved to be an oversimplification, and to yield inaccurate results. In extreme cases, such an assumption might distort measurement results. However, from Figs. 7 and 8 we may also conclude that the hypotheses, particularly Hypothesis 2, proposed in this paper estimate the measurement noise precisely. For Hypotheses 1 and 3, the results are quite smooth.
However, in case of these hypotheses, we can observe a phase shift, which is unwelcome. Thus, both hypotheses should not be applied in practice. Therefore, our results indicate that Hypothesis 2 may prove a handy tool when estimating the measurement noise by means of Kalman filter.

Conclusions
In this paper, we compared three hypotheses, which facilitate estimating the measurement noise. We applied the estimation results in Kalman filter. Next, confronted the results from theoretical considerations with the results from measurements, carried out in working conditions, and obtain a satisfactory outcome, particularly for one of the hypotheses. Taking into account the above as well as simplicity of our approach, it may be recommend for real-time measurements.