3

I was looking to implement voice pitch detection in iphone using HPS method. But the detected tones are not very accurate. Performous does a decent job of pitch detection.

I looked through the code but i did not fully get the theory behind the calculations. They use FFT and find the peaks. But the part where they use the phase of FFT output, got me confused.I figure they use some heuristics for voice frequencies.

So,Could anyone please explain the algorithm used in Performous to detect pitch?

Shreesh
  • 677
  • 5
  • 15

1 Answers1

2

[Performous][1] extracts pitch from the microphone. Also the code is open source. Here is a description of what the algorithm does, from the guy that coded it (Tronic on irc.freenode.net#performous).

  • PCM input (with buffering)
  • FFT (1024 samples at a time, remove 200 samples from front of the buffer afterwards)
  • Reassignment method (against the previous FFT that was 200 samples earlier)
  • Filtering of peaks (this part could be done much better or even left out)
  • Combining peaks into sets of harmonics (we call the combination a tone)
  • Temporal filtering of tones (update the set of tones detected earlier instead of simply using the newly detected ones)
  • Pick the best vocal tone (frequency limits, weighting, could use the harmonic array also but I don't think we do)

I still wasn't able from this information to figure it out and implement it. If anyone manages this, please please post your results here, and comment this response so that SO notifies me.

The task would be to create a minimal C++ wrapper around this code.

P i
  • 29,020
  • 36
  • 159
  • 267
  • 1
    For further information you can refer to http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/ on which performous code is based on (i think). The 3rd step in your answer is the crucial one and can effect the accuracy of your results. – Shreesh Nov 18 '10 at 11:51
  • Fantastic!!! You have no idea how much that article helped me! I had been looking for that information for over a week. Thanks!!! – P i Nov 18 '10 at 13:38
  • 1
    I've managed to wrap performous's analyser for iOS. If anyone is interested, send me an e-mail sunfish7|gmail|c0m – P i Nov 24 '10 at 19:10
  • I've rewritten Performous' algorithm in 2020, using a more precise method than in that dspdimension article, and also better combining of harmonics. A Python/Numpy implementation is also available. -Tronic / https://github.com/performous/performous – Tronic Apr 23 '20 at 09:17