Kalman Filter (1D)

Hard MATLAB DSP
Solve this problem

Implement a 1D Kalman filter for state estimation given measurement z, previous estimate x, estimate covariance P, measurement noise R, and process noise Q. Output updated state and covariance.

Constraints

  • Use standard Kalman update equations.
  • Measurements are scalar.
  • No loops allowed.
  • Must compute Kalman gain K.
  • Output variables: x_out and P_out.
  • Assume Q and R are positive.
Starter codeMATLAB
1function [x_out, P_out] = kalman1D(x, P, z, Q, R)2% TODO3end