# LM386 output signal problem

I've built a signal generator (with an Arduino) what can output 18kHz and 19kHz signals (separately) and it's connected to a speaker. This works just fine, there are no signals on awkward frequencies.

After I've added an LM386 audio amplifier with the circuit (amplifier with gain = 20). Weird frequencies start to show up around 9-10kHz and my 18-19kHz signals are weakened.

Why is that?

• Can you post a schematic please? – Oli Glaser Nov 11 '11 at 15:35
• Yes, we need to see how exactly you wired up the LM386. Did you notice that it only has 300 kHz gain-bandwidth product? That means it's down to unity gain at 15 kHz. – Olin Lathrop Nov 11 '11 at 15:46
• In addition to the resistive attenuator, try obtaining the signal from the arduino through a .1 uF series capacitor. – Chris Stratton Nov 11 '11 at 19:09
• Doh! I just noticed that my previous statement came out wrong. This part has a 300 kHz gain-bandwidth product and a fixed gain of 20. That means the gain of 20 can't be supported at over 15 kHz. In reality the way the feedback most likely works in the amp to set the gain, it starts falling off from a gain of 20 somewhat below 15 kHz. All this means that while it will still have some gain at 18 and 19 kHz, it will be somewhat below what is expected for for frquencies more in its intended range. – Olin Lathrop Nov 11 '11 at 21:07
• @Olin - I think that 300kHz is just it's closed loop bandwidth at G=20 (e.g. GBP is more like 6MHz) So it should be usable well over 20kHz. – Oli Glaser Nov 12 '11 at 4:19

In designing an electronic music box, I found that the LM386 would behave very badly if it tried to drive some kinds of speakers without a series resistor. At very low output levels the thing would sound fine, but at a certain output level the thing would start self-oscillating during certain parts of the input waveform. Adding a small resistor (about an ohm, if I recall) solved the problem, allowing the amplifier to usefully produce a much greater volume (probably more than 10dB improvement) than it otherwise could.

• Probably could use a Zobel network... – Bitrex Nov 14 '11 at 20:27

What you're seeing is a subharmonic. It's generally a sign of instability. Basically, through clipping or some other mechanism, the amplifier's "state" is not the same at a given point on each cycle of your waveform.

So you're feeding this kind of signal in and expecting a similar output:

--    --    --    --    --    --    --    --    --
\  /  \  /  \  /  \  /  \  /  \  /  \  /  \  /
--    --    --    --    --    --    --    --


But what is coming out looks more like:

--    ---     --    ---     --    ---     --    --
\  /   \   /  \  /   \   /  \  /   \   /  \  /
--     ---    --     ---    --     ---    --


(I'm guessing here; can't see your scope, if any.) Note that this signal repeats every two cycles. So it's more like a 9 kHz signal with an 18 kHz second harmonic.

One possible solution would be to first feed the signal through another amplifier to gain up the signal by at least 10, then have its output go to the LM386 which would only need to be at a gain of 2. If you want a volume control, vary the gain of the first amplifier.

EDIT: Just remembered that even-numbered harmonics are usually signs of asymmetry across the x axis, i.e. the top half of the waveform doesn't look like the bottom half. Not sure how to draw it, though.

Ah, the 386. I always need to bypass the power supply with 10 uF or larger. Also 10 ohm and 220 pf from pin 5 (output) to ground. 470 uF from output to speaker.

• I'm not sure this answers the question, which is why some frequencies are attenuated and others are amplified. Perhaps you can elaborate. – JYelton Aug 20 '14 at 19:18