VB.NET / C# - Microphone input frequency(db, hz)
15 pts.
0
Q:
VB.NET / C# - Microphone input frequency(db, hz)
Hi,
i am looking for a way(code example) to be able to get the microphone input frequency(hertz) almost in real time(timer maybe?) and show it in a label.text. Can be in VB.NET or C#.

Functional exemple:
I say something in the microphone, the timer do his job and the label show something like "400 hz".

This is for an application running under Windows Mobile.

Thanks in advance!
ASKED: Aug 10 2009  1:17 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1850 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
That's a pretty simplistic description of a complex requirement. Playing a 400 Hz sine wave in front of a microphone for one second is one thing, but if I sing or say "something" into a microphone, you might have a complex, 500 ms waveform that includes a mixture of many changing frequencies and harmonics. How do you pick out the frequency that you plan to measure?

[kccrosser]
There is no short and simple answer here. If you are getting a sound sample from a microphone, and want to determine the fundamental frequency, you will need to use a Fourier Transform. There are many implementations of a Fast Fourier Transform (FFT) available, which is the most common transform in use. Wikipedia has a good article on FFTs, at http://en.wikipedia.org/wiki/Fast_Fourier_transform. This also has links at the bottom to various FFT code and examples.

A good tutorial, with some nice code samples, of how to capture and convert code is available at http://www.relisoft.com/freeware/recorder.html

In highly simplistic terms, an FFT can take a sound sample and return a list of frequencies with associated "counts" (or magnitudes). The frequency with the highest value is the fundamental frequency of the sample.

There are of course already many devices for tuning musical instruments that display the frequency. Professional guitarists I know use devices like the Intellitouch or Korg clamp-on units that display the fundamental frequency in a small lcd window as they pluck a string. There are also quite a few software applications that sound like they do what you are contemplating - search for "guitar tuner online" to see a bunch.
Last Answered: Aug 10 2009  8:14 PM GMT by Kccrosser   1850 pts.
Latest Contributors: Ledlincoln   1220 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Carlosdl   29855 pts.  |   Aug 10 2009  3:25PM GMT

I agree. That’s a really complex requirement, or maybe we have misunderstood it due to the lack of details.

 

Armkreuz   15 pts.  |   Aug 10 2009  4:09PM GMT

Alright, sorry for the lack of details, ill try to be clearer.

I understand the mechanic of sound, and that its not really likely that i’ll be able to sustain a 400hz sound by talking, etc…

What i’m actually trying to make is a Tuner for musical instruments, but i need to be able to collect a sample of the frequency captured by the microphone every xxx’Milliseconds and display this frequency in a label1.text(just as an exemple)

The microphone capture ambiant sound, exemple “a guitar string vibration”.

P.-S.: Sorry for my english writing, this is not my native language.

 
0