Theory and Implementation of Particle Filters