Peak Limiter

Archive of Nyquist Plug-ins.
Many of the plug-ins here will be available on the Audacity Wiki.

This Forum is an archive of old topics concerning Nyquist plug-ins.

Feedback and questions relating to topics may be posted, but please

New plug-ins may be posted on the New Plug-Ins board.
Other posts relating to Nyquist should be posted to the main Nyquist board.

The main repository for Audacity/Nyquist Plug-ins is on the Audacity Wiki.

Re: Peak Limiter

Permanent link to this post Posted by steve » Sun Dec 09, 2012 4:37 pm

dietermoreno: Thanks for the feedback. Glad you like it.

Robert J. H. wrote: (on a 16-bit track)
... <snip> ...
The value changes randomly between -1.0000... and -0.999969482421875
For the positive case, the value is always 0.999969482421875
Any idea what's behind this?

As you surmised, this is due to dither.
I don't recall the exact details but I remember seeing in the Audacity code that sample values of +/- 1 are dealt with as a special case when dither is applied.
Because +/- 1 represents the most positive and most negative values it is not possible to randomise the values in the same way as is done with other sample values. In practice this is unimportant because normal undistorted audio should never reach these values for more than the occasional sample and for "scientific analysis" 32 bit float should probably be used for greater accuracy and to avoid issues with dither.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Site Admin
Posts: 44466
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Peak Limiter

Permanent link to this post Posted by steve » Thu Jul 17, 2014 12:55 am

I've reworked this limiter effect and (hopefully) made some improvements.

brickwall.png (25.34 KiB) Viewed 2451 times

As shown in the above image, I've added a control for setting the level that the audio will be limited to. In the previous version this was fixed at 0 dB.


  • Input Gain (dB) mono/Left: [0 to +10 dB. Default 0 dB] Applies gain to (amplifies) the selected audio prior to limiting. If a stereo track is selected, this amplifies the left channel. If a mono track is selected, this amplifies the selected audio.
  • Input Gain (dB) Right channel: [0 to +10 dB. Default 0 dB] Same as the previous control but for the right channel of stereo tracks only. If a mono track is selected this control does nothing.
  • Hold (ms): [1 to 100 milliseconds. Default 10 milliseconds] This control tells the limiter to keep the gain down at the "limited" level for a minimum length of time before allowing it to rise back up to the normal level. Smaller values cause the limiter to react more rapidly to changes in the audio level and larger values cause the limiter to react more gradually. Even with slow (long) settings, sudden peaks will be prevented from exceeding the threshold because the limiter is able to start changing the gain in anticipation of the peak (lookahead). The amount of lookahead is set automatically to ensure that peaks will never exceed the limit level.
  • Limit to (dB): [-10 to 0 dB. Default -0.1 dB] This is the maximum peak level that is allowed. Peaks beyond this level are amplified (attenuated) to this level.


This effect should not be confused with "clipping" effects that chop off high peaks. The term "brick wall" indicates that audio is limited to an absolute level that cannot be exceeded. The effect is closely related to "dynamic compressor" effects, but has very fast attack and release times.

The separate Left/Right gain controls can be useful for balancing the stereo positioning.
Stereo tracks that have very different audio in left and right channels may sound "out of balance" even if they have the same peak levels. This can occur due to one channel having a greater RMS level than the other (even if the peak levels are the same). Applying a little gain to the quieter side can help to correct such an imbalance while simultaneously preventing the peak level from exceeding 0 dB, thus preventing clipping.

The gain controls may also be used creatively for creating extreme compression effects. This may be useful for treating drum tracks, or after using a dynamic range compressor for creating extreme loudness maximizing. Note that extreme use of a limiter effect is likely to create audible artefacts in addition to increasing the loudness.

Holding the gain before releasing helps to avoid audible distortion.
This is particularly true when dealing with low bass. If the limiter responds too rapidly, then low bass frequencies will become distorted due to the limiter acting on individual waveform crests and troughs. On the other hand, short 'Hold' times cause the limiter to act more precisely on the position of the peaks and so not affecting surrounding audio. The default of 10 ms should be about right when applying a modest amount of limiting, but may need to be increased if used more aggressively or applied to mixes that have a lot of bass content.

When applied to single instruments, very short Hold times can be used to make percussive sounds brighter or more aggressive.
Longer Hold times tend to be 'softer' and retain more dynamic detail.

Limiting to 0 dB is good for your speakers (and ears).
The 32 bit float format used by default in Audacity supports audio over 0 dB, however, sound cards don't. If the track audio is over 0 dB it will be clipped on playback even if perfectly formed in 32 bit float format. Clipping creates harsh overtones, which in extreme cases can overload the tweeters in speakers causing their premature demise. Two possible solutions to this problem are:
1) Amplify or Normalize to a lower level so that peaks do not exceed 0 dB.
2) Leave the overall level as is, but lower the level of peaks so that they do not exceed 0 dB.

This plug-in can correctly handle signals that are over 0 dB (assuming the track is 32 bit float format) and limit the peaks to a safe level without clipping.
Even if you want the recording to be as loud as possible, it is generally a good idea to allow at least some amount of headroom. The default limit level is -0.1 dB, which is very close to the absolute limit for "valid" audio data.

To limit over 0 dB peaks without changing the gain of "valid" audio and with minimal distortion, use the default settings of 0dB gain (left and right) and the "Limit to" level to -0.1 dB.

Usage Notes:

MP3 encoding can cause an increase in peak level, particularly with heavily compressed audio. For distortion free playback you may need to normalize well below 0 dB before exporting.

This effect should be reasonably "transparent" provided it is only limiting occasional peaks. If greater transparency is required, try the "Limiter (2)" effect here: ... er_.282.29 (Note that "Limiter (2)" will clip peaks that are over 0 dB).

For "maximizing loudness", use a dynamic compressor first, then use this limiter to give you a little bit more.

Limiters can provide surprising and interesting effects on percussive and bass sounds when "abused", that can be highly suitable for many genres of modern music. For classical music limiters should generally be used sparingly ("Limiter (2)" is likely to be more suitable in this case).

A common and useful role of limiters is as a "second pass" effect after using a compressor. This is particularly useful when using a compressor that does not use "lookahead" (such as the LADSPA SC4 compressor). In the absence of lookahead, high level transient peaks may "slip through" before the compressor has had time to react. This limiter is well suited to applying after such compressors to catch the peaks that the compressor misses.

(2.08 KiB) Downloaded 757 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Site Admin
Posts: 44466
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Peak Limiter

Permanent link to this post Posted by steve » Wed Aug 23, 2017 7:42 am

A version of this limiter is now included with Audacity:
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Site Admin
Posts: 44466
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu


Return to Plug-in Archive

Who is online

Users browsing this forum: No registered users and 2 guests