Adding filters to class AB audio amp - Page 1
Forum section: electronics / beginners

author: d4n13l
author_rank: Regular Contributor
timestamp: August 17, 2019, 05:54:12 pm
content: Hi,I picked up the attached amp from internet and made small modifications, I think it works nicely for audio but is still missing some filtering which I'm still not clear how it works. I tested the circuit as is, except by R4 and C7 which is how I've seen some filters implemented by I'm not sure how it works since the filters I've found on literature take the output from between R4 and C7, they don't put it in parallel with the output as you see here. Also is C2 making a filter R1 or with the rest of the circuit?Basically I'd appreciate notes on how to add high and low pass filtering here.

author: ledtester
author_rank: Super Contributor
timestamp: August 17, 2019, 07:48:50 pm
content: I am not an audio guru, but I would place any filters before the final amplification stage which is what the TL084 is doing.Are the 3 other op amps in the TL084 being used? If not you could use some of them to create active low/high pass filters. This page has pretty good info on the main types of filters used in electronics:https://www.electronics-tutorials.ws/category/filterSee the page on "Active Band Pass Filter" for an example of how filter and amplifier stages are chained together.

author: wraper
author_rank: Unknown
timestamp: August 17, 2019, 08:02:18 pm
content: First of all this is not AB but B class amplifier. Secondly, it not a filter on the output but snubber to improve stability of amplifier.

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2019, 08:04:11 pm
content: That circuit is class B, not class AB, and will have some crossover distortion, so is not optimal for audio.https://www.google.com/search?client=firefox-b-d&q=class+b+crossover+distortionR4 and C7 form a Zobel network.https://www.google.com/search?client=firefox-b-d&q=Zobel+networkC2 is an AC coupling capacitor, which enables the audio signal to pass through to the input of the amplifier, whilst blocking DC. Removing it will upset the biasing of the circuit, so its output will saturate close to the positive rail, instead of sitting between both supply rails.https://www.google.com/search?client=firefox-b-d&q=AC+coupling+capacitor

author: wraper
author_rank: Unknown
timestamp: August 17, 2019, 08:06:47 pm
content: QuoteFilter consists from impedance of signal source, VR1, C2, R1. It's not good at all because it's parameters depend on signal source and VR1 position,

author: wraper
author_rank: Unknown
timestamp: August 17, 2019, 08:08:48 pm
content: Quote from: Zero999 on August 17, 2019, 08:04:11 pmYeah, I tried to remember but failed to recall how exactly this snubber network was called.

author: d4n13l
author_rank: Regular Contributor
timestamp: August 17, 2019, 08:14:22 pm
content: doesn't the op amp make this work as a class AB? as I understand it a class B amplifies only after the 0.6V that takes to activate the transistors thus causing distortions, however due to the negative feedback the op amp put enough voltage to overcome that

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2019, 08:20:12 pm
content: Quote from: d4n13l on August 17, 2019, 08:14:22 pmNo the op-amp doesn't cause the output stage to work in class AB. Each transistor conducts for less than half of the waveform, so it's definitely class B.The op-amp will reduce the crossover distortion somewhat, but it will still be there, especially at higher frequencies/slew rates. The only way to reduce it further is to bias the output transistors so both conduct slightly all the time, making it class AB.

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2019, 08:56:39 pm
content: I've done an LTSpice simulation. Note that I didn't include the Zobel network or decoupling because it's not necessary for a simulator, which uses ideal components. Of course they should be included in real life.Look at the horrible crossover distortion.

author: soldar
author_rank: Super Contributor
timestamp: August 17, 2019, 08:59:53 pm
content: VR2 provides negative feedback. You can put any filtering network in its place to adjust frequency response.

author: mikerj
author_rank: Super Contributor
timestamp: August 17, 2019, 10:40:02 pm
content: Quote from: soldar on August 17, 2019, 08:59:53 pmAdding additional,variable phase shifts into the feedback is likely to turn this into a oscillator, and even if it could be made stable it will undoubtedly make the crossover distortion even worse. Filters should go before the amp.

author: Circlotron
author_rank: Super Contributor
timestamp: August 17, 2019, 11:20:36 pm
content: R4 and C7 are there to keep a load on the amplifier output at high frequencies. The speaker impedance goes up with frequency meaning less and less load and the chance of high frequency oscillations and instability. The impedance of C7 comes down with frequency, and if R4 and C7 are sized right the amplifier will see a constant load regardless of frequency. I have seen typical values of 100nF and 10 ohms.

author: John B
author_rank: Frequent Contributor
timestamp: August 18, 2019, 05:24:52 am
content: Not only will the output transistors have crossover distortion, but with only a 12V supply to the op amp, the output of the op amp itself is likely to have crossover distortion above a certain voltage output swing. It will likely need loading down to the negative rail, ground in this case. Something like 2k-10k ohms depending on how much output swing you want.

author: d4n13l
author_rank: Regular Contributor
timestamp: August 18, 2019, 06:52:10 am
content: ok I'll work on the other stuff next, now I get the Zobel network (made by R4 and C7) and why is there but in order to calculate the cap and resistor values you need the inductance value of the speaker, at least according tohttps://diyaudioprojects.com/Technical/Speaker-Zobel/, however I can't find an easy way of calculating it, does anyone now a practical way for doing it or people just take approximate values?

author: GerryR
author_rank: Frequent Contributor
timestamp: August 18, 2019, 12:47:44 pm
content: Speakers, I believe are rated for impedance at 1 KHz (8@ 1 KHz), so you can measure the resistance with an ohm meter and calculate the inductance at 1 KHz.

author: Audioguru again
author_rank: Regular Contributor
timestamp: August 18, 2019, 12:57:56 pm
content: Quote from: John B on August 18, 2019, 05:24:52 amThe only opamps I know that have crossover distortion at ANY supply voltage (within spec's) are the LM324 quad and LM358 dual (they use the same opamps) because they are designed for very low idle current so they are missing the biasing of their output transistors that eliminates crossover distortion. A load on the output causes one of the output transistors to operate in class-A eliminating the crossover distortion.

author: Audioguru again
author_rank: Regular Contributor
timestamp: August 18, 2019, 01:02:52 pm
content: This thread title says "adding filters".Why? To cut low frequencies to make an adult male voice sound like a chipmunk and to muffle high frequencies in speech and music like an old telephone?

author: GerryR
author_rank: Frequent Contributor
timestamp: August 18, 2019, 01:55:26 pm
content: Quote from: Zero999 on August 17, 2019, 08:56:39 pmThe OP's schematic shows a 100 nf (.1 uf) cap, not a 10 uf like in your model. It is a ~160 Hz hi-pass into the op-amp. If the OP wants a lower response, then changing to 1 uf will drop it to ~16 Hz. I believe the 10 uf will cause other problems at the low end.

author: d4n13l
author_rank: Regular Contributor
timestamp: August 18, 2019, 10:02:21 pm
content: Quote from: Audioguru again on August 18, 2019, 01:02:52 pmHi audioguru,Well, since the intended purpose of the amp is to work with audio I'd say the obvious answer is to restrict the amp output to the appropiate 20hz to 20kHz bandwith. But I'm actually doing this to learn how they work so is more of and excersise, and since I happend to have a bunch of sort of crappy small speakers I'm thinking it would be a good idea to implement some kind of bass cut.

author: d4n13l
author_rank: Regular Contributor
timestamp: August 18, 2019, 10:27:18 pm
content: Going with GerryR's note on speakers having 8 ohms at 1kHz I came out with a value of 10 ohms for R5 and ~10uF for C5 for the Zobel network.As for the filters, I take it C6 and the speaker are making a high pass filter so a better value for C6 would be 1000uF as to allow freq over 20hz?But I'm having trouble as to where to put the low pass filter, maybe at pin 2 of the op amp as seen in the diagram? which would be 795nF (closest I have is 1uF) for C7 to cut frequencies below 20hz, or 63nF if I wanted to cut the bass at 250hz?

author: GerryR
author_rank: Frequent Contributor
timestamp: August 18, 2019, 11:17:06 pm
content: Quote from: d4n13l on August 18, 2019, 10:27:18 pmThe 100 nf and 10 K is a high pass with a break frequency of ~160 Hz; nothing below that (at 6 db per octave) is going to "get in." Change the 100 nf or the 10 K to change what you "let in" to the amp at the low end.

author: John B
author_rank: Frequent Contributor
timestamp: August 19, 2019, 01:25:02 am
content: Quote from: Audioguru again on August 18, 2019, 12:57:56 pmMea culpa. I probably got bitten by the fake bug again. As not to derail this thread, I documented it here:https://www.eevblog.com/forum/beginners/tl07x-tl08x-ebay-fakery/

author: d4n13l
author_rank: Regular Contributor
timestamp: August 19, 2019, 02:21:54 am
content: Quote from: GerryR on August 18, 2019, 11:17:06 pmOk thanks, but that takes me to my original post, I'm having trouble analyzing the filter in series like that, all literature that I've seen would take the output of the filter from between C1 and R2.. so are VR1 and C1 making a variable low pass filter as well?

author: Audioguru again
author_rank: Regular Contributor
timestamp: August 19, 2019, 02:35:00 am
content: Throw away that horrible class-B amplifier with its awful crossover distortion. Use an opamp made for audio to drive the output transistors.If C5 has the extremely high value of 10uF then the 10 ohms resistor in series with it will overload the amplifier above only 1600Hz. An LM386 IC amplifier uses a 0.05uF capacitor in series with 10 ohms for its Zobel network. Then it begins loading the amplifier output at very high ultrasonic frequencies where the speaker is a very high impedance and the amplifier will try to oscillate without the load.EDIT: I forgot about the capacitor to ground you added at pin 2. It does nothing at pin 2 because this inverting input has the input signal cancelled by the negative feedback. Make a lowpass filter parallel with the feedback resistor.

author: fourfathom
author_rank: Super Contributor
timestamp: August 19, 2019, 03:10:03 am
content: Quote from: Audioguru again on August 18, 2019, 12:57:56 pmDoesn't adding this resistor at the output merely move the crossover distorting to a different place? Of course with small signals the modified crossover point won't be reached, so the distortion as a % of the signal will be improved.

author: d4n13l
author_rank: Regular Contributor
timestamp: August 19, 2019, 03:35:08 am
content: Quote from: Audioguru again on August 19, 2019, 02:35:00 amI'll take the advice thanks, but I'm following this schematic for educational purposes, I started with class A amps now I'm working with this to get some reference points, for example, I wanted to know how bad would the audio actually sound, and I used this op amp because is what I had available at the moment (and thought its high slew rate would be good for this configuration) I actually need to do some research into audio amps I have not idea how they are improved for audio, also I didn't know how loud would be sound actually be with the speakers I got, stuff like that.and of course you learn stuff along the way

author: fourfathom
author_rank: Super Contributor
timestamp: August 19, 2019, 06:10:27 am
content: Quote from: d4n13l on August 17, 2019, 05:54:12 pmYou can improve the crossover distortion by adding a resistor from the transistor bases to the transistor emitters. The idea is to let the opamp drive the output directly (through the resistor) while the circuit transitions through the crossover region. Instead of a the opamp needing to compensate for a 1V crossover deadband, it now only has to correct for a gain-slope change (which is easier). The resistor value depends on the opamp, and the load, but you might try 50 Ohms or so. This doesn't get you "golden ear" distortion levels, but can make a significant difference.

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2019, 08:18:10 am
content: Quote from: GerryR on August 18, 2019, 01:55:26 pmYes, I increased the capacitor size for full range response. I think the title of this thread centres around the OP's misunderstanding of how the circuit works. I don't believe the OP actually wants any filtering. If so, he should have given the desired frequency response. Look at the size of the capacitor on the output stage. Even though it's good to oversize decoupling capacitors, it beyond the joke to have a cut-off of 9Hz after an input stage with a cut-off of 160Hz.What problems do you think having a 10µF capacitor will introduce? It's generally good practise to make DC coupling capacitors much larger than the bare minimum because it reduces phase shift and attenuation at the lowest frequency of interest. The only downsides are a bigger audible click at turn on it taking longer for the steady state condition to be reached. 10µF and 10k is an RC time constant of 100ms, so it will be fairly close to steady state after being turned on of 0.5s.Quote from: fourfathom on August 19, 2019, 06:10:27 amI'm not sure what you mean. Are you talking about biasing it more towards class AB? That will reduce crossover distortion, but using resistors along makes it sensitive to supply voltage and temperature variations. A better way is to use diodes or another small transistor with a VBEmultiplier. If both transistors will be biased so they simultaneously conduct (true class AB operation) then emitter resistors are required to prevent thermal runaway.

author: John B
author_rank: Frequent Contributor
timestamp: August 19, 2019, 08:53:18 am
content: Quote from: Zero999 on August 19, 2019, 08:18:10 amIt's a resistor from the output of the op amp to the emitters of Q1 and Q2.

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2019, 09:41:09 am
content: Quote from: John B on August 19, 2019, 08:53:18 amSorry, I should have reread your reply more carefully. It was obvious that's what you meant.Yes, it will soften the crossover distortion, but it'll still be there. I doubt it'll do much in this application because the op-amp would have to supply a significant output current. It's more effective in applications where the output current is under an order of magnitude greater than what the op-amp can supply.

author: GerryR
author_rank: Frequent Contributor
timestamp: August 19, 2019, 11:22:04 am
content: Quote from: d4n13l on August 19, 2019, 02:21:54 amVR1 is simply a volume / level control. C1 and R2 make up a simple 1st order high-pass filter with its break frequency atf = 1/ (2pi RC). Changing R and / or C will change the break frequency.Also, I might mention that good audio amps have a frequency response from below 20 Hz to 100 to 200 KHz, the reasons being the "feel" of the bass in the low end (below 30 Hz) and the better transient response in the high end. (One amp of a receiver I have goes to 100 KHz, and a power amp that I have (150 Watts RMS out per channel) has a response out to 200 KHz, which I have tested to spec.) Most people can't hear below 40 Hz and above 15 KHZ, and at my age, I'm sure the band is much narrower, but hey, the specs are great.

author: soldar
author_rank: Super Contributor
timestamp: August 19, 2019, 12:20:19 pm
content: Just for reference and comparison I am attaching a schematic of a preamp with treble and bass filtering. I seem to remember this type of RC network was pretty standard at the time and most preamps had similar controls. This schematic is half of a stereo unit so it had a similra circuit in parallel.

author: GerryR
author_rank: Frequent Contributor
timestamp: August 19, 2019, 12:41:23 pm
content: Quote from: Zero999 on August 19, 2019, 08:18:10 amWith the 10 uf and 10 K resistor, your cut-off is down to 1.5 HZ. Any "drift" on the input to that filter is going to affect the output of the amp. (I believe most amps stop at 15 Hz, or above, on the low end to avoid this issue. If you have a super power supply and the circuit feeding the amp is really stable, you might get with it.

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2019, 12:59:55 pm
content: Quote from: GerryR on August 19, 2019, 12:41:23 pmWhat do you mean by drift? Are you talking about power supply rejection or thermal effects?I don't see how having an oversized input capacitor supply affects the power supply rejection.C1 filters the bias voltage, keeping the power supply rejection high. Any "drift" as you say (due to thermal effects?) will be much below 1.5Hz and will be rejected.I admit, there's less of a reason for oversized coupling on the power stage because it will be the final one in the chain, but when you've got many amplifiers, it's a good idea. Try chaining several stages together, each with a cut--off of 16Hz and you'll see there's quite a lot of phase shift and attenuation at 20Hz.

author: Audioguru again
author_rank: Regular Contributor
timestamp: August 19, 2019, 02:22:24 pm
content: When the audio engineering company I worked for began selling business telephone systems when the government allowed competition with Bell, the cheapest telephone system was made by Goldstar from South Korea. The hand soldering was the worst I have ever seen and customers complained about the speakerphones producing severe crossover distortion.Later, Goldstar Electronics grew up and changed their name to LG (Lucky Goldstar) Electronics.Since the speaker in each telephone was about 32 ohms then I added a 33 ohms resistor from the output of the opamp to the emitters of the class-B output transistors to allow the opamp to fill the crossover gap.

author: fourfathom
author_rank: Super Contributor
timestamp: August 19, 2019, 04:05:32 pm
content: Quote from: Zero999 on August 19, 2019, 09:41:09 amYes, this would work better with a more powerful opamp, but I'll bet that it would noticeably improve this design as well. With a 100-Ohm resistor, the opamp only has to drive an additional 6mA (approx) before the transistor takes over. I don't have sim models for the TL082, but the spec sheet shows that it can sink/source this level of current within 3V of the supply/ground. Given the 10V supply here, that gives about 3.5VP-P output at the load, or 190mW power out (8 Ohm load).Tell me I'm wrong -- I can take it! It's just a fun problem.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: August 19, 2019, 05:53:51 pm
content: Quote from: Zero999 on August 17, 2019, 08:20:12 pmActually, it's class C because the output devices conduct for less than 180 degrees.Class B is exactly 180 degrees. Some of the lowest distortion amplifiers are class B.Class AB is more than 180 degrees. When everything else is optimally implemented, moving from class B to AB actually increases distortion because of gm-doubling.See page 55 of this PDF (page 35 of the book):https://www.desmith.net/NMdS/Data/Books%20and%20Manuals/Self%20-%20Audio%20Power%20Amp%20Design%20Handbook%204th%20Edn.pdfChapter 5 goes into much more detail - page 131 (109).For anyone with even a passing interest in audio, Douglas Self's works are well worth seeking out. As well as the power amp book, "Small Signal Audio Design" is also excellent

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2019, 06:50:52 pm
content: Quote from: fourfathom on August 19, 2019, 04:05:32 pmI've simulated it in LTSpice. The model for the TL072 is embedded in the file. the red trace is when R5 is 1G which is near enough open circuit and the blue trace is when R5 is 100R. It does soften the edges somewhat, but most of the crossover distortion is still there.Class B.asc(3.85 kB - downloaded 103 times.)Quote from: Mark Hennessy on August 19, 2019, 05:53:51 pmI'd say you're being a bit pedantic. Quoting the book..QuoteWhat is significant, is open to interpretation.One way of looking at it is, for large signals, where crossover distortion is less significant, it will be operating closer to class B (each device conducting for nearly 50% of the cycle) and for smaller signals, it will be closer to class C (each device conducting for much less than 50% of the cycle). I suppose if one really wants to be pedantic, they could say it's a class BC output stage.It is true that, the ideal mode of operation is class B, but is it actually possible to perfectly obtain class B? I doubt it. A compromise must be met, hence class AB.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: August 19, 2019, 07:57:53 pm
content: In the context of this circuit:QuoteIn other words, given that the crossover distortion is gross enough to be seen on a 'scope, that absolutely makes it class C - no ifs, no buts. If we were debating something that needed a distortion or spectrum analyser to distinguish, then yes, perhaps we might be in the pedantic zone...As you suggest, class AB is about avoiding the lesser of two evils (gm-doubling (AB) vs crossover distortion (C)). Pragmatic enough, especially if the rest of the design isn't all that clean...In a better amplifier, maintaining that exact bias point is worth doing, but is one of the harder things to get right. So much so that an entire chapter is devoted to it (chapter 13). For an EF stage, the quiescent voltage needs to be held to around 100mV, and for a CPF, it's 10mV (ballpark figures) - obviously very easy if these were simple fixed voltages, but of course these voltages must track the changes in output stage Vbe caused by temperature. It can be done, and Douglas Self has put many such designs into production - and I'm sure he's not the only one.

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2019, 09:05:38 pm
content: For completeness, here's the amplifier biased in class AB.