Audio Shield - Analog Inputs - Are these two functionally equivalent?

Status
Not open for further replies.

Davidelvig

Well-known member
Are the MIC and GND pins functionally the same as the LINE IN L and G pins - alternatively activated by
Code:
inputSelect(input);
Select which input to use: AUDIO_INPUT_LINEIN or AUDIO_INPUT_MIC.
Audio Shield.JPG

Other than the call to inputSelect, are they functionally identical?

Thanks!
 
In terms of what happens to the data from them yes, but the mic line has a preamp on it where the line in assumes you are already at line level. And line is stereo and mic only gets a mono channel.
 
So, I expect micGain() only applies to the Mic input.

Correct. Are you looking at the design tool documentation? (the right side panel) Every function has a short explanation. For micGain, it is:

When using the microphone input, set the amplifier gain. The input number is in decibels, from 0 to 63.

Admittedly, some of those descriptions are short and could be made clearer. If this one isn't clear, let's talk about how to improve it.
 
Thanks. I've looked at the documentation in the GUI tool so many times... and it's been a godsend!
At the same time, for me, it's been a learning curve on the audio signal side (nothing about that in my medical training or software hacking or trumpet playing).

In retrospect, the documentation you highlight is quite clear.... micGain() affects the "microphone input" [only].

For me, the difference between the electrical and functional characteristics of the various analog audio input has challenging.
- ADC, vs Audio Shield/Mic vs. Audio Shield/Line In (L & R)
- Mic level vs. Line level (vs. "instrument level")
- impedance vs resistance
- offset voltage
It's still challenging, though I'm a lot smarter... which is certainly part of my drive to do this stuff.

That said, there are few places where it was hard to find answers, and it was frustrating.
Search in the Forum for "mic level line level" and you'll see several posts I started, and a few more that I commented on...
Searching the web is somewhat helpful.
Top hit on google is from Sweetwater, highlighted by google as:
Mic level is the lowest, or weakest, level signal of the four and requires a preamplifier to bring it up to Line level. Instrument level signals live between mic and line level signals and have the most variation. You typically see this kind of signal come from an electric guitar or bass.Feb 8, 2017

Further searching can find typical p-p voltages... nothing clear to me on standard voltage offsets.
I've read a few books on audio signal processing... yet still miss some of the basics.
I'm sure it's out there.

So maybe it's indexing.
Maybe it's "problem-based WIKIs" or some such...
e.g. "Mic usage options with Teensy"

I'm not complaining - unless my posts appear to be...
Lots of good choices in the Teensy and the Audio Shield

but I ramble...

Thanks for the reply. It's clearer now.
 
Really good feedback, actually. Lots of this stuff is pretty well established convention in the audio world, so people who are already familiar don't think to include that sort of info when writing documentation.

I'll try to get back to this in a few weeks. Hopefully you'll still be following this thread... all the docs could really use mild editing to add some of this background people not already familiar with audio engineering need to know.
 
Question about micGain(). The data presumably ends up being treated digitally, so you can do any transform on it you want. If that is true, why does one want to amplify an input signal?

My guess would be that ADC bins based upon certain (non-adjustable?) voltage ranges, and if you don't adjust the gain properly, all your data ends up in the lower bins, effectively limiting your dynamic range.
 
My guess would be that ADC bins based upon certain (non-adjustable?) voltage ranges, and if you don't adjust the gain properly, all your data ends up in the lower bins, effectively limiting your dynamic range.

Yes, that's about right.

Another way to think about this is called "quantization noise". The idea is you're rounding the ideal signal numbers to the nearest integer. The difference between the sampled integer and a perfect real number with tons of places past the decimal point is called quantization noise. The larger the integers, the larger the signal to noise ratio is. We like large signal to noise ratios.
 
Status
Not open for further replies.
Back
Top