frequency detector