public boolean checkWindow(Integer idx, ArrayList<Integer> peak_frames) {
    boolean response = false;
    for (int i = 0; i < peak_frames.size(); ++i) {
      if ((idx > peak_frames.get(i) - 1600 && idx < peak_frames.get(i)) ||
          (idx < peak_frames.get(i) + 1600 && idx > peak_frames.get(i))) {
        response = true;
      }
      if (idx.equals(peak_frames.get(i)))
        return false;
    }

    return response;
  }