added threshold function to ekf_API to avoid outlier measurements