# Echo Removal from PCM 16 bit arrays (time frames)?

I am keen to know the basics to remove echo knowing FarEnd Signal and NearEnd Signal. I have read research papers in which its commonly said:
y(n) = (hT)x
where h is the room impulse response and T is transpose and echo signal estimated is y(n).
Now, what I really want to understand is the computation of room impulse response. Given two-time frame arrays of PCM 16 bit. Let's say:

Near_end_sig = [x1,x2,x3,x4,....,xN] (one time frame)
Far_end_sig = [y1,y2,y3,....,yN] (one time frame)

Here I want to know in this case working on digital acoustic signals (PCM-16 bit arrays of size let's assume 1024).
How do I compute room impulse response h and how do I estimate echo signal?
My main concern is the computation of room impulse response and the echo signal estimation based on the time frames.

Regards,

The canonical way to remove an echo (it can be either electrical echo, or acoustic echo) from a signal is by using adaptive filters. Such an adaptive filter should be able to hold a model of an echo path in the form of an impulse response of this path. Having this model, we can use an original signal to create a copy of its echo, so it can be then subtracted from the signal. Here is an echo canceller:

Lets assume that a communication system has two signals in two directions: $$x$$ and $$s$$. Lets also assume that signal $$x$$ creates an echo $$z$$. As a result the system gets a signal $$s$$ mixed with $$z$$: $$s+z$$. An echo canceller wants to remove the echo, so it uses an adaptive echo model to create a copy of the echo - $$\hat z$$ and subtracts it from $$s+z$$ signal. Since the model can't be precise, instead of $$s$$ we get $$s+e$$, where $$e$$ is a residual echo.

In the most simple case an adaptive echo model is a FIR filter, which adapts during a period, when there is no signal $$s$$ and this becomes a simple system identification problem: it should match $$x$$ and $$z$$ so that $$z-\hat z=0$$. After adaptation we get $$H$$ - a vector of filter coefficients, which represent a linear part of the echo path's impulse response. Then during regular communication the filter doesn't adapt and we get $$s+e$$ like this:

$$s + e = s + z - H* X ,$$

where $$X$$ - is an array of past samples of $$x$$.

The positioning of the filter depends on a system configuration: it can be at the near end or at the far end. The complexity of the filter strongly depends on characteristics of the echo path: long echo path demands a longer filter, also non-linearity of the echo path determines the required filter capabilities (so that a filter not only includes a FIR filter, but also has IIR taps, implements Volterra series or does something else).

In case of an acoustic echo an echo path is long, nonlinear and changing in time. It is estimated as a room echo response. The filter should preferably be placed at the near end, should include nonlinear component, and should be able to adapt during a conversation (i.e. it has to somehow tolerate the double talk). There are multiple techniques for such things.

As for the specifics of your particular signal, it shouldn't change the basic principle of the echo canceller, since it only changes how the signals $$x$$ and $$s$$ are encoded.

Here are several links about echo cancellation from the Vocal Technologies site. I've found their site very helpful, having a lot of useful explanations regarding various aspects of echo cancellation.

• Thank you for the explanation. Let me study the links provided by you then I shall get back to you. Jan 14 at 8:29