**7.2 Kalman filter harmonic oscillator**

To facilitate the next step, we rewrite (8) as:

$$
\begin{pmatrix}
\varkappa\_1(t+1) \\
\varkappa\_2(t+1)
\end{pmatrix} = \begin{pmatrix}
1 & 0
\end{pmatrix} \begin{pmatrix}
\varkappa\_1(t) \\
\varkappa\_2(t)
\end{pmatrix} + \begin{pmatrix}
w\_1(t) \\
w\_2(t)
\end{pmatrix} \tag{10}
$$

where *x*2ð*t* þ 1) is just an auxiliary notation for *x*1ð Þ*t* and it is not *x*2ð Þ*t* in (3). Then the standard KF equations in the above case produce [2]:

Prediction Step:

$$
\hat{\mathbf{x}}\_1(\mathbf{t} + \mathbf{1}/\mathbf{t}\_1) = -\mathbf{a}\_0 \hat{\mathbf{x}}\_1(\mathbf{t}/\mathbf{t}\_1) - \hat{\mathbf{x}}\_2(\mathbf{t}/\mathbf{t}\_1) \tag{11}
$$

$$
\hat{\mathbf{x}}\_2(t+\mathbf{1}/t\_\perp) \quad = \hat{\mathbf{x}}\_1(t/t\_\perp) \tag{12}
$$

and they are determined by the initial Kalman Filter design. One way to

*Kalman Filter Harmonic Bank for Vostok Ice Core Data Analysis and Climate Predictions*

Here the values of *Q*<sup>11</sup> and *Q*<sup>22</sup> are assumed to be of same the order because they represent uncertainty in modeling *x*1ð Þ*t* and *x*2ð*t*), and they are just one step apart values of the same state. Simple correlation analysis of *x*1ð Þ*t* and *x*2ð*t*) indicates that *Q*<sup>12</sup> is of order of �*a*0*Q*11*=*4. **Figure 10** below shows a block diagram of a single *ω*<sup>0</sup> KFHO. Here we have the total state vector corresponding to specific harmonic *ω*<sup>0</sup> as:

Once we define single harmonic KF as in **Figure 10** we can proceed and construct a KFHB as an assemblage of a number of individual harmonic filters in parallel with the combine outputs to form the original signal (data). We assume a set of harmonics *ω* ¼ f g *ω*1, *ω*2, *ω*3, … , *ω<sup>N</sup>* and for each of *ωi*, *i* ¼ 1, 2, … , *N* we define a separate KFHO as described above. Note that harmonics are related to each other via:

and the total signal output (such as Votok data) is the sum of individual

*y t*ðÞ¼ <sup>X</sup> *N*

1 *yi*

*p*11ð Þ¼ 1*=*0 *Q*11, *p*12ð Þ¼ 1*=*0 *Q*12, and *p*22ð Þ¼ 1*=*0 *Q*<sup>22</sup> (24)

*<sup>x</sup>*^0ð Þ¼ *<sup>t</sup>=<sup>t</sup>* � <sup>1</sup> ½ � *<sup>x</sup>*^1ð Þ *<sup>t</sup>=<sup>t</sup>* � <sup>1</sup> , *<sup>x</sup>*^2ð Þ *<sup>t</sup>=<sup>t</sup>* � <sup>1</sup> <sup>T</sup> (25)

*ω<sup>i</sup>* ¼ *i ω*1, *i* ¼ 1, 2, … , *N* (26)

ð Þ*t* (27)

determine them is to use matrix *Q* values:

*DOI: http://dx.doi.org/10.5772/intechopen.94263*

**7.3 Kalman filter harmonic bank**

harmonic *ω<sup>i</sup>* ¼ 2*π fi* outputs:

*Kalman filter harmonic oscillator.*

**Figure 10.**

**Figure 11.**

**53**

*Kalman filter harmonic bank.*

Correction Step:

$$
\hat{\mathfrak{x}}\_1(t+\mathbf{1}/t+\mathbf{1})\_\cdot = \hat{\mathfrak{x}}\_1(t+\mathbf{1}/t\,) + K\_{11}(t+\mathbf{1})\bar{\mathfrak{y}}\_0\,(t+\mathbf{1})\tag{13}
$$

$$
\hat{\mathfrak{x}}\_2(t+\mathbf{1}/t+\mathbf{1})\_\text{-} = \hat{\mathfrak{x}}\_2(t+\mathbf{1}/t\mathbf{ }) + K\_{21}(t+\mathbf{1})\bar{\mathfrak{y}}\_0(t+\mathbf{1})\tag{14}
$$

In (13), (14) above, ~*y*0ð Þ¼ *t y*0ðÞ�*t x*^1ð Þ *t=t* � 1 is Innovation Sequence and filter gains are:

$$K\_{11}(t) = P\_{11}(t/t - \mathbf{1})/[P\_{11}(t/t - \mathbf{1}) + R] \tag{15}$$

$$K\_{21}(t) = P\_{12}(t/t - \mathbf{1})/[P\_{11}(t/t - \mathbf{1}) + R] \tag{16}$$

The corresponding Prediction Step and Correction Step variances and covariances of the estimation error *x*~1ð Þ¼ *t=t* � 1 *x*1ð Þ�*t x*^1ð Þ *t=t* � 1 , and *x*~1ð Þ¼ *t=t x*1ðÞ�*t x*^1ð Þ *t=t* , and similarly for the state *x*2ð Þ*t* , are:

Prediction Step:

$$p\_{11}(t+1/t) = a\_0 \, ^2 p\_{11}(t/t) + 2a\_0 p\_{12}(t/t) + p\_{22}(t/t) + Q\_{11.} \tag{17}$$

$$p\_{12}(t+1/t) = -a\_0 p\_{11}(t/t) - p\_{12}(t/t) + Q\_{12} \tag{18}$$

$$p\_{22}(t+1/t) = p\_{11}(t/t) + Q\_{22} \tag{19}$$

Correction Step:

$$p\_{11}(t+\mathbf{1}/t+\mathbf{1}) = \left[\mathbf{1} - K\_{11}(t)\right]p\_{11}(t+\mathbf{1}/t) \tag{20}$$

$$p\_{12}(t+\mathbf{1}/t+\mathbf{1}) = \left[1 - K\_{11}(t)\right]p\_{12}(t+\mathbf{1}/t) \tag{21}$$

$$p\_{22}(t+1/t+1) = -K\_{21}(t) \, p\_{12}(t+1/t) + p\_{22}(t+1/t) \tag{22}$$

The initial conditions for the above equations are:

$$p\_{11}(\mathbf{1}/\mathbf{0}), p\_{12}(\mathbf{1}/\mathbf{0}), \text{and } p\_{22}(\mathbf{1}/\mathbf{0})\tag{23}$$

*Kalman Filter Harmonic Bank for Vostok Ice Core Data Analysis and Climate Predictions DOI: http://dx.doi.org/10.5772/intechopen.94263*

and they are determined by the initial Kalman Filter design. One way to determine them is to use matrix *Q* values:

$$p\_{11}(\mathbf{1}/\mathbf{0}) = Q\_{11}, p\_{12}(\mathbf{1}/\mathbf{0}) = Q\_{12}, \text{and } p\_{22}(\mathbf{1}/\mathbf{0}) = Q\_{22} \tag{24}$$

Here the values of *Q*<sup>11</sup> and *Q*<sup>22</sup> are assumed to be of same the order because they represent uncertainty in modeling *x*1ð Þ*t* and *x*2ð*t*), and they are just one step apart values of the same state. Simple correlation analysis of *x*1ð Þ*t* and *x*2ð*t*) indicates that *Q*<sup>12</sup> is of order of �*a*0*Q*11*=*4. **Figure 10** below shows a block diagram of a single *ω*<sup>0</sup> KFHO. Here we have the total state vector corresponding to specific harmonic *ω*<sup>0</sup> as:

$$\hat{\mathbf{x}}\_{0}(\mathbf{t}/\mathbf{t}-\mathbf{1})=\left[\hat{\mathbf{x}}\_{1}(\mathbf{t}/\mathbf{t}-\mathbf{1}),\hat{\mathbf{x}}\_{2}(\mathbf{t}/\mathbf{t}-\mathbf{1})\right]^{\mathrm{T}}\tag{25}$$

## **7.3 Kalman filter harmonic bank**

there is a compelling reason to make it time varying. The model (8) and (9) above remains the same. Obviously equivalent model holds for *x*2ð Þ *t* þ 1 with the proper initial conditions. The model as given by (8) and (9) is our starting point for KFHO

> <sup>¼</sup> �*a*<sup>0</sup> �<sup>1</sup> 1 0 *x*1ð Þ*t*

where *x*2ð*t* þ 1) is just an auxiliary notation for *x*1ð Þ*t* and it is not *x*2ð Þ*t* in (3).

*x*2ð Þ*t* 

*x*^1ð Þ ¼� *t* þ 1*=t a*0*x*^1ð Þ� *t=t x*^2ð Þ *t=t* (11)

*x*^1ð Þ¼ *t* þ 1*=t* þ 1 *x*^1ð Þþ *t* þ 1*=t K*11ð Þ *t* þ 1 ~*y*<sup>0</sup> ð Þ *t* þ 1 (13)

*x*^2ð Þ¼ *t* þ 1*=t* þ 1 *x*^2ð Þþ *t* þ 1*=t K*21ð Þ *t* þ 1 ~*y*0ð Þ *t* þ 1 (14)

*K*11ðÞ¼ *t P*11ð Þ *t=t* � 1 *=*½*P*11ð Þþ *t=t* � 1 *R*� (15) *K*21ðÞ¼ *t P*12ð Þ *t=t* � 1 *=*½ � *P*11ð Þþ *t=t* � 1 *R* (16)

<sup>2</sup>*p*11ð Þþ *<sup>t</sup>=<sup>t</sup>* <sup>2</sup>*a*0*p*12ð Þþ *<sup>t</sup>=<sup>t</sup> <sup>p</sup>*22ð Þþ *<sup>t</sup>=<sup>t</sup> <sup>Q</sup>*11*:* (17)

*p*22ð Þ¼ *t* þ 1*=t p*11ð Þþ *t=t Q*<sup>22</sup> (19)

*p*12ð Þ¼� *t* þ 1*=t a*0*p*11ð Þ� *t=t p*12ð Þþ *t=t Q*<sup>12</sup> (18)

*p*11ð Þ¼½ *t* þ 1*=t* þ 1 1 � *K*11ð Þ� *t p*11ð Þ *t* þ 1*=t* (20)

*p*12ð Þ¼½ *t* þ 1*=t* þ 1 1 � *K*11ð Þ� *t p*12ð Þ *t* þ 1*=t* (21)

*p*11ð Þ 1*=*0 , *p*12ð Þ 1*=*0 , and *p*22ð Þ 1*=*0 (23)

*p*22ð Þ¼� *t* þ 1*=t* þ 1 *K*21ð Þ*t p*12ð Þþ *t* þ 1*=t p*22ð Þ *t* þ 1*=t* (22)

In (13), (14) above, ~*y*0ð Þ¼ *t y*0ðÞ�*t x*^1ð Þ *t=t* � 1 is Innovation Sequence and filter

The corresponding Prediction Step and Correction Step variances and covariances of the estimation error *x*~1ð Þ¼ *t=t* � 1 *x*1ð Þ�*t x*^1ð Þ *t=t* � 1 , and

*x*~1ð Þ¼ *t=t x*1ðÞ�*t x*^1ð Þ *t=t* , and similarly for the state *x*2ð Þ*t* , are:

The initial conditions for the above equations are:

*p*11ð Þ¼ *t* þ 1*=t a*<sup>0</sup>

*x*^2ð Þ¼ *t* þ 1*=t x*^1ð Þ *t=t* (12)

þ

*w*1ð Þ*t w*2ð Þ*t* 

(10)

described next. The consideration holds for any harmonic *ω*.

Then the standard KF equations in the above case produce [2]:

**7.2 Kalman filter harmonic oscillator**

*Glaciers and the Polar Environment*

Prediction Step:

Correction Step:

Prediction Step:

Correction Step:

**52**

gains are:

To facilitate the next step, we rewrite (8) as:

*x*1ð Þ *t* þ 1 *x*2ð Þ *t* þ 1 

> Once we define single harmonic KF as in **Figure 10** we can proceed and construct a KFHB as an assemblage of a number of individual harmonic filters in parallel with the combine outputs to form the original signal (data). We assume a set of harmonics *ω* ¼ f g *ω*1, *ω*2, *ω*3, … , *ω<sup>N</sup>* and for each of *ωi*, *i* ¼ 1, 2, … , *N* we define a separate KFHO as described above. Note that harmonics are related to each other via:

$$o o\_i = i \ o\_1, i = \mathbf{1}, \mathbf{2}, \dots, N \tag{26}$$

and the total signal output (such as Votok data) is the sum of individual harmonic *ω<sup>i</sup>* ¼ 2*π fi* outputs:

*y t*ðÞ¼ <sup>X</sup> *N* 1 *yi* ð Þ*t* (27)

**Figure 10.** *Kalman filter harmonic oscillator.*

**Figure 11.** *Kalman filter harmonic bank.*

**Figure 11** indicates this arrangement with KFHO where we have:

$$
\hat{\mathbf{x}}(t/t-\mathbf{1}) = \sum\_{1}^{N} \hat{\mathbf{x}}\_{i}(t/t-\mathbf{1})\tag{28}
$$

representing the total KFHB predicted state estimate. These can be used for short and long term prediction purposes for CO2, temperature or other variables of interest. We can similarly define a set of corrected state estimates which are more precise than predicted with the real data available.

$$
\hat{\mathbf{x}}(t/t) = \sum\_{1}^{N} \hat{\mathbf{x}}\_{i}(t/t) \tag{29}
$$

General idea here as compared to a simple sum of harmonic cosine signals (following inverse Fourier Transform) as in (27) with:

$$y(t) = \sum\_{1}^{N} y\_i(t) = \sum\_{1}^{N} A\_i \cos \left(a\_i t + \theta\_i \right) \tag{30}$$

is to accommodate stochasticity of the underlying Vostok measurement data as well as a simple linear structure of Kalman Filters Harmonic Oscillator, and its ability to make predictions for the signal future values in the probabilistic (more realistic) environment.
