Static in mic input

Status
Not open for further replies.

keraba

Member
I'm wondering about the status of this post from 2016, concerning using an ADC to read a MAX4466 mic input, which is what I'm attempting.

https://forum.pjrc.com/threads/40468-Help-with-Basic-Audio-Lib-results

It mentions doing soldering to get the bias voltage down to 1.2V. However, in the ADC.h file, it looks like it (now?) defaults to 3.3V. Anyways, I'm not touching it, and the MAX4466 seems to work fine.

The problem that I'm seeing is fairly high static noise. When I send the output to a speaker, the noise is higher than what the mic should pick up. The min and max levels below show ~31xxx min to ~33xxx.

The speaker doesn't appear to have any noise. When I send it a sine wave, it sounds perfect (although an FFT might spot a warble.)

When I connect the ADC input to ground (GND), I get values fairly consistently between 6 and ~120. Does this mean that the reference voltage is flaky, or could there be an issue in the ADC ? Or is this expected?

Also, I have no idea what conversion or sampling speed should be for this application. I'm using a Teensy 3.6.

#include <ADC.h>

int ADC1 = 16;

ADC* adc;

void setup()
{
Serial.begin(38400);
pinMode(LEDpin, OUTPUT);

adc = new ADC();
// Doesn't seem to make much difference.
adc->setConversionSpeed(ADC_LOW_SPEED, 0);
// Setting this to 10 generates a range centered at 512.
// Setting this to 16 generates a range centered at 32k.
adc->setResolution(16, 0);

SIM_SCGC2 |= SIM_SCGC2_DAC0 | SIM_SCGC2_DAC1;
DAC0_C0 = DAC_C0_DACEN | DAC_C0_DACRFS;
DAC1_C0 = DAC_C0_DACEN | DAC_C0_DACRFS;
}

int led;
int level = 0; // -1;
int max_level, min_level;

void loop()
{
digitalWrite(LEDpin, led);
led = 1 - led;

min_level = 100000;
max_level = -100000;
for (int i = 0; i < 30000; ++i)
{
// 3.3V will produce results around 32k (for 16 bit samples.)
int level = adc->analogRead(ADC1);
if (level > max_level)
max_level = level;
if (level < min_level)
min_level = level;

// Convert from 16 bit (centered at 32k) to 12 bit (centered at 2k)
level = ((level - 32768) >> 4) + 2048;
// A+
// Endian nuetral write
DAC0_DAT0L = level % 256;
DAC0_DATH = level >> 8;
// A-
DAC1_DAT0L = (4096 - level) % 256;
DAC1_DATH = (4096 - level) >> 8;
}
Serial.print(min_level);
Serial.print(" min ");
Serial.print(max_level);
Serial.println(" max");
}
 
Maybe the microphone isn't able to drive to ADC to its full range?
Or maybe the ADC input isn't biased halfway its range (3.3V / 2 - 1.65 volt)?
Use the 16 bit ADC bit depth to ensure you dont lose resolution.
 
... and the MAX4466 seems to work fine.

The problem that I'm seeing is fairly high static noise. When I send the output to a speaker, the noise is higher than what the mic should pick up. The min and max levels below show ~31xxx min to ~33xxx.

The MAX4466 is _incredibly_ noisy(*) at 80nV/√Hz, completely not a microphone preamp, but sold as such.
This is the problem with using a micro-power device, the other specifications are usually woeful to reduce
power consumption. The MAX4466 is 24uA supply current, high performance opamps are always around 4mA....

An AD797 opamp for instance has 0.9nV/√Hz and would out-perform in noise by nearby 40dB best case (although the microphone's
intrinsic noise will likely be the dominant source of noise in practice).

(*) As bad as the ancient µA741! <=5nV/√Hz is the sort of figure you'd see for a reasonably good low noise opamp.
 
These number really depend on you microphone. It normal for a electret mic element to have a building impedance converter that has around 50 to 100 nv/sqrtHz noise. BJT input opamps such as the AD797 are suitable for low impedance sources because of their high input current noise. Only stating their voltage noise it telling only halve the storie.

Now to get you noise down, you should really figure out if it is noise you are hearing or interference.

Noise is a constant ‘ssssssssssssssh’ sound. While interference has a pronounced pitch and repetition or ticks.

Interference is solved by better shielding en wiring not by changing the amplifying semiconductor
 
The MAX4466 should be able to getdown to 30dBA.. that pretty silent and very suitable to pickup voices from 1 mtr distance, prolly not good enough for distant bird sounds. If you cannt get descent sound from a MAX4466 you are prolly not using it correctly.
 
Thanks for the replies everyone. What I'm hearing is definitely hiss. Like the thread title says, it's kind of like record player or analog TV static noise.

I'm using very short wires to connect the mic. Think breadboard connector lengths. I would think that, at the length, even an insulated wire would pick up noise from the Teensy itself.

I'm certainly starting with the simplest, cheapest, lowest power mic/amp that I could find, so there's room for improvement, but I was really hoping Adafruit wasn't selling garbage. I'll take a look at the AD797, but I'm a long-time programmer, less a digital and certainly not an analog guy, so if that didn't work, I wouldn't know if it was my design. Any pointers would be appreciated.
 
as well as decent amp in that case :)

Any favorite inexpensive opamps for low noise?

I'm considering updating the CS42448 test board for Teensy 4.x sometime next year. Might just go the path of least resistance and leave it as-is with the 14 passive filters. Or maybe update to active filters which Cirrus recommends? Or maybe even try something wild like DC coupled (maybe with offset null circuitry) for the modular synth folks.

Using 14 AD797s would be kind of expensive...
 
ADAfruit isn't selling garbage. The MAX4466 will get you to 30dBA if used correctly. Long wires dont cause hiss. An opamp with enourmoud bias current like the costly AD797 is a bad choise for a high impedance source like a electret.. and so on, and so on...

Test you programm for ADC range, then test you MAX4466 on a scope for analog output range. These need to much up for good noise performance.
 
Hi tscharma,

That is very encouraging, but I'm still wondering a few things from my first post:

- I'm seeing ~6 to ~120 when I ground an ADC. Is this what other people are seeing? I'm fairly surprised that it isn't closer to 0 steadily. This might speak to not grounding my Teensy properly or something.

- Regarding "Test your program for ADC range", I'm seeing ~31xxx to ~33xxx when listening to outside background noise. The baseline matches 3.3V. What I'm wondering about is why it bounces so much when the audio is so low. When a car drives by, the signal that it produces is no louder than the static, like the static is coming from somewhere else.

Thanks again for the replies. Cheers.
 
The ADC has an effective dynamic range of 13 to 14 bits. That depends on how low you can get the source impedance driving the ADC. So expect at least 4 to 5 bits of random fluctuations rms That’s about 32 LSB rms or about 6x that values peak2peak
 
Find out if your ADC reads zero-ish with a low values potenter. And find out what the high values at 3.3v too. Might be better to use an lower ADC reference value to ensure that the electret module can drive the ADC range completely.
 
Next. See what the analog output is of the electret module at your intended SPL. See if you have high enough sensitivity.

IIRC that electret module has a sensitivity adjustment pot.

It might be that you are aiming to record soft sounds. That will always be difficult.
 
Is you hiss as loud as speech at 1 meter? That would equal about 60 to 70 dB. If so, then something is not right. The hiss should be atleast 20dB lower. Or 1/10th of a speech signal at 1 meter.
 
The MAX4466 should be able to getdown to 30dBA.. that pretty silent

That's noisy for a studio mic, 10--15dB is more reasonable. At 1m distance you are in studio conditions, and not being a mobile phone mic - there's
perhaps 20 to 30dB path-loss from moving the mic back that far for many frequencies. Basically the ear's reference for silence is 0dB by definition,
30dBA is not silent.
 
Any favorite inexpensive opamps for low noise?

General use, NE5532, great all-round performance, very cheap, although its not the best for a low impedance source. For
low voltage rail-to-rail the situation changes all the time, but anything designed for audio should quote
both voltage- and current-noise specs.
 
Status
Not open for further replies.
Back
Top