Resampling method for the particle filter