# Problem when solving Kalman filter in Mathematica: How to define a spectral density matrix and calculate the covariance matrix?

I am reading the classic book on state-space control theory by Bernard Friedland.

In order to strengthen my understanding of Kalman filter, I want to reproduce Example 11A (Inverted pendulum on page 418) with Mathematica.

However, I cannot find a way to define the spectral density matrices (of excitation noise and observation, in equation (11A.2) ) in Mathematica. Moreover, how can I calculate the covariance matrix of noise from a spectral density matrix?

Thanks. • A comment on the power spectrum matrix/covariance matrix. Nonwhite noise can be handled fine by the power spectrum matrix, but if the noise is non stationary, the Fourier basis is no longer a good orthogonal basis.
– HM51
Nov 11, 2019 at 19:05

KalmanEstiamtor only works with numeric values, because the underlying RiccatiSolve is a numeric solver.
White noise is simply a random process with an expected value (mean) of zero and with an absolutely flat power spectrum $$S(\omega)=W$$. Since the inverse Fourier transform of a constant is a unit impulse, the correlation function of a white noise process is $$\rho(\tau)=W\delta(\tau)$$.