beep is the function which takes frequency as input