For one of my electrical engineering labs, we are required to build an lm386 circuit with a gain of 40, then measure its frequency response. I have successfully done the first part - I get a gain of 43 at low frequency (~100 Hz).
Diagram:

The problem is that when I increase the frequency to about 20k Hz the signal becomes distorted:

66k Hz:

and after that the waveform is basically unreadable. Is an lm386 even capable of amplifying at these frequencies? I thought it is since the datasheet gives a bandwidth of 300k.

Anyway, I have tried replacing the lm386 twice (same result) as well as the capacitor. The lab tutors say they don't know what else could be causing this. Any ideas?

\$\begingroup\$It has a gain bandwidth product of 300k, so 20kHz * 40 gain = 800k, above the GBP, hence distortion. This is effectively what the question is asking; at what frequency does it become unusable?\$\endgroup\$
– pjc50Sep 13 '13 at 10:05

1

\$\begingroup\$Also, you might see better results with a power supply decoupling capacitor of 10uF on pin 7. And you haven't shown any load; it may be unstable if it's just driving the scope.\$\endgroup\$
– pjc50Sep 13 '13 at 10:12

\$\begingroup\$This amplifier can be very prone to layout problems too - make sure you feed power to the device exclusively to the pins and don't connected input grounds to share the power ground until right at the chip. It's probably power cable inductance causing this.\$\endgroup\$
– Andy akaSep 13 '13 at 10:46

\$\begingroup\$Thanks for the suggestions. I'll only be able to test next week though. @Andyaka, do you mean connecting the power supply ground to the signal generator ground?\$\endgroup\$
– geniassSep 13 '13 at 11:24

\$\begingroup\$Yes I do mean that - power ground should wire directly to the ground pins on the chip and analogue input ground should make one connection to that same point and the sig-gen ground is part of the analogue ground. No power currents in the analogue ground is the rule to abide by.\$\endgroup\$
– Andy akaSep 13 '13 at 12:26