Go Down

### Topic: Mic Elements, what are they receiving? (Read 4131 times)previous topic - next topic

#### Teddy1

##### Dec 29, 2013, 04:28 am
Hi,

So I bought this mic element:

I'm not sure if it's doing anything...it mostly fluctuates around 980. Is that getting the pitch or is it getting volume? I just have the code doing a digital read of the input. And then I am reading from the serial monitor what number it gives.  If it is the pitch, what is the threshold? The goal here is to essentially make a tuner, based on hertz, not oscillation.

#### capicoso

#1
##### Dec 29, 2013, 07:48 am
a digital read? That's only low/high 1/0. The fluctuations of the electret are analog. You have to put it in an analog input.
The signal of the electret may be too small to work with arduino, in the range of the millivolts. You should amplify in to the 0-5v range:
Googling fast i found this image http://fritzing.org/media/fritzing-repo/projects/e/electret-mic-opamp/images/Fritzing.png i didn't test it.
And the mic doesn't give you any information on the pitch or frequency. Higher voltage = higher amplitude, not higher freq.
To determine the frequency you have to use the FFT library for arduino

#### Teddy1

#2
##### Dec 29, 2013, 04:53 pm
Oh God. This might be more difficult than I thought. What are those purple things? And the black thing on the right?

Thanks!

#### DVDdoug

#3
##### Dec 31, 2013, 07:25 amLast Edit: Dec 31, 2013, 07:29 am by DVDdoug Reason: 1
If you want to make the hardware simpler, you can get a circuit board with a mic & amplifier built-in.

Quote
Is that getting the pitch or is it getting volume?
Neither...  It's the instantaneous amplitude at one moment in time.   It's sort-of related to volume, but only if you happen to catch the "top" of the waveform.     What are you trying to do?  What kind of information do you need?

Sound is a pressure wave.  The microphone converts sound pressure to an electrical signal.   The sound wave goes positive & negative (like waves in the water go above and below the average or still-water level).   The electrical signal from a microphone also goes positive & negative.   Since the Arduino can only read positive voltages, the SparkFun board I linked to above puts a 2.5VDC bias on the signal.   With this board, silence will read about 512 on the Arduino ADC.     A "maxed-out" 5V peak-to-peak signal will have readings between zero and 1023.

When you read an audio signal "randomly", you don't know where you are in the waveform... You can read anything between the positive & negative peak.   You might even read zero (or 512 if there is bias) if you happen to take a reading at the waveform zero-crossing.   If you want to read "loudness", you need to take lots of readings and pick the biggest reading to get the approximate peak of the waveform.    Again, it's like measuring waves in water...  You can't just stick a measuring tape in the water and take a reading at any-old time... You have to wait for a wave-peak to come-along.

If you also need the pitch information, you need to read at known time intervals to know the timing of the waveform.  For example, CD audio has 44,100 samples (readings) per second.   Here is a basic  introduction to digital audio...   Basically each sample is a "dot", and an analog-to-digital converter can "connect the dots" to re-create the analog waveform.

#### Teddy1

#4
##### Jan 01, 2014, 06:18 pm
The goal is to get the pitch, but I might just get the special component that has it already...thanks for your help though!

#### Grumpy_Mike

#5
##### Jan 03, 2014, 11:55 pm
Quote
The goal is to get the pitch

That is a very difficult thing to do with any real world sound input.
Take most instruments, the fundamental is often lower than the harmonics and they change over time so getting the exact pitch is very hit and miss.

#### retrolefty

#6
##### Jan 04, 2014, 12:34 am
Why don't you look and see what others have done.