I'm designing a circuit that hooks up an SP0256A speech synthesizer to an AVR microcontroller and would like some help with the audio output amplification. The datasheet describes the output as being "a Pulse Width Modulator that creates a digital output which is converted to an analog signal when filtered by an external low pass filter." An example circuit is given using an LM386

SP0256A datasheet circuit

Another circuit I have is from a Maplin project that uses a pair of transistors

Maplin TalkBack circuit

(top is 5v rail, right connection is to DIN socket which connects to a TV audio input)

As I see it the advantage of the Maplin circuit is that the speech synthesizer output can be combined with the sound output of the computer (a Commodore VIC-20), the complete circuit has a pair of DIN sockets just for this purpose.

I'd like to have a more compact circuit, can I use the LM386 in place of the transistors?

(edit: I've noticed the following on the datasheet re the Digital Output "Pulse width modulated digital speech output which, when filtered by a 5KHz low pass filter and amplified, will drive a loudspeaker")

  • \$\begingroup\$ Both circuits looks suspicious to me as the both use two identical cascaded RC filters. Which suggest to me the designers did not know or did not care that you can't simple cascade RC filters. \$\endgroup\$ – Oldfart Dec 9 '18 at 13:03
  • \$\begingroup\$ @Oldfart well, I'd agree with you, if we understand this as two cascaded RCs, then it's problematic, as the source impedance of the second stage is anything but low, but if we do a Δ-Y transform on the second 33kΩ and the two adjacent 22nF, and absorb the first 33 kΩ into the left branch of the so-formed Y, we do get something that exhibits a strong LP characteristic \$\endgroup\$ – Marcus Müller Dec 9 '18 at 14:24

Yes, you can use an active filter, like, as you suggest, instead of the passive first stage in the upper diagram, and instead of the nonlinear BJT-based filter in the lower diagram.

Whether the LM386 would be my amplifier of choice here: probably not, but whatever fulfills your application's needs!

You'd have to take care to:

  • ensure high input impedance: the datasheet of the IC suggests (it's not a great datasheet by modern standards) that you shouldn't expect the thing to source more than 50 µA.
  • AC-couple or use a rail-to-rail opamp or use a dual supply to allow the amplifier to even work with longer-term low output volume (this is the reason LM386 wouldn't be my choice)

The problem with the LM386 is that it's not an opamp; hence, calculating how you build a bandwidth-limiting loop is going to be rather intense.

If I wanted to use an LM386: a single stage RC filter would more than do the trick of being a low pass filter with a cutoff of let's say 4.5 kHz and a stopband starting at 10 kHz with 50 dB of attenuation. Either the application note/datasheet of the speech synthesizer isn't even remotely honest when it says "all noise is shifted above 10 kHz", or the filtering circuitry is total overkill. I'll go with both assumptions and say: get an opamp with 2 channels (or more). Use one channel as a voltage buffer to improve the horrendous current sourcing ability of that PWM output (whyever it is that bad – this should be a CMOS device, and a CMOS output driver should work better and could have been implemented in the same technology); use the output of that voltage buffer to feed a simple RC filter, followed by the second stage, followed by yet another RC filter, followed by the LM386. It's a stupid design (with two opamp stages, one could have built a much nicer filter), but it works without any ado.

Let's be honest here: not the route I'd take. The LM386 is a relatively crappy amplifier, and its filter characteristics are sloppy, it's hard to design around and furthermore:

You have a PWM signal. Why use a class-AB amplifier to make it loud, especially when you need to filter it at the same time?

Instead I'll propose the following:

Build a class-D amplifier. You already have a PWM signal!

Use that to drive one of the thousands of half-bridge gate drivers you can buy, for example the ADP3110A.

Use the outputs of that to control a n-channel dual mosfet device, e.g. NTGD3148N.

Connect the mosfets up like shown in the gate driver's datasheet, and AC-couple the output to an LC lowpass filter. Tadah! Class D amplifier.

Honestly, I was surprised when I read the SPO0256 datasheet! This was an impressive feat for DSP in the early 1980's.

This is essentially a decoder for LPC-compressed speech. Nice! Though I must admit: If all you want is actually to play back compressed speech, then choose any modern speech codec and do the decompression in software on the Arduino itself. All but the earliest Arduinos are plenty fast enough for simplistic codecs.

If your aim is to reproduce the original sound of the 1980's speech synths, go for it :) this is a cool project.

| improve this answer | |
  • \$\begingroup\$ I'm planning to re-create the Votrax Type 'N Talk, this was a text to speech device that connected to various 8-bit micros. \$\endgroup\$ – Simon Rowe Dec 9 '18 at 18:41
  • \$\begingroup\$ nice! that's pretty cool. Just because I've mentioned voice codecs: You're not perchance related to the author of codec2? But yeah, if you're recreating something, you might actually want to go with something simple like driving an NPN in common emitter directly with your PWM output and filtering the high-side voltage of that with a single-stage RC: Imperfections probably make out a part of the "character" of old-timey audio synthesis. \$\endgroup\$ – Marcus Müller Dec 9 '18 at 18:56
  • \$\begingroup\$ Not as far as I know. I've done a lot of work to reverse-engineer the ROM that came with this device, documented here. It used an SC-01, another speech synthesiser but one that's almost impossible to source. I'm comfortable with the software and digital electronic aspects of this project, analogue electronics have always been a mystery to me. \$\endgroup\$ – Simon Rowe Dec 9 '18 at 19:13

The amplifier is secondary to the application, the filter is the critical part.

The amplifier only has to:

  1. Satisfy the input requirements of your load.
  2. Isolate the filter from the load.

Your amplifier choice completely depends on the load you are going to put on it.

Both of the choices you present do this, but the transistor amplifier lacks overall feedback, which means it will have more distortion. It is also a class-A design, while the opamp is a class AB. This makes it likely to have more power consumption.

| improve this answer | |
  • \$\begingroup\$ I need sufficient amplification to feed the output into a TV audio input. I hadn't considered power consumption, the connector to the VIC-20 is only rated at 100 mA. It looks like the SP0256A can draw up to 90mA, so I may need an external PSU. \$\endgroup\$ – Simon Rowe Dec 10 '18 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.