0

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.

MSalters
  • 159,923
  • 8
  • 140
  • 320
Shoan
  • 3,818
  • 1
  • 24
  • 28
  • "_The_ frequency" is very, very unlikely to happen. Even if you played a pure tone (which is already physically impossible), the microphone would capture a noisy variant thereof, with multiple frequencies. How familiar are you with signal processing theory? – MSalters Oct 11 '10 at 09:44

2 Answers2

1

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.

Community
  • 1
  • 1
hotpaw2
  • 68,014
  • 12
  • 81
  • 143
1

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

Ananth
  • 133
  • 12
  • on what base should I choose appropriate sampling rate? – Nirav Jun 17 '11 at 04:34
  • I would follow the [Nyquist Frequency](http://en.wikipedia.org/wiki/Nyquist_frequency) which indicates that the sampling rate should be **twice** the highest frequency. So somehow determine a way of finding the highest frequency (Maybe you already know it, maybe you can just update it as you read frequencies), and make your sampling rate twice that. – sourdesi Jan 17 '14 at 15:47