Input Handler & Resampler
Sinc-resample + PCM decode
Decodes multi-channel raw PCM bytes, extracts 6 circular mic channels + 2 loopback reference channels, and applies Sinc-Kaiser resampling to 16 kHz.
Auto Gain Matcher
EMA RMS Level Matching
Scales the loopback reference to match mic energy before AEC. After spatial, learns stereo gain when playback / correlation conditions are met.
Reference Extractor
Differential Stereo Decoder
Builds a mono reference from the loopback pair, validates presence, and gates low-energy reference so AEC does not adapt on silence.
High-Pass Filter
2nd-order Butterworth IIR
Applied before AEC on all mic channels and the matched mono reference. Removes sub-120 Hz rumble / motor noise.
MDF Classical AEC
Multi-Delay Frequency Adaptive
Linear frequency-domain AEC on all mic channels when echo-path correlation is plausible. Skipped on double-talk-dominated or inactive reference.
Nearend Activity
Energy Nearend Detector
Per-block nearend vs playback-only gate from mic/ref RMS and echo correlation. Drives MVDR SCM updates and AGC masks only. The gate itself uses no direction information.
WPE Dereverberation
Online recursive-RLS MIMO
Linear, distortionless removal of LATE reverberation, per frame per bin, inside the shared STFT pair so it adds no latency. ON BY DEFAULT since 2026-08-22; fails closed to passthrough.
Online MVDR Beamformer
Geometry-blind SCM MVDR
Online MVDR with speech/noise SCMs. Nearend applies beamformed output; playback-only adapts the noise SCM but emits equal-mix. Geometry-blind: SRP-PHAT DOA observes Phi_ss and never steers it.
Residual Echo Suppressor
Per-bin, before synthesis
Suppresses what the linear AEC leaves behind — the residual is loudspeaker nonlinearity, so the linear ceiling is ~11–13 dB. Per bin and coherence-driven, so double-talk speech survives instead of being ducked along with the whole spectrum.
Noise Floor Tracker
Inside processMono()
Tracks ambient noise RMS on the mono stream after synthesis; feeds Adaptive AGC inside EchoAndGainModule::processMono. Its only remaining consumer is the AGC.
Adaptive AGC
Target RMS Gain Controller
Speech-aware gain toward a target RMS, using the noise floor, voice probability and the nearend gate. Owns output level end to end; it is the only stage that sets level.
S16LE Encoder
Pure conversion + clip guard
Float → S16LE at full scale. Applies NO gain: no normalisation, boost, peak tracking or slew — a second gain stage with its own time constant would fight the AGC and pump the level.