Measure frequency of a signal by counting pulses