Implement optional filtering by average interval.