Skip to main content

Module elements

Module elements 

Source
Expand description

The elements: ESP-ADF’s filter/resample/mixer elements and ESP-SR’s lite front end, each an Element over interleaved i16.

Every element states its contract in its own docs and has a host test against a reference: byte-identity where the maths is exact (gain, channel ops, conversion, resampler), a stated tolerance against an external oracle where it is not (Biquad against ffmpeg and scipy, in rusty_esp_audio-esp’s oracle tests).

Structs§

Agc
One gain per block, moved toward the target at the attack or release rate, applied in f32 with rounding and saturation.
AgcConfig
How the AGC behaves.
Biquad
A biquad section over up to MAX_CHANNELS channels of i16.
Coefficients
Normalised coefficients (a0 = 1).
Convert
Re-encode every sample to to (see codec::pcm::convert for the exact rules). Same-format input is a byte copy.
DcBlock
y[n] = x[n] - x[n-1] + r·y[n-1], per channel, in f32.
EnergyVad
The detector. Read is_speech after each block.
Gain
Multiply every sample by a fixed gain.
LinearResampler
Linear interpolation from in_rate to out_rate over up to MAX_CHANNELS channels of i16.
MonoToStereo
Duplicate a mono i16 stream onto two channels. Byte-exact.
StereoToMono
Average a stereo i16 stream to mono: (l + r) >> 1 (floor). Byte-exact.
VadConfig
How the detector decides.

Enums§

BiquadKind
Which response to design.

Constants§

MAX_CHANNELS
Channels the stateful filters keep memory for.

Functions§

mix_i16
Sum two equal-length i16 byte streams into out, saturating. a, b and out must have the same even length.