## 3 Mathematical Foundations
### Non-Uniform Dual-Rate Extended Kalman Filter (NUDREKF)
#### 3.2.1 Nonuniform, Multirate, Sampled-Data System Modeling  
First of all, let us consider a continuous time-invariant linear state-space plant model:  
\[ \begin{split}\dot{x}(t)&=A\cdot x(t)+B\cdot u(t)\\ y(t)&=C\cdot x(t)+D\cdot u(t)\end{split}  \tag{3}\]  
where \(t\in\mathbb{R}^{+}\), \(x\in\mathbb{R}^{n}\) is the state vector, \(u\in\mathbb{R}^{m}\) is the control input vector, and \(y\in\mathbb{R}^{p}\) is the output vector. In consequence, the state transition matrix \(A\in\mathbb{R}^{n\times n}\), the input matrix \(B\in\mathbb{R}^{n\times m}\), the output matrix \(C\in\mathbb{R}^{p\times n}\), and the feedthrough (or feedforward) \(D\in\mathbb{R}^{p\times m}\). Assuming a periodic sampling \(T\) (i.e., \(t=k\cdot T\), \(k\in\mathbb{N}\)), a discrete-time-invariant, linear, state-space plant model under ZOH conditions yields  
\[ \begin{split} x_{k+1}^{T}&=A_{SR}\cdot x_{k}^{T}+B_ {SR}\cdot u_{k}^{T}\\ y_{k}^{T}&=C_{SR}\cdot x_{k}^{T}+D_{SR}\cdot u_{k}^ {T}\end{split}  \tag{4}\]  
where  
\[ \begin{split} A_{SR}&=e^{A\cdot T}\\ B_{SR}&=\int_{0}^{T}e^{As}Bds\\ C_{SR}&=C\\ D_{SR}&=D\end{split} \]  
An example of sampling scheme for a nonuniform, multirate, sampled-data multiple-input multiple-output (MIMO) system is depicted in Figure 3.  
To represent the different sampling times, two diagonal matrices of dimensions \(m\times m\) and \(p\times p\) can be used as follows:  
Figure 3: Sampled MIMO plant. \[(\Delta^{u})_{k}^{T} \equiv diag\Big{\{}[\delta^{u}]_{k}^{T}(i),i=1,2,\ldots,m\Big{\}} \tag{5}\] \[(\Delta^{y})_{k}^{T} \equiv diag\Big{\{}[\delta^{y}]_{k}^{T}(i),i=1,2,\ldots,p\Big{\}}\] \[[\delta^{u}]_{k}^{T}(i) \equiv \begin{cases}1,&\text{when there is a sample}\\ 0,&\text{otherwise}\end{cases} \] \[[\delta^{y}]_{k}^{T}(i) \equiv \begin{cases}1,&\text{when there is a sample}\\ 0,&\text{otherwise}\end{cases} \]  
Following the principles developed in [37; 38], a nonuniform, multirate, sampled-data system can be expressed as two discrete time systems, one of them representing the plant and another one representing the input-hold process  
\[\overline{x}_{k+1}^{T}=(A_{MR})_{k}^{T}\cdot\overline{x}_{k}^{T}+(B_{MR})_{k} ^{T}\cdot u_{k}^{T} \tag{6}\]  
where \(\left[\overline{x}_{k}^{T}\right]^{\top}\equiv\left[\left[x_{k}^{T}\right]^{ \top}\quad\left[\left(v^{u}\right)_{k}^{T}\right]^{\top}\right]\in R^{n+m}\) is an extended state vector and \(\left(v^{u}\right)_{k}^{T}\) is the held input. Note that \(\left[\cdot\right]^{\top}\) denotes the transpose function. The matrices \((A_{MR})_{k}^{T}\), \((B_{MR})_{k}^{T}\) are defined as  
\[(A_{MR})_{k}^{T} = \begin{bmatrix}A_{SR}&B_{SR}(T)\cdot\big{(}I-(\Delta^{u})_{k}^{T }\big{)}\\ 0&I-(\Delta^{u})_{k}^{T}\end{bmatrix}  \tag{7}\] \[(B_{MR})_{k}^{T} = \begin{bmatrix}B_{SR}(T)\cdot\big{(}\Delta^{u})_{k}^{T}\\ (\Delta^{u})_{k}^{T}\end{bmatrix} \]  
being \(B_{SR}(T)=\int_{0}^{T}e^{A\cdot(T-s)}Bds\). These multirate matrices can be easily obtained as the product of two independent matrices: the first one corresponds to the single-rate system, and the second one to the nonuniform multirate sampling procedure. So, we have  
\[ \begin{bmatrix}x\\ u\end{bmatrix} _{k+1}^{T} =(H_{SRD})_{k}^{T}\cdot(H_{MRS})_{k}^{T}\cdot \begin{bmatrix}x\\ v^{u}\\ u\end{bmatrix} _{k}^{T} \tag{8}\] \[= \begin{bmatrix}A_{SR}&B_{SR}(T)\\ 0&I\end{bmatrix} \cdot \begin{bmatrix}I&0&0\\ 0&I-(\Delta^{u})_{k}^{T}&(\Delta^{u})_{k}^{T}\end{bmatrix} \cdot \begin{bmatrix} x\\ v^{u}\\ u\end{bmatrix} _{k}^{T}\]  
If a similar reasoning is additionally applied to output signals, a compact, nonuniform, multirate, discrete model can be obtained as follows:  
\[ \begin{bmatrix}x_{k+1}\\ v_{k+1}^{u}\\ v_{k+1}^{y}\\ u_{k}\\ y_{k}\end{bmatrix} ^{T} =