Audio playback device and noise reduction method and apparatus thereof for adaptive noise reduction gain adjustment
By acquiring the noise power set and calculating the noise reduction gain using a weighted algorithm, the problem of imprecise adjustment of active noise cancellation when switching between different scenarios is solved, achieving a noise reduction effect that is more adapted to the human ear and improving user comfort and stability.
Patent Information
- Application Number
- CN202210744520.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-06-27
AI Technical Summary
Existing active noise cancellation technology cannot finely adjust the noise cancellation gain when switching between different noise scenarios, resulting in noise cancellation effects that are not suitable for the human ear, which may cause eardrum pressure, cumbersome operation, or electrical noise problems.
By acquiring the noise power set of the environment, determining the current scene based on the correspondence between multiple noise powers and preset environmental scenes, calculating the noise reduction gain using a weighted algorithm, and generating an adaptive noise cancellation waveform to cancel the environment noise.
It improves the precision and stability of noise reduction gain, reduces over- or under-noise reduction, and enhances user comfort and adaptability of noise reduction effect.
Smart Images

Figure CN115866469B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of audio noise reduction technology, and in particular to an audio playing device and a noise reduction method and device for adaptive noise reduction gain adjustment. BACKGROUND
[0002] Noise not only affects people's normal life, but also is harmful to hearing. With the increasing noise pollution, the technology for suppressing noise has attracted more and more researchers' attention. In order to reduce the impact of noise on people, various noise reduction methods have emerged. Common noise reduction methods include active noise reduction and passive noise reduction. Among them, active noise reduction (ANC) is based on the principle of waveform interference, which generates a waveform that is opposite in phase and the same in amplitude to the noise to cancel out the noise, thereby achieving the purpose of noise reduction. In this noise reduction method, the environment noise is not perceived by the human ear because it is canceled out by the reverse signal.
[0003] There are three types of noise reduction gain adjustment methods for active noise reduction, including fixed noise reduction gain, manually adjustable noise reduction gain, and adaptively adjustable noise reduction gain.
[0004] Fixed noise reduction gain means that the noise reduction gain cannot be adjusted, and the noise reduction effect is fixed and unchanged. This method is prone to compress the user's eardrum and has high power consumption.
[0005] Manually adjustable noise reduction gain means that the noise reduction gain can be adjusted by manually switching different noise reduction gears by the user. This method solves the problems of compressing the user's eardrum and high power consumption, but it requires manual adjustment by the user, which is cumbersome and has poor user experience. Especially in a noisy environment, it is more inconvenient to use.
[0006] Adaptively adjustable noise reduction gain usually automatically switches the noise reduction gear according to the average number of noise power to adjust the noise reduction gain. This method achieves adaptive adjustment of the noise reduction gain, so that the noise reduction effect can be adaptively adjusted when switching between different noise environments. It can be seen that adaptively adjustable noise reduction gain is the best noise reduction method among the three types.
[0007] In different application scenarios (such as bedroom, conference room, living room, outdoor, etc.), the noise power is different. In order to switch between different scenarios and make the noise reduction gain better match the corresponding scenario, the existing technology usually provides multiple noise reduction gains. These noise reduction gains one by one match each scenario. In actual use, the actual noise power is detected to determine the current scenario, and the appropriate noise reduction gain is selected accordingly, or the corresponding gain is directly determined according to the actual noise power. In actual application, there is often a noise floor, especially when the user switches between different scenarios, this noise floor is more obvious.
[0008] In the prior art, there is also a way of deep noise reduction to cancel the noise of the middle and low frequency band audio, however, when deep noise reduction is adopted, it may exceed the human ear threshold and make the human ear uncomfortable, and also may cause the problem of electrical noise.
[0009] Therefore, in the adaptive noise reduction gain adjustment active noise reduction, how to improve the noise reduction reliability, improve the noise reduction performance, and make the noise after noise reduction more comfortable becomes a problem to be solved. SUMMARY
[0010] Based on the above status, the main purpose of the present application is to provide an audio playing device and a noise reduction method and device thereof with adaptive noise reduction gain adjustment, so as to improve the fineness of adjusting the noise reduction gain in the active noise reduction method.
[0011] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0012] An active noise reduction method based on adaptive noise reduction gain adjustment, comprising:
[0013] Step S100, obtaining the original audio signal collected by the collecting element within a preset time length;
[0014] Step S200, determining the environmental noise within the preset time length from the original audio signal, and obtaining the noise power set of the environmental noise, wherein the noise power set is a plurality of noise powers of the environmental noise within the preset time length;
[0015] Step S300, determining the current possible environmental scene according to the corresponding relationship between the plurality of noise powers and the preset environmental scenes, wherein each preset environmental scene corresponds to a noise power range of a preset range, if a part of the plurality of noise powers belongs to the noise power range of the preset first environmental scene, and a part belongs to the noise power range of the preset second environmental scene, then step S500 is entered;
[0016] Step S500, respectively determining the first number belonging to only the first environmental scene and the second number belonging to only the second environmental scene in the plurality of noise powers, and obtaining the number ratio of the first number and the second number;
[0017] Step S600, weighting the first preset gain and the second preset gain according to the number ratio to obtain the noise reduction gain, wherein each environmental scene corresponds to a preset gear noise reduction gain, the first preset gain is the noise reduction gain of the preset gear corresponding to the first environmental scene, and the second preset gain is the noise reduction gain of the preset gear corresponding to the second environmental scene;
[0018] Step S700, according to the noise reduction gain, prompting the secondary path to generate a noise cancellation waveform corresponding to the noise reduction gain, so as to cancel the environmental noise in the original audio signal.
[0019] Preferably, the step S300 further comprises:
[0020] The step S330, when there is an overlapping noise power between the first environment scene and the second environment scene, then determine the overlapping number ratio of the noise power range belonging to the first environment scene and the noise power range belonging to the second environment scene in the plurality of noise powers, when the overlapping number ratio exceeds a preset threshold, then enter the step S500.
[0021] Preferably, in the step S300, the corresponding relationship between the plurality of noise powers and the preset environment scene is used to determine the current possible environment scene comprises:
[0022] The step S310, respectively determine a first total number of the plurality of noise powers belonging to the first environment scene and a second total number of the plurality of noise powers belonging to the second environment scene;
[0023] The step S320, when the sum of the first total number and the second total number is greater than a preset value, then determine the current environment scene is the first environment scene and / or the second environment scene.
[0024] Preferably, in the i th execution cycle, i is greater than 1, the step S500 further comprises:
[0025] The step S410, respectively weight the first number and the second number cached in the i-1 th execution cycle to obtain a weighted first number and a weighted second number, the weighting coefficient is greater than 0 and less than or equal to 1;
[0026] The step S420, respectively determine a new first number of the plurality of noise powers belonging to the first environment scene and a new second number of the plurality of noise powers belonging to the second environment scene in the i th execution cycle;
[0027] In the i th execution cycle, in the step S500, the following formula is used to obtain the number ratio k(i) of the i th execution cycle:
[0028] k(i)=N1(i):N2(i), wherein N1(i) is the first number of the i th execution cycle; N2(i) is the second number of the i th execution cycle;
[0029] N1(i)=a1*N1(i-1)+N1’(i), wherein N1(i-1) is the first number of the i-1 th execution cycle, N1’(i) is the new first number of the i th execution cycle, a1 is the weighting coefficient for weighting N1(i-1);
[0030] N2(i) = a2*N2(i-1) + N2'(i), wherein N2(i-1) is the second quantity of the i-1th execution cycle, N2'(i) is the new second quantity of the ith execution cycle, and a2 is a weighting coefficient for weighting N2(i-1).
[0031] Preferably, before step S410, further comprising:
[0032] Step S401, counting the total quantity of the first quantity, the second quantity, and the quantity of the plurality of noise powers in the ith execution cycle;
[0033] When the total quantity does not exceed the preset cache threshold, the weighting coefficient in step S410 is equal to 1;
[0034] When the total quantity exceeds the cache threshold, the weighting coefficient in step S410 is less than 1.
[0035] Preferably, in the ith execution cycle, step S300 further comprises:
[0036] Step S301, determining whether a third environment scenario exists according to the set of noise powers obtained in the ith execution cycle, wherein the third environment scenario is different from the first environment scenario and the second environment scenario;
[0037] When it is determined in the ith execution cycle that the third environment scenario exists, the first quantity and the second quantity cached in the i-1th execution cycle are both cleared.
[0038] Preferably, after step S600, further comprising:
[0039] Step S610, when the weighted noise reduction gain is not equal to the current noise reduction gain, adjusting the current noise reduction gain to the weighted noise reduction gain according to a preset gradient, so as to gradually transition the noise reduction gain.
[0040] Preferably, when the overlap quantity ratio does not exceed the preset threshold, performing:
[0041] Step S800, sorting the plurality of noise powers in the set of noise powers according to the numerical value size to obtain a noise power median of the set of noise powers;
[0042] Step S900, extracting the noise reduction gain corresponding to the noise power range of the noise power median, and performing step S700.
[0043] Preferably, the original audio signal in the preset time period in step S100 comprises a plurality of audio signals; step S100 comprises sequentially obtaining the plurality of audio signals; and in step S200, the noise power of the environmental noise in each frame of audio signal is determined frame by frame.
[0044] The step S800 comprises: when determining the noise power of the jth frame of audio signal, sorting the noise power of the jth frame with the noise power of the 1st to the (j-1)th frame until j=P, wherein 2≤j≤P, P is the frame number of the original audio signal in the preset time length.
[0045] Preferably, in the step S800, when the noise power set comprises an even number of noise powers, the median of the noise powers is one of the middle two values of the sorted noise power set.
[0046] In a second aspect, the embodiments of the present application disclose an active noise reduction device, which comprises:
[0047] An audio signal acquisition module is configured to acquire an original audio signal collected by a collection element in a preset time length.
[0048] A noise power set obtaining module is configured to determine an ambient noise in the preset time length from the original audio signal and obtain a noise power set of the ambient noise, wherein the noise power set is a plurality of noise powers of the ambient noise in the preset time length.
[0049] A scene determining module is configured to determine a current possible ambient scene according to a corresponding relationship between the plurality of noise powers and preset ambient scenes, wherein each preset ambient scene corresponds to a noise power range of a preset range.
[0050] A ratio determining module is configured to, when the scene determining module determines that a part of the plurality of noise powers belongs to a noise power range of a preset first ambient scene and a part of the plurality of noise powers belongs to a noise power range of a preset second ambient scene, determine a first number of the plurality of noise powers that only belong to the first ambient scene and a second number of the plurality of noise powers that only belong to the second ambient scene, and obtain a number ratio of the first number and the second number.
[0051] A gain calculating module is configured to weight a first preset gain and a second preset gain according to the number ratio to obtain a noise reduction gain, wherein each ambient scene corresponds to a preset gear of the noise reduction gain, the first preset gain is the noise reduction gain of a preset gear corresponding to the first ambient scene, and the second preset gain is the noise reduction gain of a preset gear corresponding to the second ambient scene.
[0052] A counteracting module is configured to generate a noise counteracting waveform corresponding to the noise reduction gain to counteract the ambient noise in the original audio signal.
[0053] Preferably, the scene determining module is further configured to determine an overlap quantity ratio of noise power ranges belonging to the first environment scene and the second environment scene when there is an overlap of noise power between the first environment scene and the second environment scene, and determine the first quantity and the second quantity and obtain the quantity ratio when the overlap quantity ratio exceeds a preset threshold.
[0054] Preferably, the scene determining module is further configured to respectively determine a first total number of the plurality of noise power belonging to the first environment scene and a second total number of the plurality of noise power belonging to the second environment scene, and determine the first environment scene and / or the second environment scene as the current scene when a sum of the first total number and the second total number is greater than a preset value.
[0055] Preferably, in the i th execution cycle, the ratio determining module is configured to respectively weight the first quantity and the second quantity cached in the i-1 th execution cycle to obtain a weighted first quantity and a weighted second quantity, and a weighting coefficient is greater than 0 and less than or equal to 1.
[0056] The ratio determining module is further configured to respectively determine a new first quantity of the plurality of noise power belonging to the first environment scene and a new second quantity of the plurality of noise power belonging to the second environment scene in the i th execution cycle.
[0057] In the i th execution cycle, the gain calculating module obtains the quantity ratio k(i) of the i th execution cycle by using the following formula:
[0058] k(i) = N1(i) : N2(i), wherein N1(i) is the first quantity of the i th execution cycle, and N2(i) is the second quantity of the i th execution cycle.
[0059] N1(i) = a1*N1(i-1) + N1'(i), wherein N1(i-1) is the first quantity of the i-1 th execution cycle, N1'(i) is the new first quantity of the i th execution cycle, and a1 is a weighting coefficient for weighting N1(i-1).
[0060] N2(i) = a2*N2(i-1) + N2'(i), wherein N2(i-1) is the second quantity of the i-1 th execution cycle, N2'(i) is the new second quantity of the i th execution cycle, and a2 is a weighting coefficient for weighting N2(i-1).
[0061] Preferably, before weighting the first quantity and the second quantity cached in the i-1 th execution cycle, the ratio determining module is further configured to count a total number of the first quantity, the second quantity cached in the i-1 th execution cycle, and the quantity of the plurality of noise power in the i th execution cycle.
[0062] The weighting coefficient is equal to 1 when the total quantity does not exceed the preset cache threshold;
[0063] The weighting coefficient is less than 1 when the total quantity exceeds the cache threshold.
[0064] Preferably, in the i th execution cycle, the scene determination module is further configured to determine whether a third environment scene exists according to the set of noise powers obtained in the i th execution cycle, wherein the third environment scene is different from the first environment scene and the second environment scene.
[0065] When it is determined in the i th execution cycle that the third environment scene exists, the first quantity and the second quantity cached in the i-1 th execution cycle are both cleared.
[0066] Preferably, the device further comprises:
[0067] The transition module is configured to adjust the current noise reduction gain to the weighted noise reduction gain by a preset gradient when the weighted noise reduction gain is not equal to the current noise reduction gain, so that the noise reduction gain is gradually transitioned.
[0068] Preferably, the device further comprises:
[0069] The sorting module is configured to sort the plurality of noise powers in the set of noise powers according to the numerical value size to obtain a noise power median of the set of noise powers when the overlap quantity proportion does not exceed the preset threshold.
[0070] The noise reduction gain extraction module is configured to extract a noise reduction gain corresponding to a noise power range of the noise power median, so that the cancellation module outputs a corresponding noise cancellation waveform according to the noise reduction gain.
[0071] Preferably, the original audio signal in the preset time length obtained by the audio signal acquisition module includes a plurality of audio signals, and the audio signal acquisition module sequentially acquires the plurality of audio signals, and the set of noise powers is obtained by the noise power set obtaining module determining the noise power of the environmental noise in each frame of audio signal frame by frame.
[0072] The sorting module sorts in the following manner:
[0073] When the noise power of the j th audio signal is determined, the noise power of the j th frame is sorted with the noise powers of the 1 st to the j-1 th frames, until j=P, wherein 2≤j≤P, and P is the number of frames of the original audio signal in the preset time length.
[0074] Preferably, when the set of noise powers includes an even number of noise powers, the noise power median is one of the middle two values of the sorted set of noise powers.
[0075] Thirdly, embodiments of this application disclose an audio playback device, wherein the active noise reduction method disclosed in the first aspect is applied to the audio playback device.
[0076] Preferably, the audio playback device is headphones.
[0077] Fourthly, embodiments of this application disclose an audio playback device pair, including a pair of first audio devices and second audio devices, wherein the first audio device and the second audio device are both audio playback devices as disclosed in the third aspect above, and the first audio device and the second audio device can communicate with each other.
[0078] After receiving the noise reduction gain of the other party, the first audio device and / or the second audio device compare the two noise reduction gains and obtain the larger noise reduction gain. Both the first audio device and the second audio device generate a noise cancellation waveform corresponding to the noise reduction gain according to the larger noise reduction gain.
[0079] Fifthly, embodiments of this application disclose a computer-readable storage medium storing a computer program thereon, which, when executed, can implement the active noise reduction method disclosed in the first aspect above.
[0080] In a sixth aspect, embodiments of this application disclose a chip for active noise reduction, including a processor and a memory, wherein a computer program is stored in the memory, and the processor is capable of executing the computational program to implement the active noise reduction method disclosed in the first aspect above.
[0081] [Beneficial Effects]
[0082] The embodiment discloses an active noise reduction method of adaptive noise reduction gain adjustment, after a noise power set of environmental noise is obtained, a first environment scene and a second environment scene where the current is located are determined according to a plurality of noise powers, and then a current possible environment scene is determined according to a corresponding relationship between the plurality of noise powers and preset environment scenes, wherein each preset environment scene corresponds to a noise power range of a preset range, if a part of the plurality of noise powers belongs to a noise power range of a preset first environment scene and a part belongs to a noise power range of a preset second environment scene, a first number of the plurality of noise powers belonging only to the first environment scene and a second number of the plurality of noise powers belonging only to the second environment scene are determined respectively, and after a quantity ratio of the first number and the second number is obtained, a noise reduction gain is obtained by weighting the first preset gain and the second preset gain according to the quantity ratio, and the secondary path is caused to generate a noise cancellation waveform corresponding to the noise reduction gain according to the noise reduction gain, so as to cancel the environmental noise in the original audio signal. Therefore, when the noise power falls in the noise power ranges corresponding to two different scenes, the uncertain scene can be adapted, the precision of adjusting the noise reduction gain is effectively improved, the problem of excessive noise reduction or insufficient noise reduction is minimized, and therefore the noise reduction effect can better match various noise scenes, so that the noise reduction effect is more suitable for human ears and the use comfort is improved.
[0083] In addition, by referring to the quantity ratio of the last execution cycle to some extent, that is, the noise reduction gain of the last execution cycle is inherited to some extent, so that the stability and reliability of the noise reduction gain are ensured.
[0084] In addition, when noise reduction is performed on a single environment scene, the plurality of noise power values are sorted according to size, and the noise reduction gain is determined according to the median of the noise power, so that the problem of sudden change of the noise reduction gain caused by transient noise can be effectively avoided, thereby preventing the problem of accidental or random triggering of the noise reduction gain caused by transient noise, and ensuring the stability of the noise reduction gain and the reliability of adjusting the noise reduction gain.
[0085] Other beneficial effects of the present application will be described in the specific embodiments by introducing specific technical features and technical solutions, and those skilled in the art should be able to understand the beneficial technical effects brought by the technical features and technical solutions through the introduction of the technical features and technical solutions. BRIEF DESCRIPTION OF DRAWINGS
[0086] The embodiment will be described below with reference to the accompanying drawings. In the drawings:
[0087] Figure 1 A flow chart of an active noise reduction method based on adaptive noise reduction gain adjustment disclosed by the embodiment;
[0088] Figure 2 A schematic diagram of a power range and a preset environment scene correspondence disclosed by the embodiment;
[0089] Figure 3 A structure schematic view of an active noise reduction device disclosed in the embodiment;
[0090] Figure 4 A module schematic view of an audio playing device based on adaptive noise reduction gain adjustment disclosed in the embodiment. DETAILED DESCRIPTION
[0091] The present application is described in the following based on embodiments, but the present application is not limited to these embodiments only. In the following detailed description of the present application, some specific details are described in detail in order to avoid obscuring the essence of the present application, and well-known methods, procedures, processes, elements are not described in detail.
[0092] In addition, those skilled in the art should understand that the drawings provided herein are for illustrative purposes only, and the drawings are not necessarily drawn to scale.
[0093] Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is to say, in the sense of "including, but not limited to".
[0094] In the description of the present application, it should be understood that the terms "first", "second", and the like are used only for the purpose of description, and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise stated, the meaning of "multiple" is two or more.
[0095] In the field of active noise reduction, the scene and the corresponding noise reduction gain value are determined by the noise power. The applicant found that the actual environmental noise may not be consistent with the preset environmental noise, and only using any noise reduction gain corresponding to the preset environmental scene for noise reduction may lead to insufficient noise reduction or excessive noise reduction.
[0096] For example, the noise reduction system is preset with a conference room scene and a bedroom scene adjacent to the noise reduction gain, the corresponding noise reduction gain of the conference room scene is-6dB, and the corresponding noise reduction gain of the bedroom scene is 0dB. If the user is actually located in an environmental scene with noise intensity between the two scenes, for example, in a living room scene that actually needs-3dB noise reduction gain for noise reduction, the noise reduction gain set to-6dB will lead to insufficient noise reduction, and the noise reduction gain set to 0dB will lead to excessive noise reduction.
[0097] In addition, since the noise power of the living room scene is close to that of the conference room scene or the bedroom scene, and the power range between the two has overlap, even if the noise power range is divided into a smaller range interval, for example, originally divided into 3 noise power ranges, changed to 6 noise power ranges, it is also not feasible, because the average number of noise power of the living room scene and the average number of noise power of the conference room scene or the bedroom scene are too small or even no difference, which leads to the fact that the average number of noise power at this time cannot truly reflect the actual noise intensity, and therefore cannot be set to direct the noise reduction gain.
[0098] Especially in a relatively quiet environment, the lack of precision in adjusting the noise reduction gain will seriously affect the user experience. Insufficient noise reduction will result in insufficient noise reduction effect, while excessive noise reduction will cause the generation of electrical noise, which is more easily captured by the human ear in a quiet environment, and therefore excessive noise reduction will actually produce noise.
[0099] Please refer to Figure 1 A flow chart of an active noise reduction method based on adaptive noise reduction gain adjustment is disclosed in the present embodiment, which comprises steps S100, S200, S300, S500, S600 and S700.
[0100] In step S100, the original audio signal collected by the collection element within a preset time length is obtained. In the present embodiment, the collection element can be a microphone or other element capable of collecting audio signals. In the specific implementation process, the collection element can be the collection element of the noise reduction device (with audio playing function) itself; or the collection element of another device, which transmits the original audio signal collected by the collection element to the noise reduction device. The noise reduction device and the other device can be connected by wire or wirelessly, such as Bluetooth. As an example, the noise reduction device is a Bluetooth headset, Bluetooth speaker, etc., which collects the original audio signal by its own microphone or the microphone of another device (such as a mobile phone) and then transmits it to the noise reduction device. It should be noted that the original audio signal is the audio signal collected locally by the noise reduction device in the current environment, rather than the audio signal collected in another environment (for example, the noise reduction device is in a horizontal environment, but the audio signal is collected in a living room environment).
[0101] In step S200, the environmental noise within the preset time length is determined from the original audio signal, and a noise power set of the environmental noise is obtained. In the present embodiment, the noise power set is a plurality of noise powers of the environmental noise within the preset time length. The noise power is a parameter that can represent the size of the noise, and its calculation method can be the existing calculation method. For details, please refer to Figure 2 A power range and preset environment scene correspondence diagram is disclosed in the present embodiment. As an example, the obtained noise power set includes a plurality of noise powers in the diagram.
[0102] Step S300, according to the corresponding relationship between the plurality of noise power and the preset environment scene, determine the current possible environment scene. Specifically, each preset environment scene corresponds to a preset range of noise power range, in the specific implementation process, if a part of the plurality of noise power belongs to the noise power range of the preset first environment scene, and a part belongs to the noise power range of the preset second environment scene, then enter step S500. See Figure 2 , for example, scene 1 is bedroom scene, its corresponding noise power range is A1-A2; scene 2 is living room scene, its corresponding noise power range is B1-B2; scene 3 is conference room scene, its corresponding noise power range is C1-C2.
[0103] Step S500, respectively determine the first number of only belonging to the first environment scene and the second number of only belonging to the second environment scene in the plurality of noise power, and get the number ratio of the first number and the second number. Specifically, the first number is the number of noise power only belonging to the first environment scene, and the second number is the number of noise power only belonging to the second environment scene. That is, if there is noise power in the noise power set which belongs to the noise power range of the first environment scene and the noise power range of the second environment scene, then the noise power overlapping in the two environment scenes is not counted in the first number or the second number.
[0104] For the convenience of those skilled in the art, please see Figure 2 , for example, the first number only belonging to scene 1 is the number of noise power belonging to A1-B1 (the power range of scene 1 is originally A1-A2, but the range of B1-A2 belongs to scene 1 and scene 2 at the same time, only the range belonging to scene 1 is A1-B1, therefore B1-A2 is not counted, only A1-B1 is counted), the second number only belonging to scene 2 is the number of noise power belonging to A2-B2 (the power range of scene 2 is originally B1-B2, but the range of B1-A2 belongs to scene 1 and scene 2 at the same time, only the range belonging to scene 2 is A2-B2, therefore B1-A2 is not counted, only A2-B2 is counted).
[0105] In step S500, the number ratio k(i) is obtained by using the following formula:
[0106] k(i)=N1(i):N2(i), wherein N1(i) is the first number; N2(i) is the second number.
[0107] For example, in the first cycle (i.e. i=1), the first number and the second number are 6 and 4 respectively, then the number ratio k(1) is: k(1)=3:2.
[0108] Step S600, the first preset gain and the second preset gain are weighted according to the quantity ratio to obtain the noise reduction gain. Specifically, each environment scene corresponds to the noise reduction gain of a preset gear, the first preset gain is the noise reduction gain of the preset gear corresponding to the first environment scene, and the second preset gain is the noise reduction gain of the preset gear corresponding to the second environment scene.
[0109] For the convenience of those skilled in the art, please refer to Figure 2 For example, the noise reduction gain corresponding to scene 1 is D1, the noise reduction gain corresponding to scene 2 is D2, and the noise reduction gain corresponding to scene 3 is D3. According to the quantity ratio of the first quantity to the second quantity, D1 and D2 are weighted, and the weighted noise reduction gain is obtained as the final noise reduction gain in the current execution period.
[0110] For example, the quantity ratio k(i) is 3:2, and the weighted noise reduction gain D' is: D' = 3 / 5D1 + 2 / 5D2.
[0111] Step S700, according to the noise reduction gain, the secondary path generates a noise cancellation waveform corresponding to the noise reduction gain to cancel the environmental noise in the original audio signal. Specifically, the secondary path can be a loudspeaker or other components that can generate a noise cancellation waveform. In addition, a total noise reduction gain is obtained by weighting calculation, and the corresponding noise cancellation waveform is also a total output, which can avoid the error caused by multiple superpositions, thereby further improving the noise reduction accuracy.
[0112] The active noise reduction method disclosed in the embodiment, after obtaining the noise power set of the environmental noise, determines the first environment scene and the second environment scene according to the plurality of noise powers, and then determines the current possible environment scene according to the correspondence between the plurality of noise powers and the preset environment scenes, wherein each preset environment scene corresponds to a preset range of noise power range. If a part of the plurality of noise powers belongs to the noise power range of the preset first environment scene and a part belongs to the noise power range of the preset second environment scene, the first quantity belonging only to the first environment scene and the second quantity belonging only to the second environment scene are determined respectively, and the quantity ratio of the first quantity and the second quantity is obtained. Then, the first preset gain and the second preset gain are weighted according to the quantity ratio to obtain the noise reduction gain, and the secondary path generates a noise cancellation waveform corresponding to the noise reduction gain according to the noise reduction gain to cancel the environmental noise in the original audio signal. Thus, when the noise power falls within the noise power range corresponding to two different scenes, the uncertain scene can be adapted, the precision of adjusting the noise reduction gain is effectively improved, the problem of excessive noise reduction or insufficient noise reduction is minimized, and the noise reduction effect can better match various noise scenes, so that the noise reduction effect is more suitable for human ears and the use comfort is improved.
[0113] In specific embodiments, in step S300, determining the current possible environment scene according to the correspondence between the plurality of noise power determinations and the preset environment scenes comprises: step S310, respectively determining a first total number of the plurality of noise power determinations belonging to the first environment scene and a second total number of the plurality of noise power determinations belonging to the second environment scene; and step S320, when the sum of the first total number and the second total number is greater than a preset value or a preset proportion, determining that the current environment scene is the first environment scene and / or the second environment scene. The preset value and the preset proportion can be obtained by a person skilled in the art according to experience.
[0114] Specifically, a small amount of noise power may not belong to the first environment scene or the second environment scene, and only the sum of the first total number and the second total number needs to be greater than the preset value or the preset proportion. For example, in a relatively quiet scene, a door is suddenly closed, and the noise power at the moment of closing the door may not belong to the noise power range of the first environment scene or the second environment scene, but since the sum of the first total number and the second total number is greater than the preset value or the preset proportion, it is still considered that the current environment scene is the first environment scene and / or the second environment scene.
[0115] In specific embodiments, the method for further determining whether the current environment scene is a single environment scene (the first environment scene or the second environment scene) or a double environment scene (the first environment scene and the second environment scene) is as follows, and step S300 further comprises:
[0116] Step S330, when there is overlapping noise power between the first environment scene and the second environment scene, determining an overlapping number proportion of the plurality of noise power determinations that simultaneously belong to the noise power range of the first environment scene and the noise power range of the second environment scene.
[0117] In one embodiment, when the overlapping number proportion does not exceed a preset threshold, it is considered that the current environment is a single environment scene, and noise reduction can be performed according to the single environment scene. For details, see the following description.
[0118] In another embodiment, when the overlapping number proportion exceeds the preset threshold, it is considered that the current environment scene is a double environment scene, that is, the plurality of current noise power determinations correspond to the first environment scene and the second environment scene, and the current execution cycle is continued, that is, in the first execution cycle (i = 1), step S500 is continued; and in the i (i > 1) execution cycle, step S301 is continued. For details, see the following description.
[0119] It should be noted that the determination of the first number and the second number in step S310 and step S500 in the present embodiment can be the same execution step or two independent execution steps.
[0120] In a common noise reduction process, the ambient noise in which the user is located is usually dynamically changing, so the ambient noise needs to be continuously detected, and the size of the noise reduction gain is adaptively adjusted accordingly, that is, the noise reduction effect is adaptively adjusted according to the actual size of the ambient noise.
[0121] In most cases, the change of the ambient noise is small, that is, the environment scene does not change, so the reliability and stability of the noise reduction gain can be better ensured by referring to the quantity ratio of the last execution period to some extent, so that the use experience of noise reduction is better.
[0122] In a small part of the cases, the change of the ambient noise is large, that is, the environment scene changes, so the quantity ratio of the last execution period is no longer referential. In order to more accurately determine whether to refer to the quantity ratio of the last execution period, the specific determination method is as follows.
[0123] In the i th execution period, when i is equal to 1, refer to the description above; when i is greater than 1, step S300 further comprises:
[0124] Step S301, determine whether there is a third environment scene according to the noise power set obtained in the i th execution period, wherein the third environment scene is different from the first environment scene and the second environment scene.
[0125] When it is determined that the i th execution period determines the existence of the third environment scene, that is, the change of the ambient noise is large (the environment scene changes), the first quantity and the second quantity cached in the i-1 th execution period are all cleared, that is, the quantity ratio in the i-1 th period is no longer referred to at this time.
[0126] In a specific embodiment, when it is determined that the i th execution period exists the third environment scene, the first quantity and the second quantity cached in the i-1 th execution period are all cleared. That is, when the i th execution period is detected to exist the third environment scene, it is considered that the environment scene in the i th execution period has changed relative to the i-1 th execution period, so the quantity ratio in the i-1 th execution period is no longer referential, then i=1, that is, the execution steps of the i th execution period at this time are exactly the same as the first execution period.
[0127] In an embodiment, there is only a single third environment scene in the i th execution period, so the noise reduction can be performed according to the single environment scene. The noise reduction mode of the single environment scene is specifically described below.
[0128] In another embodiment, there are a third environmental scene and another environmental scene in the i-th execution cycle, the first quantity and the second quantity cached in the (i-1)-th execution cycle are both cleared, and the noise reduction mode of the double environmental scenes in the 1st execution cycle is continued to execute, and the third environmental scene and the another environmental scene can be analogous to the first environmental scene and the second environmental scene.
[0129] By clearing the historical environmental noise when the environmental scene changes and only considering the environmental noise power in the current execution cycle, the influence of the historical quantity on the noise reduction effect of the current environmental scene is avoided, and the noise reduction effect can be better ensured to be more in line with the human ear comfort.
[0130] In a specific embodiment, when it is determined that the double environmental scenes of the first environmental scene and the second environmental scene still exist in the i-th execution cycle, that is, the current environmental scene is the same as that in the (i-1)-th execution cycle, there is no third environmental scene, and the change of the environmental noise is small (the environmental scene does not change), the first quantity and the second quantity in the (i-1)-th execution cycle are not cleared, and are used to participate in the operation of the quantity ratio in the i-th execution cycle, so that the effect of referring to the quantity ratio in the last execution cycle is achieved. In the i-th execution cycle (i>1) in the specific embodiment, the calculation method of the quantity ratio of the double environmental scene noise reduction mode is described below.
[0131] In order to further improve the stability of the noise reduction effect and make the noise reduction device more in line with the comfort requirement of the human ear, in the i-th execution cycle (i>1) in the specific embodiment, the following steps are further included. Figure 1 The execution steps in the dashed box, that is, between step S300 and step S500, further include:
[0132] In step S410, the first quantity and the second quantity cached in the (i-1)-th execution cycle are weighted to obtain the weighted first quantity and the weighted second quantity, and the weighting coefficient is greater than 0 and less than or equal to 1. The specific determination method of the weighting coefficient is described below in step S401.
[0133] In step S420, a new first quantity belonging to the first environmental scene and a new second quantity belonging to the second environmental scene are determined from the plurality of noise powers in the i-th execution cycle. It should be noted that the execution order of step S410 and step S420 is not limited, and they can be executed in sequence or synchronously.
[0134] In the i-th execution cycle (i>1), in step S500, the quantity ratio k(i) of the i-th execution cycle is obtained by using the following formula:
[0135] k(i) = N1(i) : N2(i), wherein N1(i) is the first number of the i th execution cycle; N2(i) is the second number of the i th execution cycle;
[0136] N1(i) = a1*N1(i-1) + N1'(i), wherein N1(i-1) is the first number of the i-1 th execution cycle, N1'(i) is the new first number of the i th execution cycle, and a1 is a weighting coefficient for weighting N1(i-1);
[0137] N2(i) = a2*N2(i-1) + N2'(i), wherein N2(i-1) is the second number of the i-1 th execution cycle, N2'(i) is the new second number of the i th execution cycle, and a2 is a weighting coefficient for weighting N2(i-1).
[0138] For example, the 1 st execution cycle and the 2 nd execution cycle both belong to the first environmental scenario and the second environmental scenario, wherein the first number and the second number cached in the 1 st execution cycle are 6 and 4 respectively, the new first number and the new second number cached in the 2 nd execution cycle are 5 and 5 respectively, and the weighting coefficient is 0.5. Then in the 2 nd execution cycle:
[0139] N1(2) = 0.5*6 + 5 = 8;
[0140] N2(2) = 0.5*4 + 5 = 6;
[0141] Then the number ratio k(2) of the 2 nd execution cycle is 8:6.
[0142] As can be seen, in most cases, when the environmental noise changes little in a period of time, it can be considered that the environmental scenario has not changed, and thus the number ratio of the last execution cycle can be referenced to a certain extent through the above algorithm, that is, the noise reduction gain of the last execution cycle is inherited to a certain extent, thereby ensuring the stability and reliability of the noise reduction gain. It should be noted that the unchanged environmental scenario does not mean that the noise power is unchanged, as long as the sum of the first total number belonging to the first environmental scenario and the second total number belonging to the second environmental scenario is greater than the preset number or the preset proportion.
[0143] It should be understood that in the calculation process of the number ratio of the inherited history, the smaller the weighting coefficient, the less the influence of the environmental noise of the inherited history, that is, the smaller the weight of the historical environmental noise in the current execution cycle. When the weighting coefficient is set to 1, the historical environmental noise is completely inherited in the current execution cycle, and when the weighting coefficient is set to less than 1, the historical environmental noise is partially inherited in the current execution cycle.
[0144] In specific embodiments, the specific determination method of the weighting coefficient is as follows, before step S410, the method further comprises:
[0145] Step S401, the total number of the first number, the second number and the number of the plurality of noise powers in the i-th execution cycle in the i-1-th execution cycle is counted;
[0146] When the total number does not exceed the preset cache threshold, the weighting coefficient in step S410 is equal to 1;
[0147] When the total number exceeds the cache threshold, the weighting coefficient in step S410 is less than 1, and the specific value of the weighting coefficient can be obtained by the person skilled in the art according to experience.
[0148] For example, the preset cache threshold is 128, and the number of noise powers in the preset time length is 35.
[0149] When i=2, the total number of the first number, the second number and the number of the plurality of noise powers in the 2nd execution cycle in the 1st execution cycle is 70, which does not exceed the cache threshold 128, so the weighting coefficient in step S410 in the 2nd execution cycle is equal to 1;
[0150] When i=3, the total number of the first number, the second number and the number of the plurality of noise powers in the 3rd execution cycle in the 2nd execution cycle is 105, which does not exceed the cache threshold 128, so the weighting coefficient in step S410 in the 3rd execution cycle is equal to 1;
[0151] When i=4, the total number of the first number, the second number and the number of the plurality of noise powers in the 4th execution cycle in the 3rd execution cycle is 140, which exceeds the cache threshold 128, so the weighting coefficient in step S410 in the 4th execution cycle is less than 1.
[0152] It can be seen that by setting the cache threshold, the amount of calculation can be reduced to a certain extent, so that the active noise reduction method can simultaneously consider the timeliness, reliability and comfort of the human ear.
[0153] To sum up, the embodiment discloses an active noise reduction method for adaptive noise reduction gain adjustment. After obtaining a noise power set of environmental noise, a first environmental scene and a second environmental scene where the current is located are determined according to a plurality of noise powers. Then, a current possible environmental scene is determined according to a correspondence between the plurality of noise powers and preset environmental scenes. Each preset environmental scene corresponds to a preset range of noise power range. If a part of the plurality of noise powers belongs to the noise power range of the preset first environmental scene and a part belongs to the noise power range of the preset second environmental scene, a first number of the plurality of noise powers belonging to only the first environmental scene and a second number of the plurality of noise powers belonging to only the second environmental scene are determined respectively. After obtaining a number ratio of the first number and the second number, a noise reduction gain is obtained by weighting the first preset gain and the second preset gain according to the number ratio. The secondary path is caused to generate a noise cancellation waveform corresponding to the noise reduction gain according to the noise reduction gain, so as to cancel the environmental noise in the original audio signal. Thus, when the noise power falls within the noise power ranges corresponding to two different scenes, the scene can be adapted to the uncertainty, the precision of adjusting the noise reduction gain is effectively improved, and the problem of excessive noise reduction or insufficient noise reduction is minimized, so that the noise reduction effect can better match various noise scenes, the noise reduction effect is more suitable for human ears, and the use comfort is improved.
[0154] In addition, by referring to the number ratio of the last execution cycle to some extent, that is, to some extent, the noise reduction gain of the last execution cycle is inherited, so as to ensure the stability and reliability of the noise reduction gain.
[0155] In addition, when noise reduction is performed on a single environmental scene, the plurality of noise power values are sorted according to size, and the noise reduction gain is determined according to the median of the noise power, so as to effectively avoid the problem of sudden change of the noise reduction gain caused by transient noise, thereby preventing the problem of accidental or random triggering of the noise reduction gain caused by transient noise, and ensuring the stability of the noise reduction gain and the reliability of adjusting the noise reduction gain.
[0156] In specific embodiments, in the step S330, when the overlap number ratio does not exceed the preset threshold, it is considered that the current environment is a single environmental scene, and the noise reduction step of the single environmental scene is performed without executing the steps S500-S600. The noise reduction step of the single environmental scene is as follows:
[0157] Step S800, sorting the plurality of noise powers in the noise power set according to the size of the value, obtaining the noise power median of the noise power set;
[0158] Step S900, extracting the noise reduction gain of the noise power range corresponding to the noise power median, and executing step S700.
[0159] After obtaining the plurality of noise power values of the ambient noise in the preset time length, the noise power values in the current noise power set are sorted in order of size to obtain a noise power median of the current noise power set, a noise reduction gain is determined according to the noise power median, and a noise reduction signal is sent according to the noise reduction gain.
[0160] It can be seen that, by sorting the plurality of noise power values in order of size and determining the noise reduction gain according to the noise power median, the problem of sudden change of the noise reduction gain caused by transient noise can be effectively avoided, thereby preventing the problem of mis-triggering or disorderly triggering of the noise reduction gain caused by transient noise, and the stability of the noise reduction gain and the reliability of adjusting the noise reduction gain are ensured.
[0161] In specific embodiments, the original audio signal in the preset time length in step S100 includes a plurality of audio signals, and each audio signal corresponds to a noise power. Step S100 includes sequentially obtaining the plurality of audio signals. In step S200, the noise power of the ambient noise in each audio signal is determined frame by frame.
[0162] Step S800 includes: when the noise power of the jth audio signal is determined, the noise power of the jth audio signal is sorted with the noise powers of the 1st to the (j-1)th audio signals until j=P, where 2≤j≤P, and P is the number of frames of the original audio signal in the preset time length.
[0163] In step S800, the noise power of each audio signal is sorted as soon as it is determined, that is, the noise power is sorted simultaneously in the process of determining the noise power, thereby improving the calculation efficiency, reducing the delay caused by calculation, and ensuring the timeliness and reliability of the noise reduction method.
[0164] Further, when the noise power set includes an odd number of noise powers, the noise power median is the middle value of the sorted noise power set, that is, the existing median calculation method.
[0165] When the noise power set includes an even number of noise powers, the noise power median is one of the two middle values of the sorted noise power set.
[0166] Thus, while effectively avoiding the problem of sudden change of the noise reduction gain caused by transient noise, the calculation amount of obtaining the noise power median can be further reduced, thereby further ensuring the timeliness of the noise reduction method.
[0167] In specific embodiments, in order to make the switching of the noise reduction gain more comfortable and moderate, after step S600 or step S900, the method further includes:
[0168] Step S610, when the noise reduction gain calculated in step S600 or step S900 is not equal to the current noise reduction gain, adjusting the current noise reduction gain to the calculated noise reduction gain by a preset gradient, so as to gradually transition the noise reduction gain. Wherein, the noise reduction gain calculated in step S600 is also the weighted noise reduction gain, and the noise reduction gain calculated in step S900 is also the noise reduction gain corresponding to the noise power range of the noise power median.
[0169] Preferably, when the current noise reduction gain is adjusted to the calculated noise reduction gain by a preset gradient, the adjustment amount of each gradient adjustment is consistent, so that the switching of the noise reduction gain is more smooth and comfortable.
[0170] More preferably, when the current noise reduction gain is adjusted to the calculated noise reduction gain by a preset gradient, the number of gradient adjustments is 5-15, and the adjustment time length from the current noise reduction gain to the next noise reduction gain is 100-500ms. This time limit and the limit of the number of gradient adjustments can effectively ensure that the comfort of the noise reduction gain switching is optimal, and also can ensure the timeliness of the noise reduction gain switching.
[0171] The embodiment also discloses an active noise reduction device, please refer to Figure 3 The active noise reduction device disclosed in the embodiment is a structure schematic diagram, which comprises an audio signal acquisition module 100, a noise power set obtaining module 200, a scene determining module 300, a ratio determining module 400, a gain calculating module 500 and a cancellation module 600, wherein:
[0172] The audio signal acquisition module 100 is used for acquiring the original audio signal collected by the collection element within a preset time length. In a specific embodiment, the original audio signal within the preset time length acquired by the audio signal acquisition module 100 contains multiple frames of audio signals, and the audio signal acquisition module 100 acquires the multiple frames of audio signals in sequence.
[0173] The noise power set obtaining module 200 is used for determining the environmental noise within the preset time length from the original audio signal, and obtaining the noise power set of the environmental noise, wherein the noise power set is multiple noise powers of the environmental noise within the preset time length. In a specific embodiment, the noise power set obtaining module 200 determines the noise power of the environmental noise in each frame of audio signal frame by frame.
[0174] The scene determining module 300 is used for determining the current possible environmental scene according to the corresponding relationship between the multiple noise powers and the preset environmental scenes, wherein each preset environmental scene corresponds to a preset range of noise power range.
[0175] The ratio determining module 400 is configured to determine a first quantity of the plurality of noise powers belonging to the first environment scene and a second quantity of the plurality of noise powers belonging to the second environment scene, and obtain a quantity ratio of the first quantity and the second quantity, when the scene determining module 300 determines that a part of the plurality of noise powers belongs to the noise power range of the first environment scene and a part of the plurality of noise powers belongs to the noise power range of the second environment scene.
[0176] The gain calculating module 500 is configured to obtain the noise reduction gain by weighting the first preset gain and the second preset gain according to the quantity ratio, wherein each environment scene corresponds to a preset gear of the noise reduction gain, the first preset gain is the noise reduction gain of the preset gear corresponding to the first environment scene, and the second preset gain is the noise reduction gain of the preset gear corresponding to the second environment scene.
[0177] The offsetting module 600 is configured to generate a noise offset waveform corresponding to the noise reduction gain to offset the environmental noise in the original audio signal.
[0178] In specific embodiments, the scene determining module 300 is further configured to determine an overlap quantity ratio of the plurality of noise powers belonging to both the noise power range of the first environment scene and the noise power range of the second environment scene when there is an overlap of the noise power between the first environment scene and the second environment scene, and determine the first quantity and the second quantity and obtain the quantity ratio when the overlap quantity ratio exceeds a preset threshold. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0179] In specific embodiments, the scene determining module 300 is further configured to determine a first total quantity of the plurality of noise powers belonging to the first environment scene and a second total quantity of the plurality of noise powers belonging to the second environment scene, and determine that the current scene is the first environment scene and / or the second environment scene when the sum of the first total quantity and the second total quantity is greater than a preset value. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0180] In specific embodiments, in the i th execution cycle (i > 1), the ratio determining module 400 is configured to weight the first quantity and the second quantity cached in the i-1 th execution cycle to obtain a weighted first quantity and a weighted second quantity, and the weighting coefficient is greater than 0 and less than or equal to 1.
[0181] The ratio determining module 400 is further configured to determine a new first quantity of the plurality of noise powers belonging to the first environment scene and a new second quantity of the plurality of noise powers belonging to the second environment scene in the i th execution cycle.
[0182] In the i th execution cycle, the gain calculating module 500 obtains the quantity ratio k(i) of the i th execution cycle by using the following formula:
[0183] k(i) = N1(i) : N2(i), wherein N1(i) is the first number of the i th execution cycle; N2(i) is the second number of the i th execution cycle;
[0184] N1(i) = a1*N1(i-1) + N1'(i), wherein N1(i-1) is the first number of the i-1 th execution cycle, N1'(i) is the new first number of the i th execution cycle, and a1 is a weighting coefficient for weighting N1(i-1).
[0185] N2(i) = a2*N2(i-1) + N2'(i), wherein N2(i-1) is the second number of the i-1 th execution cycle, N2'(i) is the new second number of the i th execution cycle, and a2 is a weighting coefficient for weighting N2(i-1). For details, please refer to the description of the above embodiments, which will not be repeated here.
[0186] In specific embodiments, the ratio determination module 400 is further configured to count the total number of the first number, the second number cached in the i-1 th execution cycle, and the number of noise powers in the i th execution cycle before weighting the first number and the second number cached in the i-1 th execution cycle, respectively. When the total number does not exceed the preset cache threshold, the weighting coefficient is equal to 1. When the total number exceeds the cache threshold, the weighting coefficient is less than 1. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0187] In addition, in the i th execution cycle, the scene determination module 300 is further configured to determine whether a third environment scene exists according to the set of noise powers obtained in the i th execution cycle, wherein the third environment scene is different from the first environment scene and the second environment scene.
[0188] When it is determined that the third environment scene exists in the i th execution cycle, the first number and the second number cached in the i-1 th execution cycle are both cleared. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0189] In specific embodiments, the device further comprises a transition module 610, which is configured to adjust the current noise reduction gain to the weighted noise reduction gain by a preset gradient when the weighted noise reduction gain is not equal to the current noise reduction gain, so as to gradually transition the noise reduction gain. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0190] The apparatus further comprises a sorting module 800 and a noise reduction gain extraction module 900. When the overlap quantity proportion does not exceed the preset threshold, the sorting module 800 is configured to sort the plurality of noise powers in the noise power set according to the numerical value size in sequence to obtain a noise power median of the noise power set. The noise reduction gain extraction module 900 is configured to extract a noise reduction gain corresponding to a noise power range of the noise power median, so that the cancellation module 600 outputs a corresponding noise cancellation waveform according to the noise reduction gain.
[0191] In specific embodiments, the sorting module 800 sorts by the following method:
[0192] When determining the noise power of the jth frame of audio signal, the noise powers of the 1st to the (j-1)th frames are sorted until j=P, where 2≤j≤P, and P is the frame number of the original audio signal in the preset time length. Specifically, please refer to the description of the above embodiments, which will not be repeated here.
[0193] In one embodiment, when the noise power set includes an even number of noise powers, the noise power median is one of the two middle values of the sorted noise power set.
[0194] In another embodiment, when the noise power set includes an odd number of noise powers, the noise power median is the value located at the middle position of the sorted noise power set.
[0195] The present embodiment also discloses an audio playback device based on active noise reduction. The active noise reduction method disclosed in the above embodiments is applied to the audio playback device.
[0196] In specific embodiments, the audio playback device is a headset.
[0197] Please refer to Figure 4 A module schematic diagram of an audio playback device based on adaptive noise reduction gain adjustment disclosed in the present embodiment. The audio playback device pair 20 comprises a pair of first audio device 21 and second audio device 22, wherein the first audio device 21 and the second audio device 22 are both the audio playback device disclosed in the above embodiments. Therefore, the first audio device 21 and the second audio device 22 can both independently obtain the parameters of the environmental noise, thereby further improving the reliability and accuracy of the audio playback device pair 20 in obtaining the parameters of the environmental noise.
[0198] In specific embodiments, the first audio device 21 and the second audio device 22 can communicate with each other, and the communication mode of the two is not limited, for example, it can be wired communication, or wireless communication such as Bluetooth, wifi or infrared.
[0199] After the first audio device 21 and / or the second audio device 22 receives the noise reduction gain of the other party, the two noise reduction gains are compared to obtain a larger noise reduction gain, and the first audio device 21 and the second audio device 22 both generate a noise cancellation waveform corresponding to the larger noise reduction gain according to the larger noise reduction gain.
[0200] In a normal use process, there is often a certain difference in the position, direction, etc. of the first audio device 21 and the second audio device 22, which may lead to different noise power sets obtained by the first audio device 21 and the second audio device 22 in the same environment. The first audio device 21 and the second audio device 22 both emit a noise reduction signal according to the larger one of the noise reduction gains obtained by the two audio devices, which can ensure the consistency of the noise reduction gains of the two audio devices and improve the use comfort, and further ensure a better noise reduction effect of the audio device pair 20. Especially when the audio device pair 20 is a headphone pair, this design can better adapt to the comfort requirements of human ears.
[0201] The embodiment also discloses a computer readable storage medium, which stores a computer program, and the computer program can implement the active noise reduction method disclosed in the above embodiment when executed.
[0202] The embodiment also discloses a chip for active noise reduction, which comprises a processor and a memory, and the memory stores a computer program, and the processor can execute the computer program to implement the active noise reduction method disclosed in the above embodiment.
[0203] It should be noted that the computer readable storage medium in the embodiments of the present disclosure is not limited to the above given embodiments, for example, it can also be an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or instrument, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or instrument.
[0204] Those skilled in the art can understand that the above-mentioned preferred embodiments can be freely combined and superimposed without conflict. Among them, the flowcharts and block diagrams in the drawings illustrate the possible implementation architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code containing one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than those noted in the drawings, for example, two blocks indicated in succession can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the function involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of special-purpose hardware and computer instructions. The numbering of the steps herein is only for the convenience of description and reference, and does not limit the front and rear sequences, and the specific execution sequence is determined by the technology itself, and those skilled in the art can determine various allowed and reasonable sequences according to the technology itself.
[0205] It should be noted that the step numbering (letter or number) is used in the present application to refer to certain specific method steps, only for the purpose of convenience and brevity, and absolutely not to limit the order of the method steps by letters or numbers. Those skilled in the art can understand that the order of the related method steps should be determined by the technology itself, and should not be improperly limited by the existence of step numbering, and those skilled in the art can determine various allowed and reasonable step sequences according to the technology itself.
[0206] Those skilled in the art can understand that the above-mentioned preferred embodiments can be freely combined and superimposed without conflict.
[0207] It should be understood that the above-described embodiments are only exemplary and not limiting, and those skilled in the art can make various obvious or equivalent modifications or replacements to the above-described details without departing from the essential principles of the present application, which will be included in the scope of the claims of the present application.
Claims
1. An active noise reduction method based on adaptive noise reduction gain adjustment, characterized by, The method comprises the following steps: Step S100, acquiring an original audio signal collected by a collection element within a preset time length; Step S200, determining an ambient noise within the preset time length from the original audio signal, and obtaining a noise power set of the ambient noise, wherein the noise power set is a plurality of noise powers of the ambient noise within the preset time length; Step S300, determining an ambient scene where the current may be located according to a corresponding relationship between the plurality of noise powers and preset ambient scenes, wherein each preset ambient scene corresponds to a preset range of noise power range, if a part of the plurality of noise powers belongs to a noise power range of a preset first ambient scene, and a part of the plurality of noise powers belongs to a noise power range of a preset second ambient scene, then entering step S500; Step S500, respectively determining a first number belonging to only the first ambient scene and a second number belonging to only the second ambient scene in the plurality of noise powers, and obtaining a quantity ratio of the first number and the second number; Step S600, weighting a first preset gain and a second preset gain according to the quantity ratio to obtain a noise reduction gain, wherein each ambient scene corresponds to a preset gear of noise reduction gain, the first preset gain is a noise reduction gain of a preset gear corresponding to the first ambient scene, and the second preset gain is a noise reduction gain of a preset gear corresponding to the second ambient scene; Step S700, according to the noise reduction gain, causing a secondary path to generate a noise cancellation waveform corresponding to the noise reduction gain, so as to cancel the ambient noise in the original audio signal.
2. The active noise reduction method of claim 1, wherein, The step S300 further comprises: Step S330, when there is an overlapping noise power between the first ambient scene and the second ambient scene, determining an overlapping number ratio of the plurality of noise powers that simultaneously belong to the noise power range of the first ambient scene and the noise power range of the second ambient scene, and when the overlapping number ratio exceeds a preset threshold, then entering the step S500.
3. The active noise reduction method of claim 2, wherein, In the step S300, the determination of the ambient scene where the current may be located according to the corresponding relationship between the plurality of noise powers and the preset ambient scenes comprises: Step S310, respectively determining a first total number belonging to the first ambient scene and a second total number belonging to the second ambient scene in the plurality of noise powers; Step S320, when the sum of the first total number and the second total number is greater than a preset value, then determining that the current scene is the first ambient scene and / or the second ambient scene.
4. The active noise reduction method according to any one of claims 1 to 3, wherein In the i-th execution cycle, i is greater than 1, before the step S500, the method further comprises: Step S410, weighting the first number and the second number cached in the i-1th execution cycle respectively to obtain a weighted first number and a weighted second number, and the weighting coefficient is greater than 0 and less than or equal to 1; Step S420, respectively determining a new first number belonging to the first ambient scene and a new second number belonging to the second ambient scene in the plurality of noise powers in the i-th execution cycle; In the i th execution cycle, in the step S500, the quantity ratio k (i) of the i th execution cycle is obtained by using the following formula: k (i) = N1 (i) : N2 (i), wherein N1 (i) is the first quantity of the i th execution cycle; N2 (i) is the second quantity of the i th execution cycle; N1 (i) = a1*N1 (i-1) + N1' (i), wherein N1 (i-1) is the first quantity of the i-1 th execution cycle, N1' (i) is the new first quantity of the i th execution cycle, and a1 is a weighting coefficient for weighting N1 (i-1) ; N2 (i) = a2*N2 (i-1) + N2' (i), wherein N2 (i-1) is the second quantity of the i-1 th execution cycle, N2' (i) is the new second quantity of the i th execution cycle, and a2 is a weighting coefficient for weighting N2 (i-1).
5. The active noise reduction method of claim 4, wherein, Before the step S410, further comprising: Step S401, counting the total quantity of the first quantity, the second quantity and the quantity of the plurality of noise powers in the i-1 th execution cycle and the i th execution cycle; When the total quantity does not exceed the preset cache threshold, the weighting coefficient in the step S410 is equal to 1; When the total quantity exceeds the cache threshold, the weighting coefficient in the step S410 is less than 1.
6. The active noise reduction method of claim 4, wherein, In the i th execution cycle, the step S300 further comprises: Step S301, determining whether there is a third environment scene according to the set of noise powers obtained in the i th execution cycle, wherein the third environment scene is different from the first environment scene and the second environment scene; When it is determined in the i th execution cycle that there is a third environment scene, the first quantity and the second quantity cached in the i-1 th execution cycle are both cleared.
7. The active noise reduction method according to any one of claims 1 to 6, wherein After the step S600, further comprising: Step S610, when the weighted noise reduction gain is not equal to the current noise reduction gain, adjusting the current noise reduction gain to the weighted noise reduction gain by a preset gradient, so as to gradually transition the noise reduction gain.
8. The active noise reduction method of claim 2 or 3, wherein, When the overlap quantity ratio does not exceed the preset threshold, performing: Step S800, sorting the plurality of noise powers in the set of noise powers in order of numerical value to obtain a noise power median of the set of noise powers; Step S900, extracting the noise reduction gain corresponding to the noise power range of the noise power median, and performing the step S700.
9. The active noise reduction method of claim 8, wherein, The original audio signal in the preset time length in the step S100 comprises a plurality of audio signals; the step S100 comprises sequentially obtaining the plurality of audio signals; In the step S200, the noise power of the environmental noise in each frame of audio signal is determined frame by frame; The step S800 comprises: when the noise power of the j th frame of audio signal is determined, sorting the noise power of the j th frame with the noise powers of the 1 st to the j-1 th frames until j = P, wherein 2 ≤ j ≤ P, and P is the frame number of the original audio signal in the preset time length.
10. The active noise reduction method of claim 8, wherein, In the step S800, when the set of noise powers includes an even number of noise powers, the median of the noise powers is one of the middle two values of the sorted set of noise powers.
11. An active noise reduction device, characterized by, The device comprises: An audio signal acquisition module (100) is configured to acquire an original audio signal collected by a collection element within a preset time length; A set of noise powers obtaining module (200) is configured to determine an ambient noise in the preset time length from the original audio signal and obtain a set of noise powers of the ambient noise, wherein the set of noise powers is a plurality of noise powers of the ambient noise in the preset time length. A scene determining module (300) is configured to determine a current possible ambient scene according to a corresponding relationship between the plurality of noise powers and preset ambient scenes, wherein each preset ambient scene corresponds to a preset range of noise power range. A ratio determining module (400) is configured to, when the scene determining module (300) determines that a part of the plurality of noise powers belongs to a noise power range of a preset first ambient scene and a part of the plurality of noise powers belongs to a noise power range of a preset second ambient scene, determine a first number of the plurality of noise powers that only belong to the first ambient scene and a second number of the plurality of noise powers that only belong to the second ambient scene, and obtain a number ratio of the first number and the second number. A gain calculating module (500) is configured to weight a first preset gain and a second preset gain according to the number ratio to obtain a noise reduction gain, wherein each ambient scene corresponds to a preset gear of noise reduction gain, the first preset gain is a noise reduction gain of a preset gear corresponding to the first ambient scene, and the second preset gain is a noise reduction gain of a preset gear corresponding to the second ambient scene. A cancellation module (600) is configured to generate a noise cancellation waveform corresponding to the noise reduction gain to cancel the ambient noise in the original audio signal.
12. The active noise reduction device of claim 11, wherein, The scene determining module is further configured to, when there is an overlapping noise power between the first ambient scene and the second ambient scene, determine an overlapping number ratio of the plurality of noise powers that simultaneously belong to the noise power range of the first ambient scene and the noise power range of the second ambient scene, and when the overlapping number ratio exceeds a preset threshold, the ratio determining module determines the first number and the second number and obtains the number ratio.
13. The active noise reduction device of claim 12, wherein The scene determining module is further configured to determine a first total number of the plurality of noise powers that belong to the first ambient scene and a second total number of the plurality of noise powers that belong to the second ambient scene, and when a sum of the first total number and the second total number is greater than a preset value, determine that a current ambient scene is the first ambient scene and / or the second ambient scene.
14. An active noise reduction device according to any one of claims 11-13, wherein, In an i-th execution cycle, the ratio determining module is configured to weight the first number and the second number cached in an (i-1)-th execution cycle to obtain a weighted first number and a weighted second number, and a weighting coefficient is greater than 0 and less than or equal to 1. Also used to determine a new first number belonging to the first environmental scenario and a new second number belonging to the second environmental scenario in the plurality of noise powers of the i th execution cycle respectively; In the i th execution cycle, the gain calculation module obtains the number ratio k (i) of the i th execution cycle by using the following formula: k (i) = N1 (i) : N2 (i), wherein N1 (i) is the first number of the i th execution cycle; N2 (i) is the second number of the i th execution cycle; N1 (i) = a1*N1 (i-1) + N1' (i), wherein N1 (i-1) is the first number of the i-1 th execution cycle, N1' (i) is the new first number of the i th execution cycle, and a1 is a weighting coefficient for weighting N1 (i-1) ; N2 (i) = a2*N2 (i-1) + N2' (i), wherein N2 (i-1) is the second number of the i-1 th execution cycle, N2' (i) is the new second number of the i th execution cycle, and a2 is a weighting coefficient for weighting N2 (i-1).
15. The active noise reduction device of claim 14, wherein, The ratio determination module is further used to count the total number of the first number, the second number cached in the i-1 th execution cycle and the number of the plurality of noise powers in the i th execution cycle before weighting the first number and the second number cached in the i-1 th execution cycle respectively; When the total number does not exceed the preset cache threshold, the weighting coefficient is equal to 1; When the total number exceeds the cache threshold, the weighting coefficient is less than 1.
16. The active noise reduction device of claim 14, wherein, In the i th execution cycle, the scenario determination module is further used to determine whether a third environmental scenario exists according to the set of noise powers obtained in the i th execution cycle, wherein the third environmental scenario is different from the first environmental scenario and the second environmental scenario; When it is determined that a third environmental scenario exists in the i th execution cycle, the first number and the second number cached in the i-1 th execution cycle are both cleared.
17. An active noise reduction device according to any one of claims 11-16, wherein The device further comprises: A transition module, when the weighted noise reduction gain is not equal to the current noise reduction gain, the transition module is used to adjust the current noise reduction gain to the weighted noise reduction gain by a preset gradient, so that the noise reduction gain gradually transitions.
18. The active noise reduction apparatus according to claim 12 or 13, wherein The device further comprises: An ordering module, when the overlap number ratio does not exceed the preset threshold, the ordering module is used to order the plurality of noise powers in the set of noise powers according to the numerical value size to obtain a noise power median of the set of noise powers; A noise reduction gain extraction module is used to extract the noise reduction gain of the noise power range corresponding to the noise power median, so that the cancellation module outputs the corresponding noise cancellation waveform according to the noise reduction gain.
19. The active noise reduction device of claim 18, wherein, The original audio signal obtained by the audio signal obtaining module within the preset time period comprises a plurality of audio signals, and the audio signal obtaining module sequentially obtains the plurality of audio signals, and the noise power set obtaining module determines the noise power of the environmental noise in each audio signal frame by frame; The sorting module sorts in the following manner: When the noise power of the jth audio signal frame is determined, the noise power of the jth audio signal frame is sorted with the noise power of the 1st to the (j-1)th audio signal frames until j=P, wherein 2≤j≤P, and P is the number of frames of the original audio signal within the preset time period.
20. The active noise reduction device of claim 18, wherein, When the noise power set comprises an even number of noise powers, the median of the noise powers is one of the middle two values of the sorted noise power set.
21. An audio playback device, comprising: The active noise reduction device comprises the active noise reduction device according to any one of claims 11-20.
22. The audio playback device of claim 21, wherein, The audio playback device is an earphone.
23. An audio playback device pair, wherein The audio playback device comprises a pair of first and second audio devices, wherein the first and second audio devices are both the audio playback device according to claim 21 or 22, and the first and second audio devices can communicate with each other; After the first audio device and / or the second audio device receives the noise reduction gain of the other device, the two noise reduction gains are compared to obtain a larger noise reduction gain, and the first and second audio devices both generate a noise cancellation waveform corresponding to the larger noise reduction gain.
24. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed to implement the active noise reduction method according to any one of claims 1-10.
25. A chip for active noise reduction, comprising a processor and a memory, characterized in that, The computer program is stored in the memory, and the processor can execute the computer program to implement the active noise reduction method according to any one of claims 1-10.
Citation Information
Patent Citations
Method and device for counteracting environment noise and active noise reduction earphone
CN106792315A
Scene self-adaptive active noise reduction earphone and scene self-adaptive active noise reduction design method
CN107750027A