Python: pitch detection from sound spectrum