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.

Control

The following runtime control parameters are available for the EnvelopeDetectorPeak Stage:

Command ID macro

Payload length

Description

CMD_ENVELOPE_DETECTOR_PEAK_ATTACK_ALPHA

sizeof(int32_t)

The attack alpha in Q0.31 format.

CMD_ENVELOPE_DETECTOR_PEAK_RELEASE_ALPHA

sizeof(int32_t)

The release alpha in Q0.31 format.

CMD_ENVELOPE_DETECTOR_PEAK_ENVELOPE

sizeof(int32_t)

The current peak envelope of the signal in Q_SIG format.

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.

Control

The following runtime control parameters are available for the EnvelopeDetectorRMS Stage:

Command ID macro

Payload length

Description

CMD_ENVELOPE_DETECTOR_RMS_ATTACK_ALPHA

sizeof(int32_t)

The attack alpha in Q0.31 format.

CMD_ENVELOPE_DETECTOR_RMS_RELEASE_ALPHA

sizeof(int32_t)

The release alpha in Q0.31 format.

CMD_ENVELOPE_DETECTOR_RMS_ENVELOPE

sizeof(int32_t)

The current RMS envelope of the signal in Q_SIG format.