Simple AGC for audio - preferably SMD - Page 1
Forum section: electronics / projects

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 06, 2022, 04:25:54 pm
content: Am playing about with some pantry AM transmitters. Getting the best out of them requires a fairly constant input level to modulate the RF - that apparent compression not being much of an issue on AM.The audio feed is a low level - a few hundred mV RMS (generally line level sources), but obviously subject to content.What I want is a simple AGC that will deliver a pretty much constant 200mV output. Low distortion required, else I will trade the problem I have now (over-modulation creating distortion) for another.Ideally I'd like to make it SMD due to space. Power is single rail 9V, but circuit can include 78L05 or similar. Audio ground will be same as battery and circuit ground.I've looked at companders (like NE57x range) but these don't quite tick the box.I'm thinking a FET acting as a voltage-controlled resistor feeding an op-amp?Thank you.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 06, 2022, 06:18:38 pm
content: A typical, low-cost integrated solution is something like the MAX9814.As with most other semiconductors these days, availability is questionable. But if you wanna experiment with it, there are breakout boards available for cheap on Aliexpress, eBay and probably elsewhere.

author: Benta
author_rank: Super Contributor
timestamp: May 06, 2022, 07:03:26 pm
content: Quote from: 6SN7WGTB on May 06, 2022, 04:25:54 pmWhy not? The NE570/572 would fit exactly to my mind. Playing around with a FET won't be any better.

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 06, 2022, 07:25:17 pm
content: Perhaps I am missing something, but the companders apply some limiting and some expansion, but don't actually hold at a desired level?

author: TimFox
author_rank: Super Contributor
timestamp: May 06, 2022, 07:51:48 pm
content: A compander is a direct (instantaneous) mapping from input to output.A compressor usually has an attack and decay time included.You can't hold the audio input to an AM transmitterliterallyconstant, but radio stations do compress the dynamic range, usually by decreasing the gain at high signal levels.

author: Benta
author_rank: Super Contributor
timestamp: May 06, 2022, 07:57:47 pm
content: Quote from: 6SN7WGTB on May 06, 2022, 07:25:17 pmYou specified "low distortion required". That leaves clipping out, yes?Which leaves compression: detecting peak level and using that to control an AGC.This is exactly what the NE/SA572 does. No one is saying that you need to use the expander as well. It can be used solely as a compressor. The compression factor can be set to your wishes.And I'm quite certain it will do itmuchbetter than your FET. It's what it was built for.

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 06, 2022, 07:58:49 pm
content: Yes, you're right, I perhaps worded my reply badly. Of course the processed audio won't be 100% flat else it will be a very odd experience.What I should have said was that I do need a hard limit on upper level to prevent over-modulation, and the compression won't do that?Equally I don't want just a limiter. else the quiet stuff will be lost/RF will be wasted.However, I'm no expert, hence the reason for my post...

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 06, 2022, 08:00:35 pm
content: Quote from: Benta on May 06, 2022, 07:57:47 pmIndeed, as I need the audio I can't go for the sort of hard clipping one might use for driving disco lights or similar.OK, will take another look at the NE/SA572.

author: Benta
author_rank: Super Contributor
timestamp: May 06, 2022, 08:10:02 pm
content: There are a lot of permutations here, but nothing stops you from combining compression with "soft" clipping.As an example, set the nominal output voltage from the compressor at 100 mv (-6 dB). Then start soft clipping at ~180 mV using a FET or whatever. That would ensure good sound quality without the risk of over-modulating.

author: TimFox
author_rank: Super Contributor
timestamp: May 06, 2022, 08:53:03 pm
content: In professional broadcasting, where there are legal limits on over-modulation, it is common to use a compressor (so that teenagers do not suffer from dynamic range with their boomety-boom) and a limiter (to avoid illegal modulation).

author: Benta
author_rank: Super Contributor
timestamp: May 06, 2022, 09:03:38 pm
content: Quote from: TimFox on May 06, 2022, 08:53:03 pmIt's actually quite the reverse.In professional broadcasting, a lot of care is taken to provide best audio quality... meaning no compression and full dynamic rate transmitted.Over-modulation is not possible.Where compression happens is during the commercial spots. This makes the spot overly load and penetrating, as more audible power (in the same transmission envelope) can be modulated.Peak modulation power (or frequency excursion in FM) is always the same.

author: TimFox
author_rank: Super Contributor
timestamp: May 06, 2022, 09:21:05 pm
content: When my local high-quality classical FM station goes on a two-week fundraising period (something unknown in Europe), I switch to my CD collection and am reminded how much more dynamic range there is in classical CDs.Over-modulation is always possible, depending on the audio source and the system gain. With only digital sources, the maximum output level should be well-determined, but I remember college broadcasting from LPs.

author: Benta
author_rank: Super Contributor
timestamp: May 06, 2022, 09:35:49 pm
content: Quote from: TimFox on May 06, 2022, 09:21:05 pmYou're waffling instead of just saying "this time perhaps I'm not right and someone else is".Over-modulation is never possible, this would give the AM or FM transmitter power stage major problems.Enjoy your CD collection.

author: TimFox
author_rank: Super Contributor
timestamp: May 06, 2022, 10:24:46 pm
content: Nonsense. You should be more careful with the word "never".The FCCrequiresa limiter before an FM transmitter to avoid overmodulation.With an FM transmitter, over-driving the transmitter will produce illegal frequency deviation, but have no effect on the power stage.Limiting the input to an FM transmitter is very important, since modern US FM transmissions include the multiplexed-stereo signal and an "HD" or hybrid-digital subchannel as well as the baseband, and the peak levels of the total waveform are what cause overmodulation.With an AM transmitter, over-driving may cause the output stage problems on the positive peaks, and the negative peaks will give substantial distortion due to clipping.Whatever can go wrong, will go wrong, and over-driving something is rarely a good idea.(In my experience with AM broadcasting, we kept a simple CRO on the RF output to see the "dashes" caused by negative overmodulation.)Since overmodulation is possible, yet bad, radio stations employ peak limiters to avoid it. They may also compress the signal to reduce the dynamic range to cope with SNR problems.

author: boB
author_rank: Frequent Contributor
timestamp: May 06, 2022, 10:38:00 pm
content: Check out parts from THAT Corp.Log amp and VCA will do the trick in addition to an op-amp or two.They may (they used to) also have both in a single package but haven't looked at their SMT offerings since I used to design in their parts around 30 years ago...http://thatcorp.com/THAT_Dynamics_Processing_ICs.shtmlboB 🌜

author: CaptDon
author_rank: Super Contributor
timestamp: May 07, 2022, 12:43:15 am
content: O.P., you then mention "But I don't want the soft parts to be missing" or what ever. Can you say 'COMPANDER"?? It will compress on the peaks and expand the quieter parts!!! In A.M. broadcasting we had the much sought after C.B.S. Laboratories 'Level Devils' the Volumax and its mate. The one device acted like an operator with his hand on the volume control always shooting for that 0Vu 100% modulation and had a slower response time. It could EXPAND or REDUCE much like a volume control with a careful hand. The mate which I think was called Audimax would push some limiting and compression on peaks. In A.M. the F.C.C. allows something like 110% or 115% positive peaks but never more than 100% negative peaks where the carrier cuts off. Some of the transmitters even had sort of a keep-alive circuit that NEVER allowed the carrier to cut off although the negative audio peaks started to look and sound a bit weird. Prior to the Orban Optimod A.M. which could do all kinds of magic including independent audio band limiting we would use the strongest vacuum tube on the side of the modulator that produced a rise in R.F. final plate voltage and a weaker tube on the side of the modulator responsible for downward R.F. final plate voltage. We were getting 105% forward with 99% negative modulation on our R.C.A. BTA-5 20 years before Gates/Harris did it with PWM in the MW-5 series. Those sought after level devils and Orban Optimods still sell for thousands of bucks today as does the much sought after LA-4A limiter. I suggest you look for a DBX-160 limiter/compressor or the stereo Phonic PCL-3200. They are limiters but you will like their effect when adjusted properly!!! I use the Phonic ahead of a wireless uplink to prevent clipping of the wireless FM bandpass and clipping in the receiver which feeds a local CATV head end. Cheers mate!

author: David Hess
author_rank: Super Contributor
timestamp: May 07, 2022, 02:15:15 am
content: Quote from: 6SN7WGTB on May 06, 2022, 04:25:54 pmAn FET can work as the gain control element. If necessary a pair of identical FETs can be used in a feedback circuit to compensate for the non-linearity of the gain control signal but that should not be necessary. Resistive feedback from the drain to the gate can cancel drain non-linearity reducing distortion.A more modern solution is to use something like an LM13700 or LT1228 operational transconductance amplifier. Beyond that there are a number of 2 and 4 quadrant analog multipliers which are suitable like the AD633.

author: Buriedcode
author_rank: Super Contributor
timestamp: May 07, 2022, 02:32:51 am
content: As a compromise between functionality and fidelity, you could look at compressors used for guitar. Plenty of schematics for compressors/limiters about, some based on JEFT, others LM13700 (or some other operational transconductance amp). Some of the more extreme ones can give a pretty consistent output level for large inputs - not particularly usable for guitar, but a good limiter without clipping.

author: boB
author_rank: Frequent Contributor
timestamp: May 07, 2022, 04:21:58 am
content: Then again, you can use a light bulb or LED and a photo sensitive resistor in a closed box.boB 🌜

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 07, 2022, 08:37:24 am
content: All fascinating stuff, but as I started out with, this is a very lower power pantry transmitter that is being used to feed vintage radio.I need something super small (already have the Tx built), low current (PP3 battery supply, Tx using 15mA) and clearly not of broadcast quality. Although AM broadcast quality I thought was indeed quite compressed and frequency limited, but I’m not a broadcaster.From what I’m reading a compander/or would appear suitable. Good enough for Government work as they say.I don’t have the experience to design from first principles, so if anyone could point me to a schematic that is in the right ball park, I can modify it suitably. I have looked at some NEC data sheets but couldn’t see enough detail.Hope I’m not appearing as “just tell me the answer” since I’m prepared to experiment/modify once I’m on the right track.

author: Terry Bites
author_rank: Super Contributor
timestamp: May 07, 2022, 01:12:54 pm
content: How about a SSM2167 compressor limmiter with noise gating all in one?A THAT4301/5 is a multiputpose AGC/ compressor/expander. BTW That corp. Has many interesing app notes on this subject.

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 07, 2022, 05:29:41 pm
content: Thanks. The SSM2167 looks very interesting, and single rail. Perfect voltage, low current, and the downward expander to suppress noise might be a nice to have here.I think that 4301/5 is dual rail which won't work here.It did occur to me that with the sort of RMS limit I want - ca. 300mV, a pair of back-to-back 1N4148s would offer crude soft-ish clipping. Tried them on the 'scope and it looks quite promising for the lo-fi application I have.Might try that 'chinagraph pencil' approach before trying to design the pen that works underwater...

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 07, 2022, 05:38:41 pm
content: If it's "lo-fi" as I suspected, why not consider the MAX9814 (or something similar) as I suggested? It's dirt cheap and with 0.04% THD+N, I guess it should be adequate. It's marketed as a microphone AGC, but no reason you can't use that for any kind of signal as long as it's within specs. But maybe there's some spec that doesn't meet your requirements.The THAT parts are very good, but meant for professional audio gear.

author: 6SN7WGTB
author_rank: Regular Contributor
timestamp: May 07, 2022, 07:14:54 pm
content: Yes, certainly a valid option.Having perused the datasheets I think the SSM2167 gets my vote as it appears to offer lower overall gain, noise floor expander, doesn't have the unnecessary complexity of the MIC bias, appears more easily configurable (noise gate, gain, compression, etc.) and the application note is more comprehensible to me at least.I think I stand a better chance of producing a working circuit with it.Thanks to all for a very illuminating set of options that I simply would not have found under my own steam.

author: BrianHG
author_rank: Super Contributor
timestamp: May 08, 2022, 12:57:42 am
content: Here you go, some example circuits:https://www.eevblog.com/forum/projects/audio-level-limiter-almost-good/msg3766358/#msg3766358Note that all the components that these are built with are available in SMD.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 08, 2022, 01:47:50 am
content: Quote from: 6SN7WGTB on May 07, 2022, 07:14:54 pmThe SSM2167 is probably more flexible and a good choice here. It's interesting to note that the stated THD+N for the Maxim part is much lower than that of the SSM2167. Wondering if those figures are realistic or if Maxim is leading us on here. =)