Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pitch detection in Python

The concept of the program I'm working on is a Python module which detects certain frequencies (human speech frequency 80-300hz) and by checking from a database shows the intonation of the sentence. I use SciPy to plot frequency of the sound files, but I cannot set any certain frequency in order to analyze pitch. How can I do this?

more info: I would like to be able to set a defined pattern in speech (e.g. Rising, Falling) and the program detects if the sound file follows the specific pattern.

like image 422
Andrew Ravus Avatar asked Sep 15 '15 20:09

Andrew Ravus


People also ask

How do you find the pitch of a sound in python?

Use the function by giving the input argument as the name of the wav file (type==str). Function returns the value of the pitch of the audio.

How is pitch detected?

Detecting PitchHigh-pitched sounds are detected by cells with shorter hair bundles, located closest to where sound enters the ear; lower-pitched sounds are detected by cells with taller hair bundles located further in, and that pattern progresses through the several thousand hair cells that are essential for hearing.

What is a pitch analysis?

Definition. ​A technique that measures variations in the frequency of the human voice. Such frequency modulations are typically associated with various human emotions. Such analysis may be useful in determining emotional response to stimuli, ideas or concepts, largely in the pre-testing space.


1 Answers

There are many different algorithms to estimate pitch, but a study found that Praat's algorithm is the most accurate [1]. Recently, the Parselmouth library has made it a lot easier to call Praat functions from Python [2].

[1]: Strömbergsson, Sofia. "Today's Most Frequently Used F0 Estimation Methods, and Their Accuracy in Estimating Male and Female Pitch in Clean Speech." INTERSPEECH. 2016. https://pdfs.semanticscholar.org/ff04/0316f44eab5c0497cec280bfb1fd0e7c0e85.pdf

[2]: https://github.com/YannickJadoul/Parselmouth

like image 87
Bai Li Avatar answered Sep 25 '22 02:09

Bai Li