Technical Field
This invention relates generally to automatic gain control, and more specifically, to automatic gain control with speech recognition.
Background
Automatic gain control (AGC) of speech signals is used to maintain the level of a signal representing speech relatively constant. Most existing circuits designed for automatic gain control of speech suffer from at least one of the following problems (1) they respond slower than necessary to changes in the average amplitude of the speech, (2) they sound unnatural due to allowing the speech amplitude to adapt too quickly, or (3) they allow extraneous sounds to be subject to AGC also. Most of those circuits respond slower than necessary because they use all available information present at the input of the AGC. Therefore, they must use very long time constants for smoothing because of the highly variable nature of the amplitudes of the signals (speech, noise, and silent passages are all included in the input information). Improvements have been made in other AGCs by processing only the largest amplitude signals within a given range of the expected signal, where the expected signal was derived from ongoing information. With this approach, if no information is received within the expected range, the estimate of the expected signal would be gradually lowered until information is again received within the expected range. In order to make the AGC sound natural, the process of changing the expected range of information must occur fairly slowly to prevent performing AGC on low amplitudes of information that occur in normal speech. Some AGCs process only information that contains components in a particular frequency band, in which it is assumed that most of the information will be speech. That approach has obvious shortcomings because many sounds that are not speech have components in the speech range and also because there could be a very large variation in the amplitudes of the speech within the particular frequency band (in that both voiced and unvoiced sounds may meet the criteria). Thus, a need exists for an AGC circuit that allows a faster AGC response time with natural sounding speech, and will not increase the gain on non-speech background noise during pauses or when the user is in a high noise environment.
Summary of the Invention
Briefly, according to the invention, an automatic gain control circuit comprises a speech recognizer to obtain smooth automatic gain control. An analog audio input signal is converted to a digital signal input by an analog-to-digital (A/D) converter and delayed by delay means. A frame power (or alternatively, rectified peak amplitude) detector determines the power of each frame (or alternatively, the rectified peak amplitude) of the audio input signal, after applied to the A/D converter. A linear-to-log converter converts those values to a logarithmic form (for gain control over a broad range of values). Detected speech smoothing means smooths the variation in the values determined by the frame power (or peak amplitude) detector. A summer subtracts the output of the detected speech smoothing means from a fixed reference level, and thus obtains an error signal from the desired reference. A gain smoothing circuit smooths the resulting error signal (which is the logarithmically-shaped gain signal). A logarithm-to-linear converter converts the logarithmic gain signal to a linear form; and a multiplier multiplies the digital input signal by this smoothed gain. In accordance with the invention, a speech recognizer determines whether the audio input signal represents speech in terms of known recognizable words or sounds. An output of the speech recognizer is used to enable the detected speech smoothing means and the gain smoothing means when the audio input signal represents speech. Thus AGC is not used until it is required (i.e., when speech is present).
Brief Description of the Drawings
FIG. 1 shows an AGC circuit in accordance with the invention.
FIG. 2 shows another AGC circuit in accordance with the invention.
FIG. 3 shows still another AGC circuit in accordance with the invention.
Detailed Description of the Preferred Embodiment
Referring to FIG. 1, there is shown an automatic gain control (AGC) circuit 10 to be used with a radio transceiver 48 in accordance with the invention. The AGC circuit 10 functions as a "smart" automatic gain control for speech systems. Preferably, the AGC circuit 10 is used at a microphone input in a land mobile or cellular radio, base station, or portable radio (any of which is represented by the transceiver 48), or at the input of a repeater, but it could be used in any environment requiring automatic gain control of speech, such as in a hands-free mobile radio application.
In the embodiment of FIG. 1 all the processing of the AGC circuit 10 may be done inside a conventional digital signal processor (DSP), except possibly, the analog-to-digital (A/D) and digital-to-analog (D/A) functions. However, it will be appreciated that each of the functions of the AGC circuit 10 may also be performed with circuits or other means corresponding to the blocks in the AGC circuit 10. Operationally, an audio input signal is received at a microphone 12. An A/D converter 14 converts the audio input signal into a digital input signal. The digital input signal is delayed for a short period of time (e.g., tens of milliseconds) by a delay circuit 16 (e.g., a speech buffer). A frame power (or peak amplitude) detector 18 determines the power of each frame (or rectified peak amplitude) of the audio input signal, after it is applied to the A/D converter 14. The linear-to-logarithm converter 20 converts those values to a logarithmic form (for gain control over a broad range of values). Detected speech smoothing means 24 (e.g., a low-pass filter) smooths the variation in the values determined by the frame power (or peak amplitude) detector 18. A summer 36 subtracts the output of the detected speech smoothing means 24 from a fixed reference level, and thus obtains an error signal from the desired reference. The gain smoothing circuit 38 smooths the resulting error signal (which is a logarithmically-shaped gain signal). A logarithm-to-linear converter 40 converts the logarithmic gain signal to a linear form; and a multiplier 44 multiplies the input signal by this smoothed gain signal, thus resulting in gain control. In accordance with the invention, a speech recognizer 226 determines whether at least a portion of the digital input signal represents any of a set of words that it is programmed to recognize (i.e., recognizable speech). The speech recognizer 26 can be the SPHINX System described in "Large-Vocabulary Speaker-Independent Continuous Speech Recognition: The SPHINX System" Computer Science Department Carnegie Mellon University (1988), hereby incorporated by reference. A speech detect output 27 of the speech recognizer 26 is used to enable the detected speech smoothing means 24 and the gain smoothing means 38 when the digital input signal represents recognizable speech. Thus AGC is not used until required (i.e., when reconizable speech is present). Specifically, when the speech detect output 27 first goes from false (i.e., no speech is detected) to true (i.e., speech is detected), the output of the detected speech smoothing means 24 is initialized to the level currently at its input. The detected speech smoothing means 24 then smooths, as any typical low-pass filter would while the speech detect output 27 is true. Also, the gain smoothing only changes when the speech detect output 27 is true. When the speech detect output 27 is false, the gain smoothing output maintains its previous output value without responding to changes in its input. This allows the AGC's control to respond only to the portions of the input signal that are truly speech.
In an alternate implementation of the operation of the detected speech smoothing means 24 and the gain smoothing means 38, the detected speech smoothing means 24 can perform an average of its input values during only the time the speech detect output 27 is true. The output of detected speech smoothing means 24 would then be applied to summer 36 at the transition of the speech detect output 27, changing from a true to a false state. The output of detected speech smoothing means 24 to summer 36 results in a new output value to the input of gain smoothing means 38. The gain smoothing calculation would then be made based on the new value from the summer 36. The latter implementation differs from the one discussed previously in that there is only one change in each of the outputs of detected speech smoothing means 24, summer 36, and gain smoothing 38 for each speech portion that is detected.
The output of the multiplier 44 is converted to analog form by a D/A converter 46. The resulting amplified analog signal is then applied to a conventional radio transceiver 48 for transmission via an antenna 50.
Referring to FIG. 2, an AGC circuit 10' similar to the AGC circuit 10 is shown. The AGC circuit 10' also includes a speech (or keyword) recognizer 30 which, in this embodiment, processes the incoming speech (after converted to digital form) to detect and discern one of a set of commonly occurring sounds or keywords. These sounds or keywords may be stored in a reference codebook 28 (e.g., a memory look-up table). The information stored in the reference codebook 28 could be a set of the ten, or so, most common vowel sounds or a set of any of the most commonly occurring words like "a", "an", "the", "of", etc., or some combination of these sets or others (hereafter called keywords). The specific method of recognition may be selected. The requirements on the recognition method are that it can distinguish these keywords in a continuous speech environment with a fairly low instance of substitution error (i.e., incorrectly classifying keywords within the desired set). It can be allowed to have a fairly large deletion error rate (i.e., failing to recognize keywords within the desired set), so its parameters can be adjusted to insure that it does not make insertion errors (i.e., recognizing keywords that are not in the desired set) at the expense deletion errors.
There are two outputs, 31 and 29, of the speech recognizer 30. The keyword detect output 31 simply indicates the presence or absence of a valid keyword in the input signal, and enables the detected speech smoothing means 24 and the gain smoothing means 38 when such a valid keyword is detected. It is also timed such that this output indication will be present during the peak power (or peak amplitude) part of the keyword. Output 29 provides the keyword. When the reference codebook 28 receives a keyword, it provides an output signal to a summer 32 so that the output signal of the reference codebook 28 is added to a reference level provided by the fixed reference source 34. The summer 32 then provides a keyword reference to the summer 36 for summing with the output of the detected speech smoothing filter 24. The circuit 10' works in a manner similar to the AGC circuit 10 to provide AGC when a keyword is detected in the input signal.
The keyword detect output 31 of speech recognizer 30 is used to enable the detected speech smoothing means 24 and the gain smoothing means 38 in a manner similar to that described with respect to circuit 10. This allows the AGC circuit's gain control section to respond only to the portions of the input signal that are truly speech while limiting the set of speech signals to which it responds to be a small, known, frequently occurring subset of the possible speech signals actually applied to its input.
A delay circuit 42 introduces a delay in the input audio signal before that signal is multiplied with the linear gain signal. This allows the gain to be applied to earlier speech samples, to minimize the effect of the time delay that is required to process the speech in the speech recognizer 30. This reduces the apparent response time to changes in the input signal amplitude.
Referring to FIG. 3, there is shown an AGC circuit 10" representing the AGC circuit 10' modified to include a speech detector 22 for detecting the presence of speech-like components (e.g., based on power above background noise or other known speech detection techniques), for disabling the log-to-linear converter 40 when any speech is detected in the input signal. In this configuration, the changes in the gain that were calculated during the recognized speech are not applied to the multiplier during the time that the input signal represents speech, but the changes are made between words to make the transition in gain less noticeable. A speech recognizer 52 can operate as either speech recognizer 26 or 30 (or both). The speech recognizer 52 has output 54 for enabling the detected speech smoothing means 24 and the gain smoothing means 38 in a manner similar to that of circuits 10 and 10'. The output 56 is similar to output 29 of FIG. 2. The speech detector 22 function may be incorporated into the speech recognizer 52.