Implemented rudimentary version of a beat detector.