Envelope Detector#

Envelope detector Stages measure how the average or peak amplitude of a signal varies over time.

EnvelopeDetectorPeak#

class audio_dsp.stages.envelope_detector.EnvelopeDetectorPeak(**kwargs)

A stage with no outputs that measures the signal peak envelope.

The current envelope of the signal can be read out using this stage’s envelope control.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.envelope_detector_peak

The DSP block class; see Peak Envelope Detector for implementation details.

make_env_det_peak(attack_t, release_t, Q_sig=27)

Update envelope detector configuration based on new parameters.

Parameters:
attack_tfloat

Attack time of the envelope detector in seconds.

release_tfloat

Release time of the envelope detector in seconds.

EnvelopeDetectorPeak Control#

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

Control parameter

Payload length

CMD_ENVELOPE_DETECTOR_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_ENVELOPE_DETECTOR_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_ENVELOPE_DETECTOR_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.

EnvelopeDetectorRMS#

class audio_dsp.stages.envelope_detector.EnvelopeDetectorRMS(**kwargs)

A stage with no outputs that measures the signal RMS envelope.

The current envelope of the signal can be read out using this stage’s envelope control.

Attributes:
dsp_blockaudio_dsp.dsp.drc.drc.envelope_detector_rms

The DSP block class; see RMS Envelope Detector for implementation details.

make_env_det_rms(attack_t, release_t, Q_sig=27)

Update envelope detector configuration based on new parameters.

Parameters:
attack_tfloat

Attack time of the envelope detector in seconds.

release_tfloat

Release time of the envelope detector in seconds.

EnvelopeDetectorRMS Control#

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

Control parameter

Payload length

CMD_ENVELOPE_DETECTOR_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_ENVELOPE_DETECTOR_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_ENVELOPE_DETECTOR_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.