BPM detector using sound energy properties in C#