working on basic pitch detection algorithm