The present invention relates to sound systems where a microphone in the vicinity of a loudspeaker might give rise to acoustic feedback.
In sound systems, there is some acoustic coupling between a loud speaker, an amplifier, and a microphone so that the entire system forms a closed loop. If a feedback ratio, or “loop gain,” exceeds a certain threshold, the system will oscillate, or “ring,” and acoustic feedback will occur. This feedback will persist until something is done to reduce the loop gain.
Many sound systems rely on an operator who can determine the presence of acoustic feedback and react before the resonance builds and becomes alarming to the audience, or before equipment damage takes place. The operator normally either reduces the system gain, or manually applies some filtering at a resonant frequency using an equalization device.
The role played by the operator in maintaining system stability against feedback would not be necessary if the system had the ability to detect its own feedback and upon detection, to reduce the loop gain of the system at that particular frequency until the ringing ceased. Accordingly, there is a need for a system or method that can detect the presence of acoustic feedback and automatically reduce the gain at a particular frequency or frequencies.
The present invention provides a method and system for eliminating acoustical feedback. In one embodiment, the method includes determining at least one parameter for at least one notch filter, adjusting the notch filter based on the parameter, processing the digital signals through the notch filter, testing the effect of the notch filter in the system, and removing the notch filter if the notch filter is not effective.
In some embodiments, the method also includes selecting candidate feedback frequencies, as opposed to other desirable sound frequencies. The selection method may include converting the time domain digital signal samples by a Fourier transform algorithm into the frequency domain, using a ballistics approach to find persistent prominences in the frequency spectrum, and testing the prominences.
a is a functional block diagram of one embodiment of a digital processor used in the present invention.
b is a functional block diagram of an alternative embodiment of a digital processor used in the present invention.
a is an illustration of the results of one embodiment of the ballistics selection process.
b is an illustration of the results of one embodiment of the ballistics selection process.
a is a graphical representation of a sinusoidal signal shown in the time domain.
b is a graphical representation of a sinusoidal signal shown in
a is a graphical representation of an illustrative signal in the time domain.
b is a graphical representation of the illustrative signal shown in
The present disclosure discusses a method and system for eliminating acoustic feedback. It is understood, however, that the following disclosure provides many different embodiments, or examples, for implementing different features of the invention. Specific examples of components and arrangements are described below to simplify the present disclosure. These are, of course, merely examples and are not intended to limit the invention from that described in the claims.
Referring to
Referring to
Referring also to
The signals are filtered and processed at one processing rate (steps 302, 304, 308, and 310), but the notch filter parameters may be determined at a different processing rate (step 306). Thus, there may be two processing flows which is graphically illustrated in
In
Conceptually, the process of determining the notch filter parameters can be divided into two major processes, each process comprising a series of subroutines or sub-processes. A first process is the candidate frequency selection process 406. A second process is the implementation process 408. As will be explained in detail later, the candidate frequency selection process 406 uses a Fast Fourier Transform (“FFT”) subroutine 410, a magnitude squared subroutine 412, a ballistics process 414, a prominence search routine 416 and a threshold detection process 418.
The implementation process 408 uses an assignment process 420, a series of state machine routines 422, which are coupled with filter parameter generation processes 424. Once the candidate frequencies are selected by the frequency selection process 406, the implementation process 408 tests candidate frequencies by applying a corresponding notch filter at the candidate frequencies in the sound signal in flow path 402 at one or more notch depths over time. A “notch depth” is the amount of filtering (i.e., reduction in amplitude, usually described in decibels) at a particular frequency. If there is good correlation between the trial filter depth changes and the recorded amplitude changes, then the frequency is determined to be the result of acoustic feedback. In this case, one or more of the notch filters 407 are left in the flow path 402 at a predetermined notch depth. If there is poor correlation, then the frequency is determined to be a result of a wanted signal (e.g. music or speech etc), so the notch filter is removed.
As those who are skilled in the art will appreciate, sound signals are converted into digital signals in the time domain, but spectral analysis and discriminations are often performed in the frequency domain. A process known as a discrete Fourier Transform is one method of converting a signal from the time domain to the frequency domain. A Fast Fourier Transform (“FFT”) is an efficient and well known algorithm for calculating the discrete Fourier Transform of a signal.
a and 12b can be used to illustrate the function of a FFT.
Utilizing the FFT algorithm, each segment or “frame” of the time domain signal can be converted into the frequency domain. The number of discrete frequency components which can be distinguished in the frequency domain is equal to half the number of samples in the segment. For the example of
b is a graphical representation of the time domain signal of
a is another example illustrating a complex time domain signal 1302.
When a typical signal is converted into the frequency domain by the FFT, this signal has frequency components divided into bins representing the entire frequency spectrum. A frequency spectrum or FFT “frame” is the array of output bins produced for any given time segment. A new FFT frame can be produced at regular intervals.
Turning now to
Once a predetermined number of new signals have accumulated in a signal storage buffer (e.g., a predetermined portion of RAM 206 or RAM 216), in step 502, the signal information in the buffer is processed using a Fast Fourier Transform algorithm (FFT). In one embodiment of the present invention, a FFT is run once every 4096 samples, and produces 4096 bins per FFT frame. The rate at which FFTs are run is 1/4096th of the sample rate, or about 85 milliseconds. This effectively produces a sample rate of 11.7 Hz for FFT processing. The FFT transforms the time domain signal into a pair of arrays of FFT bins representing the real and imaginary components of the signal in the frequency domain.
In step 504, half of the real and imaginary output arrays from the FFT are combined by summing the squares of each to produce an array of bins representing the magnitudes squared. The other half is a redundant mirror image. Thus, in the present embodiments, 2048 magnitude-squared values are stored for later analysis.
In step 506, all the “magnitude squared bins” are averaged into a Mean-Square value, or a mean value of the magnitude-square values. Such a value is a measure of the energy of the signal during the current FFT frame. This value can be used as a reference of the energy of the overall signal against which the feedback energy can be compared by examining the ratios between them. As those skilled in the art will appreciate, the ratios can be compared with either squared or linearly represented data. Consequently, the present invention should not be interpreted as being limited to analyzing data based only on “squared data.”
In step 508, the ballistics process 414 is then applied to the magnitude squared bins or “frequency magnitude bins.” The ballistics sub-process is actually a bank of digital filters operating in the (frame rate) time domain on each FFT bin. For each frequency magnitude bin, a running average value of past bin values can also be kept in memory.
OLD_VALUE=(NEW_VALUE−OLD_VALUE)*K+OLD_VALUE.
Where K is the filtering coefficient according to the equation:
K=1−(1−Threshold)̂(1/(t*Ffs))
Where t is the time value to reach threshold, for example 1 second, the Threshold is the fractional value for which the time value is calibrated, for example 0.5, and Ffs is the frame sample rate, for example 11.7 Hz
Such filtering is only applied when the NEW_VALUE from the FFT is greater than the OLD_VALUE in memory. In step 608, when the NEW_VALUE from the FFT is less than the OLD_VALUE in memory, the value in memory is replaced by the NEW_VALUE from the FFT. The result causes higher values (attack phase) to build up in the memory over time, whereas lower values (release phase) are reflected in the memory instantly (zero release time).
The operation of the ballistics subroutine as it performs multiple iterations can be illustrated graphically in
A longer time-constant can be applied to frequency bins representing the lower sound frequencies. The use of a longer time-constant helps to discriminate against bass notes which often persist, without degrading the response time to attenuate high frequency feedback, which often builds up faster, is more alarming, and potentially more damaging. The present embodiments use a time-constant of 2 seconds at the low-frequency end and a time-constant of 200 milliseconds at the high frequency end. The time-constant is defined as the time taken to reach 6 dB below the threshold value (i.e., 0.5 of the target value). After the OLD_VALUE is stored for each frequency bin at step 608, the ballistics subroutine ends.
Referring again to
In step 512, the amplitude (i.e., magnitude stored in the frequency bin) and the frequency bin number (indicating the frequency) of these N highest prominences are then passed to the threshold detection process 418. The threshold detection process 418 assures that the prominences are at least a predetermined magnitude (i.e. is must be loud enough to cause problems), and a predefined amount above the mean squared value (i.e. is the feedback frequency significant compared to the level of music/background noise).
RELATIVE_THRESHOLD=MEAN_SQUARE*RELATIVE_MULTIPLIER
Where the RELATIVE_MULTIPLIER is a predetermined amount. The present invention uses a RELATIVE_MULTIPLIER of (L/150)̂2, where L is the length of the FFT, for example 4096. However, if actual magnitude values were used rather than square values, the multiplier would be (L/150). The value of the mean MEAN_SQUARE variable has been determined previously in step 506 (
In step 804, the magnitude of the frequency bin under consideration is compared to an ABSOLUTE_THRESHOLD variable. One embodiment sets this variable at a value equivalent +85 dB SPL at a distance of 1 meter from the loudspeaker. If the frequency bin magnitude is less than the ABSOLUTE_THRESHOLD, that frequency bin is not considered to be a candidate for frequency feedback and the subroutine logic continues to step 810. Step 810 sets a flag indicating that the frequency bin under consideration should not be considered to be a candidate frequency. Thus, the test performed in step 804 will only allow a frequency to be considered a candidate if the magnitude of its bin exceeds a certain volume. This prevents low-level signals from being further processed, even if the cause is feedback, on the basis that feedback which is barely audible is probably not worth filtering.
If at step 804 the frequency bin magnitude is greater than the ABSOLUTE_THRESHOLD, than the subroutine logic continues to step 806 where a comparison is made between the frequency bin magnitude and the RELATIVE_THRESHOLD (computed in step 802). If at step 806 the frequency bin magnitude is less than the RELATIVE_THRESHOLD, then that frequency bin is not considered to be a candidate for frequency feedback and the subroutine logic continues to step 810. Otherwise, execution proceeds to step 808, where a flag is set indicating that the frequency bin should be considered to be a candidate frequency. The test of step 806 only allows a frequency to be considered a candidate if the amplitude of its bin exceeds the average bin level by a given amount. This prevents feedback from being attenuated, which is already hidden by wide-band signals and is thus not doing any harm. This also helps to discriminate feedback from wanted signals since it will favor pure tones. In other words, the prominence is sufficiently below the rest of the sound spectrum so that it will not be discerned.
Thus, only prominences that are above both of these thresholds (i.e., RELATIVE_THRESHOLD and ABSOLUTE_THRESHOLD) are then considered to be candidate frequencies. This concept is illustrated graphically in
Referring again to
One embodiment of the assignment process 420 is control scheme that runs the state machine subroutines in succession from zero to the last state machine routine. (There are N state machines for N notch filters because one state machine controls one notch filter). One embodiment of this routine uses 6 filters. Any number of filters, however, could be used. For each candidate frequency, the assignment process 420 searches all state machine routines, if the candidate frequency is already in use, the candidate frequency is assigned to the same state machine routine. If the candidate frequency is not already in use, the candidate frequency is assigned to the first free state machine routine.
In step 1004, the state machine subroutine assigned to the current filter is executed. Step 1006 determines whether the filter counter has incremented to the last filter number (i.e., “N”), if it has, then the assignment process 420 exits. If not, then step 1007 determines whether the flag set for the candidate frequency in step 1003 is still false. (In other words, has the appropriate state machine routine changed the flag?) If the flag is set to true, then the candidate frequency has already been assigned and the routine exits. If not, the filter counter is incremented in step 1008, and the program logic returns to step 1004.
The state machine routines 422 which are individually assigned to the candidate frequencies causes each candidate frequency is to be “tested” by setting the associated notch filter to the appropriate candidate frequency at a given attenuation depth and bandwidth. There is a state machine subroutine associated with each of the N notch filters so that the current status of each filter can be tracked. The state machine routines track when each notch filter is idle (ready for a new assignment), when the filter is testing a trial notch, and when the filter is engaged in feedback suppression (i.e. not longer a candidate since feedback discrimination has been successful). If, after a predetermined test time, the measured amplitude at the candidate frequency has been reduced by a predetermined minimum amount, then genuine feedback is said to have been detected, and the filter is left in place at a predetermined depth, otherwise the filter is canceled.
The logic used by one embodiment of the state machine routine is illustrated in
If the time limit has not expired (step 1104), the notch filter is still in a testing state. The subroutine terminates and no action is taken. If the time limit has expired, the current bin magnitude for the frequency is retrieved in step 1106.
In step 1108, the magnitude is checked to see if it has been sufficiently reduced by comparing the reduction in magnitude at the candidate frequency to a predetermined value: TESTDROP. In one embodiment, TESTDROP is 3 dB. If the magnitude for the candidate frequency has not been reduced by TESTDROP, the candidate frequency is not likely to be feedback. Consequently, the parameters of the notch filter are set to “bypass” in step 1110 (which can also be done by setting the notch depth to 0 db causing the filter to have no effect on the audio signal.) The idle state flag is set in step 1112.
Once the TESTDROP comparison has failed, the filter bypassed, and the state set to Idle, the state machine routine and the filter are ready to be reassigned (in the same frame if necessary) to another frequency. Consequently, the notch filter will no longer function at that candidate frequency. If the magnitude of the frequency has been sufficiently reduced by more than TESTDROP, then in step 1111, the filtering state flag is set. In either situation, the logic continues with at step 1116.
In step 1116, the state flag is checked to determine if it has been set to filtering (to determine if the notch filter is currently filtering a feedback frequency). If so, a check is performed in step 1118 to determine whether the notch filter is currently set to the same frequency or within a few bins of the new candidate frequency. Checking within a few bins of a candidate frequency creates a “deadband” each of candidate frequency to assure that additional candidate frequencies are not erroneously located around the main candidate frequency in future iterations. One embodiment of this routine uses 2 bins.
If it is the same frequency (or close to the same frequency), the notch depth is increased in step 1120. If the current frequency is not the same as the candidate frequency, then the program exits so that the candidate frequency can be tested by another filter state machine.
Referring back to step 1116, if the state flag is not set to the filtering state, then the logic proceeds to step 1121. Step 1121 tests the state flag to see if the filter is in the idle state. If the state flag is not in an idle state, the routine exits. If the state flag is set to the idle state, (indicating that the filter is bypassed), then in step 1122 new filter parameters are set. The filter parameters may include new frequency, bandwidth, and trial notch depth. As those skilled in the art will realize, the bandwidth is a function of the specific FFT length and windowing used. In one embodiment, the bandwidth is determined by the following pseudo code equation:
BandWidth (Octaves)=(WINDOW_SMEAR*SAMPLE_RATE/FFT_LEN)/Frequency (Hz)
If (BandWidth<MIN_BANDWIDTH), then BandWidth=MIN_BANDWIDTH
In the above pseudo code routine, the variable “WINDOW_SMEAR” compensates for the smearing factor of FFT windowing. In the present invention, this is set to 2.1 for a Hann window, which is one of many windows that could be used with an FFT analysis. The SAMPLE_RATE is 48000, the FFT_LEN is 4096, and the MIN_BANDWIDTH is 0.05. The notch filters could also be set to a predetermined bandwidth if a FFT is used with sufficient resolution and over a given sensible frequency range of operation. One embodiment uses a trial notch depth of 6 dB. The trial notch depth is increased in depth in steps of 6 dB when feedback is detected at the same frequency as the one already being filtered.
In step 1123, the variable FREQUENCY_ASSIGNED is now set to “true.” This variable is passed to assignment process 420 to indicated that this state machine has now been assigned a new frequency. The timer is reset to zero and started in step 1124. In step 1126, the state flag is set to testing and the subroutine exits.
After being modified by the notch filters 407, the resulting signal is passed to the DAC 108 for conversion back to the analog domain, the resulting signal being passed ultimately to the amplifier 110 and loudspeaker 112 for reproduction.
In sum, the present embodiment is very effective at picking lingering tones out of a noisy (music) background. The process ensures that frequencies that are not continuous (and are thus probably music signals) are not considered for candidature. A tone must be present continuously for a period of time before becoming a candidate. Also, the rate at which the tone build up in the ballistics memory is dependent on the amplitude of the tone, so a high level tone is acted on more urgently than low level ones.
Once the candidate frequencies are selected by the frequency selection process, the implementation process continuously tests candidate frequencies by applying trial notch filters at the candidate frequency. If there are good results, then the frequency is determined to be the result of acoustic feedback. If there are poor results, then the frequency is determined to be a result of a wanted signal (e.g. music or speech etc), so the notch filter is removed.
The present embodiment, therefore, dynamically guards against feedback in applications where the conditions are continuously changing, such as where a microphone is mobile, and is being moved around in the same environment as the loudspeaker(s).
This application is a divisional of U.S. patent application Ser. No. 09/658,538, filed Sep. 9, 2000, titled SYSTEM FOR ELIMINATION OF ACOUSTIC FEEDBACK, which application is incorporated by reference in this application in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 09658538 | Sep 2000 | US |
Child | 12606978 | US |