Finite Impulse Response Filtering Algorithm with Adaptive Horizon Size Selection and Its Applications

—It is known, that unlike the Kalman filter (KF) finite impulse response (FIR) filters allow to avoid the divergence and unsatisfactory object tracking connected with temporary perturbations and abrupt object changes. The main challenge is to provide the appropriate choice of a sliding window size for them. In this paper, the new finite impulse response (FIR) filtering algorithm with the adaptive horizon size selection is proposed. The algorithm uses the receding horizon optimal (RHOFIR) filter which receives estimates, an abrupt change detector and an adaptive recurrent mechanism for choosing the window size. Monotonicity and asymptotic properties of the estimation error covariance matrix and the RHOFIR filter gain are established. These results form a solid foundation for justifying the principal possibility to tune the filter gain using them and the developed adaptation mechanism. The proposed algorithm (the ARHOFIR filter) allows reducing the impact of disturbances by varying adaptively the sliding window size. The possibility of this follows from the fact that the window size affects the filter characteristics in different ways. The ARHOFIR filter chooses a large horizon size in the absence of abrupt disturbances and a little during the time intervals of their action. Due to this, it has better transient characteristics compared to the KF and RHOFIR filter at intervals where there is temporary uncertainty and may provide the same accuracy of estimates as the KF in their absence. By simulation, it is shown that the ARHOFIR filter is more robust than the KF and RHOFIR filter for the temporarily uncertain systems.


I. INTRODUCTION
The Kalman filter (KF) filter and its numerous modifications widely used in various applications including in particular control, robotics, target tracking, signal processing [1][2][3][4][5][6][7][8][9][10][11] and so on are algorithms allowing receiving estimates for state-space models corrupted by noises. In the classical setting, the system dynamics and noise covariance matrices are assumed known and determine the achievable estimates accuracy [12]. However, these model assumptions are not realistic in many cases and their violation may degrade the estimate of the state leading to divergence and unsatisfactory tracking of the KF. One of the well-known approaches to improve the robustness of the KF is to estimate the uncertain parameters of the noise models during filtering and tune the filter gain using them and an adaptation mechanism. The methods implementing this approach are known as adaptive Kalman filters. These methods can be divided into two types based on the adaptation of the gain of the filter and using several models of the system [12]. In the filter with gain adaptation, only one system model is used jointly with relations for the estimation of the state and unknown noise parameters. The second approach uses several system models for different modes of its work. In the literature, many methods have been proposed that implement each of them. The Bayesian inference approach [13][14][15][16][17][18] is used for obtaining the posterior probability density function of the unknown covariance matrix parameters from their prior and the observed measurements by the Bayes' formula recursively. In general, the Bayesian approach is computationally intractable due to the numerical integration over a large parameter space. In maximum likelihood estimation [19][20][21][22][23][24], the noise statistics are obtained by maximizing the probability density function of the measurement residuals generated by the filter, which is the likelihood of the noise parameters. Adaptive filters based on maximum likelihood methods require nonlinear optimization and are computationally intractable. In addition to computational complexity, this method suffers from convergence to a local optimum. In addition, both methods use a parametrized noise covariance matrix. The basic idea of the covariancematching techniques [25][26][27][28][29] is that the sample covariance of the innovations should be consistent with its theoretical value. The unknown noise covariance is estimated from the innovation sequences accumulated over the entire historical data (or in a moving time window). The disadvantage of this method is the lack of proof of its convergence. This paper deals with finite impulse response (FIR) filters for state estimation of linear discrete systems which are extensively employed in a variety of applications see for instance [30][31][32][33][34][35][36][37][38][39][40]. Unlike the KF, they allow to avoid the divergence and unsatisfactory object tracking connected with temporary perturbations, errors in the noise statistics setting, abrupt object changes [1,14,15]. This is reached using observations and inputs specified only at a finite discrete interval (a sliding window) which is called the recent receding horizon and where the system model is adequate to the real system. Thus, the size of the sliding window is a parameter the choice of which can impact the estimation performance of the filter. The main challenge is  [13][14][15][16][17][18][19][20][21][22][23][24] does not require parametrization of the noise covariance matrix.
Various methods have been proposed to construct FIR algorithms. The optimal algorithms for a given horizon size are considered in [41][42][43][44] and the references therein]. The main idea of the proposed approaches in these works is that initial conditions at starting points of the sliding windows are assumed to be diffuse random variables or unknown arbitrary values. It is shown that the obtained estimates are unbiased. Computer modeling shows that such filters can be more robust than the KF filter if the size of the sliding window is properly fitted. However, the proposed recursive filters have two disadvantages. First, a butch form of the algorithm is needed for the initialization of the recursive filter during the learning cycle which may be inconvenient or even problematic in some cases (e.g., in case of gaps in the observations, estimation parameters of nonlinear systems and non-stationary processes). Second, these filters do not use priory known information for initialization at starting points of sliding windows. Various generalizations of this approach are proposed in [45][46][47][48][49][50][51][52][53][54][55]. In [56], it is proposed to jointly assess the state of the system and noise statistics using the optimal FIR with a fixed given size of sliding window and sequential noise statistics estimation method. Another approach ensuring optimality and unbiasedness in a finite number of steps is described in [32,57,58]. The receding horizon optimal unbiased FIR filter suggested by the authors uses known statistical information for parts of state vector components at starting points of sliding windows and a learning cycle is not required for its the initialization. Within the framework of covariance analysis this allows to take into account priory statistical information about random biases, trends and specified movements of the system.
There are general requirements for the horizon size. First of all, the model must be adequate to the object within the sliding windows. Second, if the horizon size is too small then there is not enough available information to obtain an acceptable accuracy estimate. Vice versa, if it is too large then it may not be acceptable from the point of view of the practical implementation and the filter transient characteristics. Approaches for its selection are based on Monte Carlo simulation, analytical relations for sufficiently simple models and real measurements. Several adaptive algorithms have been proposed in the literature to select the horizon size of the FIR filters for linear state-space models. In [59], the butch FIR filtering is proposed based on two user-defined windows of different sizes and the chi-square test statistic for the states comparison of the nominal and temporarily uncertain systems. The butch form for the FIR filter is developed from the conditional density of the current state given finite past measurements. It is verified by the simulation that it may achieve a significant performance improvement compared with an ordinary FIR filter which uses a fixed horizon size. In [60], the horizon selection strategy and the design of the adaptive-horizon iterative unbiased FIR filter are developed. It exploits the fact that the current iteration with large horizon length contains information of the previous iterations with small horizon lengths The research contributions of the present paper are as follows: 1) A new FIR filtering algorithm with the adaptive horizon size selection based on the joint use of the receding horizon optimal FIR (RHOFIR) filter [57,58] and abrupt change detectors is developed. To ensure the work of the filter, parametrization of the covariance matrix is not required, as well as setting the sizes of sliding windows and their number. We call such filtering algorithm further the adaptive RHOFIR (ARHOFIR) filter.
2) The ARHOFIR filter chooses a large horizon size in the absence of abrupt disturbances and a little during the time intervals of their action. Due to this, it has better transient characteristics compared to the KF and RHOFIR filter at intervals where there is temporary uncertainty and may provide the same accuracy of estimates as the KF in their absence.
3) Monotonicity and asymptotic properties of the estimation error covariance matrix (EECM) and the RHOFIR filter gain are established. These results form a solid foundation for justifying the principal possibility to tune the filter gain using them and an adaptation mechanism.
Applications of the proposed filtering algorithm to the monitoring of the a F404 gas turbine aircraft engine model and to the elevation angle monitoring of the underwater moving object obtained with the help of video surveillance are considered. Computer simulation demonstrates that it has better transient performance compared to the KF and RHOFIR filter at intervals where there is temporary uncertainty and provides the close estimation accuracy to estimates of the KF in their absence.
The work is organized as follows. The considered problem is formulated in Section II. Properties of the RHOFIR filter are established in Section III. In Section IV, the FIR filtering algorithm with the adaptive horizon size selection is derived. Computer simulation is given in Section V. The conclusions are presented in Section VI.

II. PROBLEM STATEMENT
Consider a linear discrete time-invariant system model where ∈ is the state vector, ∈ is the measured vector, and are uncorrelated random processes with zero means and known covariance matrices Under the assumptions A1, A2, the unbiased linear state estimate of (1) for ∈ * = [ − + * , ], ∈ minimizing the criterion [( −̂) ( −̂)] (the RHOFIR filter) is determined by the following relations [57,58] = +̃, where ̃= , ̃= , + is the Moore-Penrose inverse of , is the identity matrix of the size .
The EECM of the RHOFIR filter for ∈ * = [ − + * , ], ∈ is given by the expression Where = + . In (4), (13), (7) , are the transient components of the filter gain and the EECM reflecting the absence of a priori information of − , ∈ , is the standard matrix Riccati equation with zero initial condition, respectively.
The problem is formulated as follows. The model (1)-(2) is considered as a nominal one for the analyzed object and the RHOFIR filter described by expressions (3)-(13) is used to estimate its state. It is required to detect changes in the properties of the object based on observations of the filter residuals = −̂ and propose a FIR algorithm for selecting the sliding window size at each moment of time to improve its tracking ability.

III. MONOTONICITY PROPERTIES OF THE RHOFIR FILTER
This section is devoted to the development of properties of , , . Using asymptotic analysis, it is shown that under certain conditions they are not increasing functions converging to a steady state with increasing the horizon size.
It follows from (3-11), (13) that , , do not depend on and it is sufficient to study their behavior within one sliding window ∈ [0, ] for = .

2.
With an unlimited increase in the length of the horizon size, there are limits where for all ≥ * .
Proof. 1. Let's define . Assume that the state of (1) at the starting point of the sliding window 0 is the diffuse random variable, i.e., ( 0 ) = 0, ( 0 0 ) = , where > 0 is a large parameter. Then the EECM of the state estimation (1) with help of the KF has the form where 0 = , = +̃. The approximating property (17) of follows from the uniform asymptotic representation on * [57,58] due to the disappearance of the first term in this expression for ∈ * and (13).
Let's now define setting where , are specified by (19) and (7), respectively. As where 0 = , is defined by (11), 1 = + +̃. The approximating property (14) of follows from the uniform asymptotic representation on * [57,58] Consider the first inequality in (15). It is sufficient to show that it is true for some value = . Let = 1. We show that 1 ≤ 0 = for a large . It follows from (19) As for any × matrix and nonsingular × matrix Then Since ( ) + = + then substitution of this expression in (23) gives Where Σ = − + . Therefore, it is necessary to show that Taking into account that Σ has only zeros and ones as eigenvalues and the eigenvalues of are coincide with 2 ( ), = 1,2, . . . , , we successively find for any ≠ 0 using the theorem condition (d) It implies the first inequality in (18).
Proof. 1. Using the identity Since +1 ≤ , then for = , =̃, = and taking into account that ≠ 0, we establish that And is nonsingular if ≠ 0. We have Where We find from (40) Substituting this expression in (41) gives Since +1 ≤ then it follows from this (33).
Comment 2.2. The requirement ≠ 0 does not seem too strict since as an example all linear discrete systems obtained from continuous systems satisfy this condition.

DETECTION
Our approach to development of the adaptive FIR filter (the ARHOFIR filter) is based on the residuals analysis of the RHOFIR filter and an adaptive adjustment of its filter gain. The principal possibility to solve this problem using the RHOFIR filter follows from the statement that the filter gain and the EECM are the monotonically nonincreasing matrix functions proved in the previous section. In order to capture abrupt changes, in this study, we utilize the chisquare statistics that is widely used in different applications [61,62] as a detector of such changes.
Let's express the method of the ARHOFIR constructing filter step by step. Firstly, the maximum value of the horizon size is estimated off-line. Consider the EECM trace of the RHOFIR filter ( ) for the nominal system (1), (2). We have shown that EECM defined by (13) can be approximated by the one-parameter family of matrix functions which are monotonically nonincreasing and have the finite limit ̄ for → ∞. Taking this into view, let us set acceptable values of in a vicinity of the steady-state value using the inequality max min Where р , are selected parameters by a user. It follows from this an upper bound max for acceptable values of the horizon size [ min , max ], where * ≤ min < max . Instead of ( ) any diagonal element of maybe also used. Note that if is chosen too small, then this may reduce the accuracy of the estimate.
However, if is too large then then additional computing resources will be required.
Secondly, the moment of the appearance of the disturbance is estimated on-line. Let us introduce sliding windows [ + Δ , + max ] of the variable length = max − Δ ≥ min , = 0,1, . . ., and the normalized innovation squared defined on them Where Δ is an integer sequence, Σ = +̃. Under the hypothesis that the RHOFIR filter is consistent and the noises , in (1), (2) are Gaussian variables has a chi-square distribution with = ( max − ∆ + 1) degrees of freedom. Chi − squared test is determined as follows: in the case when there is a disturbance on the interval [ + Δ , + , where ( | ) is Chi-square distribution with degrees of freedom, is probability of a false alarm. Let us note the singal-run test as a special case of (56) seting Thirdly, the horizon size is determined on-line. It is proposed the following adaptive procedure of the horizon size selection: where is is any integer sequence satisfing conditioons The flowchart of the proposed adaptive FIR filter is shown in Fig. 1. Secondly, let us now show how Theorems 3, 4 can be used to estimate the upper bound for in the case of incomplete or lack of information about noises intensity in (1), (2). We have from (13) and Theorems 3, 4 that

The ARHOFIR Filter
where ̄→ 0 as → ∞ and does not depend on the intensity of the dynamics noise ̄. It follows from this that for any > 0there is such * that ||̄|| ≤ and fulfillment of the condition (55) regardless of ̄ if ≥ * . Thus, we can set * = * .
Thirdly, an estimate of the upper bound for can be obtained also using the same considarations for the transient components of the filter gain , and the inequolity where Note that in the case of the scalar meassurement (or ̃= ) = (̄(̄) ) does not depend on ̃. It is clear that this method leads to more cautious estimates of compared to the two described above.
Let us give additional explanations and interpretation of the results presented in this section, compare and disccus, them with previous works.
The ARHOFIR filter is an algorithm allowing reducing the impact of various kinds of disturbances acting for short periods of time or abrupt changes by varying adaptively the sliding window size. The possibility of this follows from the fact that the window size affects the filter characteristics in different ways. More precisely, it means that if the horizon size is too small then there is not enough information to obtain an acceptable accuracy estimate and if it is too large then it may not provide the acceptable filter transient characteristics. Taking in account this consideration, the ARHOFIR filter chooses a large in the absence of abrupt disturbances and a little during the time intervals of their action. A detailed description of the filter operation sequence in the form of the flowchart it is shown in the Fig.  1. The proposed FIR filtering algorithm is based on the joint use of the receding horizon optimal RHOFIR filter (3)-(13), the abrupt change detector (57) and the adaptive mechanism for choosing the window size (58)- (61). The RHOFIR filter evaluates the state of both nominal and perturbed systems. The detector analyzing the residues determines the presence or absence of disturbances. And finally, the recurrent adaptation mechanism sets the size of the sliding window in Journal of Robotics and Control (JRC) ISSN: 2715-5072 843 Boris Skorohod, Finite Impulse Response Filtering Algorithm with Adaptive Horizon Size Selection and Its Applications accordance with the incoming information from the detector. The described adaptive size selection procedure differs considerably from those proposed earlier in the literature. Firstly, there is no need to set the size of the windows [59] and their number can be whatever. Secondly, the algorithm is given in iterative form but not in butch form and it is not required training cycle in the batch form to initialize such filter [59,60]. Thirdly, test statistic is used for analysis of the innovation sequence but not for states comparison of the nominal and temporarily uncertain systems [59]. The ARHOFIR filter chooses a large horizon size in the absence of abrupt disturbances and a little during the time intervals of their action. Due to this, it has better transient characteristics compared to the KF and RHOFIR filter at intervals where there is temporary uncertainty and may provide the same accuracy of estimates as the KF in their absence. And finally, note also that the ARHOFIR filter with an adaptive horizon size selection mechanism unlike [13][14][15][16][17][18][19][20][21][22][23][24] does not require parametrization of the noise covariance matrix.

V. SIMULATION
We compare the performance of the proposed adaptive FIR algorithm (the ARHOFIR filter) with the Kalman filter (KF) and the fixed horizon optimal FIR filter (the RHOFIR filter) on monitoring of the F404 gas turbine aircraft engine model and on the elevation angle monitoring of the moving underwater object obtained with the help of video surveillance.

A. F404 Gas Turbine Aircraft Engine
The

B. Elevation angle estimation of a moving underwater object
We use experimental data collected with the help of a stand that is shown in Fig. 4. It allows simulating a workspace of an underwater robot and includes the analogues of the man-made underwater infrastructure objects. A pop-up cube of the brown color with the size of 3 by 3 centimeters was considered as an object of the interest. The scene is observed by a monocular video camera with a sampling rate of 10 frames per second. The object is located at the distance of about 1.5 meters from the camera. The pixels belonging to the object are selected by color in each image and the smallest rectangle center is found.
The cube movement includes three different modes accompanied by a collision with the plane, the motion along it and finally surfacing. Typical images screenshots in each mode are shown in Fig. 5. The motion trajectory in the image plane coordinates is shown in Fig. 6  If , are given then the elevation and bearing angles of the cube center can be determined by the relations [63], respectuvely, Where ℎ , , ℎ , , , are view angles, pixel numbers and the object coordinate in pixels horizontally and vertically, respectively. Due to the high accuracy of the video-based object detection, errors in determining and can be expected to be negligible in many applications. Really, the workspace size of the underwater robot is usually assigned and the maximum linear pixels sizes can be determined. So for 2 meters, they are approximately equal to 0.6 mm if ℎ = 51.13 , = 35.14 (in the water), and the error in determining the center of the cube is about 1-2 pixels. At the same time, changes during one sampling period can vary significantly within 20-25 px. Taking these considerations into account, we would like to develop one step prediction for . Taking into account the existence of the abrupt changes in the process of the movement object, we will apply for prediction the ARHOFIR filter with the adaptive horizon selection proposed in this work and for a comparison the KF and the RHOFIR filter with fixed horizon size.
Assume that the cube centers motion is described along the vertical axe by the kinematic model with a nearly constant velocity where is the object velocity projection on the vertical axe, , are the acceleration projection and the measurements noise (the centered uncorrelated white noises with the variances 2 , 2 , respectively), is the sampling period. The input data for the simulation of the nominal model are the following: = 0.1s, = 2 px/ 2 , = 1px.
As in the previous example, we begin with the filters covariance analysis, the selection of and the horizon size for the RHOFIR filter. Traces of error covariance matrixes and squared norms of filters gains are shown in Fig. 7. It is seen that the variances behavior fully corresponds to the results established in Section 3. We set = = 10. A similar conclusion is also true with respect to squared norms of filters gains.
The one-step prediction estimation errors of the KF, the ARHOFIR, RHOFIR filters and horizon sizes obbtained with help of the ARHOFIR are shown in Fig. 8. The root mean square estimation errors for the KF, the ARHOFIR and RHOFIR filters are: 19.9, 6.5, 11.9 respectively. The following input data were used: = 10, Δ 0 = 7, = 2, Δ 0 = 7, = 1 if (60) is fulfilment and = −1 if (61), = 0.01 and the single-run test was used. Filters are developed for the nominal model (69), (70). It is seen that proposed the ARHUFIR filter may have better transient characteristics compared to the KF and RHOFIR filter. Finally, we note that within each mode, the errors of the ARHOFIR filter do not exceed 5-6 pixels. In this paper, the new FIR filtering algorithm with the adaptive horizon size selection based on the joint use of the receding horizon optimal FIR filter and abrupt change detectors has been developed. The filter chooses a large horizon size in the absence of abrupt disturbances and a little during the time intervals of their action. Due to this, it has better transient characteristics compared to the KF and RHOFIR filter at intervals where there is temporary uncertainty and may provide the same accuracy of estimates as the KF in their absence. Besides, in contrast to known analogs there is no need to set the size of the windows and their number can be whatever; the algorithm is given in iterative form but not in butch form and it is not required training cycle in the batch form to initialize such filter. As a direction for further research, we note the improvement and research of the adaptation horizon size selection mechanism. The limitation of the proposed approach is the time invariance of the nominal system.