AGC - Automatic Gain Control

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

AGC - Automatic Gain Control

Post by steve » Tue Oct 16, 2012 7:10 pm

Audacity is not able to apply effects in real time while recording, but this plug-in provides an equivalent to AGC (Automatic Gain Control) when applied after recording.
The effect is similar to the AGC found on pocket recorders, camcorders and similar devices.
Note: It does not repair clipped audio. The original recording level still needs to be below 0 dB. What it does is to dynamically bring the recorded level up to 0 dB.

Controls:

AGC Strength: [0 to 100 %. Default 100 %] How much effect is applied. At 0% there is no effect.
Gain reaction speed: [0.5 to 10 seconds. Default 1.5] How quickly the gain reacts to changes in volume level.
Audio source filter: [Options: Music, Voice, Telephone. Default "Music"] Pre-filters the audio to reduce low rumble and high hiss. The "Music" setting is unfiltered (full spectrum).
Squelch threshold level: [-60 to -6 dB. Default -60 dB] Level at which "Squelch" is activated (see notes below).
Squelch attenuation: [-30 to 0 dB Default 0 dB] How much sound below the squelch threshold is attenuated (see notes below).


Difference between this effect and a "Dynamics Compressor":
  • The default settings are far more "aggressive" than you will find on most "compressor" effects.
  • Rather than pushing down the level of the loud parts, this effect pushes up the level of the quiet parts. Even though a conventional compressor may apply "make up gain", the overall effect is still not quite the same.
  • Typically a dynamics compressor will mostly affect peaks that are above a fairly high threshold, thus there is a lot more "effect" on loud parts than on quiet parts. This AGC plug-in affects all audio that is above a fairly low threshold, thus there is more "effect" on quiet parts than on loud parts.
Tips:
For evening out the level of multiple people talking, some loudly and some quietly, try a short "Gain reaction speed" of around 0.5 seconds.
For classical music, try a slow "Gain reaction speed", say around 6 seconds, and turn down to AGC strength (try around 50%).

Notes:
Squelch: "Noise Squelch" is a feature that is commonly found on walkie talkie radios to reduce or mute the noise level when no-one is talking. This plug-in includes two "Squelch" controls.

Squelch threshold level sets the level below which the "squelch" is activated. The default level is -60 dB, which is suitable for a high quality recording. For recordings that have a higher background noise level, best results will be achieved by increasing this control. If it is set too high it will prevent quiet sounds from being automatically amplified.

Squelch attenuation sets how strongly noise below the squelch threshold is muted. The default is 0 dB which does not "mute" audio below the threshold, but just limits how much it is amplified. For a stronger "noise gate" type effect, try moving this slider to the (-30 dB) minimum.

One problem that is inherent with AGC effects is that when the input goes quiet, the background noise level may be drastically boosted. To reduce this unwanted effect, increase the "Squelch" threshold (if necessary). Sound below the squelch threshold will be boosted less than audio above the threshold.

Tip:
If, when applied to a voice recording, some quiet voices are not being amplified, then either the Gain reaction speed is set too slow (try reducing it to 0.5 seconds) or the Squelch level is set too high.


Audio Source Filter
When set to "Music" there is no pre-filtering.

The "Voice" setting will filter out low booms, pops and rumbles, and high hiss before applying the automatic gain effect. This setting is recommended for voice recordings.

The "telephone" setting reduces more low and more high frequencies than the "Voice" filter. On high quality speech recordings it will probably remove too much, making voices sound "thin" and a bit "muffled". For low quality voice recordings it can help to reduce a lot of unwanted noise. This setting is recommended for telephone and other low quality voice recordings.
agc.ny
OBSOLETE VERSION
(2.45 KiB) Downloaded 1864 times
Latest Version of Automatic Gain Control.
Please read the additional notes in this post: viewtopic.php?p=337691#p337691
Last edited by steve on Wed Nov 22, 2017 3:10 pm, edited 5 times in total.
Reason: Marked for updating and moving to wiki
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AGC - Automatic Gain Control

Post by Gale Andrews » Wed Oct 17, 2012 2:17 am

Could something like this be what we need to displace the "Leveller" effect?

I didn't find the "Squelch attenuation" control made much difference with the material I tried, only the "Squelch threshold". Would it be less fiddly to not have that attenuation control (just set attenuation quite high) or only have a few choices for it, instead of a slider?



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AGC - Automatic Gain Control

Post by steve » Wed Oct 17, 2012 3:14 am

My one reservation about removing the Leveller effect is that it is the only "Distortion" effect that is shipped with Audacity.

Personally I find the Leveller effect pretty useless for "evening out the volume", but it can come in useful as a distortion effect, especially as it is the only distortion effect that is included (even if it is only a distortion effect by accident).

As a "volume levelling" effect I think this AGC plug-in does a reasonable job, but it does not provide a "distortion" effect, In fact this plug-in has extremely low harmonic distortion.

With some material the Squelch attenuation can have a huge effect.
You will not tend to notice it much unless the peak signal level stays below the squelch threshold for at least as long as the "Gain Reaction Speed".

I agree that the Squelch settings are a bit fiddly, but they can make a lot of difference. The problem is that we don't know how bad the recordings are. For relatively good recordings it is quite easy to set the squelch level and you probably don't need the squelch attenuation. For really bad recordings they are harder to set, but make a bigger improvement when set correctly.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AGC - Automatic Gain Control

Post by steve » Wed Oct 17, 2012 3:46 am

Here's a bad recording:
bad-recording.wav
(273.95 KiB) Downloaded 517 times
Try AGC with default settings and you will notice that the "background" noise is greatly amplified.

The "background noise peak level is around -20 dB, so set the Squelch to -18 dB (a little above the noise floor).
The background noise is not amplified as much.

Now set the Squelch attenuation to -30 dB.
The background noise is virtually silenced until the gain starts rising for the start of the music.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AGC - Automatic Gain Control

Post by steve » Wed Oct 17, 2012 5:16 am

In this version I've attempted to combine both "squelch" functions into one slider.
I've assumed that the higher the squelch level, the greater the required muting.
Attachments
agc.ny
(2.48 KiB) Downloaded 741 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Thunderbolt1000T
Posts: 101
Joined: Sun Apr 25, 2010 8:43 pm
Operating System: Please select

Re: AGC - Automatic Gain Control

Post by Thunderbolt1000T » Thu Nov 01, 2012 2:37 am

This plugin runs uber slow in Audacity 2.0.2. Chriss Capel's compressor runs at least 10 times faster, and I'm not exagerating. Any idea why?

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: AGC - Automatic Gain Control

Post by steve » Thu Nov 01, 2012 2:39 am

Thunderbolt1000T wrote:This plugin runs uber slow in Audacity 2.0.2. Chriss Capel's compressor runs at least 10 times faster, and I'm not exagerating. Any idea why?
That's strange. On my machine this plug-in runs a bit faster than Chriss Capel's compressor.
What sort of machine are you on?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Thunderbolt1000T
Posts: 101
Joined: Sun Apr 25, 2010 8:43 pm
Operating System: Please select

Re: AGC - Automatic Gain Control

Post by Thunderbolt1000T » Thu Nov 01, 2012 2:49 am

It has nothing to do with my machine, since I don't have this problem running similar effects such as compressor, SC4, etc. This plugin is just uber slow.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AGC - Automatic Gain Control

Post by Gale Andrews » Thu Nov 01, 2012 2:59 am

steve wrote:My one reservation about removing the Leveller effect is that it is the only "Distortion" effect that is shipped with Audacity.

Personally I find the Leveller effect pretty useless for "evening out the volume", but it can come in useful as a distortion effect, especially as it is the only distortion effect that is included (even if it is only a distortion effect by accident).

As a "volume levelling" effect I think this AGC plug-in does a reasonable job, but it does not provide a "distortion" effect, In fact this plug-in has extremely low harmonic distortion.
Well I suppose you could add a distortion control if that's what is needed...


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: AGC - Automatic Gain Control

Post by Gale Andrews » Thu Nov 01, 2012 3:02 am

steve wrote:
Thunderbolt1000T wrote:This plugin runs uber slow in Audacity 2.0.2. Chriss Capel's compressor runs at least 10 times faster, and I'm not exagerating. Any idea why?
That's strange. On my machine this plug-in runs a bit faster than Chriss Capel's compressor.
What sort of machine are you on?
Thunderbol1000T was on Windows XP a while ago.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply