Audio dynamic range expander built from basic elements.
A measurement of mean-square audio amplitude is used to generate a gain-reduction control signal (in red) which is
multiplied by the input, reducing the output amplitude below the user-defined threshold. The logarithm block is
required to convert the mean-square measurement to dB. The control expander block compares the measured
mean-square value (in dB) with the user-defined dB threshold (slider in the Expander Threshold block), and generates a
gain-reduction signal of a desired "expander ratio" if the mean-square value is below the threshold. The antillog of the
control signal is taken (to convert back from dB). This signal is then smoothed and multiplied by a delayed version of the
input audio signal, thus limiting the amplitude of the output audio signal. The gain smoother has a hysteresis loop to
determine whether the expander is in the attack or release phase. The delay gives the system a predictive
("look-ahead") capability. Experiment with the settings of all blocks to explore the behaviour of the expander.