Audio Level Limiter - almost good - Page 1
Forum section: electronics / projects

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 05:17:48 pm
content: Hi there,I find that many movies have a too large volume range in their audio output, i.e. one minute someone is whispering and I have to increase the volume, the next minute there is an explosion that wakes up the kids and I have to turn down the volume. To automate that process, I found a circuit for an audio level limiter on the net:http://stefanfrings.de/audio_limiter/index.htmlIt is designed to take a line input and attenuate the output, which then gets fed into a decent amplifier.I took that circuit and modified it only slightly (mainly the supply). It totally works but, compared with the unattenuated signal, the audio quality is not the greatest. I cannot hear any clipping or obvious distortion (currently building a tone generator to measure it). But I think the frequency response has a dip in the middle. The frequencies relevant for speech seem more attenuated than the low or high end.Is there anything obvious that I am missing?Cheers,Pete

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2021, 05:34:16 pm
content: The 47 k resistors feeding the 20 nF total capacitancebeforethe active rectifier circuit gives a low-pass network with a pole at 170 Hz, so a large part of the audio spectrum is not measured by the rectifier. If the program involves only speech frequencies without low frequency content, the control response will be different from that with a wider frequency range musical content.Quibble: in technical English, a "limiter" gives a hard limit to the instantaneous output voltage, as in the units required to avoid overmodulation in a broadcast FM transmitter.A "compressor" is slower and adjusts the gain to reduce the dynamic range.

author: eblc1388
author_rank: Frequent Contributor
timestamp: October 23, 2021, 05:37:56 pm
content: Quote from: PeLa on October 23, 2021, 05:17:48 pmYes. The R12 50K POT feeding to the op amp precision rectifier should not have one end connected to GND. Removes the zero ohm jumper resistor.Why are you using 1000uF capacitors at the outputs of the opamps? 10uF will be perfectly large enough value for this application.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2021, 05:40:23 pm
content: Yes, that connection of R12 puts 0 V (not Vref) at the rectifier input. The pot should go to Vref to keep the DC bias correct.Personally, I prefer split power supplies on audio systems to avoid problems such as these, but the trend in this millenium is to single supplies.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 05:55:31 pm
content: Thank you for the reply! You do have a point, TimFox.The comment from the original author of this circuit on that is:"The two output signals are mixed to a mono signal via the 10nF and 100nF capacitors. The pass frequency band is 500-5000Hz. The human ear senses Volume mainly in this area, hence only this band is used for regulation."In my circuit only one fo the two 10nF caps is populated (the other one is marked DNP for "do not populate"), hence the capacitance is not 20nF but 10nF, which should cut off at 340Hz (not 500 Hz as in the quote above). I will play around with that value. But I still think that this should not influence the frequency response. Am I wrong? I am not worried about too much or too little attenuation at this point.I was thinking that maybe I used the wrong type of input and output filter caps around U3A and U3B or something? I used electrolytic caps as output caps and PET film caps as input caps. Do they seem to be the right values and types?

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 05:58:47 pm
content: The 0R resistor connecting R12 to GND is DNP (do not populate), i.e. the third pin of the potentiometer is not connected.

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2021, 05:59:27 pm
content: If you are using a Windows PC for your source audio, they have an excellent audio limiter built in which looks ahead and can be tuned to be ultra fast responding. The best for movies and especially Youtube making everything 1 consistent volume in the high speed setting.The setting is located in Speaker Properties, Enhancement tab, 'Loudness Equalization'.Under settings, configure the 'Release Time' to the short setting and your movies and TV speech will be the same volume as the music and background effects.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:01:41 pm
content: I am using 1000uF caps as output because I don't know any better. Thank you for the hint, eblc1388!

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:04:56 pm
content: Quote from: BrianHG on October 23, 2021, 05:59:27 pmUnfortunately the audio signal source is not a PC. I used to limit the signal using a mixer and compressor until the compressor let the magic smoke out, so I thought why not try and use this circuit. How hard could it possibly be?

author: Paul Ed
author_rank: Contributor
timestamp: October 23, 2021, 06:06:46 pm
content: Hi Pete,Not wishing to de-rail your thread but wondered if this is of interest:I built what I call an auto-attenuator to do exactly what you describe - keep audio levels to a more uniform range - this is used with a home-made hearing aid inductive loop system for my (97 years old) mother-in-law so she can hear and enjoy her TV (and DvD etc. too).Note I didn't design the auto-attenuator but used a circuit by Alan Wolke (W2AEW) a member of this forum - and then added what I call a "buffer amplifier" to restore the signal suitable for input to a TDA3116D2 based class D audio amplifier which then uses a cable-loop around her lounge as it's output (but I initially tested it using my home HiFi and like it enough that when a round tuit is available I'll build one for us, too).Simulation using LTspice was used to tweak things (mainly the buffer amp) but it works on the entire audio band (it's capable of 40Hz through 50KHz+ , but for hearing aid use we only need 100Hz-20KHz really, but I found this happened naturally (presumably by her hearing aids) so I didn't actually include the bandwidth limiting in the circuit in use currently.This works very well indeed - and I can provide the circuit I'm using if this is of interest, but don't with to de-rail this thread by posting more than this without invitationOh, I'm just putting together a semi-portable system so when she's staying with others away from home it can simply be plugged into their TV etc. as she now misses it when it's not available - it is usually used in parallel to the existing sound system, so those with hearing can adjust their sound but the inductive loop system, with this auto-attenuator and buffer amp, is set independently to her preferred volume.Kr, Paul.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:09:40 pm
content: Paul, that is super interesting! Thank you for posting! If you could provide that circuit I would be over the moon!

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2021, 06:10:40 pm
content: Quote from: PeLa on October 23, 2021, 05:55:31 pmThe network as drawn in your figure, with the DNPs omitted, will not have the 500 to 5000 Hz response quoted. The 47k and 10 nF capacitor has a low-pass at 340 Hz, not 5 kHz. Considering the derived mono signal, it will have an output resistance of 23.5 k, increasing the low-pass frequency to 680 Hz with the single 10 nF capacitor for filtering the mono signal. With the pot connected as a two-terminal resistor, as in the original German article, it is a variable resistance into pin 9 of U3C, which is a virtual ground. Its value will affect both the frequency response and gain of the control. The 47 k and 10 nF values are in the original article, but look like a power of 10 was done in error.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:17:51 pm
content: Quote from: TimFox on October 23, 2021, 06:10:40 pmThank you for pointing that out. I can see it now. The idea was indeed to change gain rather than frequency response. I'll connect it to VRef. I don't see a reason for needing to adjust the frequency response.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2021, 06:23:40 pm
content: Please note a modification to my last post that I entered while you made this reply.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 23, 2021, 06:24:47 pm
content: Note that LDRs have parasitic capacitance. Unfortunately, the datasheet for the ones you're using (NORPS-12) is very sparse.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:31:05 pm
content: Quote from: SiliconWizard on October 23, 2021, 06:24:47 pmI measured 10pF in the dark using an LCR meter.

author: Paul Ed
author_rank: Contributor
timestamp: October 23, 2021, 06:33:00 pm
content: Hi Pete,Here are the circuit I've used, the Bode plot showing frequency response (confirmed with sig-gen and 'scope) and the LTspice source.Quote from: PeLa on October 23, 2021, 06:09:40 pmPlease bear with me - I've not tried to post attachements before, so may make a pigs ear of doing this (just say if it doesn't work for you).autoattenuatorbufferamplifier.asc(8.1 kB - downloaded 63 times.)

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2021, 06:34:46 pm
content: Another important parameter for LDRs is the response time of the resistance value to light-level variation: depending on material and light level, this is typically 30 or 50 ms, but is not directly related to the parasitic capacitance. It can be exploited in audio gain systems to avoid jerky or too quick variations in attenuation.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:38:57 pm
content: Quote from: TimFox on October 23, 2021, 06:10:40 pmThat makes sense. I will change it to 1nF.

author: Benta
author_rank: Super Contributor
timestamp: October 23, 2021, 06:41:29 pm
content: Have you taken a look st the classic NE570 from onsemi?Somewhat simpler, I'd say, and you have the option of attack/decay control.LDRs are generally problematic to source due to the cadmium content (RoHS).

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2021, 06:48:59 pm
content: C7 and C10 should be at least 1uf for some bass, if not 10uf if you want low subsonic frequency support.The 2 output C? caps at 1000uf should also be the same as the input DC filter caps C7 & C10.Because of your DC supply issue, the + side of those caps should face the opamps.There are slightly more pricey opamps/limiter circuits which do not require the photo-resistors to work and use half the circuits.If you want a high quality 2 slope audio compressor, look here:http://www.thatcorp.com/datashts/dn05.pdfThough you need 2 of them for stereo and they are pricey at ~5$ each.Another cheaper VCA solution using a JFET instead of photo-resistors:https://sound-au.com/project67.htm(Circuit 2 with opamps)Or, with PCB:https://www.circuitlib.com/index.php/projects/product/108-simple-compressor-limiter/category_pathway-29A stereo version which includes common gain between both channels with PCB:https://pira.cz/hlimste.htm

author: ejeffrey
author_rank: Super Contributor
timestamp: October 23, 2021, 06:49:41 pm
content: One thing to consider, most consumer AV receivers have DSP based compression built in. Usually with some brand specific term and value description that may not actually say "compression" due to the bad reputation of overly compressed music recordings. If you have such a receiver that will be easier and likely perform better than an analog compression circuit.

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:52:26 pm
content: Quote from: Paul Ed on October 23, 2021, 06:33:00 pmThank you so much! That is really helpful. I will try that design in parallel and play around with it on LTSpice:)

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 06:54:57 pm
content: Quote from: Benta on October 23, 2021, 06:41:29 pmI haven't actually. But I will. I did not think to look for an integrated solution. Thanks for the hint!

author: PeLa
author_rank: Contributor
timestamp: October 23, 2021, 07:12:00 pm
content: Quote from: BrianHG on October 23, 2021, 06:48:59 pmI will try and change those 4 caps to 10uF and start reading through the compressor circuit that you have posted. These 4 caps were indeed my prime suspects. Thank you!Intuitively, having the same value caps makes significantly more sense than having different values for the input and output caps. My understanding is that you would use electrolytic caps here.Quote from: BrianHG on October 23, 2021, 06:48:59 pmOh wow! That will be a busy weekend. I will have a good look at the gems that you have posted there!Thank you so much for your help!