added function to set sampling interval
constrain on sampling interval