Noise reduction method, headphone device and storage medium
By detecting the external noise of the earphones and switching modes, collecting internal and external microphone data to optimize the feedforward filter parameters, it solves the problem of poor noise reduction effect of earphones in practical applications, and realizes adaptive noise reduction optimization for different ear canals and wearing styles. , improving the noise reduction effect of headphones.
Patent Information
- Application Number
- CN202310207093.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-02-24
AI Technical Summary
In actual applications, due to differences in the size of the user's ear canal and wearing methods, the noise reduction effect of existing headphones is poor, and it is difficult to achieve the effect in a laboratory environment.
By detecting that the external noise data of the headset is greater than the threshold, the mode is switched, the internal and external microphone data are collected, and the feedforward filter parameters are optimized to achieve adaptive noise reduction.
It improves the noise reduction effect of headphones in high-noise environments, adapts to different ear canals and wearing styles, improves the noise reduction optimization effect, and is close to the noise reduction effect of laboratory simulation.
Smart Images

Figure CN117156333B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a noise reduction method, an earphone device and a storage medium. Background Art
[0002] In recent years, with the rapid development of wearable audio devices, headphones have become an indispensable daily necessity in people's lives, and noise reduction has become one of the essential attributes of headphones.
[0003] At present, a good noise reduction effect can often be debugged in a laboratory environment. However, in actual applications, due to factors such as differences in user ear canal size, wearing methods, and prototype differences, the noise reduction effect of headphones is not good. Summary of the invention
[0004] The embodiments of the present application provide a noise reduction method, an earphone device, and a storage medium to optimize earphone parameters to improve the noise reduction effect of the earphone.
[0005] In a first aspect, an embodiment of the present application proposes a noise reduction method, which includes: when it is detected that the external noise data of the earphone is greater than a first threshold, the earphone mode is set to the first mode; first external noise data and first internal noise data of the earphone in the first mode are obtained; the earphone mode is switched from the first mode to the second mode; second external noise data and second internal noise data of the earphone in the second mode are obtained; based on the first external noise data, the first internal noise data, the second external noise data and the second internal noise data, target parameters are determined, and the target parameters are used to optimize the parameters of the feedforward filter of the earphone in the second mode.
[0006] In this embodiment, the first mode may be a transition mode, and the second mode may be a default deep noise reduction mode. The feedback noise reduction parameters of the first mode and the second mode are the same, and the parameters of the feedforward filter of the earphone in the first mode and the second mode are different. The parameters of the earphone feedforward filter are feedforward filter parameters.
[0007] The above method is suitable for optimizing the noise reduction effect of headphones in a high-noise environment. When it is detected that the external noise of the headphones is greater than a preset threshold, the headphones are switched from the first mode to the second mode, and the optimization direction of the headphone feedforward filter parameters is determined by obtaining the noise data collected by the internal and external microphones of the headphones in the two modes, so as to optimize the noise reduction effect in the ear in a high-noise environment by adjusting the feedforward filter parameters.
[0008] In an optional embodiment of the first aspect, obtaining first external noise data and first internal noise data of the headset in the first mode includes: obtaining the first external noise data from the first microphone of the headset, and obtaining the first internal noise data from the second microphone of the headset; obtaining the second external noise data and the second internal noise data of the headset in the second mode includes: obtaining the second external noise data from the first microphone, and obtaining the second internal noise data from the second microphone.
[0009] In this embodiment, the first microphone is an external microphone of the headset, and the second microphone is a built-in microphone of the headset.
[0010] The above method collects noise data from the internal and external microphones of the earphone respectively, which is used for the subsequent optimization calculation of the earphone feedforward filter parameters.
[0011] In an optional embodiment of the first aspect, before determining the target parameter based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, it also includes: acquiring a first parameter of the feedforward filter in the first mode, and a second parameter of the feedforward filter in the second mode; determining the target parameter based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, including: determining the target parameter based on the first external noise data, the first internal noise data, the second external noise data, the second internal noise data, the first parameter, and the second parameter.
[0012] In this embodiment, the first parameter and the second parameter are both pre-configured feed-forward filter parameters, and different headphone modes correspond to different feed-forward filter parameters.
[0013] The above method collects data from the external microphone, internal microphone and feedforward filter in the first mode and the second mode, respectively, for a total of six sets of data. The target parameters are calculated based on the six sets of data to optimize the feedforward filter parameters in the second mode, that is, to optimize the above-mentioned second parameters.
[0014] In an optional embodiment of the first aspect, the method further includes: obtaining a predicted noise reduction amount after optimizing a feedforward filter of the earphone based on a target parameter; if the predicted noise reduction amount is greater than or equal to a second threshold, optimizing parameters of the feedforward filter based on the target parameter.
[0015] The above method sets a second threshold to determine the predicted noise reduction effect of optimizing the feedforward filter parameters based on the target parameters. The predicted noise reduction effect meets the preset requirements (that is, the predicted noise reduction amount is greater than or equal to the second threshold) before the actual feedforward filter parameters are adjusted to achieve adaptive noise reduction optimization of the headphones.
[0016] In an optional embodiment of the first aspect, obtaining a predicted noise reduction amount after optimizing a feedforward filter of headphones based on target parameters includes: obtaining predicted internal noise data of the headphones after optimizing the feedforward filter based on the target parameters, and second internal noise data of the headphones in a second mode; and taking the absolute value of the difference between the predicted internal noise data and the second internal noise data as the predicted noise reduction amount.
[0017] The above method determines the predicted noise reduction amount by acquiring the predicted in-ear noise data and the current in-ear noise data after adjusting the feedforward filter parameters, so as to judge whether to adjust the actual feedforward filter parameters.
[0018] In an optional embodiment of the first aspect, optimizing the feedforward filter based on the target parameter includes: taking the product of the target parameter and the parameter of the feedforward filter in the second mode as the parameter of the optimized feedforward filter.
[0019] The above method shows a specific implementation manner of optimizing the feedforward filter parameters based on the target parameters. After adjusting the feedforward filter parameters in this manner, a better headphone noise reduction effect can be achieved.
[0020] In an optional embodiment of the first aspect, the method further includes: acquiring a third parameter collected by a vibration sensor built into the headset; if the third parameter is greater than a third threshold, stopping optimizing a feedforward filter of the headset.
[0021] When the vibration intensity of the earphone is large, it will affect the optimization effect of the feedforward filter parameters. The above method controls whether to perform the optimization of the earphone feedforward filter parameters by detecting the vibration sensor data, effectively reducing the problem of deterioration of the earphone noise reduction.
[0022] In an optional embodiment of the first aspect, the method further includes: when it is detected that the internal noise data of the earphone contains audio data of a preset frequency band, stopping optimizing the feedforward filter of the earphone until it is detected that the internal noise data does not contain audio data of the preset frequency band.
[0023] In this embodiment, the audio data collected by the in-ear microphone can be eliminated by setting an echo cancellation module.
[0024] The above method is aimed at the concurrent scenario of headphones playing audio. In this scenario, the noise data collected by the in-ear microphone contains audio data. If the optimization direction of the feedforward filter parameters is calculated based on the noise data, it may lead to inaccurate headphone noise reduction optimization. After detecting that the audio data is eliminated, the above parameter optimization scheme is executed to achieve a better noise reduction optimization effect.
[0025] In a second aspect, an embodiment of the present application provides an earphone device, comprising: a processing module and an acquisition module; the processing module is used to set the earphone mode to a first mode when it is detected that the external noise data of the earphone is greater than a first threshold; the acquisition module is used to acquire first external noise data and first internal noise data of the earphone in the first mode; the processing module is used to switch the earphone mode from the first mode to the second mode; the acquisition module is used to acquire second external noise data and second internal noise data of the earphone in the second mode; the processing module is used to determine target parameters based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, and the target parameters are used to optimize the parameters of the feedforward filter of the earphone in the second mode.
[0026] In a third aspect, an embodiment of the present application provides an earphone device, comprising: a speaker, a feedforward filter, a first microphone, a second microphone, a processor and a memory; the first microphone is used to collect external noise data of the earphone device, and the second microphone is used to collect internal noise data of the earphone device; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement a noise reduction method as described in any one of the first aspects.
[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of the first aspects is implemented.
[0028] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes any method of the first aspect.
[0029] In a sixth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute any method as in the first aspect.
[0030] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of the noise reduction effect of different users wearing headphones provided in an embodiment of the present application;
[0032] Figure 2 A schematic diagram of the waveform of the feedforward filter when different users wear headphones provided in an embodiment of the present application;
[0033] Figure 3 A schematic diagram of the structure of an earphone device provided in an embodiment of the present application;
[0034] Figure 4 A flowchart of a noise reduction method provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of the structure of an earphone device provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of the structure of an earphone device provided in an embodiment of the present application;
[0037] Figure 7 A flowchart of a noise reduction method provided in an embodiment of the present application;
[0038] Figure 8 A comparison diagram of the noise reduction effect of the noise reduction method provided by the embodiment of the present application;
[0039] Fig. 9 A schematic diagram of the structure of an earphone device provided in an embodiment of the present application;
[0040] Fig.10 A schematic diagram of the structure of an earphone device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with basically the same functions and effects. For example, the first mode and the second mode are only used to distinguish between different working modes of the headset, and their order is not limited. For another example, the first external noise data and the second external noise data, the first internal noise data and the second internal noise data are only used to distinguish between different noise data. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit them to be different.
[0042] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0043] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0044] Figure 1 A schematic diagram of the noise reduction effect of different users wearing headphones provided in the embodiment of the present application, such as Figure 1 As shown, curve 1 represents the noise reduction effect curve of the feedforward noise reduction filter simulated in the laboratory, and curves 2 to 4 represent the noise reduction effect curves of the feedforward filter when wearing headphones of different users. Existing headphones can often be debugged to achieve a good noise reduction effect in a laboratory environment, but in actual use, due to differences in the user's ear canal (such as ear canal length or width, etc.) or wearing method (such as wearing tightness or wearing direction, etc.), the noise reduction effect of the headphones will be lost and the noise reduction effect simulated in the laboratory cannot be achieved.
[0045] According to experimental tests, in headphone noise reduction, feedforward noise reduction is more susceptible to wearing differences. For example, Figure 2 The waveform diagram of the feedforward filter when different users wear headphones provided in the embodiment of the present application is as follows: Figure 2 As shown in the figure, the waveforms of the feedforward filters corresponding to different users wearing the same noise reduction headphones are quite different, which is different from the default feedforward filter waveform ( Figure 2 The difference of the average waveform of multiple waveforms can reach more than 3db.
[0046] In the related noise reduction headphone solutions, multiple sets of filter parameters are usually pre-stored for different ear canal differences. By traversing multiple sets of filter parameters, the set with the best noise reduction effect is selected from the multiple sets of filter parameters and used as the target filter parameters of the headphone. However, this solution is not a true feedforward noise reduction adaptation to achieve the optimization of noise reduction effect in different ear canals and different wearing conditions.
[0047] Based on this, the embodiment of the present application provides a noise reduction solution. According to the differences in ear canals and wearing styles of different users, the noise data of internal and external microphones in different headphone modes are collected, and the optimization parameters of the headphone feedforward filter in the user's current wearing state are calculated based on the collected noise data, thereby achieving targeted noise reduction optimization for different ear canals and wearing styles, thereby improving the noise reduction effect of the headphone.
[0048] In addition, the noise reduction solution provided by the present application can optimize the noise reduction for ear canal differences and wearing differences in the external time-varying noise environment, and can also optimize the noise reduction for ear canal differences and wearing differences in concurrent scenarios of playing audio data, such as scenarios where users play music.
[0049] It should be noted that the noise reduction scheme provided in the embodiment of the present application is suitable for high-noise environments, that is, there will be a relatively stable noise reduction optimization effect in high-noise environments. The high-noise environment can be understood as the external environmental noise of the headset being greater than a preset threshold (such as 65db). Experimental data show that when the environmental noise is large enough, the difference in noise data collected by the internal and external microphones of the headset is basically constant, and the feedforward filter parameters of the headset remain unchanged.
[0050] It should also be noted that the noise reduction solution provided in the embodiments of the present application is applicable to headphones with internal and external microphones, in-ear bean-shaped headphones, rod-shaped headphones, and semi-open headphones, etc., and the embodiments of the present application do not impose any restrictions on this.
[0051] Figure 3 This is a schematic diagram of the structure of an earphone device provided in an embodiment of the present application. Figure 3 As shown, the headphone device of this embodiment includes an external microphone (also called a feedforward (FF) microphone), an in-ear microphone (also called a feedback (FB) microphone), a speaker, a feedforward filter, a feedback filter, and a processor. The feedforward filter may also be called a feedforward controller, and the feedback filter may also be called a feedback controller.
[0052] based on Figure 3 In the headphone structure shown, the processor can obtain the noise data collected by the external microphone and the in-ear microphone, and calculate the optimization parameters of the feedforward filter through the preset noise reduction optimization algorithm. If it is determined that the optimization parameters can achieve the preset noise reduction effect, the optimization parameters are configured to the feedforward filter, so that the feedforward filter processes the signal collected by the external microphone based on the optimization parameters to achieve headphone noise reduction.
[0053] The following is combined with Figure 4 The noise reduction method of the embodiment of the present application is described in detail.
[0054] Figure 4 A flowchart of a noise reduction method provided in an embodiment of the present application. The execution subject of this embodiment may be a processor or chip system built into the headset, which is not limited in this embodiment of the present application, and the processor is used as an example to illustrate the solution below.
[0055] like Figure 4 As shown, the noise reduction method provided in this embodiment includes the following steps:
[0056] S401. When it is detected that the external noise data of the earphone is greater than a first threshold, the earphone mode is set to a first mode.
[0057] When the user wears the headset and manually triggers or the headset automatically turns on noise reduction, the external microphone of the headset collects the current external noise data. The processor can determine the noise level of the external environment based on the current external noise data of the headset and set the headset mode. When it is detected that the external noise data of the headset is greater than the first threshold, the headset mode is set to the first mode, which can be one of the headset modes. The external noise data includes the noise value, which is a numerical value used to measure the strength of the noise, usually in decibels (dB).
[0058] In an optional embodiment, the headphone mode includes a default mild noise reduction mode, a transition mode, and a default deep noise reduction mode. Different headphone modes correspond to different parameters of the feedforward filter, and specific reference may be made to Table 1. The parameters of the feedforward filter may also be referred to as feedforward noise reduction parameters. When optimizing the feedforward filter parameters, the parameters of the feedback filters of different headphone modes are the same, such as setting the parameters of the feedback filter of the transition mode to be the same as the parameters of the feedback filter of the default deep noise reduction mode. The parameters of the feedback filter may also be referred to as feedback noise reduction parameters.
[0059] In one example, when the headset enters a noisy environment from a quiet environment, the headset mode can be switched in the order of "default mild noise reduction mode → transition mode → default deep noise reduction mode". Exemplarily, the judgment condition for the headset to enter a noisy environment from a quiet environment can be: the external noise data of the headset is detected to be greater than a first threshold, where the first threshold can be set to 65db, for example. The user can customize the first threshold according to actual needs, and this embodiment of the application is not limited to this.
[0060] Table 1
[0061] Headphone Mode Parameters of the feedforward filter (feedforward noise reduction parameters) Default mild noise reduction mode K0 Transition Mode K1 Default deep noise reduction mode K2
[0062] It should be noted that different headphone modes usually correspond to different external noise ranges. For example, the default mild noise reduction mode corresponds to [40db, 65db), and the default deep noise reduction mode corresponds to [65db, ∞). In order to avoid a large difference in noise reduction when switching from the default mild noise reduction mode to the default deep noise reduction mode, a transition mode can be set between the two modes, and the external noise range corresponding to the transition mode can be [65db, ∞).
[0063] The noise reduction scheme provided by the present application is suitable for high-noise environments. Usually, when the external noise data of the earphone is detected to be greater than 65db, the earphone processor sets the earphone mode to the transition mode according to the external environment data of the earphone, and switches to the default deep noise reduction mode through the transition mode. When switching from the transition mode to the default deep noise reduction mode, the noise reduction scheme provided by the present application is executed to optimize the parameters of the earphone feedforward filter in the default deep noise reduction mode, so as to optimize the in-ear noise reduction effect in a high-noise environment.
[0064] S402. Acquire first external noise data and first internal noise data of the earphone in the first mode.
[0065] In one example, when the headset is in a first mode, the processor receives a signal from a first microphone ( Figure 3 ) to obtain first external noise data, and, from a second microphone ( Figure 3 The in-ear microphone in the apparatus obtains the first internal noise data.
[0066] In this example, the first internal noise data collected by the second microphone of the headset, that is, the residual noise in the ear, includes two parts: one is the first external environment data after passive attenuation, and the other is the first external environment data after the noise reduction path, which includes the external microphone, feedforward filter and speaker. The first internal noise data can be expressed by the following formula:
[0067] FB1=Hnoise2_t1+Hnoise1_t1*Hmic*K1*Hspk (1)
[0068] In the formula, the headphone mode in the time period t1 is the first mode, FB1 represents the first internal noise data in the time period t1, Hnoise2_t1 represents the first external environment data after passive attenuation in the time period t1, Hnoise1_t1*Hmic*K1*Hspk represents the first external environment data passing through the noise reduction path in the time period t1, Hmic represents the parameters of the external microphone on the noise reduction path, Hmic is usually set to 1, K1 represents the parameters of the feedforward filter on the noise reduction path in the first mode, and Hspk represents the parameters of the speaker on the noise reduction path.
[0069] S403. The headset mode is switched from the first mode to the second mode.
[0070] In one example, the first mode may be a transition mode. When the external noise data becomes larger, the headphone mode switches from the first mode to the second mode. The second mode may be a default deep noise reduction mode.
[0071] In another example, the first mode may be a default deep noise reduction mode. When the external noise data becomes smaller but greater than a first threshold, the headphone mode is switched from the first mode to the second mode. The second mode may be a transition mode.
[0072] In the above two examples, the condition for mode switching is that the external noise data is greater than the first threshold, that is, the environment where the headset is located is a high-noise environment, and the headset processor can switch the mode according to the change of the external noise data.
[0073] S404: Acquire second external noise data and second internal noise data of the earphone in the second mode.
[0074] In one example, when the headset is in the second mode, the processor obtains second external noise data from the first microphone of the headset, and obtains second internal noise data from the second microphone of the headset.
[0075] In this example, the second internal noise data collected by the second microphone of the headset also includes two parts: one is the second external environment data after passive attenuation, and the other is the second external environment data after the noise reduction path. The second internal noise data can be expressed by the following formula:
[0076] FB2=Hnoise2_t2+Hnoise1_t2*Hmic*K2*Hspk (2)
[0077] In the formula, the headphone mode in the time period t2 is the second mode, FB2 represents the second internal noise data in the time period t2, Hnoise2_t2 represents the second external environment data after passive attenuation in the time period t2, Hnoise1_t2*Hmic*K1*Hspk represents the second external environment data passing through the noise reduction path in the time period t2, Hmic represents the parameters of the external microphone on the noise reduction path, Hmic is usually set to 1, K2 represents the parameters of the feedforward filter on the noise reduction path in the second mode, and Hspk represents the parameters of the speaker on the noise reduction path.
[0078] S405. Determine target parameters based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, where the target parameters are used to optimize parameters of the feedforward filter of the earphone in the second mode.
[0079] In one example, based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, before determining the target parameter, the first parameter of the feedforward filter in the first mode and the second parameter of the feedforward filter in the second mode are obtained. Exemplarily, referring to Table 1, the first mode is the transition mode, and the first parameter is K1. The second mode is the default deep noise reduction mode, and the second parameter is K2.
[0080] After acquiring the first parameter and the second parameter, the earphone processor determines a target parameter based on the first external noise data, the first internal noise data, the second external noise data, the second internal noise data, the first parameter and the second parameter, and the target parameter is used to optimize the second parameter.
[0081] The target parameter can be expressed by the following formula:
[0082] y=(mn) / (mm*n) (3)
[0083] m=K2 / K1 (4)
[0084] n=FB2' / FB1' (5)
[0085] Wherein, y represents the target parameter; m represents the ratio of the change of the feedforward filter parameters, that is, the ratio of the parameters of the feedforward filter in the second mode to the parameters in the first mode; n represents the change of the noise data collected by the in-ear microphone corresponding to the change of the feedforward filter; FB2' represents the normalized FB2, see formula (6); FB1' represents the normalized FB1, see formula (7).
[0086] FB2'=estimate(FF2,FB2) (6)
[0087] FB1'=estimate(FF1,FB1) (7)
[0088] In the formula, estimate represents normalization processing, FF2 is the second external noise data collected by the external microphone in the time period t2 (the measured value of Hnoise1_t2), FB2 represents the second internal noise data collected by the in-ear microphone in the time period t2, FF1 is the first external noise data collected by the external microphone in the time period t1 (the measured value of Hnoise1_t1), and FB1 represents the first internal noise data collected by the in-ear microphone in the time period t1.
[0089] Based on the above formulas, it can be known that the target parameter y can be determined according to the first external noise data FF1, the first internal noise data FB1, the second external noise data FF2, the second internal noise data FB2, the first parameter K1 and the second parameter K2. Among them, FF1, FB1, FF2 and FB2 can be directly measured, and K1 and K2 are preset feedforward noise reduction parameters.
[0090] In this embodiment, after determining the target parameter y, the parameter K2 can be optimized based on the parameter K2 of the feedforward filter in the second mode. In order to ensure that the noise reduction effect reaches the expected effect, after determining the target parameter, the second parameter is not directly optimized, and whether to optimize the second parameter is determined by executing the following steps:
[0091] The predicted noise reduction amount after optimizing the second parameter based on the target parameter is obtained. In one case, if the predicted noise reduction amount is greater than or equal to the second threshold, the second parameter of the feedforward filter is optimized based on the target parameter. In another case, if the predicted noise reduction amount is less than the second threshold, the process returns to S401.
[0092] In one example, the predicted noise reduction amount after optimizing the second parameter based on the target parameter can be obtained in the following manner: the predicted internal noise data of the earphone after optimizing the second parameter based on the target parameter, and / or the second internal noise data of the earphone in the second mode are obtained, and the absolute value of the difference between the predicted internal noise data and the second internal noise data is used as the predicted noise reduction amount. Typically, the predicted internal noise data is smaller than the second internal noise data.
[0093] The predicted noise reduction amount can be expressed by the following formula:
[0094] ▽NC=FB2'-FB2”=Hnoise1'*Hmic*K2*Hspk(1-y) (6)
[0095] Wherein, ▽NC represents the predicted noise reduction amount, FB2″=Hnoise2′+Hnoise1′*Hmic*K2*y*Hspk, FB2″ represents the predicted internal noise data after normalization, and FB2′ represents the second internal noise data after normalization, see formula (6).
[0096] In the noise reduction frequency band of the feedforward filter (generally between 20 Hz and 5 kHz), the actual feedforward filter adjustment will be performed when ▽NC≥a, where a represents the second threshold and a is a positive number.
[0097] By judging whether the predicted noise reduction amount reaches the preset noise reduction effect, it is determined whether to optimize the parameters of the feedforward filter (i.e., the second parameter K2), so as to realize adaptive optimization of the feedforward filter parameters, so as to further reduce the noise in the ear and improve the noise reduction effect of the headphones.
[0098] Based on the above example, when the earphone enters a noisy environment from a quiet environment, for example, when the external noise data of the earphone is detected to be greater than the first threshold, the earphone mode can be switched from the transition mode to the default deep noise reduction mode according to the change of the external noise data, such as the external noise gradually becoming larger. After switching to the default deep noise reduction mode, the feedforward filter parameters in the default deep noise reduction mode can be adaptively optimized for the ear canal, see Table 2.
[0099] Table 2
[0100]
[0101] Based on Table 2, the headphone processor can obtain the parameter change of the feedforward filter (K1→K2) and the corresponding in-ear noise data change (FB1'→FB2'), and can determine the parameter optimization parameter y of the feedforward filter in combination with formula (3), and finally obtain the optimized parameter K3 based on K3=K2*y.
[0102] The noise reduction method provided in the embodiment of the present application can switch from the first mode to the second mode according to the change of the external noise data when the external environment of the earphone is detected to be a high noise environment, and the earphone processor obtains the earphone internal and external noise data in the first mode and the earphone internal and external noise data in the second mode respectively. Based on the earphone internal and external noise data in the first mode and the earphone internal and external noise data in the second mode, the target parameters are determined, and the target parameters can be used to optimize the parameters of the earphone feedforward filter in the second mode.
[0103] The above scheme is not affected by the differences in ear canals and wearing methods of headphone wearers. It uses the noise data collected by the internal and external microphones of the headphones in different modes, combined with the preset parameters of the feedforward filter in the two modes, to determine the optimization direction of the feedforward filter under the current wearing condition, and adaptively adjust the filter direction for different ear canals and wearing methods, thereby improving the noise reduction effect of the headphones.
[0104] In addition, before determining the target parameters to optimize the headphone feedforward filter parameters, a noise reduction prediction is added to determine whether the target parameters can improve the noise reduction effect of the headphones (such as by judging whether the predicted noise reduction amount is greater than or equal to a second threshold to determine whether the target parameters can improve the noise reduction effect of the headphones). Only when the noise reduction effect of the headphones is improved, the filter parameters are optimized based on the target parameters. This can effectively reduce the problem of deterioration of the noise reduction of the headphones.
[0105] Based on the above embodiments, in some embodiments, the external noise data collected by the external microphone at the first moment is 65db (or 70db), and the headphone mode can be set to a transition mode. At this time, the external noise data FF1, the in-ear noise data FB1 and the parameter K1 of the headphone feedforward filter in the transition mode are recorded. At the second moment, the external noise data collected by the external microphone is 75db, and the headphone mode is switched from the transition mode to the default deep noise reduction mode. At this time, the external noise data FF2, the in-ear noise data FB2 and the parameter K2 of the headphone feedforward filter in the default deep noise reduction mode are recorded. Through these 6 sets of data (FF1, FB1, FF2, FB2, K1, K2), combined with formulas (3), (4), and (5), the optimization direction y of the parameter K2 of the feedforward filter is calculated to obtain the optimized parameter K3, K3 = K2*y.
[0106] Based on the above embodiments, Figure 5 This is a schematic diagram of the structure of an earphone device provided in an embodiment of the present application. Figure 5As shown, the headphone device of this embodiment includes an external microphone, an in-ear microphone, a speaker, a feedforward filter, a filter module, a feedback filter and a processor. The external microphone collects external noise data, passes through the feedforward filter, the filter module and the speaker in sequence, and plays the processed data in the user's ear canal. The in-ear microphone collects residual noise in the ear, which is processed by the feedback filter and superimposed with the data output by the filter module to achieve data noise reduction, and then the noise-reduced data is played through the speaker.
[0107] In this embodiment, the filter module is used to adaptively adjust the waveform of the output signal of the feedforward filter. The target parameter y of the above embodiment is configured in the filter module. At this time, the feedforward filter and the filter module can be regarded as a filter. The configuration parameter of the filter is K3, K3 = K2*y, K2 is the current configuration parameter of the feedforward filter.
[0108] Optionally, the filter module can be an infinite impulse response digital filter (IIR) or a finite impulse response digital filter (FIR).
[0109] It should be understood that when the noise reduction solution provided in the present application is not executed, the configuration parameters of the filter module can be set to 1, that is, no signal processing is performed on the output signal of the feedforward filter.
[0110] In some embodiments, the headphone device may also include a vibration sensor, such as Figure 5 As shown, the vibration sensor can be used to detect the state of the headset. In one example, the headset processor obtains a third parameter collected by the vibration sensor, and if the third parameter is greater than a third threshold, the optimization of the feedforward filter of the headset is stopped.
[0111] It should be understood that the third parameter may be a parameter related to the vibration intensity. If the vibration intensity is large, such as the third parameter is greater than the third threshold, the wearer may be running, chewing, talking, etc. At this time, if the noise reduction scheme of the above embodiment is executed, it will affect the calculation accuracy of the target parameter y.
[0112] The above embodiment controls whether to execute the noise reduction solution by detecting the vibration sensor data, thereby effectively reducing the problem of deterioration of the noise reduction of the earphone.
[0113] Based on the above embodiments, Figure 6 This is a schematic diagram of the structure of an earphone device provided in an embodiment of the present application. Figure 6As shown, the headphone device of this embodiment includes an external microphone, an in-ear microphone, a speaker, a feedforward filter, a filter module, a feedback filter, a processor, an equalizer (EQ), an echo cancellation module and an analog-to-digital converter (ADC).
[0114] Figure 6 The figure shows the processing flow inside the earphone when the earphone plays audio data. After the audio data is processed by the equalizer, one path passes through the echo cancellation module to output the signal y1(s), and the other path is input to the speaker to play the processed audio data. The data collected by the in-ear microphone includes the audio data and the in-ear noise data, which is recorded as y2(s). After the two signals are superimposed, they pass through the analog-to-digital converter and the feedback filter in turn, and are superimposed with the external noise data of the earphone output by the filter module to achieve audio elimination and noise reduction, and then the audio elimination and noise reduction data are played through the speaker.
[0115] In this embodiment, in order to avoid the influence of audio playback on the optimization of feedforward filter parameters, the audio collected by the in-ear microphone can be eliminated by the echo cancellation module. The echo cancellation module generally uses an adaptive filter algorithm to adjust the weight vector of the filter, and continuously adjusts and approximates the actual in-ear transfer function of the current wearer, thereby removing the component of the audio signal collected by the in-ear microphone and optimizing the feedforward noise reduction effect.
[0116] based on Figure 6 In the scenario shown, the embodiment of the present application provides a noise reduction method, when the headphone processor detects that the internal noise data collected by the in-ear microphone contains audio data of a preset frequency band, it stops optimizing the headphone feedforward filter until it detects that the internal noise data does not contain audio data of the preset frequency band. The audio data of the preset frequency band includes but is not limited to music, telephone voice, audio broadcast and other data.
[0117] In this embodiment, the convergence of the echo cancellation module is prioritized until the in-ear noise collected by the in-ear microphone does not contain the played audio data. After the target parameter y converges to the target value, the ear canal adaptive calculation is performed to optimize the parameters of the feedforward filter and improve the headphone noise reduction effect in the concurrent scenario of the headphone playing audio data.
[0118] Based on the above embodiments, Figure 7 The noise reduction solution provided in this application is summarized.
[0119] Figure 7 A flowchart of a noise reduction method provided in an embodiment of the present application is shown in FIG. Figure 7As shown, after the user wears the noise reduction headphones, an in-ear detection is first performed, and data collection is performed when the headphones are worn well. Data collection includes two parts, one is the external environmental noise collected by the external microphone, and the other is the residual noise in the ear collected by the in-ear microphone. Among them, the external environmental noise changes in real time. If it is judged that the intensity of the external environmental noise is greater than the first threshold, for example, the first threshold is 65db, the headphone mode is set to the transition mode, and then the headphone mode is switched from the transition mode to the default deep noise reduction mode, based on the external environmental noise and residual noise in the ear collected in the transition mode and the default deep noise reduction mode, and the feedforward filtering parameters in these two modes, the ear canal adaptive optimization parameter y is calculated, and y is used to optimize the feedforward filtering parameters in the default deep noise reduction mode.
[0120] After determining the ear canal adaptive optimization parameter y, obtain the predicted noise reduction amount after optimizing the feedforward filter parameters based on y. If the predicted noise reduction amount is greater than or equal to the second threshold, optimize the feedforward filter parameters based on y; otherwise, reacquire the external environment data and calculate the new optimization parameter y.
[0121] Figure 8 This is a comparison chart of the noise reduction effect of the noise reduction method provided by the embodiment of the present application. Figure 8 As shown, compared to Figure 1 By adopting the noise reduction scheme of the embodiment of the present application, the predicted noise reduction amount in the noise reduction frequency band (20Hz to 5KHz) is effectively improved. The noise reduction effect curve (light gray) obtained by the actual user wearing headphones is basically consistent with the noise reduction effect curve (dark gray) obtained by laboratory simulation. The noise reduction effect of the headphones can achieve the noise reduction effect simulated in the laboratory.
[0122] The embodiment of the present application can divide the functional modules of the headphone device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. The following is an example of dividing each functional module according to each function.
[0123] Fig. 9 This is a schematic diagram of the structure of an earphone device provided in an embodiment of the present application. Fig. 9 As shown, the earphone device 900 of this embodiment includes: a processing module 901 and an acquisition module 902 .
[0124] The processing module 901 is configured to set the earphone mode to the first mode when it is detected that the external noise data of the earphone is greater than a first threshold;
[0125] An acquisition module 902 is used to acquire first external noise data and first internal noise data of the earphone in a first mode;
[0126] The processing module 901 is used to switch the headset mode from the first mode to the second mode;
[0127] An acquisition module 902 is used to acquire second external noise data and second internal noise data of the earphone in a second mode;
[0128] The processing module 901 is used to determine target parameters based on the first external noise data, the first internal noise data, the second external noise data and the second internal noise data, where the target parameters are used to optimize the parameters of the feedforward filter of the earphone in the second mode.
[0129] In an optional embodiment of this embodiment, the acquisition module 902 is used to:
[0130] Acquire first external noise data from a first microphone of the headset, and acquire first internal noise data from a second microphone of the headset;
[0131] Second external noise data is acquired from the first microphone, and second internal noise data is acquired from the second microphone.
[0132] In an optional embodiment of this embodiment, before the processing module 901 determines the target parameter based on the first external noise data, the first internal noise data, the second external noise data, and the second internal noise data, the acquiring module 902 is further used to:
[0133] Acquire a first parameter of the feedforward filter in the first mode and a second parameter of the feedforward filter in the second mode;
[0134] The processing module 901 is used to determine a target parameter based on the first external noise data, the first internal noise data, the second external noise data, the second internal noise data, the first parameter and the second parameter.
[0135] In an optional embodiment of this embodiment, the acquisition module 902 is used to obtain the predicted noise reduction amount after optimizing the feedforward filter of the earphone based on the target parameter;
[0136] The processing module 901 is configured to optimize the parameters of the feedforward filter based on the target parameters if the predicted noise reduction amount is greater than or equal to the second threshold.
[0137] In an optional embodiment of this embodiment, the acquisition module 902 is used to:
[0138] Acquire predicted internal noise data of the earphone after optimizing the feedforward filter based on the target parameters, and second internal noise data of the earphone in the second mode;
[0139] The absolute value of the difference between the predicted internal noise data and the second internal noise data is used as the predicted noise reduction amount.
[0140] In an optional embodiment of this embodiment, the processing module 901 is used to: use the product of the target parameter and the parameter of the feedforward filter in the second mode as the parameter of the optimized feedforward filter.
[0141] In an optional embodiment of this embodiment, the acquisition module 902 is used to acquire a third parameter collected by a vibration sensor built into the headset;
[0142] The processing module 901 is configured to stop optimizing the feedforward filter of the earphone if the third parameter is greater than a third threshold.
[0143] In an optional embodiment of this embodiment, the processing module 901 is used to:
[0144] When it is detected that the internal noise data of the earphone contains audio data of a preset frequency band, optimization of the feedforward filter of the earphone is stopped until it is detected that the internal noise data does not contain audio data of the preset frequency band.
[0145] In the headphone device shown in the embodiment of the present application, when the processing module of the headphone device detects that the external noise of the headphone is greater than a first threshold, the headphone switches the first mode to the second mode, and determines the optimization direction of the headphone feedforward filter parameters based on the noise data collected by the internal and external microphones of the headphone in the first mode and the second mode acquired by the acquisition module. If the feedforward filter parameters are adjusted based on the optimization direction and the predicted noise reduction amount is greater than or equal to the second threshold, the actual feedforward filter parameters are adjusted to optimize the in-ear noise reduction effect in a high-noise environment.
[0146] Fig.10 This is a schematic diagram of the structure of an earphone device provided in an embodiment of the present application. Fig.10 As shown, the headphone device of this embodiment includes: a speaker 1010, a feedforward filter 1020, a first microphone 1030, a second microphone 1040, a processor 1050 and a memory 1060; the first microphone 1030 is used to collect external noise data of the headphone device, and the second microphone 1040 is used to collect internal noise data of the headphone device;
[0147] Memory 1060 stores computer executable instructions;
[0148] The processor 1050 executes the computer execution instructions stored in the memory 1060 to implement the technical solution of the aforementioned method embodiment. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.
[0149] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0150] In one possible implementation, a computer-readable medium may include random access memory (RAM), read-only memory (ROM), compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and blue-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0151] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, the computer executes the technical solution in the above method embodiment. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.
[0152] An embodiment of the present application provides a chip, which includes a processor. The processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments and will not be repeated here.
[0153] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing module of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing module of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0154] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A noise reduction method, characterized in that: include: When it is detected that the external noise data of the earphone is greater than a first threshold, the earphone mode is set to a first mode; Acquire first external noise data and first internal noise data of the earphone in the first mode; The headset mode is switched from the first mode to the second mode; Acquire second external noise data and second internal noise data of the earphone in the second mode; determining a target parameter based on the first external noise data, the first internal noise data, the second external noise data, the second internal noise data, a first parameter of the feedforward filter in the first mode, and a second parameter of the feedforward filter in the second mode, wherein the target parameter is used to optimize the second parameter of the feedforward filter of the earphone in the second mode; Obtaining a predicted noise reduction amount after optimizing a feedforward filter of the headset based on the target parameter; If the predicted noise reduction amount is greater than or equal to a second threshold, a product of the target parameter and a second parameter of the feedforward filter in the second mode is used as a parameter of the optimized feedforward filter.
2. The method according to claim 1, characterized in that: Acquiring first external noise data and first internal noise data of the earphone in the first mode includes: Acquire the first external noise data from a first microphone of the headset, and acquire the first internal noise data from a second microphone of the headset; Acquiring second external noise data and second internal noise data of the earphone in the second mode includes: The second external noise data is acquired from the first microphone, and the second internal noise data is acquired from the second microphone.
3. The method according to claim 1, characterized in that Obtaining a predicted noise reduction amount after optimizing a feedforward filter of the headset based on the target parameter, comprising: Acquire predicted internal noise data of the earphone after optimizing the feedforward filter based on the target parameter, and second internal noise data of the earphone in the second mode; The absolute value of the difference between the predicted internal noise data and the second internal noise data is used as the predicted noise reduction amount.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Acquire a third parameter collected by a vibration sensor built into the headset; If the third parameter is greater than a third threshold, the optimization of the feedforward filter of the earphone is stopped.
5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When it is detected that the internal noise data of the earphone includes audio data of a preset frequency band, optimization of the feedforward filter of the earphone is stopped until it is detected that the internal noise data does not include audio data of the preset frequency band.
6. A headphone device, characterized in that: include: A processing module, configured to set the earphone mode to a first mode when it is detected that the external noise data of the earphone is greater than a first threshold; An acquisition module, configured to acquire first external noise data and first internal noise data of the earphone in the first mode; The processing module is used to switch the headset mode from the first mode to the second mode; The acquisition module is used to acquire second external noise data and second internal noise data of the earphone in the second mode; The processing module is used to determine a target parameter based on the first external noise data, the first internal noise data, the second external noise data, the second internal noise data, a first parameter of the feedforward filter in the first mode, and a second parameter of the feedforward filter in the second mode, wherein the target parameter is used to optimize the second parameter of the feedforward filter of the earphone in the second mode; The acquisition module is further used to obtain the predicted noise reduction amount after optimizing the feedforward filter of the headset based on the target parameter; The processing module is further configured to use, if the predicted noise reduction amount is greater than or equal to a second threshold, a product of the target parameter and a second parameter of the feedforward filter in the second mode as a parameter of the optimized feedforward filter.
7. A headphone device, characterized in that: include: A speaker, a feedforward filter, a first microphone, a second microphone, a processor, and a memory; The first microphone is used to collect external noise data of the headphone device, and the second microphone is used to collect internal noise data of the headphone device; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the noise reduction method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
9. A chip, characterized in that: The chip comprises a processor, and the processor is used to call a computer program in a memory to execute the method according to any one of claims 1 to 5.
10. A computer program product, characterized in that The computer program product comprises a computer program, which performs the method according to any one of claims 1 to 5 when the computer program is executed.
