Why does my electret microphone amplifying and filtering circuit output so much noise?
There are a number of problems with this circuit:
- The input to the reference is not filtered.
R5 and R4 make half the supply voltage, but also transfer half of whatever noise is on the supply. There should be cap to ground across R4. I'd start with around 2 µF.
- There is no bias supply for the microphone.
You said this was a electret, so there should be a pullup to 5 V. Usually these should be a few kΩ. Check the datasheet of your mic.
You should also filter the pullup voltage to keep power supply noise from being fed directly into the mic. Perhaps 1 kΩ from 5 V followed by 20 µF to ground, then 2 kΩ to the mic. Again, see the mic datasheet.
- There are no bypass caps anywhere!
The above shows the power to only one opamp, but all of them have the same problem. For even better noise rejection, especially for the first stage amp shown above, put a ferrite chip inductor in series followed by 10 µF or so ceramic to ground. That reduces high frequencies, like from radio station pickups, that the active circuitry in the opamp can't handle well.
- Low gain. The first stage amplifies by a bit over 6. That by itself is OK, although I'd like to see a bit more from the first stage if the opamp can handle it. You didn't provide a link to the opamp datasheet, so I didn't look it up. In any case, there are certainly opamps available that can run from 5 V and provide a closed loop gain of 30 or so at 20 kHz with plenty of gain headroom for the feedback to do its job.
A microphone amp usually needs a gain of around 1000 at full volume to get to line level signals. Two gain stages at front with a gain of 30 each is usually about right, with a volume control between the two of them.
After the signal has been amplified, any noise added is a much lower fraction of the whole.
- Decouple the Vref inputs to each stage. U5 isn't perfect. It will have some noise. It's output impedance also isn't 0, so there will be some cross talk between stages. Even just 1 kΩ in series followed by 20 µF to ground at each point of use would help.
- Do you really need all that filtering? This is way excessive for any normal audio. Eliminating filter stages will reduce noise. Everything adds noise, so don't put more stuff in the signal path than you really need.
You are generating the reference voltage by using a voltage divider on your 5V rail. I think this is going to be your mains source of noise - any noise on your 5V rail is going to be directly injected into your circuit.
In your simulation, you can see how strong this impact is in your circuit. In series with V4, put a noise source and watch the impact.
If you are going to use a voltage divider to generate a 2.5V, perhaps look at using a voltage regulator or voltage reference IC. This will do a better job at removing noise from your reference than any reasonable amount of decoupling capacitance will ever be able to.
You need extremely clean power to bias your microphone. The raw +5V from a USB connection is probably one of the worst places from which to get power for this purpose. The noise on the bias supply is applied directly to the input of the first stage with essentially no attenuation at all.
I always use at least a "T" filter to bias my microphone circuits:
simulate this circuit – Schematic created using CircuitLab
In particularly egregious situations, R1 might be combined with or replaced by an inductor, or a second RC filter stage will be added.