Hi, I have an use case where I need to calculate aggregated value of every n-samples and replace the samples with the aggregated value in case the difference between the sample and aggregated value is greater than certain threshold.
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