Limiter#

Limiter Stages allow the amplitude of the signal to be restricted based on its envelope.

LimiterRMS#

class audio_dsp.stages.limiter.LimiterRMS(**kwargs)

A limiter based on the RMS value of the signal. When the RMS envelope of the signal exceeds the threshold, the signal amplitude is reduced.

The threshold sets the value above which limiting occurs. The attack time sets how fast the limiter starts limiting. The release time sets how long the signal takes to ramp up to its original level after the envelope is below the threshold.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.limiter_rms

The DSP block class; see RMS Limiter for implementation details.

make_limiter_rms(threshold_db, attack_t, release_t, Q_sig=27)

Update limiter configuration based on new parameters.

Parameters:
threshold_dbfloat

Threshold in decibels above which limiting occurs.

attack_tfloat

Attack time of the limiter in seconds.

release_tfloat

Release time of the limiter in seconds.

LimiterRMS Control#

The following runtime command ids are available for the LimiterRMS Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.

Control parameter

Payload length

CMD_LIMITER_RMS_ATTACK_ALPHA

sizeof(int32_t)

The attack alpha in Q0.31 format. To convert an attack time in seconds to an int32_t control value, use the function calc_alpha(fs, attack_time) in control/helpers.h.


CMD_LIMITER_RMS_RELEASE_ALPHA

sizeof(int32_t)

The release alpha in Q0.31 format. To convert a release time in seconds to an int32_t control value, use the function calc_alpha(fs, release_time) in control/helpers.h.


CMD_LIMITER_RMS_ENVELOPE

sizeof(int32_t)

The current RMS² envelope of the signal in Q_SIG format. To read the int32_t control value, use the function qxx_to_db_pow(envelope, Q_SIG) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.


CMD_LIMITER_RMS_THRESHOLD

sizeof(int32_t)

The threshold in Q_SIG format above which limiting will occur. To convert a threshold in dB to the int32_t control value, use the function calculate_rms_threshold(x) in control/helpers.h.


CMD_LIMITER_RMS_GAIN

sizeof(int32_t)

The current gain applied by the limiter in Q0.31 format. To read the int32_t control value, use the function qxx_to_db(envelope, 31) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.

LimiterPeak#

class audio_dsp.stages.limiter.LimiterPeak(**kwargs)

A limiter based on the peak value of the signal. When the peak envelope of the signal exceeds the threshold, the signal amplitude is reduced.

The threshold sets the value above which limiting occurs. The attack time sets how fast the limiter starts limiting. The release time sets how long the signal takes to ramp up to its original level after the envelope is below the threshold.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.limiter_peak

The DSP block class; see Peak Limiter for implementation details.

make_limiter_peak(threshold_db, attack_t, release_t, Q_sig=27)

Update limiter configuration based on new parameters.

Parameters:
threshold_dbfloat

Threshold in decibels above which limiting occurs.

attack_tfloat

Attack time of the limiter in seconds.

release_tfloat

Release time of the limiter in seconds.

LimiterPeak Control#

The following runtime command ids are available for the LimiterPeak Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.

Control parameter

Payload length

CMD_LIMITER_PEAK_ATTACK_ALPHA

sizeof(int32_t)

The attack alpha in Q0.31 format. To convert an attack time in seconds to an int32_t control value, use the function calc_alpha(fs, attack_time) in control/helpers.h.


CMD_LIMITER_PEAK_RELEASE_ALPHA

sizeof(int32_t)

The release alpha in Q0.31 format. To convert a release time in seconds to an int32_t control value, use the function calc_alpha(fs, release_time) in control/helpers.h.


CMD_LIMITER_PEAK_ENVELOPE

sizeof(int32_t)

The current peak envelope of the signal in Q_SIG format. To read the int32_t control value, use the function qxx_to_db(envelope, Q_SIG) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.


CMD_LIMITER_PEAK_THRESHOLD

sizeof(int32_t)

The threshold in Q_SIG format above which limiting will occur. To convert a threshold in dB to the int32_t control value, use the function calculate_peak_threshold(x) in control/helpers.h.


CMD_LIMITER_PEAK_GAIN

sizeof(int32_t)

The current gain applied by the limiter in Q0.31 format. To read the int32_t control value, use the function qxx_to_db(envelope, 31) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.

HardLimiterPeak#

class audio_dsp.stages.limiter.HardLimiterPeak(**kwargs)

A limiter based on the peak value of the signal. The peak envelope of the signal may never exceed the threshold.

When the peak envelope of the signal exceeds the threshold, the signal amplitude is reduced. If the signal still exceeds the threshold, it is clipped.

The threshold sets the value above which limiting/clipping occurs. The attack time sets how fast the limiter starts limiting. The release time sets how long the signal takes to ramp up to its original level after the envelope is below the threshold.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.hard_limiter_peak

The DSP block class; see Hard Peak Limiter for implementation details.

make_hard_limiter_peak(threshold_db, attack_t, release_t, Q_sig=27)

Update limiter configuration based on new parameters.

Parameters:
threshold_dbfloat

Threshold in decibels above which limiting occurs.

attack_tfloat

Attack time of the limiter in seconds.

release_tfloat

Release time of the limiter in seconds.

HardLimiterPeak Control#

The following runtime command ids are available for the HardLimiterPeak Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.

Control parameter

Payload length

CMD_HARD_LIMITER_PEAK_ATTACK_ALPHA

sizeof(int32_t)

The attack alpha in Q0.31 format. To convert an attack time in seconds to an int32_t control value, use the function calc_alpha(fs, attack_time) in control/helpers.h.


CMD_HARD_LIMITER_PEAK_RELEASE_ALPHA

sizeof(int32_t)

The release alpha in Q0.31 format. To convert a release time in seconds to an int32_t control value, use the function calc_alpha(fs, release_time) in control/helpers.h.


CMD_HARD_LIMITER_PEAK_ENVELOPE

sizeof(int32_t)

The current peak envelope of the signal in Q_SIG format. To read the int32_t control value, use the function qxx_to_db(envelope, Q_SIG) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.


CMD_HARD_LIMITER_PEAK_THRESHOLD

sizeof(int32_t)

The threshold in Q_SIG format above which limiting will occur. To convert a threshold in dB to the int32_t control value, use the function calculate_peak_threshold(x) in control/helpers.h.


CMD_HARD_LIMITER_PEAK_GAIN

sizeof(int32_t)

The current gain applied by the limiter in Q0.31 format. To read the int32_t control value, use the function qxx_to_db(envelope, 31) in control/helpers.h This command is read only. When sending a write control command, it will be ignored.

Clipper#

class audio_dsp.stages.limiter.Clipper(**kwargs)

A simple clipper that limits the signal to a specified threshold.

If the signal is greater than the threshold level, it is set to the threshold value.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.clipper

The DSP block class; see Clipper for implementation details.

make_clipper(threshold_db, Q_sig=27)

Update clipper configuration based on new parameters.

Parameters:
threshold_dbfloat

Threshold in decibels above which clipping occurs.

Clipper Control#

The following runtime command ids are available for the Clipper Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.

Control parameter

Payload length

CMD_CLIPPER_THRESHOLD

sizeof(int32_t)

The threshold in Q_SIG format above which clipping will occur. To convert a threshold in dB to the int32_t control value, use the function calculate_peak_threshold(x) in control/helpers.h.