# A Survey of Autonomous Vehicles: Enabling Communication Technologies and Challenges
## 3 System Architecture for Autonomous Vehicles
### Sensor Fusion
#### 3.6.1 Kalman Filters  
The Kalman filter (KF) is used to calculate the probabilistic state of the dynamic system in the past (smoothing), present (filtering) or future (prediction) [93]. As the sensors used in self-driving cars produce noisy and incomplete data, the role of the Kalman filter is to eradicate the unwanted noise and obtain accurate estimates [94]. The state of the system (\(\mathbf{x}\)) is composed of the position and velocity of the AV [95]. In addition, as the data are obtained from different sensors such as Radar, Lidar, ultrasonic, etc., the measured/observed position and velocity of the AV varies depending upon the accuracy of these sensors. This uncertainty in the data (of position and velocity) can be reduced by combining the measured data with the prediction of the states utilising the Kalman filter. The Kalman filter models the uncertainty using a Gaussian model [16]. The variance of the Gaussian model, \(\sigma^{2}\), measures the amount of uncertainty in the state of the system and thus, a larger variance implies greater uncertainty [96]. To accurately estimate the state of the system, with low uncertainty, the Kalman filter compares the current observation with the previous prediction. The process is recursive unless the measurement data are unavailable. The Kalman filter is composed of two stages, prediction and update, to finalise the actual state of the system [93; 97]. Considering a dynamic system moving linearly, its mathematical model can be briefly explained as follows. Calculation of the Prediction Stage  
In the prediction stage, the state, \(\mathbf{x}_{1}\), of the system with an uncertainty of \(\mathbf{P}_{1}\) at time \(t\), is estimated from its previous state \(\mathbf{x}\) and \(\mathbf{P}\) at time \((t-1)\). The formula to calculate the predicted state is as follows [93]  
\[\mathbf{x}_{1} = \mathbf{F}\mathbf{x}+\mathbf{n} \tag{1}\] \[\mathbf{P}_{1} = \mathbf{F}\mathbf{P}\mathbf{F}^{H}+\mathbf{R} \tag{2}\]  
where \(\mathbf{F}\) is the transition matrix from \((t-1)\) to \(t\), \(\mathbf{n}\) is the added noise and \(\mathbf{R}\) is the noise co-variance matrix. Calculation of the Update Stage  
In the update stage, the predictions are modified by comparing them with the data obtained from sensors. If \(\mathbf{z}\) represents the measured data from sensors, then the estimated error between the measurement and the prediction is given as [98]  
\[\mathbf{y}=\mathbf{z}-\mathbf{H}\mathbf{x}_{1}, \tag{3}\]  
where \(\mathbf{H}\) represents the transition matrix between the measured sensor data [93; 99]. Similarly, the estimated system error (\(\mathbf{E}\)) can be given as \(\mathbf{E}=\mathbf{H}\mathbf{P}_{1}\mathbf{H}^{T}+\mathbf{R}\). The Kalman filter gain (\(\mathbf{K}\)) is given by \(\mathbf{K}=\mathbf{P}_{1}\mathbf{H}^{T}\mathbf{E}^{-1}\). The essential purpose of Kalman gain is to correct predictions [99; 100]. The actual state of the system and position is predicted as [93]  
\[\mathbf{x}=\mathbf{x}_{1}+\mathbf{K}\mathbf{y} \tag{4}\] \[\mathbf{P}=(\mathbf{I}-\mathbf{K}\mathbf{H})\mathbf{P}_{1} \tag{5}\]  
Even though the measurement will provide data that are originated from sensors, the information in the predicted and measurement states is always uncertain and therefore the optimal state estimate will be the one in which the position has a lower uncertainty [101]. From the above equations, it can be noted that, to learn the vehicle position and state, the knowledge of the transition matrix and the noise co-variance matrix is required. Traditional Kalman filtering yields the optimal solution if the noise statistics and noise process is completely defined [102]. These matrices are configured with priori fixed values that do not adapt with the changing surroundings [103]. Ideally, these matrices should change, adapt and update dynamically according to their surroundings and environment. Therefore, various approaches have been adopted in the literature to adapt the matrices and improve the estimate of the state and the position of the vehicle [104; 105].