Dynamic range expander
Audio Toolbox / Dynamic Range Control
The Expander block performs dynamic range expansion independently across each input channel. Dynamic range expansion attenuates the volume of quiet sounds below a given threshold. The block uses specified attack, release, and hold times to achieve a smooth applied gain curve.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

The Expander block processes a signal frame by frame and element by element.
The Npoint signal, x[n], is converted to decibels:
$${x}_{\text{dB}}[n]=20\times {\mathrm{log}}_{10}\leftx[n]\right$$
x_{dB}[n] passes through the gain computer. The gain computer uses the static characteristic properties of the dynamic range expander to attenuate gain that is below the threshold.
If you specified a soft knee, the gain computer has the following static characteristic:
$${x}_{\text{sc}}({x}_{\text{dB}})=\{\begin{array}{cc}T+\left({x}_{\text{dB}}T\right)\times R& {x}_{\text{dB}}<\left(T\frac{W}{2}\right)\\ {x}_{\text{dB}}+\frac{\left(1R\right){\left({x}_{\text{dB}}T\frac{W}{2}\right)}^{2}}{2W}& \left(T\frac{W}{2}\right)\le {x}_{\text{dB}}\le \left(T+\frac{W}{2}\right)\\ {x}_{\text{dB}}& {x}_{\text{dB}}>\left(T+\frac{W}{2}\right)\end{array}\text{\hspace{1em}},$$
where T is the threshold, R is the expansion ratio, and W is the knee width.
If you specified a hard knee, the gain computer has the following static characteristic:
$${x}_{\text{sc}}({x}_{\text{dB}})=\{\begin{array}{cc}T+\left({x}_{\text{dB}}T\right)\times R& {x}_{\text{dB}}<T\\ {x}_{\text{dB}}& {x}_{\text{dB}}\ge T\end{array}$$
The computed gain, g_{c}[n], is calculated as
$${g}_{\text{c}}[n]={x}_{\text{sc}}[n]{x}_{\text{dB}}[n].$$
g_{c}[n] is smoothed using specified attack, release, and hold time parameters:
$${g}_{\text{s}}[n]=\{\begin{array}{cc}{\alpha}_{\text{A}}{g}_{\text{s}}[n1]+(1{\alpha}_{\text{A}}){g}_{\text{c}}[n]& \text{\hspace{0.17em}}\left({C}_{\text{A}}>{T}_{\text{H}}\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\&\text{\hspace{0.17em}}\text{\hspace{0.17em}}\left({g}_{\text{c}}[n]\le {g}_{\text{s}}[n1]\right)\\ {g}_{\text{s}}[n1]\text{\hspace{0.17em}}& {C}_{\text{A}}\le {T}_{\text{H}}\\ {\alpha}_{\text{R}}{g}_{\text{s}}[n1]+(1{\alpha}_{\text{R}}){g}_{\text{c}}[n]\text{\hspace{1em}}& {g}_{\text{c}}[n]>{g}_{\text{s}}[n1]\end{array}$$
C_{A} is the hold counter for attack. The limit, T_{H}, is determined by the Hold time (s) parameter.
The attack time coefficient, α _{A}, is calculated as
$${\alpha}_{\text{A}}=\mathrm{exp}\left(\frac{\mathrm{log}(9)}{Fs\times {T}_{\text{A}}}\right)\text{\hspace{0.17em}}.$$
The release time coefficient, α _{R}, is calculated as
$${\alpha}_{\text{R}}=\mathrm{exp}\left(\frac{\mathrm{log}(9)}{Fs\times {T}_{\text{R}}}\right)\text{\hspace{0.17em}}.$$
T_{A} is the attack time period, specified by the Attack time (s) parameter. T _{R} is the release time period, specified by the Release time (s) parameter. Fs is the input sampling rate, specified by the Inherit sample rate from input or Input sample rate (Hz) parameter.
The smoothed gain in dB, g_{s}[n], is translated to a linear domain:
$${g}_{\text{lin}}[n]={10}^{\left(\frac{{g}_{\text{s}}[n]}{20}\right)}\text{\hspace{0.05em}}.$$
The output of the dynamic range expander is given as
$$y[n]=x[n]\times {g}_{\text{lin}}[n].$$
[1] Giannoulis, Dimitrios, Michael Massberg, and Joshua D. Reiss. "Digital Dynamic Range Compressor Design –– A Tutorial And Analysis." Journal of Audio Engineering Society. Vol. 60, Issue 6, 2012, pp. 399–408.