The present invention relates to an ambient noise Root Mean Square (RMS) level detector. In particular, the present invention is directed toward an improved noise RMS detector that is robust to speech presence, wind noise, and other sudden variations in noise levels.
A personal audio device, such as a wireless telephone, includes an adaptive noise canceling (ANC) circuit that adaptively generates an anti-noise signal from a reference microphone signal and injects the anti-noise signal into the speaker or other transducer output to cause cancellation of ambient audio sounds. An error microphone is also provided proximate the speaker to measure the ambient sounds and transducer output near the transducer, thus providing an indication of the effectiveness of the noise canceling. A processing circuit uses the reference and/or error microphone, optionally along with a microphone provided for capturing near-end speech, to determine whether the ANC circuit is incorrectly adapting or may incorrectly adapt to the instant acoustic environment and/or whether the anti-noise signal may be incorrect and/or disruptive and then takes actions in the processing circuit to prevent or remedy such conditions.
Examples of such adaptive noise cancellation systems are disclosed in published U.S. Patent Application 2012/0140943, published on Jun. 7, 2012, and in published U.S. Patent Application 2012/0207317, published on Aug. 16, 2012, both of which are incorporated herein by reference. Both of these references are assigned to the same assignee as the present application and name at least one inventor in common and thus are not prior art to the present application, but are provided to facilitate the understating of ANC circuits as applied in the field of use.
Referring now to
Wireless telephone 10 includes adaptive noise canceling (ANC) circuits and features that inject an anti-noise signal into speaker SPKR to improve intelligibility of the distant speech and other audio reproduced by speaker SPKR. A reference microphone R is provided for measuring the ambient acoustic environment and is positioned away from the typical position of a user's/talker's mouth, so that the near-end speech is minimized in the signal produced by reference microphone R. A third microphone, error microphone E, is provided in order to further improve the ANC operation by providing a measure of the ambient audio combined with the audio reproduced by speaker SPKR close to ear 5, when wireless telephone 10 is in close proximity to ear 5. Exemplary circuit 14 within wireless telephone 10 includes an audio CODEC integrated circuit 20 that receives the signals from reference microphone R, near speech microphone NS, and error microphone E and interfaces with other integrated circuits such as an RF integrated circuit 12 containing the wireless telephone transceiver.
In general, the ANC techniques measure ambient acoustic events (as opposed to the output of speaker SPKR and/or the near-end speech) impinging on reference microphone R, and by also measuring the same ambient acoustic events impinging on error microphone E, the ANC processing circuits of illustrated wireless telephone 10 adapt an anti-noise signal generated from the output of reference microphone R to have a characteristic that minimizes the amplitude of the ambient acoustic events at error microphone E. Since acoustic path P(z) (also referred to as the Passive Forward Path) extends from reference microphone R to error microphone E, the ANC circuits are essentially estimating acoustic path P(z) combined with removing effects of an electro-acoustic path S(z) (also referred to as Secondary Path) that represents the response of the audio output circuits of CODEC IC 20 and the acoustic/electric transfer function of speaker SPKR including the coupling between speaker SPKR and error microphone E in the particular acoustic environment, which is affected by the proximity and structure of ear 5 and other physical objects and human head structures that may be in proximity to wireless telephone 10, when wireless telephone is not firmly pressed to ear 5.
Such adaptive noise cancellation (ANC) systems may employ a Root Mean Square (rms) detector to detect average background noise levels. Such an RMS detector needs to track background noise levels slowly but not so slowly as to become insensitive to environmental variations. An ideal RMS detector should be robust to speech presence, robust to scratching (contact) on the microphone, robust to wind noise, and a have a low computational complexity. For the purposes of describing the present ambient noise RMS detector, the lower case rms variable is utilized to refer to the prior art techniques and the upper case RMS to represent the corrected signal of the present ambient noise RMS detector, as set forth below. The present ambient noise RMS detector may utilize the prior art rms value in generating the RMS signal.
Perhaps the most well-known background noise estimation method, based on minimum statistics, was the rms detector introduced by Ranier Martin. See, Martin, Ranier, Noise Power Spectral Density Estimation Based on Optimal Smoothing and Minimum Statistics, IEEE Transactions on Speech and Audio Processing, Col. 9, No, 5, July 2001, incorporated herein by reference, as well as Martin, Ranier, Spectral Subtraction Based on Minimum Statistics, in Proc. 7th EUSIPCO '94, Edinburgh, U.K., Sep. 13-16, 1994, pp/. 1182-1195, also incorporated herein by reference. Israel Cohen has made another RMS detector based on the Martin design. See, Cohen, Israel, Noise Spectrum Estimation in Adverse Environments: Improved Minima Controlled Recursive Averaging, IEEE Transactions on Speech and Audio Processing, Vol. 11, Issue 5, September 2003, incorporated herein by reference as well as Cohen, Israel, Noise Estimation by Minima Controlled Recursive Averaging for Robust Speech Enhancement, IEEE Signal Processing Letters, Vol. 9, No. 1, January 2002, also incorporated herein by reference. Both the Martin and Cohen methods and designs employ a method to track the minimum RMS value. Both methods also use a first-order regressor with a variable smoothing factor.
The Cohen design may be less complex compared and provides better performance compared to the Martin design. The Cohen design depends on a couple of thresholds and parameters that should be adjusted for different applications. The Cohen design also uses less memory than the Martin design in that previous values of rms are kept to find the minimum value. The problem with the Cohen design is that it is susceptible to non-stationary noise such as spike noise. For example, when used in an adaptive noise cancellation system (ANC) on a cellular phone or the like, spike noise such as wind noise or scratching (user's/talker's hand scratching or rubbing the case) may create spikes to which the Cohen design would over-react. As a result, the performance of an ANC system, for example, in a cellular telephone or the like, may be degraded, as the rms detector over-reacts to these spike noises.
A simple rms detector based on a first order regression may produce an output illustrated in
where α represents a smoothing factor, rms(n) represents the rms value for the sample n and input(n) represents the input signal for sample n, and n is a sample integer number. Thus, the rms value in equation (1) is calculated by multiplying a smoothing factor (subtracted from one) times the previous rms value and then adding the absolute value of the input value times this same smoothing factor. The smoothing factor α may be selected from one of two values, αatt or αdec depending on whether the absolute value of the input signal is greater or less than the previous rms value.
The problem with such a simple rms detector is that it not only tracks background noise, but also speech, scratch, and wind noise. As illustrated in
The present ambient noise RMS detector represents an improvement over the prior art rms detector from a adaptive or machine learning perspective. The present ambient noise RMS detector uses the concept of a k-NN (classifying using nearest neighbors) algorithm in order to obtain RMS values. The k-nearest neighbor algorithm (k-NN) is a method for classifying objects based on closest training examples in the feature space. k-NN is a type of instance-based learning, or lazy learning where the function is only approximated locally and all computation is deferred until classification. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common amongst its k nearest neighbors (k is a positive integer, typically small). If k=1, then the object is simply assigned to the class of its nearest neighbor.
The same method can be used for regression, by simply assigning the property value for the object to be the average of the values of its k nearest neighbors. It can be useful to weight the contributions of the neighbors, so that the nearer neighbors contribute more to the average than the more distant ones. (A common weighting scheme is to give each neighbor a weight of 1/d, where d is the distance to the neighbor. This scheme is a generalization of linear interpolation.)
The present invention incorporates a prior art rms detector using first-order regressor with a variable smoothing factor but adds additional features to penalize samples from center of data in order to obtain RMS values. Thus, samples which vary greatly from the background noise levels, such as speech, scratch, and other noise spikes, are dampened in the RMS calculation. However, when background noise increases/decreases (changes in general), the system will track this change in background noise and include that in the calculation of the corrected RMS value.
Output from a prior art rms detector using a first-order regressor with a variable smoothing factor is fed to a minimum tracker, which is also known in the art. The minimum tracker tracks the minimum rms value, Rmin over time. This revised minimum value is used to compute a normalized distance value d, which represents the ratio expressed as the absolute value of the difference between the previously calculated rms value, and the RMS value calculated in the present ambient noise RMS detector divided by the RMS value calculated by the present ambient noise RMS detector. This value d in turn is used to normalize the smoothing factor α by dividing the smoothing factor by the maximum of d or 1.
Once these values are calculated, a corrected or revised RMS value can be determined as the function of the previous RMS value multiplied by one minus the smoothing factor plus the smooth factor times the minimum rms value to output the corrected RMS for the present ambient noise RMS detector. The rms value may be used to generate a reset signal for the minimum tracker. This reset signal may be operated on an order of 0.1 to 1 seconds and is used to avoid deadlock in the tracker, for example, when the background signal increases over time.
The effect of the present ambient noise RMS detector, as demonstrated in the Figures attached herewith, is to provide a background RMS value which is largely immune from sudden spikes in value, such as due to speech, “scratching” (when a person physically touches the microphone, for example), or wind noise, particularly when compared to the prior art techniques.
While discussed herein in the context of cellular telephones and adaptive noise cancellation circuits used therein, the present ambient noise RMS detector has applications for a number of audio devices and the like. For example, the RMS detector of the present invention may be applied to audio and audio-visual recording equipment, computing devices equipped with microphones, speech recognition systems, speech activated systems (e.g., in automobiles), and even event detectors, such as alarm systems, where it may be desirable to filter background sounds from sudden noises, such as glass-break or speech by intruders. While disclosed in the context of cellular phones and adaptive noise cancellation circuits, the present ambient noise RMS detector should in no way be construed as being limited to that particular application.
The present ambient noise RMS detector improves upon the techniques of prior art rms detectors such as taught by Martin and Cohen by using an improved algorithm in the RMS detector.
Both the Martin and Cohen methods and designs discussed above also employ a method to track the minimum rms value, Rmin, and tracking the minimum rms value is one function of the present ambient noise RMS detector. Speech, scratching (physical contact) on the microphone, wind noise, and any spike noise are all unlikely background noise in that they are not always present but appear as noise spikes in the ambient noise signal. This fact can be leveraged by comparing a short-term minimum RMS value with a long-term one to determine whether such a spike has occurred.
where Rmin is the minimum rms value over time, and Rtmp is a temporary minimum rms value to track background noise changes.
The reset mechanism for the ambient noise detector is then calculated simultaneously with equation (2). This reset mechanism calculates a long-term rms value every 0.1 to 1 seconds for values Rmin and Rtmp as:
As illustrated in
In Cohen's method from this minimum RMS value Rmin calculation, it may be possible to calculate RMS using a first approach based on the probability of the presence of disturbance in the background noise signal:
RMS(l)=αd(l)·RMS(l−1)+(1−αd(l)·|input(l)|
αd(l)=β+(1−β)*p(l)
p(l)→1→αd(l)→1 (4)
Here, p(1) is the probability of the presence of any disturbance (e.g., speech presence), and as this probability approaches one, the smoothing factor value approaches one. This probability value may be calculated as follows:
where αp represents a smoothing factor, and δ is the threshold which determines the level of any disturbance compared to Rmin(1).
One problem with this RMS tracking technique is that there are too many parameters to adjust. In addition, its reaction time is slow and is not robust. Speech rms can leak to the background RMS value. While the prior art Cohen design has additional components to make the system more robust, the system still suffers from these same operational problems. Thus, the present ambient noise RMS detector improves on the algorithms of equations (4) and (5) to provide an improved minimum RMS value Rmin tracking technique and RMS calculation.
Referring back to
where rms(l) is a raw rms value for sample l and RMS(l) is a corrected RMS factor.
In block 160, the smooth factor is normalized with this distance d:
where αd(l) represents the normalized smoothing factor for sample l and α0 represents a standard smoothing factor, and max(d, 1) is the maxima of the normalized distance and 1. The normalized smoothing factor is then fed to block 170:
RMS(l)=(1−αd(l))·RMS(l−1)+αd(l)·Rmin(l) (8)
where RMS(l) is the corrected RMS value, and RMS(l−1) is a previous corrected RMS value, αd(l) represents the normalized smoothing factor for sample l as calculated in equation (7) and minimum RMS value Rmin is the minimum rms value calculated in equation (3).
The raw rms value is also fed to block 190, which then generates a reset signal Reset. The reset signal Reset is triggered in order to reset the system to avoid any deadlock, for example, when the background noise signal rises gradually. The reset mechanism is shown in equation (3) as discussed previously.
The present ambient noise RMS detector has thus been proven to more accurately calculate RMS values from an input signal, while being relatively immune to speech, wind noise, scratch, and other signal spikes. This improved RMS value calculation provides a better input value for an adaptive noise cancellation (ANC) circuit for use, for example, in a cellular telephone or the like. This improved value in turn allows for better operation of the ANC circuit, creating fewer artifacts or dropped out audio (e.g., due to the ANC circuit overcompensating and muting desired audio signals) in the audio output to the user.
While embodiments of the present ambient noise RMS detector have been disclosed and described in detail herein, it may be apparent to those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope thereof.