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
f32with rounding and saturation. - AgcConfig
- How the AGC behaves.
- Biquad
- A biquad section over up to
MAX_CHANNELSchannels of i16. - Coefficients
- Normalised coefficients (
a0 = 1). - Convert
- Re-encode every sample to
to(seecodec::pcm::convertfor the exact rules). Same-format input is a byte copy. - DcBlock
y[n] = x[n] - x[n-1] + r·y[n-1], per channel, inf32.- Energy
Vad - The detector. Read
is_speechafter each block. - Gain
- Multiply every sample by a fixed gain.
- Linear
Resampler - Linear interpolation from
in_ratetoout_rateover up toMAX_CHANNELSchannels of i16. - Mono
ToStereo - Duplicate a mono i16 stream onto two channels. Byte-exact.
- Stereo
ToMono - Average a stereo i16 stream to mono:
(l + r) >> 1(floor). Byte-exact. - VadConfig
- How the detector decides.
Enums§
- Biquad
Kind - 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,bandoutmust have the same even length.