IP phones and SIP-based intercoms run voice over a packet network rather than a circuit. That changes the AEC reference in two ways: the far-end signal is encoded by a codec, and it arrives through a jitter buffer that can delay or rearrange packets.
This article covers the echo and reference-signal issues specific to SIP devices. The general echo-cancellation math is the same as elsewhere; the complications are codec artifacts, clock skew, and in-band signaling such as DTMF.
Codecs change the reference, not the math
The AEC still needs the far-end reference, but on a SIP device that reference is the decoded far-end speech, not the network packets. Narrowband G.711 at 8 kHz and wideband G.722 at 16 kHz are common; Opus is also used. The canceller must run at the sample rate of the decoded audio. A mismatch between the reference sample rate and the microphone sample rate breaks alignment.
Codec artifacts such as quantization noise are small, but a vocoder-style codec can color the spectrum in a way that makes the far-end correlation check slightly less clean. This is a minor effect compared with packet timing.
- G.711 at 8 kHz narrowband, the default SIP codec.
- G.722 at 16 kHz wideband.
- Opus, variable rate and sample rate.
Jitter buffer and the moving reference
The jitter buffer absorbs network delay variation by holding packets and releasing them with a smoothed timing. For AEC this means the far-end reference timing can shift relative to the microphone capture, because the two clocks are not perfectly aligned. If the reference used by the canceller is not time-aligned with what actually played, the echo estimate is delayed and cancellation degrades.
A stable local clock and a reference taken after the jitter buffer, matched to the same time base as the microphone, keep the two signals aligned.
A second subtlety is that the jitter buffer may resample or transpose the far-end timing to keep it contiguous, so the reference sample index no longer maps one-to-one to the played sample index. The canceller must use the post-buffer timestamp stream, not the network sequence numbers, as the reference clock. If it uses sequence numbers, every jitter-induced reorder looks like a path change and the filter keeps re-converging.
Clock skew between capture and render
On many embedded SIP intercoms the microphone ADC and the speaker DAC run from independent clock domains. Slow drift between them means the echo path the canceller learned slowly de-aligns. Sample rate conversion or a shared clock source is the usual fix; without it the tail position of the learned filter creeps and ERLE slowly drops until the filter re-converges.
This is the same class of problem seen on USB audio devices, discussed in our video-conferencing bar article.
DTMF and in-band signaling
DTMF tones used for menus and door unlock travel in-band and are therefore part of the far-end signal. They are pure tones, easy for the canceller to model, but if the reference is taken before DTMF injection the canceller will treat the played tone as echo it cannot explain. Take the reference after signaling injection so the tone is included.
Some intercoms use out-of-band RFC 2833 DTMF, which is not rendered through the speaker and must not appear in the reference at all. A related gotcha is call recording and comfort-noise generation on the far end: if the far end inserts its own comfort noise, that noise is not part of your echo and should not be in your reference, but it does appear in the mic signal as uncorrelated content that the detector must not mistake for double-talk.
Verification on a packet network
Test with the real codec and a simulated jitter buffer, not just raw PCM, because the buffer is where timing errors appear. Measure ERLE in single-talk and confirm double-talk stability; capture over the network path so clock skew is present. Our measurement guide explains how to isolate each condition.
Also test recovery after a packet-loss burst. When far-end packets are lost, the reference has gaps; a canceller that caches the last good reference can keep cancelling, while one that treats the gap as silence will let echo through when audio resumes. Confirm the reference handling during loss, not only during steady streaming.
Clock drift on SIP intercoms is the same family of problem as on USB audio bars, and the correct reference tap is explained in Why AEC Needs a Far-End Reference.
Hear it on your own audio
Upload a real call recording and compare the AEC output on our demo page.
Try the live demo Request an evaluationCommon questions
Does the codec change AEC math?
No, the adaptive filter math is unchanged; the codec only changes the sample rate and spectral color of the far-end reference you decode.
Why align the reference after the jitter buffer?
The jitter buffer reschedules packets, so a reference taken before it is not time-aligned with what the speaker actually rendered, which delays the echo estimate.
What causes slow ERLE drift on SIP intercoms?
Independent capture and render clocks drift apart; without a shared clock or resampling the learned tail position creeps and cancellation degrades.
Should DTMF be in the reference?
In-band DTMF played through the speaker should be in the reference; RFC 2833 out-of-band DTMF is not rendered and must be excluded.
Which codecs are typical on SIP voice?
G.711 at 8 kHz narrowband, G.722 at 16 kHz wideband, and Opus are the common choices for SIP voice devices.