Frequency measuring device