This invention relates to a telephone employing echo canceling circuitry and, in particular, to echo canceling circuitry that includes a clipping detector.
As used herein, “telephone” is a generic term for a communication device that utilizes, directly or indirectly, a dial tone from a licensed service provider. As such, “telephone” includes desk telephones (see
There are two kinds of echo in a telephone system, an acoustic echo between an earphone or a loudspeaker and a microphone and electrical echo generated in the switched network for routing a call between stations. In a handset, acoustic echo is typically not much of a problem. In speaker phones, where several people huddle around a microphone'and loudspeaker, acoustic feedback is much more of a problem. Hybrid circuits (two-wire to four-wire transformers) located at terminal exchanges or in remote subscriber stages of a fixed network are the principal sources of electrical echo.
One way to reduce echo is to program the frequency and phase response of a filter to match the frequency and phase response of an echo path. A filter typically used is a finite impulse response (FIR) filter having programmable coefficients. A filtered signal, emulating the echo, is subtracted from the echo bearing signal at an input. This technique reduces echo typically as much as 30 dB, depending upon the coefficient adaptation algorithm. Additional means using non-linear techniques are typically added to further reduce an echo. Approximating a solution for an adaptive filter is like trying clothes on a squirming child: the input signal keeps changing. At one extreme, sudden and/or large changes can upset the approximation process and make the process diverge rather than converge. At the other extreme, a low echo to noise ratio can cause instability and divergence.
As if variations in the input signal were not enough, errors within the audio processing portion of a telephone can compound the problem of convergence. The audio processing circuit contains two channels. A transmit channel extends from a microphone input to a line output. A receive channel extends from a line input to a speaker output. The transmit channel contains several stages, each with its own gain, that can cause the signal to exceed the dynamic range of the analog components or the digital componoents in a stage. Exceeding the range of a stage “saturates” the stage and causes the signal to become “clipped.” Portions of the signal are lost.
When a signal is in analog form, the voltage increases to a maximum and goes no higher. When a signal is in digital form, a stage saturates by having the digital value representing the signal be larger than the capacity of a register. For example, a one byte (eight bit) register can store signed values in the range 0 to 127 (one bit indicates sign, + or −). Any data larger than 127 causes the register to “overflow” and data lower than −127 causes the register to “underflow”. Carefully written software usually includes routines to check for and prevent overflow and underflow, whether the values are signed or unsigned. Thus, the data is set to some number, e.g. the range of the register, and the signal is clipped to its minimum value or to its maximum value.
Stages following the clipping stage may have an even lower saturation level than the maximum allowable range of the signal of a preceding stage. Analog stages may saturate at a different level from digital stages and vice-versa. Often stages are provided with variable gains to perform certain functions. Thus, clipping does not necessarily occur at a given stage and may not occur at all under benign operating conditions. Clipping is a type of nonlinearity that cannot be canceled by a typical FIR filter used in an echo canceling circuit.
There can be two kinds of clipping in an audio processing circuit. The kind described above is undesirable. There is also what is known as center clipping, typically combined with other circuits in what is known as the non-linear processing portion of an echo canceling circuit. In center clipping, low level signals (signals near zero crossing, which is why it is called “center” clipping) are removed or clipped. The theory is that low level signals are not voice but echo or noise. Thus, for example, digital data in the range ±5 is set to zero. Data outside the range ±5 is passed to the following stage unaltered. Analog signals can be processed in the same way; e.g. see
In the prior art, U.S. Pat. No. 6,650,701 (Hsiang et al.) discloses an echo canceling system that checks for distortion at a microphone input, wherein distortion is defined as exceeding an amplitude threshold. U.S. Pat. No. 6,771,771 (Moon et al.) discloses using a variable gain amplifier on a microphone input to prevent overloading an analog to digital (A/D) converter.
In view of the foregoing, it is therefore an object of the invention to provide a clipping detector for improving acoustic echo canceling in a telephone.
Another object of the invention is to provide a clipping detector for improving the stability of an acoustic echo canceling circuit.
The foregoing objects are achieved in this invention in which an adaptive filter in an echo canceling circuit includes a clipping detector that affects the coefficients of the adaptive filter when clipping is detected. Clipping is defined as at least two successive maxima or minima in a predetermined period. The coefficients are either locked or the echo estimate is reduced to prevent overcorrection. In accordance with another aspect of the invention, lower order bits are ignored to avoid problems of bit resolution when comparing signals.
A more complete understanding of the invention can be obtained by considering the following detailed description in conjunction with the accompanying drawings, in which:
Those of skill in the art recognize that, once an analog signal is converted to digital form, all subsequent operations can take place in one or more suitably programmed microprocessors. Reference to “signal”, for example, does not necessarily mean a hardware implementation or an analog signal. Data in memory, even a single bit, can be a signal. In other words, a block diagram can be interpreted as hardware, software, e.g. a flow chart or an algorithm, or a mixture of hardware and software. Programming a microprocessor is well within the ability of those of ordinary skill in the art, either individually or in groups.
This invention finds use in many applications where the electronics is essentially the same but the external appearance of the device may vary.
The various forms of telephone can all benefit from the invention.
A cellular telephone includes both audio frequency and radio frequency circuits. Duplexer 55 couples antenna 56 to receive processor 57. Duplexer 55 couples antenna 56 to power amplifier 58 and isolates receive processor 57 from the power amplifier during transmission. Transmit processor 59 modulates a radio frequency signal with an audio signal from circuit 54. In non-cellular applications, such as speakerphones, there are no radio frequency circuits and signal processor 54 may be simplified somewhat. Problems of echo cancellation and noise remain and are handled in audio processor 60. It is audio processor 60 that is modified to include the invention. How that modification takes place is more easily understood by considering the echo canceling and noise reduction portions of an audio processor in more detail.
The output from non-linear processing circuit 74 is coupled to summation circuit 76, where comfort noise 75 is optionally added to the signal. The signal is then converted back to analog form by D/A converter 77, amplified in amplifier 78, and coupled to line output 64. Data from the four VAD circuits is supplied to control 80, which uses the data for allocating sub-bands, echo elimination, and other functions. Circuit 73 reduces acoustic echo and circuit 81 reduces line echo. The operation of these last two circuits is known per se in the art; e.g. as described in the above-identified text.
The path from speaker output 68 to microphone input 62 is simulated in echo canceler 73 by operation on signal x from the receive channel. In the simple case where there is no echo, signal x is attenuated and no signal is subtracted from signal y in circuit 72. In the more complex case where there is echo, echo canceler 73 simulates the attenuation, frequency response, and phase (delay) of the path for subtracting the echo from the signal at microphone input 62.
The external path can be simulated with any linear filter, such as an FIR filter known in the art. The basic operation of an echo canceler constructed in accordance with the invention is illustrated in
As described in greater detail in conjunction with
Analog clipping may generate values that do not repeat because of filtering and the resolution of the A/D converter. The “≧” and “≦” symbols in comparators 94 and 95 represent a comparison of higher order bits. In other words, the output is “true” or a logic one when the difference between one input and the other is less than 1 bit or less than 2 bits of resolution. A repeated maximum or minimum value is signaled as a clip. For example, in binary notation, a maximum of 11101101 and a maximum of 11101110 match if the two lower order (right hand) bits are ignored. Thus, the second data is considered a repeated maximum, indicating clipping. The number of bits one chooses to ignore is arbitrary. Ignoring the 0 and 1 bits has been found satisfactory. Ignoring more (higher order) bits can lead to false positives, which are more undesirable than false negatives. The repeats are usually either maxima or minima. In fact, it is very unlikely for a maximum to be followed by a minimum, or vice-versa.
Also of interest is the depth of the clipping, defined as the number of successive maximums or minimums. The number gives some idea of how much the microphone signal is being clipped. Each maximum, or minimum, increments counter 96 through OR-gate 97. The count is accumulated during a sample period determined by clock 101, D-flip-flop 102, inverter 103, and AND gate 104. A logic one output from AND gate 104 resets counter 96. The output from AND gate 104 is inverted by inverter 106 to provide a binary indication of clipping.
The range data is used to modify the echo estimate using range limiting circuit in circuit 86. In the event of a large amount of clipping, the estimate is locked to prevent the adaptation loop from diverging. Other portions of the echo canceling circuitry (not shown) can remain in operation, e.g. attenuation and center-clipping.
The invention thus provides a clipping detector for improving acoustic echo canceling in a telephone and, in particular, for improving the stability of an acoustic echo canceling circuit using a linear filter. The invention enables an echo cancelling circuit to operate even when the input has been clipped within the range allowed by the echo cancelling algorithm.
Having thus described the invention, it will be apparent to those of skill in the art that various modifications can be made within the scope of the invention. For example, circuits 72 and 76 (