Reputation: 4078
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 display a graph plotting the frequency of the note.
Upvotes: 0
Views: 8924
Reputation: 143
Record the audio stream and count number of Zero crossing. That should give you the frequency. But cautious in choosing the appropriate sampling rate.
Upvotes: 1
Reputation: 70733
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.
Upvotes: 1