add recording 5 sample points before the sample that run over the threshold value