Output and state covariance of system driven by white noise
P = covar(sys,W)
[P,Q] = covar(sys,W)
covar calculates the stationary covariance
of the output y of an LTI model
by Gaussian white noise inputs w. This function
handles both continuous- and discrete-time cases.
P = covar(sys,W) returns the steady-state
output response covariance
given the noise intensity
[P,Q] = covar(sys,W) also returns the steady-state
sys is a state-space model (otherwise
When applied to an
N-dimensional LTI array
multidimensional arrays P, Q such
the covariance matrices for the model
Compute the output response covariance of the discrete SISO system
due to Gaussian white noise of intensity
W = 5.
sys = tf([2 1],[1 0.2 0.5],0.1); p = covar(sys,5)
These commands produce the following result.
p = 30.3167
You can compare this output of
covar to simulation
randn('seed',0) w = sqrt(5)*randn(1,1000); % 1000 samples % Simulate response to w with LSIM: y = lsim(sys,w); % Compute covariance of y values psim = sum(y .* y)/length(w);
psim = 32.6269
The two covariance values
not agree perfectly due to the finite simulation horizon.
Transfer functions and zero-pole-gain models are first converted
to state space with
For continuous-time state-space models
the steady-state state covariance Q is obtained by solving the Lyapunov equation
In both continuous and discrete time, the output response covariance
is given by P = CQCT + DWDT.
For unstable systems, P and Q are
infinite. For continuous-time systems with nonzero feedthrough,
the output covariance P.
 Bryson, A.E. and Y.C. Ho, Applied Optimal Control, Hemisphere Publishing, 1975, pp. 458-459.