DC and AC comparator