# Defining white noise intensites in state space kalman filter with spectral factorization

I'm a noob on this subject, so please be extra clear :)

With a system of equations: $$\dot\omega_x = \alpha_s\omega_y - \epsilon\omega_s\omega_y + \epsilon\omega_s\eta + Q_x$$ $$\dot\omega_y = -\frac{\alpha_s}{1-\epsilon}\omega_x -\frac{\epsilon\gamma}{1-\epsilon}\omega_y +\frac{\epsilon\gamma}{1-\epsilon}\eta -\frac{\epsilon\beta}{1-\epsilon}e_m +\frac{Q_y}{1-\epsilon}$$ $$\dot\eta = \gamma\omega_y - \gamma\eta +\beta e_m$$ $$y(t)=\omega_x + n$$ where $$Q_x$$ and $$Q_y$$ are plant momentum disturbances, with $$\phi_{Q_x}(w) = \phi_{Q_y}(w)= \frac{0.05}{(\frac{w}{10^5})+1}$$ and n is output noise $$\phi_n(w) = 0.625$$ I have been asked to design a discrete time kalman filter, and given the guidance in form of general steps. It is as the first of these steps I fail. 

"Start to convert all the disturbances into white noise. You need to perform Spectral factorization. And define the noise with intensities $$R_1$$, $$R_2$$ and $$R_{12}$$" It has previously been seen that $$R=[\matrix{R_1& R_{12}\\ R^T_{12}& R_2}].$$

I have gone over the litterature and can't seem to understand what I should do. What I have tried is:

Spectral factorization

We wish to find $$G_v(w)$$ such that $$\phi_{Q_x}(w) = |G_v(jw)|^2$$, which I have found to be $$G_v(jw)=\frac{\sqrt{5}\cdot10^4}{10^5+jw}$$. From what I have read we would have noise $$v=[v_1 v_2]^T$$ with intensity $$R$$.

Theory shows it like this:

A process is given by $$\dot{x} = Ax+Bu+Nv_1$$ $$y=Cx + Du+ v_2$$ where $$v = [\matrix{v_1 \\v_2}]$$ is white noise with $$R_0 = [\matrix{R_1& R_{12}\\ R^T_{12}& R_2}]$$

I simply see the path to $$R_1$$, $$R_2$$, and $$R_{12}$$.

It is related to a course on Space Craft control.

Edit

Additional attempt. From further diving I have found that $$R=\frac{1}{2\pi} \int^\infty_{-\infty} |G(j\omega)|^2 d\omega$$ $$|G(j\omega)|^2 = \phi_{Q}(w)$$ $$R=\frac{1}{2\pi} \int^\infty_{-\infty} \frac{0.05}{(\frac{w}{10^5})+1} d\omega$$ $$R=\{integrating\}=2500$$ If we define $$R_{12}$$ as $$0$$, then $$R=R_1 + R_2$$, which is allows us to select $$R_1$$ and $$R_2$$ as desired, for example $$R_1 = R_2 = \frac{1}{2}R=1250$$. However I do not see how you should include $$n$$ in this - or how to construct the approporate matrix for dealing with $$Q_x$$, $$Q_y$$ and $$n$$.

I have figured out what the correct solution is for this problem. First I had missunderstood what $$R_1$$ was. $$R_1$$ should be the the $$R$$ the the equation below, and their purpuse.

In this scenario we have $$\phi(w) = G_v(jw) R G_v^*(jw)$$ where $$\phi$$, $$R$$ and $$G_v$$ are vectors / matricies.

If we say that $$\phi(w) = \left[\matrix{\phi_x &0\\ 0& \phi_y} \right]$$, $$R=\left[\matrix{A& B\\ C& D}\right] = R_1$$, $$G_v = \left[\matrix{G_v(jw)& 0\\ 0& G_v(jw)}\right]$$, $$G_v^* = \left[\matrix{G_v^*(jw)& 0\\ 0& G_v^*(jw)}\right]$$

(Re-call) $$\phi_x = \phi_y = \phi$$. We find that $$\phi(w) = \left[\matrix{\phi &0\\ 0& \phi} \right] = \left[\matrix{A\cdot G_v \cdot G_v^*& B\cdot G_v \cdot G_v^*\\ C\cdot G_v \cdot G_v^*& D\cdot G_v \cdot G_v^*}\right] = \left[\matrix{A \phi& B \phi\\ C \phi& D \phi}\right],$$ this reveals that $$A = D = 1$$, $$B = C = 0$$, thous $$R_1 = \left[\matrix{1& 0\\ 0& 1}\right]$$. As for $$R_2$$ is should simply be $$\phi_n = 0.625$$, as it is a constant and one dimensional.

The noise can be modeld as white noise passing through a system, in this case described by $$G_v$$.

White noise $$\cdot$$ $$G_v$$ --> noise.

Converting the Transfer function TF to state space form we get: $$A_w = \left[\matrix{-10^5& 0\\ 0& -10^5}\right]$$ $$B_w = \left[\matrix{1& 0\\ 0& 1}\right]$$ $$C_w = \left[\matrix{\sqrt{0.05}& 0\\ 0& \sqrt{0.05}}\right].$$ Which can be used to represent the noise. The noise is thus modeled by construction the system / TF that shapes a white noise input to our noise.

$$R_1$$,$$R_2$$, and $$R_{12}$$ are later in this project used to check assumptions for controllability and observability of the system.