Hi everyone!

Compression in the limiters occurs in the ratio “infinity : 1”. On different resources there are different opinions about which number is “Infinity”. In some places they even write that it is 20 : 1. But I think this is far from the truth. Does anyone know what constant is used in limiters?

The formula for a compressor is this (all in dB):

```
output = threshold + (input - threshold) / ratio
```

In a limiter, `output == threshold`

.

```
threshold = threshold + (input - threshold) / ratio
0 = (input - threshold) / ratio
```

This suggests that limiting happens as ratio -> infinity.

Infinity is not a number, we cannot use it as a design parameter in any implementation (analog or digital). In variable ratio designs, an arbitrarily large number is selected to approximate “infinity.” 20 is one example, it depends on the design (this was more common in analog VCA architectures, iirc).

However, in code we can get ideal limiting (ratio == infinity) by removing the ratio from calculation.

```
output = input + gainReduction
gainReduction = output - input
output =
if input <= threshold:
input
else if limiter:
threshold
else:
threshold + (input - threshold) / ratio
```

This depends on the kind of transfer function you’re using, but for the usual piecewise polynomial, ratio is not used directly in the formulas, but in the form `1 - 1 / ratio`

, which you may call slope. So for example, for a single quadratic knee:

(with x = input - threshold)

When the ratio tends to infinity, the slope tends to 1, so this reduces to

That said, real limiters often use more sophisticated transfer functions and smoothing mechanisms. Brickwalling with low pumping and low distortion cannot really be done with the simpler forms of compression. I’ve never made an actually usable limiter, so my knowledge ends there

A sufficiently ‘fast’ compressor i.e. without a smoothed detection circuit is just a waveshaper.

As a result, the complexity is in how you smooth the level detection (and / or the application of gain).

With a limiter there are also specific considerations such as leaked transients. A simple compressor does not lookahead so when the incomming signal increases faster than the attack rate, the output will go over 0dBFS. The algorithm I wrote for Boost used lookahead and gain curves that make guarantees about their speed in order to solve this, but most well known limiters use some kind of shaped clipping to avoid exceeding the required final level.