+ double center_time = values.get(i).time;
+ double left_time = center_time - half_width;
+ double right_time = center_time + half_width;
+ double total_coeff = 0.0;
+ double total_value = 0.0;
+
+ int left = find_left(i, half_width);
+ int right = find_right(i, half_width);
+ for (int j = left; j <= right; j++) {
+ double j_time = values.get(j).time;
+
+ if (left_time <= j_time && j_time <= right_time) {
+ double coeff = filter_coeff(j_time - center_time, width);
+ total_coeff += coeff;
+ total_value += coeff * values.get(j).value;
+ }
+ }
+ if (total_coeff != 0.0)
+ f.add(center_time, total_value / total_coeff);