Hi Sivaji, Step 1: Calculate aggregated value of every n-samples. Example here I am calculating the average for every 5 samples. Use aggregateByCount which is introduced in version R54. $signal.aggregateByCount(average(), 5, 10d) Step 2: The difference between the sample and aggregated value is greater than certain threshold These capsules will be  0s duration as the aggregateByCount generated a discrete signal. Step 3: Replace the samples with the aggregated valu