Detection of whistling in an audio system
09794695 · 2017-10-17
Assignee
Inventors
Cpc classification
H04R25/30
ELECTRICITY
H04R3/02
ELECTRICITY
International classification
Abstract
A method for detecting whistling in an audio system includes determining an average frequency of an input signal of the audio system, sampling the input signal in consecutive blocks of at least one sample, wherein the average frequency is determined blockwise, and determining whether feedback related whistling is present in the input signal of the audio system by evaluating a stability of the average frequency, wherein the evaluation of the stability of the average frequency comprises: determining a difference of two values of the determined average frequency for two blocks, and comparing the determined difference to a first threshold value.
Claims
1. A method for detecting whistling in an audio system, comprising: determining an average frequency of an input signal of the audio system; sampling the input signal in consecutive blocks of at least one sample, wherein the average frequency is determined blockwise; comparing a value of the determined average frequency for one of the blocks with another value of the determined average frequency for another one of the blocks to determine a stability of the average frequency; and determining whether whistling due to repeat feedback amplification is present in the input signal of the audio system based at least in part on a result from the act of comparing.
2. The method according to claim 1, wherein the act of comparing comprises determining a difference of the value and other value of the determined average frequency.
3. The method according to claim 2, further comprising comparing the determined difference to a first threshold value.
4. The method according to claim 2, further comprising determining a function of the difference.
5. The method according to claim 4, wherein the function comprises an absolute value function.
6. The method according to claim 4, wherein the function is equal to 0 if an absolute value of the difference is less than a second threshold value.
7. The method according to claim 6, wherein the function is equal to an absolute value of the difference if the absolute value is larger than or equal to the second threshold value.
8. The method according to claim 1, further comprising determining an average of differences over a number of the blocks.
9. The method according to claim 8, wherein the act of determining the average comprises determining a moving average.
10. The method according to claim 1, further comprising transforming the input signal into a frequency domain.
11. The method according to claim 1, further comprising comparing a power or an energy content of the input signal with a third threshold value.
12. The method according to claim 1, wherein the determination of the average frequency of the input signal comprises determining a centroid of the input signal.
13. The method according to claim 1, wherein the audio system comprises a communication system, the communication system being a hearing aid, a headset, or a telephone system.
14. The method according to claim 1, wherein the whistling is due to a repeating of sound leakage from a receiver to a microphone in the audio system.
15. The method according to claim 1, wherein the act of determining whether the whistling is present in the input signal of the audio system comprises calculating a test value based on the value and the other value, and determining whether the test value satisfies a criteria.
16. A hearing aid, comprising: a microphone for the provision of an input signal; a whistle detector unit that is configured to detect whistling in the hearing aid; and a receiver for the provision of an output sound signal to be presented to a user of the hearing aid; wherein the whistle detector is configured for: determining an average frequency of the input signal of the hearing aid; sampling the input signal in consecutive blocks of at least one sample, wherein the average frequency is determined blockwise; comparing a value of the determined average frequency for one of the blocks with another value of the determined average frequency for another one of the blocks to determine a stability of the average frequency; and determining whether whistling due to repeat feedback amplification is present in the input signal of the hearing aid based at least in part on a result from the act of comparing.
17. The hearing aid according to claim 16, wherein the whistle detector is configured to compare the value with the other value by determining a difference of the value and the other value.
18. The hearing aid according to claim 17, wherein the whistle detector is configured to compare the determined difference to a first threshold value.
19. The hearing aid according to claim 16, further comprising a feedback cancellation filter, wherein the hearing aid is configured to adjust at least one parameter of the feedback cancellation filter in response to the detected whistling.
20. The hearing aid according to claim 16, further comprising an amplification controller that is configured to adjust a gain of the hearing aid based on the detected whistling.
21. The hearing aid according to claim 20, wherein a response time of the amplification controller is based on whether the whistling is detected or not.
22. The hearing aid according to claim 20, wherein a response time of the amplification controller comprises an attack time and a release time, and wherein the attack time or the release time, or both the attack time and the release time, is adjusted adaptively in response to the detected whistling for a predetermined period of time.
23. The hearing aid according to claim 20, wherein the amplification controller is configured to successively determine gain correction values, and wherein at least one of the gain correction values depends on at least one previous one of the gain correction values.
24. The hearing aid according to claim 20, wherein the amplification controller is configured to cease an attenuation, if the level of the attenuation has been substantially equal to a maximum level of attenuation for a predetermined period of time.
25. The hearing aid according to claim 16, wherein the whistling is due to a repeating of sound leakage from the receiver to the microphone.
26. The hearing aid according to claim 16, wherein the whistle detector is configured for: calculating a test value based on the value and the other value, and determining whether the test value satisfies a criteria.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) In the following, preferred embodiments are explained in more detail with reference to the drawing, wherein
(2)
(3)
(4)
(5)
(6)
(7)
DESCRIPTION OF PREFERRED EMBODIMENTS
(8) The embodiments will now be described more fully hereinafter with reference to the accompanying drawings, in which exemplary embodiments are shown. It should be noted that the figures are not drawn to scale and that elements of similar structures or functions are represented by like reference numerals throughout the figures. Like elements will, thus, not be described in detail with respect to the description of each figure. It should also be noted that the figures are only intended to facilitate the description of the embodiments. They are not intended as an exhaustive description of the invention or as a limitation on the scope of the invention. The claimed invention may, however, be embodied in different forms and should not be construed as limited to the embodiments set forth herein. In addition, an illustrated embodiment needs not have all the aspects or advantages shown. An aspect or an advantage described in conjunction with a particular embodiment is not necessarily limited to that embodiment and can be practiced in any other embodiments even if not so illustrated.
(9)
(10) The hearing aid 2 is preferably a digital hearing aid, and the digitalization of the input signal s may for example be provided by an A/D converter (not shown) that is inserted in the signal path after the microphone 4, or the A/D converter may simply be an integrated part of the microphone 4. Here the word microphone should be understood broadly as some kind of transducer, i.e. a unit that is able to transform one kind of energy into another kind of energy; in this case the transducer/microphone 4 transforms the energy content of sound waves into an electrical signal (which itself naturally carry energy).
(11) In such a digital version of the hearing aid 2, the input to the signal processing unit 6 is a certain number of samples of the s signal, say B samples. Thus the signal s is processed within the signal processing unit 6 in blocks of B samples at a time.
(12) The gain function G.sub.WD shown in
(13) In
(14)
(15) It is understood that in one embodiment the arrow 16, may be a one way arrow from the feedback suppression filter 12 to the whistle detector 8, or a one way arrow from the whistle detector 8 to the feedback suppression filter 12.
(16)
(17)
Y.sub.k=FFT(w.sub.k.Math.x.sub.k),
where w.sub.k is a window function and x.sub.k is the sampled input signal. The FFT is windowed in order to account for spectral leakage. The window that is used may for example be a Hamming window or a Hanning window. Next, as indicated by step 26, the power of the sampled signal is computed:
P.sub.k=Y.sub.k.sup.2
(18) Preferably only the magnitude spectrum is used. Thus, all phase information is discarded. Hereby the computational problem is reduced. Then in step 28 the average frequency of the sampled signal is computed. In the illustrated embodiments of the method, the average frequency is determined by calculating the power spectral centroid of the sampled signal:
(19)
where P.sub.k is the power magnitude at bin number k and F.sub.k is the center frequency of that bin and P.sub.b is the total signal power in the b′th block. The summation over k runs from k=1 to 31, due to the symmetry of the FFT and that the DC and Nyquist frequency components are neglected (In this example the index 0 corresponds to the DC bin and ascending bins are incrementing in the positive frequency direction).
(20) The power spectral centroid as described above is the most simple and straightforward method of computing an average frequency. The mean computed by this method may also be referred to as an arithmetic mean. In other embodiments, other methods of computing an average frequency which may also be applied include the computation of the harmonic mean, the geometric mean, the quadratic mean, the maximum and/or any combination of these. Quadratic mean, also known as Root Mean Square, is used especially for electronics and is advantageous if the number set includes positive and negative numbers and may also be used in the present embodiment. The harmonic mean is typically advantageous when calculating the mean of a set of rates or ratios and also in this embodiment, the method may be used to provide a frequency mean. Furthermore, the geometric mean may be used when looking at multiples or logarithms, and could be useful in some embodiments. All of these means will provide an indication of whether a whistle tone is present or not. The larger a peak the whistle tone provides with respect to the other frequencies present, the closer the calculated mean will be to the whistle tone frequency. By using the maximum, only the frequency with the largest amplitude is provided. If this frequency is the whistle tone frequency, then the exact whistle tone frequency is provided, but if this is not the case, one of the other methods for computing a mean will be preferable. Thus, typically, this method will be combined with one of the other methods. The illustrated method also comprises a step 30 of determining a function of the difference of the determined centroid for 9 consecutive blocks (9 being the chosen input buffer size in this example) averaged over the buffer size of 9. Mathematically this may be expressed by the calculation of the number:
(21)
(22) Preferably the function ƒ is chosen to be equal to zero if the absolute value of the difference between two consecutive values of the centroid is less than a second threshold value δ, and equal to the absolute value if the absolute value of the difference between two consecutive values of the centroid is larger than or equal to the second threshold value δ. Thus, mathematically the function ƒ may be defined by the equation:
(23)
(24) Hereby is achieved that fluctuations in the centroid that are smaller than δ is disregarded, and only those fluctuations, that are larger than or equal to δ are contributing to the number s.sub.b. The reason for using the absolute value function is that it is important that all fluctuations above δ is contributing to the number s.sub.b. We are so to say not interested in which centroid value is greater than the other, but only in how much they deviate from each other. In one embodiment δ is chosen to be any suitable value in the interval 0.0001 to 0.01. In a preferred embodiment δ is chosen to be any suitable value between 0.001 and 0.01, such as 0.001, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008 or 0.009.
(25) The stability of the centroid is then checked in step 32, by comparing the number s.sub.b to a first threshold value s.sub.threshold. More specifically it is checked whether the following inequality is true or false:
s.sub.b<s.sub.threshold
(26) If this inequality is true, as indicated by the output T from the block 32, then it is indicative of that the centroid of the input signal is stable, and hence that feedback related whistling is present in the input signal. The method or algorithm will in this case give the binary output 1 (see block 34), which is thus indicative of that whistling has been detected. If on the other hand it turns out that the above inequality is false, as indicated by the output F from block 32, then the centroid is unstable, which is indicative of that no feedback related whistling is present in the input signal. The method or algorithm will in this case give the binary output 0 (see block 36), which is thus indicative of that whistling has been detected. In one embodiment s.sub.threshold is chosen to be a suitable number between 0.0001 and 0.01, preferably between 0.001 and 0.01, such as 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008 or 0.009.
(27) It should be understood that the chosen values of δ and s.sub.threshold may depend on how the illustrated method is implemented.
(28) In addition to this, the illustrated embodiment may comprise an optional step 38 of checking whether the power of the input signal is larger than a third threshold value P.sub.threshold. Mathematically, this can be expressed as whether the following equation holds true:
P.sub.b-4>P.sub.threshold
(29) Feedback related whistling is usually associated with a high power, and additionally feedback related whistling is only a problem for a user if the power of that whistling is high. Thus, by checking whether the above inequality is true as indicated by the output T of block 38, or false as indicated by the output F of block 38, a simple criterion of ruling out whistling may be achieved that in many cases will be adequate. This is because if the above inequality is false, then this is indicative that the total power of the signal is below a threshold value, P.sub.threshold, wherein the signal can not be (or is at least highly likely not to be) whistling. Thus if the output of block 38 is F then the algorithm will give the binary output 0, as shown in block 36, which is an indication of that no whistling is detected in the input signal. If on the other hand the above inequality holds true, i.e. the output of block 38 is true, then feedback related whistling may be present in the input signal, and whether this is the case or not is determined in the subsequent steps 30 and 32 as described above. In the above equation the indexing b−4 has been used. This is because it in the illustrated embodiment is necessary to account for the group delay when performing the power check in step 38. Thus, that the power has index (b−4) is intentional and is done in order to ensure phase alignment of different signals processed according to the illustrated embodiments of the method. Here the number 4 is related to there being 9 blocks yielding a power index of b−(N−1)/2, where N in the illustrated embodiment is 9. Thus, the signal processing associated with step 30 and 32 of the method is avoided altogether if the power check in step 38 yields a false output F. Hereby signal processing power saved, and consequently battery load is lowered as well. This is of critical importance in for example hearing aids, wherein only very little processing power and low power batteries are available. In one embodiment P.sub.threshold is chosen to be between 40 dB and 90 dB, and in another embodiment it may be chosen to be between 50 dB and 75 dB, and in a preferred embodiment P.sub.threshold is chosen to be between 50 dB and 70 dB, such as for example 55 dB, 60 dB or 65 dB. In the illustrated embodiment scientific investigations, for example computer simulations, have shown good results if P.sub.threshold is chosen to be between 55 dB and 65 dB.
(30) Furthermore, since feedback related whistling is most likely to occur in a certain frequency range, typically at the higher frequencies, the method may in the illustrated embodiment also comprise an optional step 40 of checking whether the centroid lies within a frequency range wherein whistling is likely to occur. Mathematically, this can be expressed whether the following mathematical statement holds true:
ω.sub.min<ω.sub.b-4<ω.sub.max
(31) Again the indexing b−4 is used in order to account for group delay. Thus if the above statement is false, as indicated by the output F of block 40, then this is means that the centroid of the input signal is either lower than ω.sub.min or larger than ω.sub.max, that is the centroid lies in a frequency range wherein feedback related whistling is likely not to occur, and the output of the method or algorithm will be a binary 0 indicating that no feedback related whistling is present in the input signal. If on the other hand the centroid of the input signal is larger than ω.sub.min and smaller than ω.sub.max then this is indicative of that the centroid lies within a frequency range wherein whistling may occur, which is indicated by the output T of block 40. If this is the case, then the stability of the centroid needs be determined in the steps 30 and 32, possibly preceded by the optional step 38, wherein the power of the input signal is compared to a threshold value. In one embodiment of the method, the value of ω.sub.min is equal to 1 kHz, in another embodiment it is 2 kHz, but it may in general be chosen to be any value there between. In a preferred embodiment, the value of ω.sub.max may be chosen to be any suitable value in the interval from 4 kHz-8 kHz, preferably between 4.5 kHz and 7.5 kHz, even more preferably between 4.5 kHz and 7 kHz, such as 5 kHz, or 5.5 kHz, or 6 kHz, or 6.5 kHz. Alternatively, ω.sub.max may be chosen to have a value above 8 kHz, e.g. 9 kHz, 10 kHz, 11 kHz, 12 kHz, 13 kHz, 14 kHz, 15 kHz, 16 kHz, 17 kHz, 18 kHz, 19 kHz, or 20 kHz.
(32) Essentially, the illustrated embodiment of the whistle detection method comprises two parts, a feature extraction part 41, and a decision part 43. The feature extraction part 41 comprises in the illustrated embodiment the steps 22, 24, 26, and 28, wherein the centroid of the input signal is determined. In the illustrated embodiment the centroid is determined in the frequency domain, but it is understood that the centroid could in an alternative embodiment also be determined in the time domain. In the illustrated embodiment the decision part 43 comprises the steps 30, 32, 38, and 40. In an alternative embodiment the decision part 43 could only comprise the steps 30 and 32, and in another alternative embodiment the decision part 43 could comprise the steps 30, 32 and either one of the steps 38 and 40.
(33)
(34) This value is then according to some embodiments used to determine an eventual difference in gain from the one determined independently by the signal processing unit 6.
(35) Two examples of whistle detection algorithms have been described above and an example of a gain calculation that follows it will be described below.
(36) The final output of the whistle detector 8 is either “0” for no whistling detected or “1” for whistling detected. The action to be taken in the latter case may in some embodiments be a gain reduction in order to return to stable gain and thus eliminate whistling. The gain must be reduced relatively quickly to avoid unnecessary exposure to the whistle tone, but then increased slowly to avoid frequent and thus annoying changes in gain. The whistle detection algorithm output is therefore followed by a low pass filter 42 defined by two time constants, an attack time and a release time. The choice of time constant depends on the output of the whistle detection algorithm according to the inventive method, for example an attack time for a “1” and a release time for a “0”.
(37) As it is undesirable for the gain level to change abruptly as a direct function of the whistle detector's 8 output, it is shown by the next equation below how the time constants discussed above may be used to define a new value that can take on a larger range of values than the whistle detector's 8 binary output, x.sub.WD. It is this value that determines how much to increase or reduce the gain. The chosen time constant is inserted instead of α below:
b.sub.WD.sup.i=(1−α).Math.(b.sub.WD.sup.i-1)+α.Math.x.sub.WD.sup.i
(38) Where the gain correction value b.sub.WD.sup.i is recursively updated by using the filter output of the previous block of signal samples.
(39) The actual gain reduction is then calculated within a certain interval, for example [−12;0], so that the gain in dB is reduced (if whistling is detected) by a value lying within this interval. This is illustrated by the equation:
G.sub.Wd.sup.k=12.Math.b.sub.WD.sup.k+0
(40) This gain change is illustrated by the unit 44 in
(41) The chosen time constants α used in the above equation will preferably be chosen in dependence on whether whistling has been detected and may in one embodiment of the inventive method be determined by:
α=(1−x.sub.WD.sup.i).Math.α.sub.wdr+x.sub.WD.sup.i.Math.α.sub.wda
(42) Where α.sub.wda and α.sub.wdr are the gain reduction attack and release times, respectively. The subscript wd refers to the fact that these time constants are relevant for the whistle detection module, to avoid confusion with other time constants. Suitable values for the attack time may be a value between 0.01 and 0.1, preferably it may, however, be a value between 0.02 and 0.08. The release time will in a preferred embodiment be smaller than the attack time. Suitable values for the release time may be a value between 0.00001 and 0.001, preferably it is a value between 0.0001 and 0.0009. While these examples are realistic, there may be circumstances where the attack or release times may assume values that lie outside the mentioned intervals.
(43) The three steps expressed in last three equations above reveal that the gain correction value (b.sub.WD.sup.i) not only depends on the binary output of the whistle detector, and the maximum gain change factor, but also recursively on previous values of the low-pass filter (b.sub.WD.sup.i-1, b.sub.WD.sup.i-2 . . . ). This smoothes the gain change rate to some extent and means that the gain correction value is significantly larger after several consecutive blocks result in positive detection, while sporadic occurrences of whistling will result in much less attenuation. This in turn ensures that when there is a long sequence of whistling detected, the gain is reduced to a level that requires more time to be significantly increased again.
(44) The time constants used in gain reduction are applied in a low pass filter 42 that is dependent on a previous value. The low-pass filtering is done in such a way that a larger value is required in order to quickly reduce gain, while much smaller values allows for a slow gain increase.
(45) Alternatively it could be an amplification control unit, like for example an automatic gain control unit (AGC) that determines the gain within the hearing aid 2 instead of the digital signal processing unit 6 shown in
(46) In an alternative embodiment, the whistle detector 8, low pass filter 42 and gain changing unit 44 is built into the signal processing unit 6 of the hearing aid 2, whereby whistle detection and corresponding gain reduction would be an integrated part of the signal processing in the hearing aid 2.
(47) The choice of good criteria for whistle detection will in a practical implementation be based on a trade-off between the correct detections and true positive rates. A high correct detection rate may also include numerous incorrect detections, leading to a low true positive rate, and vice versa. In some situations the true positive rate must be prioritized at the expense of a higher correct detection rate. This is done because it is assumed that whatever gain reduction strategy is implemented, it will not return to normal gain immediately after the detection of a whistle tone, thus suppressing the whistle tones that might have followed the initial block. Furthermore, high true positive rate ensures that unnecessary gain reductions are limited.
(48) An alternative embodiment includes a hearing aid with a feedback cancellation filter and an amplification control unit, for example an AGC unit.
(49) Alternatively the gain reduction attack and release times may be chosen in dependence of the compression ratio of the hearing aid 2. In one embodiment the rate of compression can either be chosen as linear, 2:1 or 3:1. This reflects how the gain setting is calculated within the hearing aid.
(50) As illustrated above, whistle detection based on a power criterion is feasible in a hearing aid. However, as will be understood by those familiar in the art, the claimed invention may be embodied in other specific forms and utilize any of a variety of different algorithms without departing from the spirit or essential characteristics thereof. For example the selection of an algorithm is typically application specific, the selection depending upon a variety of factors including the expected processing complexity and computational load. The specification and drawings are, accordingly, to be regarded in an illustrative rather than restrictive sense. The claimed inventions are intended to cover alternatives, modifications, and equivalents.