开发者

Determine the audio frequency of sound received via the microphone

I am trying to understand how to go about determining the frequency of various sounds captured on the phone via microphone.

I am attempting to displ开发者_运维技巧ay a graph plotting the frequency of the note.


The "notes" produced by most musical instruments may contain spectral content at a large number of frequencies. Furthermore the frequency spectrum of a "note" may or may not contain significant peaks at what a human would call the musical pitch of the note. So you may not even be asking the correct question.

There's more commentary on this issue in one answer to this stackoverflow question.

A spectrograph (via repeated usage of an FFT or other filter bank) is a common technique for displaying, in graphic form plotted against time, the frequencies contained in captured sound, with a trade-off in time response versus frequency resolution.

There's example spectrograph code in Apple's aurioTouch sample app available from the iOS Developer web site.


Record the audio stream and count number of Zero crossing. That should give you the frequency. But cautious in choosing the appropriate sampling rate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜