HANDSFREE TELEPHONE APPARATUS

Abstract: A handsfree telephone circuit has separate transmit and receive audio paths for connection to a microphone and speaker respectively. The circuit comprises a controllable attenuator in each of said transmit and receive paths, an attenuator control responsive to control signals to set the attenuation level of said attenuators, and a separate monitoring circuit connected to each of said transmit and receive paths for sensing audio signals therein. Each monitoring circuit comprises a filter for band limiting the audio signals, a peak level detector receiving said band limited signals, and a speech detector for distinguishing speech from background noise. A switching comparator compares the outputs of the peak level detectors in the two monitoring circuits and produces directional control signals for said attenuator control means to determine which audio path has control. The circuit is prone to causing a "hollow" effect in the speech due to bandlimiting filtering in the audio paths.

Description: HANDSFREE TELEPHONE APPARATUS This invention relates to telephones, and more particularly to a handsfree circuit for use in a telephone set. A conventional telephone hand set operates in the full duplex mode, which means that the parties can transmit and receive at the same time. This is possible because a conventional hand set is designed to have minimal acoustic coupling between the speaker and microphone. A handsfree system, which allows the user to operate the telephone without a hand set, has difficultly operating in the full duplex mode because of the high degree of acoustic coupling between the microphone and loud speaker. Most handsfree systems are therefore operated in the half duplex mode, which means that some form of switching must be provided in the transmit and receive paths. In a conventional handsfree circuit, variable complementary loss attenuators are inserted in the transmit and receive paths. These are controlled in accordance with the audio signals in the two paths. Level detectors determine the overall noise level in the respective paths and speech detectors distinguish between background noise, which is assumed to be a generally constant level, and speech, which is generally characterized by short bursts of higher level audio. Prior art designs have generally required filters in the transmit and/or receive audio paths to band limit the speech path to the 400 to 3500 Hz region. These filters are required to reduce background noise SUBSTITUTE SHEET from fans and other heavy machinery, but they create a "hollow" effect that degrades the quality of the transmitted sound. A further problem with the prior art circuits stems from the fact that the speech detectors work by detecting short bursts of sound. Consequently, many prior art circuits will respond to intermittent background noise, such as typing, causing the attenuators to ramp up to the full transmit state when no speech is present. Yet another problem with the prior art design is the frequent presence of echo signals due to trans- hybrid reflection or reverberation in the room. Peak detector decay rate is made long so as to prevent reverberation echo from causing the handsfree to switch states. An object of the present invention is to alleviate the aforementioned problems with the prior art. According to the present invention there is provided a handsfree telephone circuit with separate transmit and receive audio paths for connection to a microphone and speaker respectively, comprising a controllable attenuator in each of said transmit and receive paths; attenuator control means responsive to control signals to set the attenuation level of said attenuators; a separate monitoring circuit defining respective monitoring paths connected to each of said transmit and receive paths for sensing audio signals therein, each said monitoring circuit comprising a filter in the associated monitoring path for band limiting said audio signals, a rectifier, a peak level SUBSTITUTE SHEET detector receiving said band limited signals, and a speech detector for distinguishing speech from background noise; and a switching comparator for comparing the outputs of the peak level detectors in the two monitoring circuits and producing directional control signals for said attenuator control means to determine which audio path has control thereof. Preferably, a fast attack filter with a slow decay rate is provided in each of the input paths of the switching comparator. The filter in the non- controlling path can be bypassed so that the tendency of the switching comparator to switch on echo signals in the non-controlling path is reduced because the envelope from the filter in the controlling path extends beyond the echo signals in the non-controlling path. The filter in the audio paths is preferably a second order biquad filter. The general 2 nc order Z- domain transfer function is as follows: Y (Z) /X (Z) = G [1 + AxZ "1 + A 2 Z _2 ]/[1 - B^ -1 - B 2 Z ~2 ] where G is the gain, A^, A 2 , B]_, B 2 are constants that define the filer function. The preferred values of G, A, A]_, A 2 , B]_, B are SUBSTITUTE SHEET The use of the second order by quadratic filter in the control path that senses the transmit and audio signals allows the audio paths to use a wider band width (200 Hz to 3500 Hz) and thus avoid the "hollow" effect that band limiting creates in a prior art circuit with a filter directly in the audio paths. The attenuators are preferably in the form of digital attenuators having three stable states, namely idle, and full transmit and full receive states, and a number of intermediate transient states through which the attenuators are ramped between the stable states. Each intermediate state is preferably separated by an attenuation of 1.5 dB, and the attenuators are preferably ramped up between the intermediate states at the rate of one state every 0.5 milliseconds when going from the idle to the fully "on" state. The attenuators decay slowly back to the idle states, taking 1 or 2 seconds in the absence of speech signals. The ramp time in the decay direction is programmable. The peak detectors follow the envelope of the filter outputs, after being rectified. A fast attack and decay rate is used. If the speech detectors are triggered momentarily by short deviations in background noise, such as may be caused by typing at the keyboard, the peak detector output will decay back to the average noise level faster than the attenuators can swing to the full transmit state. Thus, although the attenuators might start to swing on a noise spike, they will return to the correct state more quickly than prior art circuits that have a long exponential rate of decay for the peak detectors. The invention will now be described in more SUBSTITUTE SHEET detail, by way of example only, with reference to the accompanying drawings, in which:- Figure 1 is a block diagram of a handsfree telephone circuit in accordance with the invention; Figure 2 is a block diagrammatic representation of a second order biquadratic digital high pass filters; Figure 3 is a block diagram of a peak detector filter; Figure 4 is a block diagram of a speech detector comparator; Figure 5 is a block diagram of a noise level detector filter; Figure 6 is a block diagram of a detection comparator; Figure 7 is a block diagram of a comparator low pass filter; Figure 8 is a diagram showing the output wave forms of the audio signals; Figure 9 is an attenuator state diagram; and Figure 10 is a flow chart showing the attenuator control algorithm. Referring now to Figure 1, the handsfree circuit comprises a two-to-four wire hybrid 1 connected to a full duplex telephone line 2 on one side and on the SUBSTITUTE SHEET other side to respective transmit and receive paths 3, 4. The transmit path 3 includes an amplifier 5 connected to a microphone 6, an analog-to-digital converter 7, and a variable loss attenuator 8. The receive path 4 also includes a variable loss attenuator 9, a digital-to-analog converter 10 and an amplifier 11 connected to a speaker 12. Each attenuator 8, 9 has sixty-four states separated by 1.5 dB loss. The attenuators 8, 9 are controlled by an attenuator control unit 13 in a complementary fashion so that as the loss introduced by one attenuator is decreased, the loss introduced by the other attenuator is increased by a corresponding amount. The attenuators 8, 9 have three stable states, namely an idle, and a full transmit and a full receive state having respectively minimum, intermediate and maximum loss. The losses introduced by the attenuators in these states can be preset by gain control inputs 14 to the attenuator control unit 13. The transmit and receive paths, 3, 4 are associated with respective separate monitoring circuits 14, 15 connected upstream of the attenuators 8, 9 to monitor audio signals in the paths 3, 4. Each monitoring circuit 14, 15 comprises a high pass filter 16, a rectifier 17, a peak level detector 18, and a speech detector 19. The monitoring paths are also connected to a common direction control comparator 20 which determines which audio path has control of the attenuator control unit 13. Each high pass filter 16 comprises a second order SUBSTITUTE SHEET biquadratic digital filter as shown in more detail in Figure 2. The filter, which has a programmable transfer function uses default filter coefficients for a high pass filter with a -3dB point at 400 Hz. This default filter ensures that the circuit will work reliably in environments with a large amount of low frequency background noise. The filter comprises a multiplier 21, adders 22 and 23, further multipliers 26 and linear filters 24 and 25. The result of the circuit shown in Figure 2 is to implement the equation: Y/X = G [1 + A Z -1 + A 2 Z _2 ]/[1 - B Z -1 - B 2 Z -2 ] where G, Al, A2, Bl and B2 are constants having values as follows: ;-12dB passband) The values of the gain G are separately programmable for the Rx and Tx monitoring circuits. The default values are for the filter to have an attenuation of 12 dB in the passband for both circuits. The rectified output of the high pass filter 16 is fed to a peak detector filter, shown in more detail in Figure 3. This comprises an adder 27 and first order digital filter 28. The peak detector responds quickly to a rectified input signal |x(n) |, which has been attenuated by 12dB in the filter 16. The speech detector 19, shown in more detail in Figure 4, comprises a noise detector filter 29, an SUBSTITUTE SHEET adder 30 and a comparator 31. The noise detector filter 29, shown in more detail in figure 5, comprises an adder 32, an adder 33, and a first order digital filter 34. The comparator produces a high output only when peak detector output is higher than the long-term average noise level. The threshold level is programmable. The direction control comparator is shown in more detail in Figure 6. The outputs of the peak detector filters 18 are fed to respective low pass filters 35, 36, which have a fast attack and slow decay having an inverted exponential form, as shown in Figure 9 for reasons that will be described in more detail below. The filter 35 in the transmit path Tx is connected to the non-inverting input comparator 37, and the filter 36 in the receive path Rx is connected through a variable attenuator 38 to the inverting input of the operation amplifier 37. The low pass filters 35, 36 are shown in more detail in Figure 7. A constant is added at 38 to register 39 (dec(n)) to produce a linearly increasing value dec(n) which is subtracted from register 40 complemented with subtractor 41. When a reset occurs, register 40, which is shown as Z ~ l, is loaded with peak(n) and register 39 is cleared to zero. This creates the inverted exponential decay function of comp(n) . Referring again to Figure 1, the signals on the full duplex line 2 ar assumed to be digital. The hybrid 1 provides an interface between the half duplex handsfree circuit and full duplex line 2. The hybrid 1 will also include D/A and A/D converters since the full duplex line 2 is analog. Incoming signals are directed from the line 2 into the receive path 4 and outgoing SUBSTITUTE SHEET signals are directed from the transmit path 3 into the line 2. In the case of the Rx signals, they are attenuated by an amount determined by the setting of the attenuator 9 prior to digital-to-analog conversion and amplification before they are applied to the speaker 12. When the handsfree circuit is in the full receive mode, i.e. with the Rx path in control, the attenuator 9 will be set for minimum loss so as to allow the incoming signals to pass through. Similarly, the outgoing signals are passed through amplifier 5, analog-to-digital converter 7, and attenuator 8, which operates in a manner complementary to the attenuator 9. When the circuit is in the transmit mode, i.e. with the transmit path in control, the attenuator 8 is set for minimum loss and the attenuator 9 is set for maximum loss. In the idle state, when no speech is present, both attenuators are set for midgain. A full state diagram of the attenuators 8, 9, is shown in Figure 9. Each attenuator has 64 states, each separated by 1.5dB gain/loss. Three of the states are stable, namely full transmit, full receive, and idle, when no speech is detected on either path. The stable states are programmable in accordance with system requirements. The attenuators are controlled in accordance with the flow chart shown in figure 10. The attenuator control unit 13 provides 6 bit gain control output to the T x and R x attenuators 8, 9. These 6 bit controls select one of 64 possible gains, on the ramp which are 1.5dB apart giving a maximum range of 64 steps of 1.5dB. SUBSTITUTE SHEET Of the 64 possible attenuator gain states, the speaker-phone will rest in only one of the three stable states (Full-Tx, IDLE, or Full-Rx) . During a transition from idle to a full state, or full state to full state, the attenuators 8, 9 pass through the other states at a fixed rate of 1.5dB every 0.5 millisecond. A full-state to idle-state transition is timed by two programmable timers (not shown) ; the "HOLD-OVER" timer and the "RAMP-DOWN" timer. The "HOLD-OVER" timer allows the attenuators to hold a full state level for a length of time determined by the time preset value before starting a slow decay to idle state, and the ramp down timer allows the slow decay rate to be programmed. The IDLE, MΔXTX and MAXRX levels (Figure 9) are stored in programmable registers (not shown) which may be programmed by an external microprocessor (not shown) . The choice of an IDLE level will affect the overall loop attenuation of the speaker-phone. User control of the speaker volume can be adjusted over the full range of the Rx attenuator by changing the contents of the Rx gain control register. The value written to the Rx gain control register is used to limit the maximum positive swing of the attenuator (MAXRX) . This feature allows the speaker-phone to operate "closer to full duplex" at low speaker volume settings because the attenuators will not have to swing so far. The maximum gain of the Tx speech path may also be programmed over the full range of the Tx attenuator with the Tx gain control register. (MAXTX) . The following are some recommended restrictions for the Txgain, and IDLE registers: SUBSTITUTE SHEET 1. The positive gain range of the Tx attenuator should be used for optimum noise performance in the transmit path. 0 < = TXGAIN < = 48 (base 10) 2. The following restriction applies to the Rx gain setting: 0 < = RXGAIN < = 63 (base 10) 3. The following restrictions apply to the IDLE state setting: (2 * IDLE - RXGAIN) > = 0 (2 * IDLE - TXGAIN) > = 0 The control inputs to the attenuator control unit 13 that cause the attenuators 8, 9 to change state are derived from the monitoring circuits 14, 15, which set the audio signals in the speech paths 3,4. There are two types of control signal, namely the signals from the speech detectors 19 that cause the attenuators 8 to ramp rapidly to the full state, and the direction control signals from comparator that determine which audio path controls the attenuator control unit 13 at any given time. The sensed audio signals are first fed through the second order high pass filter 16, which is programmable, but which has a default response, which is high pass and a minus 3dB point at 400 Hz. This frequency response ensures that the speech detector 19 and switching comparator 20 work reliably in environments with large amounts of low frequency noise, such as fans and other machinery, as well as with analog trunk hybrids that reflect low frequency components. The default value for the gain G in both SUBSTITUTE SHEET the Tx and Rx and paths, is 12dB, but the values for G in each of the paths can be programmed separately. It is preferable not to have a gain more than 12 dB because of word length effects inside the filter. The peak level detectors 18 produce an output signal representing the envelope of the waveform of the filtered audio signals, as shown in Figure 8. The peak detector registers 28 are updated once every 125 microseconds and thereby represent the short term average audio level. The detector respond immediately to a rectified input signal |x(n) |, which has been attenuated by at least 12dB in the second order filter. The rate of decay is exponential, with the time constant being, for example, in the order of 2 milliseconds. The speech detectors 19 compare the peak detector output with the noise level tracked by the noise level detector 29 (Figure 4) , which tracks the average noise level at the output of the peak detector 18. The comparator output is only high, indicating speech present, when the peak detector is higher than a long term average noise level plus a programmable threshold level, which can be used to control the sensitivity of the speaker phone to deviations in background noise level. The noise level filter 29 takes the long term average of the background noise level of the peak detector filter output. If the peak detector output is lower than the noise level filter, the noise level filter decays slowly toward the peak detector output, with a time constant of about 16 seconds. If the peak detector output is higher than the noise filter output, SUBSTITUTE SHEET the filter output increments linearly with a full scale time constant of 1,024 seconds. These long time constants are necessary to ensure that the noise level average is not moved significantly by speech present at the peak detector output. The noise level filter shown in Figure 5 takes the difference between peak(n) and noise (n) and scales the result down by 15 bits. If peak n minus noise n is negative, then the result after scaling down is always minus 1 (since 16 bit twos complement arithmetic is used) . If peak n minus noise n is positive, then the result is always 0. This yield the desired results since the attack time has to be made very slow. The slow attack time constant is accomplished with the second adder 33, which always adds 1 over 64. this is done by adding 1 every 64 sample periods. Since the attack time constant is so long, the initial value for the noise filter output (at time T = 0) is set to a large positive level to prevent start up problems. Direction control is determined by the direction comparator 20, which compares the outputs of the peak detectors 18. Two types of hysteresis are built in. First, depending upon the state of the comparator output, one of the two comparator input signals will be low pass filtered, and second the relative levels of the peak outputs are varied according to the state of the Tx and Rx attenuators. The low pass filter tends to extend the decay time of the peak detector signal in order for the comparator to hold on longer to the direction that it is currently switched to. For example, assuming that the Tx peak detector output is large enough to switch the SUBSTITUTE SHEET comparator to the Tx direction (positive output) , this positive output is used to disable the low pass filter on the Rx peak detector signal and enable the filter on the Tx peak detector signal. This effect allows the Tx peak detector to follow the speech envelope closely without requiring a long decay time, while still preventing the direction comparator from switching inadvertently to the Rx direction on an echo or reflection from an analog trunk interface. This hysteresis is even more important when the comparator switches to the Rx direction. Because of acoustic reverberation, the Rx signal that is sent to the speaker will appear in the Tx path at a much higher level and delayed in time. The slow decay time of the low pass filter and the effect of switching the low pass filters on and off, prevents acoustic reverberation of Rx speech from switching the comparator to the Tx direction. The secondary hysteresis effect is caused by the variable attenuator in the Rx control path (shown in the figure above) . Depending upon the state of the attenuator in the Rx speech path, the maximum level of a reverberation signal in the Tx path can be deduced. For example when the Rx attenuator is in full receive mode (maximum volume) the attenuator in the Rx control path (to the -ve input of the direction comparator) is also at a maximum volume level which is identical to the Rx attenuator. Conversely when the Tx attenuator is in full Tx mode, the Rx attenuator is at a minimum level and so is the attenuator in the Rx control path. This produces a hysteresis effect on the comparator which makes it gradually harder for the opposing speech path to take control depending upon how far the attenuators are from the idle state. SUBSTITUTE SHEET When the attenuators are in idle state, the two inputs to the direction comparator should be roughly balanced. This balance may be changed by modifying the gains of the High Pass Filter sections (HPF) in the control paths. Referring again to Figure 8, the diagram shows an example speech signal being transmitted in the RX speech path, and the resulting echo waveform in the Tx path due to acoustic coupling from speaker to microphone. The peak detector filter follows the envelope of the signal closely with a fast decay rate. This fast decay rate is useful so that the speech detectors will only be triggered momentarily by short deviations in background noise. If a noise spike is shorter than a few milliseconds, the peak detector output will decay back to the average noise level faster than the attenuators can swing to a full-on state. The "HOLD-OVER" timer is not preset until the attenuator reaches the full-on state, therefore this makes the switching insensitive to large (but short) deviations in background noise. Although the" attenuators might start to deviate on a noise spike, they will return to the correct state more quickly than prior art algorithms, that have a long exponential or linear rate of decay for peak detectors. Figure 8 also shows the comparator filter output for the Rx path. The decay characteristic of this filter, which is of approximately inverted exponential from, prevents the echo waveform in the Tx path from causing a switch to Tx after the Rx signal disappears. The comparator filter output in the Tx path is forced to follow the Tx peak detector output until the switching comparator switches to Tx. SUBSTITUTE SHEET The various state constants can be stored in 16 bit registers as follows: Tx Speech Detector Threshold Default value 'OlCOh' Address 22h This register is used by the handsfree program as a threshold level for the speech detector comparators. RX Speech Detector Threshold Default value 'OOEOh' Address 23h This register is used by the handsfree program as a threshold level for the speech detector comparators. IDLE State Register Default value '0026h' Address 24h This register is used to program the idle state level for handsfree operation. Bits (b5 to bO) in this SUBSTITUTE SHEET register represent a number referred to as "IDLE" in the formula below. Idle level (in dB) = (1.5dB X IDLE) - 72dB. Comparator Decrement Constant Default value '0004' Address 25h This register is used to program the decay rate of the comparator low pass filters. Ramp-out Timer Register Default value 'OOAO' Address 26h This register is an 8 bit binary number used by the handsfree program as a timer present value to program the ramp-out (ramp-down time) of the attenuators when decaying back to idle state. Decay time per 1.5dB attenuator step = (timer present value) x (0.5msec) Hold-over Timer Register Default value SUBSTITUTE SHEET 'OlθOh' Address 27h This register is an 8 bit binary number used by the handsfree program as a timer preset value to program the hold-over time of the attenuators. This is the length of time that the attenuator holds full state before starting to ramp down to idle state. Tx High Pass Filter Gain Register Default value "035Oh" Address 28h This register is used to program the gain of the digital filter in the voice detector path. RX High Pass Filter Gain Register Default value 'O350h' Address 29h This register is used to program the gain of the digital filter in the voice detector path. Filter Coefficient Al Register Default value SUBSTITUTE SHEET 'E024h' Address 2Ah This register is used to program the Al coefficient in the HPF. Filter coefficient A2 Register Default value 'lOOOh' Address 2Bh This register is used to program the A2 coefficient in the HPF. Filter coefficient Bl Register Default value '19COh' Address 2Ch This register is used to program the Bl coefficient in the HPF. Filter coefficient B2 Register Default value 'F540h' Address 2Dh This register is used to program the B2 coefficient in the HPF. The above described circuit has a good tolerance to intermittent background noise and does not suffer to SUBSTITUTE SHEET the same extent as prior art circuits from a hollow sound due to band limiting of the speech signals. The use of the special filter design in the directional control comparator minimizes switching on echo signals or reverberation. SUBSTITUTE SHEET

Claims: Claims : 1. A handsfree telephone circuit with separate transmit and receive audio paths for connection to a microphone and speaker respectively, comprising a controllable attenuator in each of said transmit and receive paths; attenuator control means responsive to control signals to set the attenuation level of said attenuators; a separate monitoring circuit defining respective monitoring paths connected to each of said transmit and receive paths for sensing audio signals therein, each said monitoring circuit comprising a filter in the associated monitoring path for band limiting said audio signals, a rectifier, a peak level detector receiving said band limited signals, and a speech detector for distinguishing speech from background noise; and a switching comparator for comparing the outputs of the peak level detectors in the two monitoring circuits and producing directional control signals for said attenuator control means to determine which audio path has control thereof. 2. A handsfree telephone circuit as claimed in Claim 1, further comprising a fast response filter with a slow decay rate in each of the input paths of said switching comparator, and means for disabling the filter in the non-controlling path so that the tendency of the switching comparator to switch on echo signals in the non-controlling path is reduced. 3. A handsfree telephone circuit as claimed in Claim 2, wherein the transfer function of said filters in the input paths of the comparators has an approximately inverted exponential form. SUBSTITUTE SHEET 4. A handsfree telephone circuit as claimed in Claim 2, further comprising a variable attenuator in one of the input paths of said comparator that tracks the attenuation level of the attenuator in the associated audio path so as to produce a hysteresis effect that makes it gradually harder for the inactive speech path to become active as the attenuators move further toward their extreme states. 4. A handsfree telephone circuit as claimed in Claim 3, further wherein said variable attenuator is in the receive path. 5. A handsfree telephone circuit as claimed in Claim 1 wherein the filter in each monitoring circuit is a second order biquad filter. 6. A handsfree telephone circuit as claimed in Claim 1, the second order biquad filter has the following Z- domain transfer function: γ ( z ) / χ (z) = G [1 + AiZ -1 + A 2 Z- 2 ]/[l - B^ -1 - B 2 Z ~2 _ where X, Y, G is the gain, and A]_, A , B]_, B 2 are constants. 7. A handsfree telephone circuit as claimed in Claim 6, where G, A]_, A , B_, B 2 have the following approximate values: SUBSTITUTE SHEET 8. A handsfree telephone circuit as claimed in Claim 1, wherein each said attenuator has three stable states, namely Full - Tx, IDLE, and Full Tx, and a plurality of intermediate transient states through which said attenuators pass stepwise during a transition between any of the stable states. 9. A handsfree telephone circuit as claimed in Claim 1, wherein said attenuator control means causes said attenuators to ramp rapidly to the extreme states when speech is detected in one of the audio paths and to ramp slowly back to the idle state in the absence of speech. 10. A handsfree telephone circuit as claimed in Claim 8, wherein said intermediate states are separated by a fixed attenuation of about 1.5dB 11. A handsfree telephone circuit as claimed in claim 8, further comprising means for presetting the attenuation level of each of said attenuators in said stable states. SUBSTITUTE SHEET

Inventors: REESOR GORDON J, REESOR, GORDON, J.
Applicants: MITEL CORP, MITEL CORPORATION
Application year: 1992
Main classification: H04M1
IPC codes: H04B3, H04M1, H04M9