ELL705– Assignment
Stochastic Filtering
April 1, 2024
1. (3 points) Let x be a scalar valued random variable with mean x̄ and variance σx2 . Let y(i) =
x + v(i), i = 0, 1, ..., N be N+1 noisy measurements. Also, let v(i) be zero mean, white,
uncorrelated with x, and with variance σv2 . Find the linear least mean squared estimator of x
given the measurements y(i),0 ≤ i ≤ N denoted as x̂|N .
2. (5 points) Programming part:
(a) Generate a sequence v(i), 0 ≤ i ≤ N which is zero mean white and with variance σv2 .
Assume Gaussian distribution.
(b) Pick a constant true value of your own choice for x. Generate noisy observations y(i) =
x + v(i).
(c) Evaluate estimates using x̂|N calculated in earlier question. Compute mean and variance
of error x̂|N − x as N → ∞. Plot the mean and variance of error v/s N.
3. (7 points) Consider the following equations.
Signal:
xn+1 = axn + wn
Measurment:
yn = cxn + vn
with E(wi wj ) = (1 − a2 )δi−j , E(vi vj ) = Rδi−j , E(vi wj ) = 0, |a| < 1, c = 1, R = 1, vn and x0
are uncorrelated.
(a) Determine optimal Wiener filter for estimating the value of xn given yi , i = 0, 1, ..., n. Let
the estimate be x̂|yn .
(b) Generate samples of random noise wn and vn for n = 1500. Then generate xn and yn . Plot
xn v/s n and yn v/s n for n = 1400 : 1500.
(c) Implement the Wiener filter in part A. Plot x̂|yn v/s n and xn v/s n on the same graph for
n = 1400 : 1500.
1
ELL705 Assignment 8/1/2024
(d) Repeat for 50 more realizations of wn and vn . Plot the mean of x̂|yn v/s n and x v/s n on
the same graph for n = 1400 : 1500. Further, on the same graph around the mean, plot a
band of 2σx̂ i.e. std dev of the estimator v/s n. Comment on the effectiveness of estimator.
4. (10 points) Consider a robot traversing a straight line path. Let the initial position be x = 0.
We measure the position after every 0.01 seconds with some noise. Also the robot is affected by
random forces in the x-direction. Force and position are related as F (t) = ma(t). Simplifying
we get a(t) = ẍ(t) = Fm(t) . Let acceleration be the input to the robot. In state space we get
x 0 1 x 0
d
=
+ a(t)
dt
ẋ 0 0 ẋ 1
Discretizing using ∆t = 0.01 we get
0 0.01 (0.01)2 /2
xk+1 =
xk +
ak
0 0 0.01
x(k∆t)
where xk =
) and ak = a(k∆t). Let ak be white with mean 0 and variance σa2 at each
ẋ(k∆t)
2
k. Further, let yk =
1 0 xk + vk where vk is white with mean 0 and variance σv . Further,
vk and wk are uncorrelated with each other.
(a) Form a Kalman filter for estimating the value of xn given yi , i = 0, 1, ..., n. Let the estimate
be x̂|yn .
(b) Generate samples of random noise an and vn for n = 1500. Then generate xn and yn . Plot
xn v/s n and yn v/s n for n = 1400 : 1500.
Page 2 of 3
ELL705 Assignment 8/1/2024
(c) Implement the Kalman filter in part A. Plot x̂|yn v/s n and xn v/s n on the same graph
for n = 1400 : 1500.
(d) Repeat for 50 more realizations of an and vn . In the phase plane, plot the mean of x̂|yn and
also xn v/s n for n = 1400 : 1500. For these 50 realizations estimate the covariance matrix
Px̂|yn . Compare with the calculated covariance matrix. Further, on the same graph around
the mean, the uncertainty ellipses using the covariance matrix for n = 1400 : 10 : 1500.
Comment on the effectiveness of estimator.
Page 3 of 3