Separated the algorithm into separate functions so that I could calculate the BPM for a single window instead of just a whole song/wav file.  This is allow for streaming in the future hopefully.