Optimizing the Energy Efficiency of Unreliable Memories for Quantized Kalman Filtering

This paper presents a quantized Kalman filter implemented using unreliable memories. We consider that both the quantization and the unreliable memories introduce errors in the computations, and we develop an error propagation model that takes into account these two sources of errors. In addition to providing updated Kalman filter equations, the proposed error model accurately predicts the covariance of the estimation error and gives a relation between the performance of the filter and its energy consumption, depending on the noise level in the memories. Then, since memories are responsible for a large part of the energy consumption of embedded systems, optimization methods are introduced to minimize the memory energy consumption under the desired estimation performance of the filter. The first method computes the optimal energy levels allocated to each memory bank individually, and the second one optimizes the energy allocation per groups of memory banks. Simulations show a close match between the theoretical analysis and experimental results. Furthermore, they demonstrate an important reduction in energy consumption of more than 50%.


I. INTRODUCTION
Kalman filtering is a very common recursive estimation task in statistical signal processing [1], and it is often implemented on resource-limited hardware.Applications which require an embedded energy-efficient Kalman filter include air quality monitoring [2], biomedical wearable Part of the material of this paper was published in ICASSP 2021.This work was supported by grant ANR-17-CE40-0020 (EF-FECtive project) and by the "Make our Planet Great Again" Initiative of the Thomas Jefferson Fund.arXiv:2109.01520v1[cs.IT] 3 Sep 2021 sensors [3], and vehicle positioning [4].Energy budgets for embedded systems show that memory access consumes about a hundred times more energy than integer computations [5].Therefore, in this paper, we focus on optimizing the energy used by memories in Kalman filters.
All memories used in integrated circuits exhibit a fundamental trade-off between data storage reliability and energy consumption that is related to the inability of perfectly controlling the fabrication process.For example, the energy consumption of static random access memories (SRAMs) can be reduced by lowering its supply voltage, but this increases the probability that some of the stored bits cannot be retrieved correctly [6].Following this principle, [7] developed an optimization method to lower the energy consumed by SRAM accesses by reducing the bitline voltages.This methodology was also used to decrease the write energy of magnetic random access memories (MRAM) in [8].In both cases, however, this introduces errors in the words stored in memory.
The robustness to unreliability in computation operations and memories has been investigated for several signal processing and machine learning applications, including binary recursive estimation [9], binary linear transformation [10], deep neural networks [11], [12] ,or distributed logistic regression [13].Moreover, several techniques have been proposed to compensate for faults introduced by unreliable systems.For instance, [14] proposed to add redundancy in the system through algorithmic noise tolerance, and [15] investigated the use of error-correction codes (ECC) for fault correction.
Although Kalman filtering has not previously been investigated under unreliable hardware implementation, some related works considered inaccuracies in the filter parameters [16]- [18], and uncertainties on the observations [19].Although these models are not relevant for characterizing the effect of unreliable memories, the main lessons they provide is that Kalman filtering is very sensitive to inaccuracies, and that one should re-derive the optimal Kalman filter depending on the specifically considered uncertainty model.Other prior work aimed at reducing energy requirements for Kalman filtering focus on reduced computational complexity in FPGA [20], [21] and ASIC [22] implementations.
Designing a digital hardware implementation requires quantizing all the variables and computational operations.Therefore, to further reduce the memory energy consumption, one op-September 6, 2021 DRAFT tion is to properly optimize the quantization so as to reduce the memory requirements of the implementation.Significant energy gains from optimized quantization have been demonstrated in [23]- [25] for signal processing and digital communications applications, and in [26]- [28] for neural networks.The effects of quantization on the Kalman filter were first studied in [29], [30] to understand the convergence of filters with reduced precision.More recently, [31]- [33] considered two distributed quantized Kalman filters, one based on quantized observations and one based on quantized innovations, where sensors process and transmit quantized observations and innovations to a fusion center.Furthermore, [31] proposed to optimize the number of quantization bits at each sensor so as to minimize the required data transmission energy.More general linear stochastic systems were also investigated under quantized measurements [34] and quantized innovations [35], where it was shown that the derived quantized filters converge to standard Kalman filters as the number of quantization levels increases.However, none of these theoretical works considered quantized parameters (e.g., quantized Kalman gain matrices, quantized measurement matrices, etc.), in addition to quantized observations/innovations.Therefore in this paper, we study a fully-quantized Kalman filter and investigate its energy consumption when using unreliable memories.
Here, we aim to optimize the energy consumption of a Kalman filter implemented with fixedpoint quantization [36] and with unreliable memories.We consider the statistical model of [6] which relates the amount of faults introduced in memory to its energy consumption.Then, as a first contribution, we propose a unified framework to analyze the performance of Kalman filters with both quantization errors and faults introduced in the memory.To develop this framework, we build on the approach of [30] which consists of evaluating the covariance matrix of the estimation error at each filter iteration, by considering both error propagation from previous iterations, and errors introduced at the current iteration.Our analysis also includes quantized filter parameters, and further incorporates the effect of unreliable memories.Note that determining the covariance matrix of the estimation error has two advantages.First, it allows us to derive the optimal Kalman filter equations under the considered quantization and memory error models.Second, and more specific to our case, it defines a performance criterion which will be used to optimize the memory energy consumption.
As a second contribution, we define two optimization problems to minimize the memory energy September 6, 2021 DRAFT consumption while satisfying a target constraint on the estimation performance of the Kalman filter.In the first problem, we optimize the number B of quantization bits and the energy allocated to each bit position so as to minimize the overall energy consumption of the memory.This optimization problem extends [7], which was not dedicated to Kalman filtering but derived optimal bitwise energy allocations with a fixed number of quantization bits, by considering a generic Mean-Squared Error (MSE) performance criterion when reading a word in memory.
Although a useful baseline, the setting where each bit position can have a different energy allocation is not practical, since each of the B bits should be placed in a different memory bank with its own power supply.This is why we also introduce a second optimization problem in which we fix the number L < B of possible energy levels, and optimize the energy value in each level and the mapping of bit positions to an energy level.At the price of a small energy increase, this optimization problem allows us to build a practical implementation which only requires L memory banks.By using the Karush-Kuhn-Tucker (KKT) conditions, we provide solutions for the two considered optimization problems.Both solutions can be numerically computed using waterfilling.Numerical simulations show that after optimization, the memory energy consumption is reduced by up to 56% compared to uniform allocation.
The main contributions of this paper can be summarized as: 1) We develop an error propagation model of the Kalman filter that takes different sources of errors (quantization, unreliable memories) into account and allows us to derive new filter equations to minimize the estimation error.Moreover, these new equations accurately predict the filter's performance, depending on the considered sources of errors and on their parameters.
2) We propose a methodology for minimizing the energy of the unreliable memories used in the Kalman filter, under a given performance constraint.It consists of computing the optimal number of quantization levels and bit energy allocation in two setups.The first setup considers that the B energy levels can be chosen freely, while the second one assumes that only L < B energy levels can be set.
A preliminary version of this paper [37] only considered optimizing the energy allocation for each memory bank individually and for a fixed number of bits, without taking into account September 6, 2021 DRAFT the quantization noise nor trying to reduce the energy consumption by adjusting the number of bits.
The rest of the paper is organized as follows.Section II describes the quantized Kalman filter and introduces the uncertainty model for unreliable memories.Section III investigates the theoretical performance of the filter.Section IV formally defines and solves the two considered optimization problems.Section V presents simulations results.

II. SYSTEM MODEL
We first review the Kalman filter for estimating dynamic state variables from noisy measurements.
We then present the considered implementation of the filter, by first introducing its quantization model and then describing its implementation with an unreliable memory.

A. Kalman filter
Consider a linear dynamic variable x ∈ R c described by a process: where x k is the state vector of the process at step k, F is the c × c state transition matrix, and u k ∈ R c is an additive white noise vector.The state of x is observed through the measurement vector y ∈ R d : and the recursive equations of the a posteriori estimation step are: where A denotes the transpose of a matrix A. In these equations, the covariance matrices P of size c × c and the Kalman gain K of size c × d can be computed offline.On the other hand, the terms xk+1|k and xk+1|k+1 depend on the measurements y k and must be computed online.

B. Quantized implementation of the filter
In the rest of the paper we study Kalman filters that are implemented under fixed-point quantization [36].Under this model, each number is represented as a signed integer coded on (1+n+m) bits, where one bit is used for the sign, n bits are used for the integral part of the number, and m bits are used for its fractional part.Using this model, a given number z can be written as where z b ∈ {0, 1} are the bits stored in memory to represent z.In our modeling of the Kalman filter, all variables (including matrix components) involved in equations ( 3)-( 7) are stored using this quantization model, all with the same values of n and m.The quantization of the variables to this fixed-point model is done using a uniform quantizer.Note that the distribution of the quantized data is not necessarily uniform (the random variables xk|k and y k could follow Gaussian distributions for example).However, in [38] it is shown that a uniform quantizer can be applied independently of the probability distribution of the source with only a small difference to an optimal quantizer.
In the considered quantizer, the value of n is chosen so as to be able to represent the largest possible value in the system.The value of m sets the resolution of the quantization so the smallest difference between two quantized numbers is 2 −m [36].The value of m will be a parameter that is optimized for minimizing the energy in later sections.
In the case of fixed values such as components of the matrices of the filter, the fixed-point quantized value can be written as f = f + δ f where δ f is the quantization error.Using the previously described uniform quantizer, δ f < 2 −m .In the case of quantized random variables like the components of xk|k or y k , we let x be the quantization error, and express x = x + x .
In [39], conditions are given for the quantization error x to be independent from the quantized variable, depending on the distribution of the quantized data.For the special case of a Gaussian distribution, the quantization step needs to be significantly smaller than the variance of the quantized data.In this case, it can be shown that the quantization error is a white noise following a uniform distribution of variance 2 −2m 12 .This independence assumption will be used in the theoretical derivations of Section III.Note that most existing works on quantized Kalman filters only consider that random quantities like xk|k and y k as quantized, whereas here, the components of the matrices e.g., K k , of the filter are also quantized.This will require a new theoretical analysis to treat this case.

C. Implementation of the filter by using an unreliable memory
In order to reduce its energy consumption, the quantized Kalman filter can be implemented on unreliable hardware [7], [9]- [11].Here, we assume, as in [9] and [11], that only the memory is faulty.In this case, each memory cell of a memory bank has a bit flipping probability p.We then use the model of [6] to express p with respect to the memory bank energy consumption e as p = exp(−ea) , where a is a parameter that depends on the device technology.We assume that the bit errors from each memory cell are independent.
Each memory bank has a uniform energy consumption (e.g.single supply voltage) and is used in our case to store the bits at a certain position of all components of matrices that are stored in the unreliable memory.Here we consider that only the estimates xk+1|k and xk+1|k+1 are stored in unreliable memory bank.We make this assumption since the other terms of the filter can be precomputed offline and stored on a reliable memory separately in the system.Therefore, in the Kalman filter, instead of having an estimate component x, such as one the computed in (3), we have a possibly incorrect estimate component x.Using the binary representation given in (8), we define an energy per memory bank vector: e = e −m , e −m+1 , . . ., e n−1 .
A bit at position b stored in the unreliable memory can then be expressed as xb = xb ⊕ γ b , where , and ⊕ denotes the modulo-2 addition.As the filter would be particularly sensitive to faults on the sign bit, we consider a sign-preserving model, as in [9], [40], [41].This sign-preserving model can be implemented by storing the sign bits in a separate reliable memory.
Using this noise model defined at the bit-level xb , we can define a noise model at the symbol level x as where γ is the noise introduced by the unreliable memory.For the subsequent theoretical analysis, we assume that the mean E[γ] of this memory noise is negligible compared to its variance We verified this condition from Monte Carlo simulations.The covariance matrix Γ of a memory noise vector γ of length c is defined as γ , and has size c × c.The matrix Γ is diagonal since the memory noise variables are considered independent.

III. ERROR ANALYSIS
As described in Section II, we consider two types of errors affecting the filter: the quantization error and the unreliable memory noise.In this section, we first describe a generic model of error propagation in the Kalman filter, before studying both types of errors in more detail.Finally, we compute the new covariance matrix P * k|k = Cov[x k|k − x k ] of the total estimation error by taking both sources of noise (quantization and unreliable memories) into account, compared to a standard Kalman filter which does not include either.

A. Error propagation model
Our objective is to compute the total error ∆x k+1|k+1 on the computation of xk+1 at step k + 1, by considering the two types of errors: quantization and unreliable memory.To handle recursion September 6, 2021 DRAFT as in [30], we choose to split the error model in two parts: the errors occurring at step k, and the errors from the previous steps which are propagated up to step k.
To compute ∆x k+1|k+1 , we first need to express the total error ∆P k+1|k on the a posteriori covariance matrix P k+1|k after step k + 1.As in [30], we express this total error as where the function f P models the errors propagated from step k, and δP k+1|k represents the errors occurring at step k + 1.In this case, according to [30]: where We then express the total error ∆x k+1|k+1 on xk+1|k+1 by considering the same separation between propagation errors and errors from current iteration.This gives where the error propagation function f x is provided in [30] as In this expression, we observe the error propagation from the previous computations of xk|k P k+1|k .In particular, xk+1|k+1 depends on K k+1 which is precomputed from P k+1|k at each iteration.
Using the recursive equations ( 12) and ( 14), we now estimate the covariance matrix of the total estimation error P * k|k .Note that [30] considered only quantization errors, while here we consider two sources of errors: quantization and unreliable memories.To evaluate P * k|k , we must first compute the covariance of each term of ∆x k+1|k+1 .By assuming that the two sources of noise (quantization and unreliable memory noise) are statistically independent, we decompose δ xk+1|k+1 as and study the two terms δ xquant k+1|k+1 and δ xmem k+1|k+1 separately.

B. Quantization error
We now aim for an analytical expression for δ xquant k+1|k+1 , defined as the difference between the full precision estimate xk+1|k+1 and its quantized version xk+1|k+1 : Before expressing δ xquant k+1|k+1 , we first review generic quantization errors expressions [30].For the scalar fixed-point multiplication of a coefficient s with a random variable t both quantized according to the model presented in Section II-B, we can show that where δ s = s − s and t and st follow uniform distributions of variance 2 −2m 12 .The scalar expression (18) can then be generalized to the case of a product between a matrix of fixed-point coefficients A of size p×q, and a matrix of fixed-point random variables B of size q ×r as where AB is of size p × r with AB i,j = q k=1 AB i,j,k .According to Section II-B, each AB i,j,k follows a uniform distribution of variance 2 −2m 12 .In (19), the product δ A B can be considered as negligible compared to the other error terms.Indeed, all scalar quantization errors and δ are upper-bounded by 2 −m−1 and since m ≥ 1 their product is bounded by 2 −2m−2 .Thus, given that the value of m is large enough, we have that 2 −2m−2 2 −m−1 .Therefore, in the following derivation, we neglect the products of quantization errors.
We now study quantization errors introduced during the computation of xk+1|k+1 .While existing works, e.g., [31]- [33], assume that only the random quantities xk|k and y k+1 are quantized, we here also consider that the matrices D k+1 and K k+1 are quantized as well.This corresponds to a more practical implementation setup, and requires a more complex theoretical analysis.We first note that equation ( 6) can be rewritten as where both D k = (I − K k H)F and the Kalman gains K k can be computed offline.We thus consider that the matrices K k and D k are computed in full precision and then quantized with a September 6, 2021 DRAFT fixed point model.Under these conditions, according to (19) and neglecting the products between quantization errors, the quantized vector xk+1|k+1 can be approximated as We see that the expression of xk+1|k+1 depends on the full precision vectors xk|k and y k+1 and on the quantization errors and noise.
Finally, the quantization error δ xquant k+1|k+1 defined in ( 17) can be computed by using (21): where the covariance matrix Σ × of × = D k+1 x k|k + K k+1 y k+1 is given by and ] can be approximated as: where the last equality is obtained from the noise-vs-energy model (9).Therefore, the probability distributions of the variables x have actually no significant impact on the value of the MSE.
Equation (25) gives us a relation between the noise variance σ 2 γ and the vector e of energy levels defined in (10).Moreover, by using (25), we show that the covariance Γ of the memory noise vector δ xmem k+1|k+1 is given by:
By using xk|k to denote the faulty estimate of x k , we can express Considering that only the xk|k are stored in the unreliable memories, the error propagation model ( 14) can be rewritten as: where ( 29) is obtained by replacing δ xquant k+1|k+1 by its expression (22), and (30) comes from (27), which allows to write xk|k = xk|k + ∆x k|k .Equation (30) provides a recursive form of the error at step k, since ∆x k+1|k+1 depends on ∆x k|k and xk|k .All the other terms in (30) This equation gives us a recursive form of the total estimation error xk+1|k+1 − x k+1 at step k + 1, depending on the estimation error xk|k − x k at step k, and on the quantization resolution 2 −m and the memory noise δ xmem k+1|k+1 .
Finally, we can compute the covariance matrix P * k+1|k+1 of this error as where all the terms involved, including the covariance matrices, have been explicited in the previous sections.Equation (34) shows that the covariance matrix P * k+1|k+1 can be computed recursively.
Equation (34) provides us a measure of the performance of the filter, depending on the quantization resolution and on the energy supplied to the memory.Equipped with this derivation, we can now use the covariance matrix P * k+1|k+1 as a performance criterion against which to optimize the energy consumed of the unreliable memory.

IV. ENERGY OPTIMIZATION
In this section, we optimize the energy consumption of the memory while satisfying a performance constraint defined on the total estimation error of the filter.As parameters to optimize, we consider the number of bits m for the quantization, and the energy vector e of the memory September 6, 2021 DRAFT banks.We define two optimization problems, which both seek to minimize the energy consumed by the memory.In the first problem, we find the optimal number of bits m and the corresponding n + m levels of energy to allocate to the memory banks.Although solving this problem provides the minimum energy that needs to be supplied to the memory, it is not very practical since each of the n + m bits should be stored in a different memory bank with a specific voltage supply.
Therefore, in the second problem, we consider that the number of bits m is fixed, but that the number of possible energy levels is limited to L possibilities.Both the L energy values and the allocation of each bit to one of the L possible values should be optimized.Solving this problem allows to consider only L < n + m different memory banks.

A. Optimization across all the bits
We first find the optimal level of energy e b of each memory bank and the optimal number of fractional bits m so as to minimize the total memory energy consumption.As performance criterion, we consider the covariance matrix P * N |N of the total estimation error at step N , where N is chosen to be large enough so that the filter can converge.We further introduce a matrix V of the same size as P * N |N so as to define the performance constraint for the variances and covariances of estimation error on each component.The optimization problem is then defined as follows: where ≺ is a component-wise inequality between the two matrices, and where the minimum is taken over all energy vectors e as defined in (10) and for all the possible values of the number of bits m.We consider that m ∈ 0, M , where M is the maximum number of bits which could be stored in a memory.The value e thres is the minimum level of energy for each memory bank, so as to avoid undesired effects such as circuit delays and energy leakage [6].
where λ is a dual variable that balances the trade-off between reducing the energy consumption and preserving the performance of the system.The optimal vector e * can then be computed using a water-filling algorithm [7] for a fixed desired performance V of the filter.With this optimal solution, we see that the least significant bits have their energy adjusted to the minimum possible energy level e thres .The energy levels then increase logarithmically for each bit as their significance increase.
Since m is discrete, the optimal solution (35) is computed using the water-filling algorithm for each possible value of m.We then retain the solution (m , e ) which gives the lowest total energy e tot = n b=−m e b .In this method, the influence of the quantization error is taken into account through the performance criterion P * N |N .For a small number of bits m, quantization errors may make it impossible to satisfy the desired performance constraint and therefore the water-filling algorithm will not be able to find an optimal solution.In this case, if we detect that the algorithm converges toward a performance value that is still higher than the constraint, the algorithm is stopped and we proceed to the next value of m in the considered range.
The full optimization process is summarized in Algorithm 1.In this algorithm, the parameter β controls the rate at which the energy for each memory bank is increased at each iteration.
The value of β is chosen either using the precision with which energy can be set in a given device technology, or based on the desired rate of convergence for the water-filling algorithm.
The condition P prev − P * N |N > ξ is used to detect whether the water-filling algorithm has a feasible solution, so the value of ξ is set to be low.

B. Optimization with a limited number of energy levels
In practice, the solution of Problem 1 makes the implementation costly as each bit position should be stored in a separate memory bank.Therefore, we define a second optimization problem with only L < m + n possible levels of energy.For implementation purposes, we only consider small values for L (L < 10).The vector f = [f 0 , . . ., f L−1 ] contains the L levels of energy.We use n to denote the number of bits allocated to energy level f l , so that L−1 =0 n = n + m.This means that each memory bank of the energy group has an energy level e b = f n .We write n = [n 0 , . . ., n L−1 ] for the vector containing the L values n .
In the following, for simplicity, we consider that the number of bits n and m are fixed, and we seek to optimize the total energy consumption of the unreliable memory for a fixed number of energy levels L. The objective is to reduce the total energy consumed by the unreliable memory by allocating different levels of energy to the L groups of bits.Two parameters are considered in this optimization: the values of each energy level e and the number of bits allocated to each of these energy levels n .The optimization problem can be written as: First, we solve the optimization problem in the case where we know which bit is allocated to which energy level.This means that the values of n are known and that we only want to compute the optimal values of the energy levels f .In this case the optimization problem can be written as: Problem 2-a is quite similar to the one described in Section IV-A and can be solved using the same method as the one presented in Appendix B, by relying on the KKT conditions.The optimal solution in this case is: This solution allows us to compute the optimal energy levels f for a given energy allocation across the bits.The second step consists of computing the best allocation of bits to each energy group.Given that we only consider small values of L, we compute the optimal solution from (36) for each possible energy allocation of the bits.Then the solution with the smallest total energy Although Problem 2 leads to more practical solution, it is expected that the optimal total energy of the memory is higher for Problem 2 than for Problem 1.

V. SIMULATION RESULTS
In our simulations, unless explicitly stated, we consider a simple tracking problem where the state vector x is composed of two variables representing the position and velocity of an object.
Measurements y only consist of noisy observations of the position of the object.The process matrix F and measurement matrix H are defined as and the process noise covariance matrix Q and measurement covariance matrix R are given by where δt = 1 and σ x = 0.01 and σ y = 10.The factor a in ( 9) is taken as a = 12.8 as in [12].
This section is divided into two parts.We first evaluate the accuracy of the proposed theoretical analysis, and we then provide solutions to the two considered optimization problems.

A. Accuracy of the theoretical analysis
First, to evaluate the accuracy of the proposed theoretical analysis, we perform Monte Carlo simulations (N mc = 10 7 ) and measure the covariance matrix of the error on the estimation at step N = 250, thus giving enough time for the filter to converge in normal conditions.This covariance matrix is compared with the theoretical expression of the covariance of the estimation error P * N |N computed in Section III-D. Figure 1 shows the variance of the estimation errors on the position and the velocity for different values of m in the case of a reliable memory, meaning that we consider only the quantization error and not the memory noise.We observe that the theoretical predictions of the errors closely match the simulations, which shows the accuracy of our theoretical analysis.Moreover, from Figure 1 we can observe that for a small number of bits m the quantization error is large and dominates the total estimation error.However, starting from m = 10 bits the estimation error reaches a constant level which can be interpreted as a minimum bound on the estimation error that one can obtain from a standard Kalman filter for this tracking problem.This shows that from m = 10 bits, the quantization errors become negligible compared to the estimation error achieved by the standard full precision Kalman filter.
Thus at this point using more bits will not result in minimizing the estimation error, justifying the need for optimizing the parameter m.
In a second step, we introduce the memory noise in addition to the quantization.Figure 2 shows the variance of the estimation error on the position depending on the total energy e tot for different September 6, 2021 DRAFT The comparison between theoretical results and Monte Carlo simulations show the accuracy of the theoretical analysis that predicts the new computed covariance P * k|k .
From Figure 2, we can also see that both the number of bits and the total energy can affect the variance of the estimation error.If the number of bits or the energy supplied is too low then the quantization error or the memory noise will dominate the total estimation error.However we can see that there is a minimum number of bits, around m = 12, from which given enough energy it will be possible to reach the minimum possible variance of estimation error.Moreover from Figure 3, we can see that for a low value of supplied energy per variable, the variance of the estimation error will increase with the number of bits as there is too little energy.But for a larger amount of energy e tot > 10, the variance of the estimation error will decrease with the number of bits since the quantization error decreases.Finally for a large enough number of bits, the total estimation error will only depend on the total energy and on the variance of the estimation error of a reliable full precision filter.
As the work presented in this paper is done to reduce the energy consumption of the memory  of a Kalman filter, it is of a greater utility when the memory is large.For this reason, the results presented before were also tested on a larger Kalman filter with a dimension for the state vector entries of the state to the next state at each iteration such as the one used in [42].That is, and F c,1 = 1.The initial state vector is drawn from a normal distribution.
In this case, the performance of the filter is measured by the trace of the covariance matrix P N |N .The results in Figures 4 and 5 show that the same conclusion can be taken from the simulations done on the smaller-scale Kalman filter and that the method presented in this paper can therefore be applied to large-size filters.

B. Solutions to the optimization problems
We now focus on the optimization problems introduced in Section IV, starting with the first one.
Figure 6 shows the amount of energy e tot needed to store each number in the unreliable memory so as to achieve a fixed variance of estimation error on the position for each value of m.The total energy e tot was calculated both using the optimal allocation from Algorithm 1, and using a uniform energy allocation.From Figure 7, we can see that the total energy e tot of the memory slightly increases with the number of bits m + n.The slight increase in memory consumption is due to the form of the optimal solution (35).Indeed, once the minimum number of bits needed to achieve the performance constraint is reached, then additional bits will be set at the minimum energy threshold e thres .
Figure 7 compares the optimal solution from Figure 6 with a uniform energy allocation.This shows that the optimal energy allocation allows for a significant energy gain compared to the uniform allocation.Here for the minimum number of bit needed to achieve the performance constraint, the optimal allocation require 56% less energy than the uniform allocation.
We now focus on the second optimization problem defined in Section IV-B (Problem 2-a) where only a limited number of energy levels are available.Figure 8 shows the total energy needed for each variable in memory to achieve a fixed level of error depending on the number L of energy level possible.For each considered number of level L ∈ 1, 7 , the total energy e tot was computed for all possible energy allocations using the optimal solution (36).The minimum energy possible for each value of L was then kept and is shown in Figure 8.This minimum energy is compared with the minimum energy needed for Problem 1 where there are as many energy levels possible as the number of bits.Here the total number of quantization bits is B = 20.We observe that even a small number of energy levels L can lead to significant gains in energy.In this case, only 7 levels of energy allow to achieve 95% of the maximum energy gain that was obtained in the first optimization problem.When looking at the optimal energy allocation for each value of L   bit by bit, we notice that in most cases the optimal solution seems to be when the energy levels are uniformly shared between the bits.This means that if there are B bits and L levels available and L is a divisor of B then each group of bits assigned to each energy level will have a size of n = B L .

VI. CONCLUSION
In this paper we studied a quantized Kalman filter implemented with unreliable memories.We provided analytical expressions for the covariance matrix of the estimation error, and provided updated filter equations to take into account all considered sources of errors.We proposed and solved two optimization problems that allow to find the best trade-offs between energy consumption and performance of the filter.Simulation results showed the accuracy of the theoretical analysis and illustrated the significant energy gains provided by our approach.Due to the generic nature of the considered error propagation model, these results could be used for various realistic noise-versus-energy models of unreliable components.
where H is the d × c measurement model and v k ∈ R d is an additive white noise on the measurements, independent from the model noise u k .The covariance matrices of the noise vectors u k and v k are known and denoted Q and R, respectively.The Kalman filter recursively estimates the successive states x k from the measurement vectors y k and from the known model, by minimizing the mean squared error MSE(x) = E[ x k − xk 2 ] between x k and its estimate xk at each step k.The filter can be decomposed in two phases: the a priori estimation uses only the known model, and the a posteriori estimation takes into account the measurements.Each phase computes both estimates xk+1|k (a priori phase) and xk+1|k+1 (a posteriori phase) of the state vector x k+1 , and the covariance matrices of the estimations errors September 6, 2021 DRAFT P k+1|k = Cov[x k+1 − xk+1|k ] and P k+1|k+1 = Cov[x k+1 − xk+1|k+1 ].The recursive equations of the a priori estimation step are:

Cov[ x k|k ] = I c 2 −2m 12 , 1 2
Cov[ y k+1 ] = I d 2 −2m 12 .Equation (22) gives us the quantization error on the computation of xk+1|k+1 based on the unquantized values of xk|k , the filter parameters, and the quantization resolution m. C. Unreliable memory error We now consider the second source of noise from the unreliable memories, and derive an expression for the covariance matrix Γ = Cov[δ xmem k+1|k+1 ] of the unreliable memory noise δ xmem k+1|k+1 introduced in (14).Assuming E[γ] Var[γ], as discussed in Section II-C, the variance Var[γ] = σ 2 γ of the memory noise γ can be approximated by the MSE as σ 2 γ ≈ E[(x − x) 2 ].The value of E[(x − x) 2 ] depends on the error probabilities p b , but also on the probability distributions of the variables x which are stored in memory.However, from [7, Claim 17], if p n−1 or Pr (x b = xb ) Pr (x b = xb ) for any b = b , then the MSE E[(x − x) 2 e b = 1 e , s.t.P * N |N ≺ V and e b ≥ e thres ∀b ∈ −m, n − 1 , (Problem 1)

Problem 1
involves one discrete parameter m and m + n continous parameters e which makes it hard to solve at once.As a first step, we assume that the value of m is fixed, and solve the September 6e b = 1 e , s.t.P * N |N ≺ V and e b ≥ e thres ∀b ∈ −m, n − 1 , (Problem 1-a) by using the Karush-Kuhn-Tucker (KKT) conditions (see Appendix B).From these conditions, we show that the optimal energy level e * b for bit b has expression:

Algorithm 1 :
Computing the optimal values for e and m Input: V, a, β, ξ, e thres ; e min ← − +∞; for each value of m do e ← − e thres ; P prev = 0; while P * N |N (e, m) V and P prev − P * N |N > ξ do P prev = P * N |N (e, m); b ← − arg min b {log( 1 4 b a ) + ea}; e b ← − e b + β ; end if P * N |N (e, m) ≺ V and n b=−m opti e min b > n b=−m e b then e min ← − e ; m opti ← − m ; end end Result: Optimal number of bits m opti and optimal energy allocation vector e min

Fig. 1 .
Fig.1.Theoretical and simulated variance of estimation error on the position and velocity depending on the number of quantization bits, using a reliable memory.

Fig. 2 .
Fig.2.Theoretical and simulated variance of estimation error on the position depending on the supplied energy to each number using an unreliable memory for different value of number of quantization bits m.

Fig. 3 .
Fig.3.Theoretical and simulated variance of estimation error on the position depending on the number of quantization bits using an unreliable memory for different value of energy per number e.

x of c = 20 .Fig. 4 .
Fig.4.Theoretical and simulated variance of estimation error on the position depending on the supplied energy to each number using an unreliable memory for different value of number of quantization bits m in the case of a Kalman filter with a larger dimension.

eFig. 5 .
Fig.5.Theoretical and simulated variance of estimation error on the position depending on the number of quantization bits using an unreliable memory for different value of energy per number e in the case of a Kalman filter with a larger dimension.

Fig. 6 .
Fig.6.Energy needed to store each number in an unreliable memory to achieve various desired variance of estimation error on the position depending on the number of bits with the optimal energy allocation

Fig. 7 .
Fig. 7. Energy needed to store each number in an unreliable memory to achieve a variance of estimation error on the position P N |N [0, 0] = 15 depending on the number m of bits.

Fig. 8 .
Fig. 8. Energy needed to store a variable in memory e for different value of energy level available L to achieve a fixed covariance value.
come from the current iteration k + 1.In certain conditions, such as if H and F are only composed of integer components, the total estimation error xk+1|k+1 − x k+1 = xk+1|k+1 + ∆x k+1|k+1 − x k+1 can be further developed as (see Appendix A for more details):