Author Topic: Audio Level Limiter - almost good  (Read 1662 times)

0 Members and 1 Guest are viewing this topic.

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Audio Level Limiter - almost good
« on: October 23, 2021, 05:17:48 pm »
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.html

It 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
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7949
  • Country: us
  • Retired, now restoring antique test equipment
Re: Audio Level Limiter - almost good
« Reply #1 on: October 23, 2021, 05:34:16 pm »
The 47 k resistors feeding the 20 nF total capacitance before the 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.
 
The following users thanked this post: PeLa

Offline eblc1388

  • Frequent Contributor
  • **
  • Posts: 394
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #2 on: October 23, 2021, 05:37:56 pm »
Is there anything obvious that I am missing?

Yes. 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. 
« Last Edit: October 23, 2021, 05:42:38 pm by eblc1388 »
 
The following users thanked this post: PeLa

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7949
  • Country: us
  • Retired, now restoring antique test equipment
Re: Audio Level Limiter - almost good
« Reply #3 on: October 23, 2021, 05:40:23 pm »
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.
« Last Edit: October 23, 2021, 05:42:25 pm by TimFox »
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #4 on: October 23, 2021, 05:55:31 pm »
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?
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #5 on: October 23, 2021, 05:58:47 pm »
The 0R resistor connecting R12 to GND is DNP (do not populate), i.e. the third pin of the potentiometer is not connected.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7733
  • Country: ca
Re: Audio Level Limiter - almost good
« Reply #6 on: October 23, 2021, 05:59:27 pm »
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.
 
The following users thanked this post: PeLa

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #7 on: October 23, 2021, 06:01:41 pm »
I am using 1000uF caps as output because I don't know any better.  Thank you for the hint, eblc1388!
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #8 on: October 23, 2021, 06:04:56 pm »
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.

Unfortunately 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?
 

Offline Paul Ed

  • Contributor
  • Posts: 33
  • Country: gb
  • …try, for who knows what is possible? —M. Faraday
Re: Audio Level Limiter - almost good
« Reply #9 on: October 23, 2021, 06:06:46 pm »
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 invitation  :)
 Oh, 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.
« Last Edit: October 23, 2021, 06:10:28 pm by Paul Ed »
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #10 on: October 23, 2021, 06:09:40 pm »
Paul, that is super interesting! Thank you for posting! If you could provide that circuit I would be over the moon!
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7949
  • Country: us
  • Retired, now restoring antique test equipment
Re: Audio Level Limiter - almost good
« Reply #11 on: October 23, 2021, 06:10:40 pm »
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?

The 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.
« Last Edit: October 23, 2021, 06:22:53 pm by TimFox »
 
The following users thanked this post: PeLa

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #12 on: October 23, 2021, 06:17:51 pm »
The network as drawn, 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.  With the pot connected as a two-terminal resistor, it is a variable resistance into pin 9 of U3C, which is a virtual ground.  Its value as set will affect both the frequency response and the control gain. 

Thank 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.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7949
  • Country: us
  • Retired, now restoring antique test equipment
Re: Audio Level Limiter - almost good
« Reply #13 on: October 23, 2021, 06:23:40 pm »
Please note a modification to my last post that I entered while you made this reply.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14466
  • Country: fr
Re: Audio Level Limiter - almost good
« Reply #14 on: October 23, 2021, 06:24:47 pm »
Note that LDRs have parasitic capacitance. Unfortunately, the datasheet for the ones you're using (NORPS-12)  is very sparse.
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #15 on: October 23, 2021, 06:31:05 pm »
Note that LDRs have parasitic capacitance. Unfortunately, the datasheet for the ones you're using (NORPS-12)  is very sparse.

I measured 10pF in the dark using an LCR meter.
 

Offline Paul Ed

  • Contributor
  • Posts: 33
  • Country: gb
  • …try, for who knows what is possible? —M. Faraday
Re: Audio Level Limiter - almost good
« Reply #16 on: October 23, 2021, 06:33:00 pm »
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.

Paul, that is super interesting! Thank you for posting! If you could provide that circuit I would be over the moon!

Please 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).

1305596-0

1305602-1

* autoattenuatorbufferamplifier.asc (8.1 kB - downloaded 37 times.)
 
The following users thanked this post: PeLa

Online TimFox

  • Super Contributor
  • ***
  • Posts: 7949
  • Country: us
  • Retired, now restoring antique test equipment
Re: Audio Level Limiter - almost good
« Reply #17 on: October 23, 2021, 06:34:46 pm »
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.
 
The following users thanked this post: PeLa

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #18 on: October 23, 2021, 06:38:57 pm »
The 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.

That makes sense. I will change it to 1nF.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Audio Level Limiter - almost good
« Reply #19 on: October 23, 2021, 06:41:29 pm »
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).
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7733
  • Country: ca
Re: Audio Level Limiter - almost good
« Reply #20 on: October 23, 2021, 06:48:59 pm »
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.pdf
Though 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-29

A stereo version which includes common gain between both channels with PCB: https://pira.cz/hlimste.htm


 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: Audio Level Limiter - almost good
« Reply #21 on: October 23, 2021, 06:49:41 pm »
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.
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #22 on: October 23, 2021, 06:52:26 pm »
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.

Thank you so much! That is really helpful. I will try that design in parallel and play around with it on LTSpice:)
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #23 on: October 23, 2021, 06:54:57 pm »
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).

I haven't actually. But I will. I did not think to look for an integrated solution. Thanks for the hint!
 

Offline PeLaTopic starter

  • Contributor
  • Posts: 38
  • Country: gb
Re: Audio Level Limiter - almost good
« Reply #24 on: October 23, 2021, 07:12:00 pm »
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.


I 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.


If you want a high quality 2 slope audio compressor, look here: http://www.thatcorp.com/datashts/dn05.pdf
Though 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-29

A stereo version which includes common gain between both channels with PCB: https://pira.cz/hlimste.htm


Oh 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!
« Last Edit: October 23, 2021, 07:14:44 pm by PeLa »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf