Monday, July 25, 2022

Data Acquisition through Microphone Input

We like to make use of the PC audio device for data acquisition.  Here we'll do some testing to understand the capability.  Most of the recent laptops have only one 3.5mm 4-contact jack; the connection is normally tip: left audio, 1st ring: right audio, 2nd ring: return, sleeve: microphone input.   The common 3-contact headphone plug shorts out the microphone input.    The microphone input supplies a small current to power microphones with a FET amplifier.   For the laptop that I have, the open circuit microphone input voltage is 3.168V and short circuit current 1.46mA; the source impedance is about 2K Ohm.  A typical microphone draws about 0.15mA.

Python sounddevice module can be used for acquiring the signal from the microphone input.    The output seems to be limited to [-1, 1].  The microphone properties settings of output level and boost affect the gain.  For 100 output level and 10dB boost, the gain seems to be x50; 20mVpp input has value of 1 peak-to-peak and above 40mVpp input returns 2 peak-to-peak.  Interestingly, although the output is limited to [-1, 1], it does not show clipping effect.  We do a frequency sweep from 20Hz to 20KHz and look at the power spectrum density.  The sample rate is 96KHz.


There is a sharp cutoff at 15KHz and low frequency limit around 100Hz.   The resolution seems to be 16bit.  There is another cutoff about 22KHz (perhaps for anti-aliasing).

Here is 2KHz square wave input,


The upper cutoff frequency is unfortunate because the sample rate seems to be capable of up to 384KHz.   We'll have use frequency conversion for signal outside of the frequency range.  

No comments:

Post a Comment