filterpy/kalman_filter.py at master · rlabbe/filterpy · GitHub
https://github.com/rlabbe/filterpy/blob/master/filterpy/kalman/kalman_filter.pyThis code implements the same filter using the procedural form x = np.array ( [ [0., 1.]]) # position, velocity F = np.array ( [ [1, dt], [ [0, 1]]) R = np.array ( [ [r_std^^2]]) H = np.array ( [ [1., 0.]]) P = np.diag ( [.1^^2, .03^^2) Q = Q_discrete_white_noise (2, dt, q_std**2) for z in range (100): x, P = predict (x, P, F=F, Q=Q)
filterpy - PyPI
https://pypi.org/project/filterpy10.10.2018 · First, import the filters and helper functions. import numpy as np from filterpy.kalman import KalmanFilter from filterpy.common import Q_discrete_white_noise Now, create the filter my_filter = KalmanFilter(dim_x=2, dim_z=1) Initialize the filter’s matrices.