Method, device and earphone for generating target parameters of an energy compensation filter

By calculating the cross-spectral density of the electrical signals of the speaker and the feedback microphone, the parameters of the energy compensation filter are automatically determined, which solves the problem of sound source signal reduction in active noise-canceling headphones during noise cancellation, and improves playback effect and adaptability.

CN113766384BActive Publication Date: 2025-11-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111121434.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-11-28
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

Existing active noise-canceling headphones reduce the frequency components of the sound source signal during the noise cancellation process, resulting in a decline in playback quality. Furthermore, manual adjustment is inefficient and inaccurate, and cannot take into account the differences in the ear canals of different users.

Method used

By acquiring electrical signals from the speaker and feedback microphone, and calculating the transfer function using cross-correlation cross-spectral density, the frequency response and filter parameters of the energy compensation filter are automatically determined, thus achieving automated volume compensation.

Benefits of technology

It improves the accuracy and consistency of sound source signal playback, reduces the number of iterations for manual adjustment, and adapts to the differences in ear canals of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113766384B_ABST
    Figure CN113766384B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for generating target parameters of an energy compensation filter and an earphone, wherein the method comprises: collecting a first electric signal of a loudspeaker of the earphone and a second electric signal of a feedback microphone; determining a transfer function between the loudspeaker and the feedback microphone according to a cross spectrum density of cross-correlation of the first electric signal and the second electric signal; determining a first frequency response of the energy compensation filter in the earphone according to the transfer function; and determining target values of filter parameters in the energy compensation filter according to the first frequency response. Thus, the values of the filter parameters in the energy compensation filter are calculated based on the collected signals, which can improve the accuracy of the calculation results, so that the filter parameters with accurate values can be used to filter the to-be-played sound source signal or audio signal, and the volume compensation of the sound source signal or audio signal can be realized, thereby improving the playing effect of the sound source signal or audio signal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of signal processing, and in particular to a method and device for generating target parameters of an energy compensation filter and an earphone. BACKGROUND

[0002] Currently, in order to improve the playback effect of an earphone, an active noise cancellation (ANC) technology can be used to actively generate a sound wave signal with the same or similar frequency and amplitude as a noise source and opposite phase, and the sound wave signal is used to interfere with and cancel the noise source. However, the active noise cancellation technology will reduce some frequency components of a sound source signal played by the earphone to some extent while canceling the noise source. Therefore, how to compensate the sound source signal played by the earphone in volume to improve the playback effect of the sound source signal is very important. SUMMARY

[0003] The present disclosure aims to at least partially solve one of the technical problems in the related art.

[0004] To this end, the present disclosure proposes the following technical solutions:

[0005] A first aspect of the present disclosure provides a method for generating target parameters of an energy compensation filter, comprising:

[0006] collecting a first electrical signal of a loudspeaker of an earphone and a second electrical signal of a feedback microphone;

[0007] determining a transfer function between the loudspeaker and the feedback microphone according to a cross-spectral density of cross-correlation of the first electrical signal and the second electrical signal;

[0008] determining a first frequency response of an energy compensation filter in the earphone according to the transfer function;

[0009] determining target values of filter parameters in the energy compensation filter according to the first frequency response.

[0010] A second aspect of the present disclosure provides an earphone, comprising:

[0011] a loudspeaker, an energy compensation filter, and a controller, wherein the energy compensation filter stores target values of filter parameters in the energy compensation filter generated by the method provided in the first aspect of the present disclosure;

[0012] the controller comprises a processor and a memory, and the memory stores a computer program;

[0013] the processor is configured to invoke the computer program on the memory to perform the following steps:

[0014] obtaining a first audio signal to be played;

[0015] filtering the first audio signal based on the energy compensation filter to obtain a second audio signal;

[0016] controlling the loudspeaker to play the second audio signal.

[0017] The third aspect of the present disclosure provides a device for generating target parameters of an energy compensation filter, comprising:

[0018] a collection module, configured to collect a first electrical signal of a loudspeaker of a headset and a second electrical signal of a feedback microphone;

[0019] a first determination module, configured to determine a transfer function between the loudspeaker and the feedback microphone according to a cross-correlation cross-spectral density of the first electrical signal and the second electrical signal;

[0020] a second determination module, configured to determine a first frequency response of an energy compensation filter in the headset according to the transfer function;

[0021] a third determination module, configured to determine target values of filter parameters in the energy compensation filter according to the first frequency response.

[0022] The fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method for generating target parameters of an energy compensation filter according to the first aspect of the present disclosure.

[0023] The fifth aspect of the present disclosure provides a computer program product. When instructions in the computer program product are executed by a processor, the method for generating target parameters of an energy compensation filter according to the first aspect of the present disclosure is performed.

[0024] The technical solution of the present disclosure collects a first electrical signal of a loudspeaker of a headset and a second electrical signal of a feedback microphone, determines a transfer function between the loudspeaker and the feedback microphone according to a cross-correlation cross-spectral density of the first electrical signal and the second electrical signal, determines a first frequency response of an energy compensation filter in the headset according to the transfer function, and determines target values of filter parameters in the energy compensation filter according to the first frequency response. Thus, the values of the filter parameters in the energy compensation filter are calculated based on the collected signals, which can improve the accuracy of the calculation results, so that the filter parameters with accurate values can be used to filter a sound source signal or an audio signal to be played, and the sound source signal or the audio signal can be volume compensated, thereby improving the playing effect of the sound source signal or the audio signal.

[0025] Additional aspects and advantages of the present disclosure will be made apparent from the following description, which, guided the accompanying drawings, makes reference to the appended claims. BRIEF DESCRIPTION OF DRAWINGS

[0026] The above and / or additional aspects and advantages of the present disclosure will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings, in which:

[0027] Figure 1 A schematic diagram of a basic structure of an active noise reduction earphone;

[0028] Figure 2 A schematic diagram of an energy impact of an active noise reduction on a sound source signal;

[0029] Figure 3 A schematic diagram of a flow of a method for generating target parameters of an energy compensation filter provided by an embodiment of the present disclosure;

[0030] Figure 4 A schematic diagram of a flow of a method for generating target parameters of an energy compensation filter provided by another embodiment of the present disclosure;

[0031] Figure 5 A schematic diagram of a flow of a method for generating target parameters of an energy compensation filter provided by another embodiment of the present disclosure;

[0032] Figure 6 A schematic diagram of a flow of a method for generating target parameters of an energy compensation filter provided by another embodiment of the present disclosure;

[0033] Figure 7 A schematic diagram of a structure of an earphone provided by an embodiment of the present disclosure;

[0034] Figure 8 A schematic diagram of a structure of an earphone provided by another embodiment of the present disclosure;

[0035] Figure 9 A schematic diagram of a structure of a device for generating target parameters of an energy compensation filter provided by an embodiment of the present disclosure;

[0036] Figure 10 A block diagram showing an exemplary electronic device suitable for use in implementing embodiments of the present disclosure. DETAILED DESCRIPTION

[0037] Embodiments of the present disclosure are described in detail below with reference to the attached drawings, which show by way of example, embodiments in which like reference numerals refer to like elements or elements having similar functions. The embodiments described below are exemplary and are intended to be illustrative of the present disclosure, and are not to be understood as limiting of the present disclosure.

[0038] Active noise reduction technology is widely used in audio devices such as earphones, smart TVs, tablets, and vehicle-mounted multimedia devices. Taking an earphone as an example, the earphone can be referred to as an active noise reduction earphone. The active noise reduction earphone can include wired earphones and wireless earphones.

[0039] The active noise reduction earphone can obtain good noise reduction effect in the way of canceling ambient noise by using a feedforward filter and a feedback filter. However, the feedback filter is located on the inside of the earphone (close to the ear canal side), which can reduce some frequency components of the sound source signal played by the earphone to some extent while canceling the noise that penetrates into the ear canal. Meanwhile, for earphones such as semi-in-ear earphones that have a sound leakage phenomenon, the feedforward microphone on the outside of the earphone can also collect a small amount of sound source signal, which can also reduce some frequency components to some extent.

[0040] Therefore, a certain gain can be added to a specific frequency band of the sound source signal by using a filter in the post-processing link of the active noise reduction system of the active noise reduction earphone, so as to offset the attenuation of the specific frequency band of the sound source signal caused by the feedforward filter and the feedback filter, and make the signal characteristics of the sound source signal after being processed by the entire active noise reduction system consistent with the original sound source signal.

[0041] The main devices of the active noise reduction earphone can include a loudspeaker, a call microphone, a feedforward microphone, a feedback microphone, a feedforward filter, a feedback filter, and an energy compensation filter (or referred to as a music compensation filter). For example, the basic structure of the active noise reduction earphone can be as shown in FIG. Figure 1 The feedforward microphone is located on the outside of the active noise reduction earphone and is used to detect the ambient noise outside the ear. The feedback microphone is located beside the loudspeaker on the inside of the active noise reduction earphone and is used to detect the ambient noise inside the ear canal. The active noise reduction earphone constructs a feedforward active noise reduction (referred to as feedforward ANC) based on the feedforward microphone, the loudspeaker, and the feedforward filter, constructs a feedback active noise reduction (referred to as feedback ANC) based on the feedback microphone, the loudspeaker, and the feedback filter, and constructs an energy compensation function (or referred to as a music compensation function) based on the energy compensation filter and the loudspeaker.

[0042] When the active noise reduction earphone is worn on the ear of a user and the user is in an environment with noise interference, the active noise reduction earphone mainly includes two acoustic paths: a primary path and a secondary path. The primary path refers to a flow path through which the ambient noise passes from the feedforward microphone to the feedback microphone through the earphone cavity. The secondary path refers to a flow path through which the sound source signal played by the loudspeaker propagates in the ear canal to the feedback microphone. The feedforward microphone is located on the outside of the active noise reduction earphone, and the feedback microphone is located near the loudspeaker. It should be noted that Figure 1 In the figure, the conversion process between the analog signal and the digital signal of the acoustic device is omitted.

[0043] The active noise reduction process of the primary path is implemented based on a feedforward filter, and the noise reduction process of the secondary path is implemented based on a feedback filter. When the sound source signal is processed by using the energy compensation function or the music compensation function, the processing process is independent of the feedforward ANC and the feedback ANC, directly processes the sound source signal through the energy compensation filter, and finally superimposes the sound source signal after energy compensation, the feedforward noise reduction signal, and the feedback noise reduction signal.

[0044] From an acoustic perspective, the energy compensation function or the music compensation function is used to compensate for the interference of the feedback filter and a small amount of feedforward filter on the sound source signal. This interference comes from the fact that the feedback microphone collects the residual environmental noise inside the ear canal while also collecting the sound source signal, thereby weakening part of the energy of the sound source signal. Similarly, the feedforward microphone may collect the sound source signal overflowing from the inside of the ear canal, thereby weakening a small amount of energy of the sound source signal.

[0045] As an example, an example of the influence of active noise reduction on the sound source signal can be as shown in Figure 2 , where the sound source signal in Figure 2 is pink noise, the test environment is an anechoic chamber without noise sources, and the sound source signal is processed by using the active noise reduction earphone. Figure 2 As can be seen, when the active noise reduction is turned on, the energy of the sound source signal is significantly attenuated, so the energy compensation filter is needed to compensate for the missing energy to the sound source signal in advance, so that the sound source signal after the active noise reduction can be restored to the original state of the sound source signal. Since the energy attenuation of the sound source signal is mainly caused by the influence of the feedback microphone and the feedback filter, the energy compensation function or the music compensation function can be realized by compensating for the energy loss of the secondary path through the filter.

[0046] It should be noted that "active noise reduction earphone" is a concept corresponding to "passive noise reduction earphone", i.e. ordinary earphone, which uses the earphone shell to physically isolate to reduce the noise heard by the user; the active noise reduction earphone actively generates a sound wave signal with the same or close frequency, amplitude and opposite phase of the noise, and cancels part of the environmental noise through the interference characteristics of the sound wave signal. The energy compensation function or the music compensation function is used to compensate for the frequency components attenuated by the active noise reduction on the sound source signal (the playback source of the active noise reduction earphone).

[0047] In the related art, the energy compensation function or the music compensation function of the energy compensation filter is mainly completed by manual debugging, that is, the frequency spectrum of the same sound source signal before and after active noise reduction processing (after feedforward ANC and feedback ANC processing) is simply compared, the attenuated frequency component after active noise reduction processing is increased by manually increasing the gain of the energy compensation filter according to the difference between the frequency components before and after active noise reduction processing, and the center frequency, bandwidth and gain of the energy compensation filter are adjusted repeatedly until the missing frequency component after active noise reduction processing is filled and the characteristics of the sound source signal before and after active noise reduction processing are not obviously different.

[0048] Specifically, in the related art, the same sound source signal before and after active noise reduction processing (only feedforward ANC and feedback ANC processing) is collected by using a manual head acoustic measurement instrument, the difference between the frequency components before and after active noise reduction processing is compared, and the filter parameters of the energy compensation filter are set by relevant personnel according to experience to increase the gain of the corresponding frequency band. Then, the previous sound source signal is used again, energy compensation and active noise reduction are used for double processing, and the same acoustic measurement instrument is used again to collect the frequency components before and after active noise reduction processing with energy compensation. If the two are completely consistent, the debugging is completed. If they are not consistent, the filter parameters of the energy compensation filter are adjusted empirically, and the measurement is performed again. The process is repeated until the frequency components before and after active noise reduction processing with energy compensation are almost consistent.

[0049] As an example, the energy difference as shown in FIG. 1 can be observed in real time by manual observation, and the filter parameters of the energy compensation filter are manually adjusted so that the energy distribution when the active noise reduction is turned on and when the active noise reduction is turned off is close to consistent. Figure 2

[0050] However, the above iterative debugging process usually needs to be performed for dozens of times, and the debugging efficiency is low. At the same time, the empirical manual debugging method often has the problem that the filter parameters after debugging are not accurate enough and have poor universality. Moreover, since it can only be debugged by a manual head (or a manual ear) device, it cannot take into account the difference between different user ear canals.

[0051] Therefore, in view of the above problems, the present disclosure provides a method and device for generating target parameters of an energy compensation filter and an earphone.

[0052] The method and device for generating target parameters of an energy compensation filter and the earphone of the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0053] Figure 3 ​This is a flowchart illustrating a method for generating target parameters of an energy compensation filter according to an embodiment of the present disclosure.

[0054] This disclosure illustrates by exemplifying the method for generating the target parameters of the energy compensation filter being configured in a device for generating the target parameters of the energy compensation filter. This device for generating the target parameters of the energy compensation filter can be applied to any electronic device so that the electronic device can perform the function of generating the target parameters of the energy compensation filter.

[0055] Among them, electronic devices can be any device with computing capabilities, such as personal computers (PCs), mobile terminals, acoustic measuring instruments, etc. Mobile terminals can be hardware devices with various operating systems, touch screens and / or displays, such as mobile phones, tablets, personal digital assistants, wearable devices, etc.

[0056] like Figure 3 As shown, the method for generating the target parameters of the energy compensation filter may include the following steps:

[0057] Step 301: Acquire the first electrical signal from the headphone speaker and the second electrical signal from the feedback microphone.

[0058] In this embodiment of the disclosure, the electrical signal on the speaker circuit can be collected in real time through the line led out from the headphone circuit, which is referred to as the first electrical signal in this disclosure. At the same time, the electrical signal of the feedback microphone in the headphone can also be collected in real time, which is referred to as the second electrical signal in this disclosure.

[0059] Step 302: Determine the transfer function between the loudspeaker and the feedback microphone based on the cross-correlation spectral density of the first and second electrical signals.

[0060] In this embodiment, the cross-correlation cross-spectral density of the first and second electrical signals can be calculated based on the cross-spectral density calculation formula. The transfer function between the speaker and the feedback microphone can then be determined based on the aforementioned cross-correlation cross-spectral density. (Taking headphones as an example...) Figure 1 Taking active noise-canceling headphones as an example, the transfer function can be a secondary path transfer function.

[0061] Step 303: Determine the first frequency response of the energy compensation filter in the headphones based on the transfer function.

[0062] In this embodiment of the disclosure, the energy compensation filter can also be called a music compensation filter, used to filter the sound source signal or audio signal to be played by the headphones, so as to achieve volume compensation of the sound source signal or audio signal. The sound source signal may include audio signals such as white noise, pink noise, linear sweep frequency, and logarithmic sweep frequency.

[0063] In the embodiments of the present disclosure, the first frequency response of the energy compensation filter in the earphone can be determined according to the transfer function between the loudspeaker and the feedback microphone, and the first frequency response can also be referred to as a target frequency response of the energy compensation filter.

[0064] In step 304, target values of the filter parameters in the energy compensation filter are determined according to the first frequency response.

[0065] In the embodiments of the present disclosure, the target values of the filter parameters in the energy compensation filter can be determined according to the first frequency response of the energy compensation filter in the earphone. After the target values of the filter parameters in the energy compensation filter are determined, the target values of the filter parameters can be burned into the earphone, for example, burned into the energy compensation filter in the earphone, so that the energy compensation filter can filter the to-be-played sound source signal or audio signal according to the target values of the filter parameters, to achieve volume compensation of the sound source signal or audio signal, and obtain the compensated sound source signal or audio signal.

[0066] It should be noted that the present disclosure only takes the energy compensation filter arranged in the earphone as an example, and in actual application, the energy compensation filter can also be arranged in an audio device such as a smart television, a tablet computer, or a vehicle-mounted multimedia device, that is, the energy compensation filter can be used to perform volume compensation on the audio signal to be played by other audio devices, and the present disclosure does not limit this.

[0067] The method for generating the target parameters of the energy compensation filter in the embodiments of the present disclosure comprises the following steps: collecting a first electric signal of a loudspeaker of an earphone and a second electric signal of a feedback microphone; determining a transfer function between the loudspeaker and the feedback microphone according to a cross-correlation cross-spectral density of the first electric signal and the second electric signal; determining a first frequency response of an energy compensation filter in the earphone according to the transfer function; and determining target values of filter parameters in the energy compensation filter according to the first frequency response. Thus, the values of the filter parameters in the energy compensation filter are calculated by the collected signals, which can improve the accuracy of the calculation result, so that the to-be-played sound source signal or audio signal is filtered by the filter parameters with accurate values, and volume compensation of the sound source signal or audio signal can be achieved, thereby improving the playing effect of the sound source signal or audio signal.

[0068] In order to clearly illustrate how the transfer function between the loudspeaker and the feedback microphone is determined in the present disclosure, the present disclosure further provides a method for generating target parameters of an energy compensation filter.

[0069] Figure 4 A flowchart of the method for generating target parameters of an energy compensation filter according to another embodiment of the present disclosure.

[0070] As Figure 4 shown, the method for generating the target parameters of the energy compensation filter can include the following steps:

[0071] Step 401, collect a first electrical signal of a speaker of the earphone and a second electrical signal of a feedback microphone.

[0072] The execution process of step 401 can refer to the execution process of the above-mentioned embodiments, which will not be described here.

[0073] Step 402, obtain the autocorrelation cross spectral density of the first electrical signal.

[0074] In the embodiments of the present disclosure, the autocorrelation cross spectral density of the first electrical signal can be calculated based on the cross spectral density calculation formula.

[0075] Step 403, obtain the cross-correlation cross spectral density of the first electrical signal and the second electrical signal.

[0076] In the embodiments of the present disclosure, the cross-correlation cross spectral density of the first electrical signal and the second electrical signal can be calculated based on the cross spectral density calculation formula.

[0077] Step 404, determine the transfer function between the speaker and the feedback microphone according to the autocorrelation cross spectral density and the cross-correlation cross spectral density.

[0078] In the embodiments of the present disclosure, the transfer function between the speaker and the feedback microphone can be determined according to the autocorrelation cross spectral density and the cross-correlation cross spectral density.

[0079] As an example, the ratio of the autocorrelation cross spectral density and the cross-correlation cross spectral density can be determined as the transfer function between the speaker and the feedback microphone.

[0080] It can be understood that when testing the earphone to determine the values of the filter parameters in the energy compensation filter, if the earphone is tested only once, accidental errors may occur, and the accuracy of the test result is not high. Therefore, in one possible implementation manner of the embodiments of the present disclosure, the earphone can be tested multiple times, the autocorrelation cross spectral density and the cross-correlation cross spectral density calculated according to each test process are used to determine the transfer function corresponding to each test process, and the average of the transfer functions corresponding to each test process is used as the transfer function between the speaker and the feedback microphone.

[0081] For example, the active noise reduction earphone is taken as an example, in order to take into account the differences in ear canal of different users, and prevent accidental errors, a plurality of testers can be repeatedly tested for multiple times. During the test, each tester needs to correctly wear the active noise reduction earphone to be tested and keep still. Assuming that the total number of testers is I, and the total number of tests of each tester is J, then for the ith tester in the jth test, the first electric signal of the loudspeaker is represented by , the second electric signal of the feedback microphone is represented by , and the transfer function corresponding to the test can be:

[0082]

[0083] , wherein represents the transfer function (i.e., the secondary path spectral expression) corresponding to the test, k represents the kth spectral line frequency point of the spectrum in the N-dimensional Fourier transform, represents the cross-spectral density of two signals, i.e. represents , and represents , and represents the cross-spectral density of the cross-correlation of

[0084] After determining the transfer function corresponding to each test, the transfer functions corresponding to the tests can be averaged to obtain the transfer function between the loudspeaker and the feedback microphone (i.e., the final secondary path transfer function) H(k) as:

[0085]

[0086] Step 405, determining the first frequency response of the energy compensation filter in the earphone according to the transfer function.

[0087] Step 406, determining the target value of each filter parameter in the energy compensation filter according to the first frequency response.

[0088] The execution process of steps 405 to 406 can refer to the execution process of any embodiment of the present disclosure, which will not be repeated here.

[0089] The method for generating the target parameters of the energy compensation filter according to the embodiments of the present disclosure can determine the transfer function between the loudspeaker and the feedback microphone according to the cross-spectral density of the autocorrelation of the first electric signal and the cross-spectral density of the cross-correlation of the first electric signal and the second electric signal, which can ensure the reliability of the determination result of the transfer function.

[0090] To clearly illustrate how the first frequency response of the energy compensation filter is determined according to the transfer function, the present disclosure further provides a method for generating target parameters of an energy compensation filter.

[0091] Figure 5 A flowchart of the method for generating target parameters of an energy compensation filter according to another embodiment of the present disclosure is shown in FIG. 6.

[0092] As shown in FIG. 6, the method for generating target parameters of an energy compensation filter can include the following steps: Figure 5

[0093] Step 501: Collect a first electrical signal of a loudspeaker of a headphone and a second electrical signal of a feedback microphone.

[0094] Step 502: Determine a transfer function between the loudspeaker and the feedback microphone according to a cross-spectral density of the first electrical signal and the second electrical signal.

[0095] The execution process of steps 501-502 can refer to the execution process of any embodiment of the present disclosure, which will not be described here.

[0096] Step 503: Extract a first transfer sub-function in a first set frequency range from the transfer function.

[0097] In an embodiment of the present disclosure, the first set frequency range is pre-set, for example, the first set frequency range can be 0-1000 Hz.

[0098] In an embodiment of the present disclosure, the first transfer sub-function in the first set frequency range can be extracted from the transfer function. For example, the first transfer sub-function can be marked as H(k1), where k1 represents a spectral line frequency point in the first set frequency range, and the values of H(k1) are all 0 outside the first set frequency range.

[0099] Step 504: Extract a second transfer sub-function in a second set frequency range from the transfer function; wherein the second set frequency range is greater than the first set frequency range.

[0100] In an embodiment of the present disclosure, the second set frequency range is pre-set, and the second set frequency range is greater than the first set frequency range, for example, the second set frequency range can be 1000-1500 Hz.

[0101] In an embodiment of the present disclosure, the second transfer sub-function in the second set frequency range can be extracted from the transfer function. For example, the second transfer sub-function can be marked as H(k2), where k2 represents a spectral line frequency point in the second set frequency range, and the values of H(k2) are all 0 outside the second set frequency range. ​

[0102] Step 505, intercepting a third transfer sub-function in a third set frequency range from the transfer function; wherein the third set frequency range is greater than the second set frequency range.

[0103] In the embodiments of the present disclosure, the third set frequency range is pre-set, and the third set frequency range is greater than the second set frequency range, for example, the third set frequency range can be 1500Hz-2000Hz.

[0104] In the embodiments of the present disclosure, the third transfer sub-function in the third set frequency range can be intercepted from the transfer function. For example, the third transfer sub-function can be marked as H(k3), wherein k3 represents a spectral line frequency point in the third set frequency range, and the values of H(k3) are all 0 outside the third set frequency range.

[0105] Step 506, performing weighted sum processing on the second transfer sub-function and the third transfer sub-function by using a set weighting factor to obtain a weighted transfer function.

[0106] In the embodiments of the present disclosure, the second transfer sub-function and the third transfer sub-function can be weighted and summed by using a set weighting factor to obtain a weighted transfer function. For example, the weighted transfer function can be aH(k2)+bH(k3), wherein a and b are weighting factors for reducing the weight of the corresponding frequency band.

[0107] Step 507, adding the weighted transfer function and the first transfer sub-function to obtain a first frequency response of the energy compensation filter in the earphone.

[0108] In the embodiments of the present disclosure, the weighted transfer function and the first transfer sub-function can be added to obtain the first frequency response of the energy compensation filter.

[0109] That is, in the present disclosure, considering that the transfer function H(k) is a full-band function, and the energy compensation filter is used to compensate the energy loss caused by the active noise reduction, the energy compensation filter is designed to be a full-band filter. Figure 2 It can be known that the energy loss of the sound source signal caused by the active noise reduction is not a full-band loss, and the influence range is mainly within 1000Hz, and the energy of the 1000Hz-3000Hz frequency band is naturally lifted due to the water bed effect, so the target frequency response of the energy compensation (marked as the first frequency response in the present disclosure) is the frequency band within 1000Hz, and the frequency band outside 1000Hz-3000Hz will be naturally attenuated due to the water bed effect. However, if the truncation is directly at 1000Hz, the first frequency response will be difficult to fit due to the abrupt change of amplitude and phase.

[0110] Since the spectral line frequency point k and the physical frequency have the following corresponding relationship:

[0111]

[0112] Therefore, the spectral line frequency point k can be directly mapped to the physical frequency f k , where f k is in Hz, k = 0, 1, 2, …, n / 2, and k is cut off at N / 2, considering the frequency symmetry. Where f s represents the sampling rate of the sound source signal or the sampling rate of the first and second electrical signals.

[0113] Therefore, the first frequency response of the energy compensation filter can be:

[0114]

[0115] Where k1 represents the spectral line frequency point in the first set frequency range (such as 0-1000 Hz), and the values of the rest of the frequency bands H(k1) are all 0; k2 represents the spectral line frequency point in the second set frequency range (such as 1000-1500 Hz), and the values of the rest of the frequency bands H(k2) are all 0; k3 represents the spectral line frequency point in the third set frequency range (such as 1500-2000 Hz), and the values of the rest of the frequency bands H(k3) are all 0; and a and β are weighting factors for reducing the weight of the corresponding frequency band, and a can be usually set to 0.3 and β to 0.1.

[0116] After the weighted summation processing of formula (4), the first frequency response only has non-0 values in 0-2000 Hz. This way of adjusting the amplitude in different frequency bands is more likely to obtain an energy compensation filter with stable frequency response.

[0117] Step 508: determining the target values of the filter parameters in the energy compensation filter according to the first frequency response.

[0118] The execution process of step 508 can refer to the execution process of any embodiment of the present disclosure, which will not be repeated here.

[0119] The method for generating the target parameters of the energy compensation filter according to the embodiments of the present disclosure can obtain the first frequency response of the energy compensation filter by the way of weighted summation of the transfer sub-functions in different frequency bands, which can ensure the stability of the frequency response of the energy compensation filter.

[0120] In order to clearly illustrate how the target values of the filter parameters in the energy compensation filter are determined according to the first frequency response in any embodiment of the present disclosure, the present disclosure further provides a method for generating the target parameters of the energy compensation filter.

[0121] Figure 6 The flowchart of the method for generating the target parameters of the energy compensation filter according to another embodiment of the present disclosure.

[0122] As Figure 6 shown, the method for generating the target parameters of the energy compensation filter can include the following steps:

[0123] Step 601, collect a first electrical signal of a speaker of a headphone and a second electrical signal of a feedback microphone.

[0124] Step 602, determine a transfer function between the speaker and the feedback microphone according to a cross-spectrum density of cross-correlation of the first electrical signal and the second electrical signal.

[0125] Step 603, determine a first frequency response of the energy compensation filter in the headphone according to the transfer function.

[0126] The execution process of steps 601 to 603 can refer to the execution process of any embodiment of the present disclosure, which will not be described here.

[0127] Step 604, determine a second frequency response corresponding to the energy compensation filter according to each filter parameter in the energy compensation filter.

[0128] In the embodiments of the present disclosure, the second frequency response corresponding to the energy compensation filter can be determined according to each filter parameter in the energy compensation filter.

[0129] As an example, the second frequency response is marked as Then, the following can be obtained:

[0130]

[0131] wherein m=0,1,2,…,B, n=0,1,2,…,A, b={b0,b1,b2,…,b B} and a={a0,a1,a2,…,a A} are filter parameters in the energy compensation filter, B is the order of b, A is the order of a, and A and B are determined by the hardware of the fitted headphone.

[0132] Step 605, determine a target loss function according to the difference between the first frequency response and the second frequency response.

[0133] In the embodiments of the present disclosure, the target loss function can also be referred to as a target fitting error.

[0134] In the embodiments of the present disclosure, the target loss function can be determined according to the difference between the first frequency response and the second frequency response. The target loss function is in a positive relationship with the above-mentioned difference, that is, the greater the difference, the greater the target loss function, and vice versa, the smaller the difference, the smaller the target loss function.

[0135] As a possible implementation manner, the first set weight corresponding to the first set frequency range, the second set weight corresponding to the second set frequency range, and the third set weight corresponding to the third set frequency range can be acquired, and the difference between the first frequency response and the second frequency response is weighted and summed according to the first set weight, the second set weight, and the third set weight to obtain the target loss function.

[0136] As an example, the target loss function can be as shown in formula (6):

[0137]

[0138] wherein w(k) takes the first set weight in the first set frequency range (such as 0-1000 Hz), for example, the first set weight can be 1, w(k) takes the second set weight in the second set frequency range (such as 1000-1500 Hz), for example, the second set weight can be 0.8, w(k) takes the third set weight in the third set frequency range (such as 1500-2000 Hz), for example, the third set weight can be 0.5, and w(k) takes 0 in the remaining frequency range.

[0139] In step 606, the target values of the filter parameters in the energy compensation filter are determined according to the target loss function.

[0140] In the embodiments of the present disclosure, the target values of the filter parameters in the energy compensation filter can be determined according to the target loss function. For example, the values of the filter parameters corresponding to the minimum of the target loss function can be determined, and the values of the filter parameters corresponding to the minimum of the target loss function are taken as the target values of the corresponding filter parameters.

[0141] As an example, for the target loss function shown in formula (6), the filter parameters a and b corresponding to the minimum of the min value can be determined based on the standard least mean square error and the “Gauss-Newton” iterative algorithm.

[0142] In the embodiments of the present disclosure, after the target values of the filter parameters in the energy compensation filter are determined, the target values of the filter parameters can be burned into the earphone, such as burned into the energy compensation filter of the earphone, so that the energy compensation filter can filter the to-be-played sound source signal or audio signal according to the target values of the filter parameters, and the volume compensation of the sound source signal or audio signal can be realized to obtain the compensated sound source signal or audio signal.

[0143] As an application scenario, the earphone is taken as an example. Figure 1The active noise reduction earphone shown is used for exemplary illustration, and the generation process of the filter parameters of the energy compensation filter can include the following steps:

[0144] First step: acoustic environment configuration

[0145] As Figure 1 The secondary path measurement shown needs to be performed in an acoustic anechoic chamber to prevent interference from external environmental noise. The tester sits in the center of the anechoic chamber and wears the active noise reduction earphone to perform the measurement. The sound source signal played by the active noise reduction earphone can be any one of white noise, pink noise, linear sweep, and logarithmic sweep. Among them, the sound source signal needs to ensure the comfort of the tester's hearing and cannot cause any hearing discomfort. The duration of the sound source signal is preferably 3-5 seconds. A too short duration is difficult to ensure the effectiveness of the test, and a too long duration is not conducive to the tester to maintain a stationary sitting posture.

[0146] Second step: secondary path measurement

[0147] During the secondary path measurement process, the active noise reduction earphone needs to play the sound source signal selected during the acoustic environment configuration process. The electrical signal on the loudspeaker line is sampled in real time through a line introduced on the active noise reduction earphone circuit, and the electrical signal of the feedback microphone is also sampled in real time. Finally, the time-domain waveforms of the electrical signal of the loudspeaker and the electrical signal of the feedback microphone are obtained through the corresponding sampling device. During the test, in order to avoid signal distortion, the sampling rate of the sound source signal and the sampling rate of the electrical signal should be consistent, and the sampling rate should not be less than 44.1 kHz. The tester needs to correctly wear the active noise reduction earphone to be tested and maintain a stationary state during the test. In order to prevent accidental errors, each tester needs to repeat the measurement at least 3 times. In order to ensure the coverage of the test samples, the number of testers should be at least 10, and the male-to-female ratio should be 1:1.

[0148] Third step: data post-processing

[0149] Let the total number of tests be I, and the total number of tests of a single tester be J. Then, the electrical signal of the loudspeaker during the jth test of the ith tester can be represented by , and the electrical signal of the feedback microphone during the single test can be represented by . The secondary path spectral expression corresponding to the single test process can be obtained as shown in the foregoing formula (1).

[0150] Further, the secondary path spectral expressions corresponding to the test processes of all testers are averaged to obtain the final secondary path transfer function, i.e., the transfer function between the loudspeaker and the feedback microphone.

[0151] Fourth step: energy compensation modeling or music compensation modeling

[0152] The design idea of the energy compensation filter is that the frequency response of the energy compensation filter approximates the frequency response of the secondary path, so as to realize the energy compensation function or the music compensation function. Since the target of the energy compensation is to compensate for the energy loss caused by the active noise reduction, the energy response is preferentially approximated, and the phase response can be inconsistent with the secondary path.

[0153] Since H(k) is a full-band function, and Figure 2 It can be known that the energy loss of the sound source signal caused by the active noise reduction is not a full-band loss, and the influence range is mainly within 1000 Hz, and at the same time, the energy of the energy band of 1000 Hz to 3000 Hz is naturally lifted due to the water bed effect. Therefore, the target frequency response (denoted as the first frequency response in the disclosure) of the energy compensation is the frequency band within 1000 Hz, and the frequency band outside 1000 Hz to 3000 Hz will be naturally attenuated due to the water bed effect. However, if the first frequency response is directly truncated at 1000 Hz, the first frequency response will be difficult to fit due to the abrupt change of the amplitude and the phase.

[0154] Since the spectral line frequency point k and the physical frequency have a corresponding relationship as shown in formula (3), the spectral line frequency point k can be directly mapped to the physical frequency f k , so that the first frequency response of the energy compensation filter can be as shown in formula (4).

[0155] Step 5: Filter parameter fitting

[0156] Suppose the frequency response (denoted as the second frequency response in the disclosure) of the energy compensation filter to be fitted is as shown in formula (5) Suppose the frequency weight is w(k), and the target fitting error (denoted as the target loss function in the disclosure) based on the frequency weight is as shown in formula (6).

[0157] The target fitting error in formula (6) is equivalent to twice weighting through a and β and w(k). When min in formula (6) obtains the minimum value, the filter parameters a and b have an optimal solution.

[0158] When the weight of w(k) is determined, the filter parameters a and b can be solved based on the standard least mean square error and the Gauss-Newton iterative algorithm. When the filter parameters are burned into the energy compensation filter in the active noise reduction earphone, the energy compensation filter can perform volume compensation on the sound source signal according to the target value of each filter parameter, so as to realize the energy compensation function.

[0159] Thus, the auricles and ear canals of a large number of testers are taken into account, the universal adaptability of the human ear can be achieved, the frequency response of the energy compensation filter is obtained based on the acoustic transfer path measurement and the mathematical method, and the filter parameter determination result accuracy can be improved based on the least mean square and the Gauss-Newton method to fit the filter parameters according to the frequency response.

[0160] To achieve the above-mentioned embodiments, the present disclosure further provides an earphone.

[0161] Figure 7 A structural schematic diagram of an earphone provided by an embodiment of the present disclosure.

[0162] As Figure 7 shown, the earphone can include a loudspeaker 710, an energy compensation filter 720, and a controller 730, the energy compensation filter 720 stores an energy compensation filter generated by any of the embodiments. Figures 3 to 6 The target values of the filter parameters in the energy compensation filter generated by the method proposed by any of the embodiments.

[0163] The controller 730 can include a processor 731 and a memory 732, the memory 732 stores a computer program; the processor 731 is configured to invoke the computer program on the memory 732 to perform the following steps: obtaining a first audio signal to be played; performing filtering processing on the first audio signal based on the energy compensation filter 720 to obtain a second audio signal; and controlling the loudspeaker 710 to play the second audio signal.

[0164] In the embodiment of the present disclosure, the first audio signal can be an audio signal to be played by the earphone, the controller 730 can control the energy compensation filter 732 to perform filtering processing on the first audio signal according to the target values of the filter parameters, to obtain a second audio signal after volume compensation, and control the loudspeaker 710 to play the second audio signal.

[0165] It should be noted that the explanation and description of the generation method of the target parameters of the energy compensation filter in any of the foregoing embodiments are also applicable to this embodiment, and the implementation principle is similar, which will not be described here.

[0166] In a possible implementation manner of the embodiment of the present disclosure, as Figure 8 shown, based on the embodiment shown in Figure 7 , the earphone can further include a feed-forward microphone 740, a feedback microphone 750, a feed-forward filter 760, and a feedback filter 770.

[0167] The processor 731 is further configured to perform: obtaining first ambient noise collected by the feed-forward microphone 740; performing filtering processing on the first ambient noise based on the feed-forward filter 760 to obtain a feed-forward noise reduction signal; obtaining second ambient noise collected by the feedback microphone 750, the second ambient noise being residual noise after physical noise reduction on the first ambient noise; performing filtering processing on the second ambient noise based on the feedback filter 770 to obtain a feedback noise reduction signal; superimposing the feed-forward noise reduction signal, the feedback noise reduction signal, and the second audio signal; and controlling the loudspeaker 710 to play the superimposed signal.

[0168] As a possible implementation manner, the earphone can include a shell, the shell can include oppositely arranged first and second surfaces, the first surface is provided with the feed-forward microphone 740, and the second surface is provided with the feedback microphone 750. The feed-forward microphone 740 is configured to collect the first ambient noise; and the feedback microphone 750 is configured to collect the second ambient noise.

[0169] Taking the earphone as an active noise reduction earphone as an example, the first ambient noise can be ambient noise outside the active noise reduction earphone, i.e., ambient noise outside the ear, and the second ambient noise can be ambient noise inside the ear canal.

[0170] The feed-forward filter 760 connected to the feed-forward microphone 740 is configured to perform filtering processing on the first ambient noise to obtain a feed-forward noise reduction signal.

[0171] The feedback filter 770 connected to the feedback microphone 750 is configured to perform filtering processing on the second ambient noise to obtain a feedback noise reduction signal.

[0172] The energy compensation filter 720 is configured to perform filtering processing on the first audio signal to be played according to target values of the filter parameters to obtain the second audio signal after volume compensation; wherein the target values of the filter parameters are determined by using the method for generating target parameters of the energy compensation filter in any one of the preceding embodiments.

[0173] In a possible implementation manner of the embodiment of the present disclosure, the earphone can further include an accumulator connected to the feed-forward filter 760, the feedback filter 770, and the energy compensation filter 720, respectively. The accumulator is configured to add or superimpose the feed-forward noise reduction signal, the feedback noise reduction signal, and the second audio signal after volume compensation to obtain a superimposed signal.

[0174] The loudspeaker 770 can be connected to the accumulator and configured to play the superimposed signal.

[0175] It should be noted that the foregoing explanation and description of the method for generating target parameters of the energy compensation filter also apply to the earphone in this embodiment, and the implementation principle is similar, which will not be described here in detail.

[0176] The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure. Figures 3 to 6 The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure. Figures 3 to 6 The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0177] Figure 9 The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0178] As shown in the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure. Figure 9 The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0179] The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0180] The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0181] The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0182] The energy compensation filter target parameter generation method provided in the embodiments corresponds to the energy compensation filter target parameter generation method provided in the embodiments of the present disclosure.

[0183] In a possible implementation manner of the energy compensation filter target parameter generation method provided in the embodiments, the first determination module 920 is configured to: obtain the autocorrelation cross-spectral density of the first electric signal; obtain the cross-correlation cross-spectral density of the first electric signal and the second electric signal; and determine the transfer function according to the autocorrelation cross-spectral density and the cross-correlation cross-spectral density.

[0184] In a possible implementation manner of the embodiment of the present disclosure, the second determining module 930 is configured to: intercept a first transfer sub-function in a first set frequency range from the transfer function; intercept a second transfer sub-function in a second set frequency range from the transfer function; the second set frequency range is greater than the first set frequency range; intercept a third transfer sub-function in a third set frequency range from the transfer function; the third set frequency range is greater than the second set frequency range; perform weighted sum processing on the second transfer sub-function and the third transfer sub-function by using a set weighting factor to obtain a weighted transfer function; and add the weighted transfer function and the first transfer sub-function to obtain the first frequency response of the energy compensation filter.

[0185] In a possible implementation manner of the embodiment of the present disclosure, the third determining module 940 is configured to: determine the second frequency response of the energy compensation filter according to the filter parameters; determine the target loss function according to the difference between the first frequency response and the second frequency response; and determine the target value of the filter parameters in the energy compensation filter according to the target loss function.

[0186] In a possible implementation manner of the embodiment of the present disclosure, the third determining module 940 is configured to: obtain a first set weight corresponding to the first set frequency range, a second set weight corresponding to the second set frequency range, and a third set weight corresponding to the third set frequency range; and perform weighted sum on the difference between the first frequency response and the second frequency response according to the first set weight, the second set weight, and the third set weight to obtain the target loss function.

[0187] In a possible implementation manner of the embodiment of the present disclosure, the third determining module 940 is configured to: determine the value of the filter parameters corresponding to the minimum of the target loss function; and take the value of the filter parameters corresponding to the minimum of the target loss function as the target value of the corresponding filter parameter.

[0188] The apparatus for generating a target parameter of an energy compensation filter in the embodiment of the present disclosure acquires a first electric signal of a loudspeaker of a headphone and a second electric signal of a feedback microphone; determines a transfer function between the loudspeaker and the feedback microphone according to the cross-correlation cross-spectrum density of the first electric signal and the second electric signal; determines a first frequency response of the energy compensation filter in the headphone according to the transfer function; and determines a target value of filter parameters in the energy compensation filter according to the first frequency response. Thus, the value of the filter parameters in the energy compensation filter is calculated by the acquired signals, which can improve the accuracy of the calculation result, so that the filter parameters with accurate values can be used to filter a sound source signal or an audio signal to be played, and the sound source signal or the audio signal can be volume compensated, thereby improving the playing effect of the sound source signal or the audio signal.

[0189] To achieve the above-mentioned embodiments, the present disclosure further proposes an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, when the processor executes the program, the generation method of the target parameter of the energy compensation filter according to any one of the preceding embodiments of the present disclosure is realized.

[0190] To achieve the above-mentioned embodiments, the present disclosure further proposes a non-transitory computer-readable storage medium, having a computer program stored thereon, when the program is executed by a processor, the generation method of the target parameter of the energy compensation filter according to any one of the preceding embodiments of the present disclosure is realized.

[0191] To achieve the above-mentioned embodiments, the present disclosure further proposes a computer program product, when the instructions in the computer program product are executed by a processor, the generation method of the target parameter of the energy compensation filter according to any one of the preceding embodiments of the present disclosure is executed.

[0192] Figure 10 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 1000 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.

[0193] Referring to Figure 10 , the electronic device 1000 can include one or more of the following components: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input / output (I / O) interface 1012, a sensor component 1014, and a communication component 1016.

[0194] The processing component 1002 usually controls overall operations of the electronic device 1000, such as operations associated with displaying, making phone calls, data communications, camera operations and recording operations. The processing component 1002 can include one or more processors 1020 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 1002 can include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.

[0195] The memory 1004 is configured to store various types of data to support the operations of the electronic device 1000. Examples of such data include instructions for any application programs or methods operating on the electronic device 1000, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1004 can be implemented by any type of volatile or nonvolatile memory, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or a compact disk.

[0196] The power component 1006 provides power to the various components of the electronic device 1000. The power component 1006 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 1000.

[0197] The multimedia component 1008 includes a screen providing an output interface between the electronic device 1000 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense a boundary of a touching or swiping action, but also detect duration and pressure related to the touching or swiping action. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. The front camera and / or the rear camera can receive external multimedia data when the electronic device 1000 is in an operation mode, such as a photographing mode or a video mode. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0198] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC) configured to receive external audio signals when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.

[0199] The I / O interface 1012 provides an interface between the processing component 1002 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0200] The sensor component 1014 includes one or more sensors for providing status assessments for various aspects of the electronic device 1000. For example, the sensor component 1014 can detect an open / closed position of the electronic device 1000, relative positioning of components, such as a display and a keypad of the electronic device 1000, a change in position of the electronic device 1000 or a component of the electronic device 1000, presence or absence of user contact with the electronic device 1000, orientation or acceleration / deceleration / g-force and temperature of the electronic device 1000. The sensor component 1014 can include an optical sensor for detecting ambient light, a proximity sensor for detecting nearby objects without any physical touch, a CMOS or CCD image sensor for use in imaging applications, and / or a gyroscope sensor, a magnetometer sensor, a pressure sensor, or a temperature sensor in some embodiments.

[0201] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a corresponding communication standard, such as WiFi, 4G, or 5G, or a combination thereof. In an example embodiment, the communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 1016 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technology.

[0202] In an example embodiment, the electronic device 1000 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, to perform the above-described methods.

[0203] In an example embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 1004 including instructions, is also provided, which can be executed by the processor 1020 of the electronic device 1000 to implement the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0204] In the description of the disclosure, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the disclosure. In the description of the disclosure, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, a person skilled in the art can combine and combine different embodiments or examples described in the specification and the features of different embodiments or examples without contradiction.

[0205] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the disclosure, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.

[0206] Any process or method descriptions in flow charts or otherwise described herein represent embodiments that can be understood as a module, segment, or portion of code that includes one or more executable instructions for implementing the specified logical function or process. The scope of the preferred embodiments of the disclosure includes additional implementation in which the functions described in the illustrated or discussed order are performed in a different order, including substantially simultaneously, or in reverse order, according to the functions involved, which should be understood by those skilled in the art to which the embodiments of the disclosure belong.

[0207] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of instructions to implement logic functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a machine-readable storage device (e.g., magnetic, optical or other) a machine-readable storage diskette (e.g., floppy disk, optical disk, CD- ROM, etc.), a machine- readable storage card (e.g., PCMCIA card, etc.), a machine-readable storage tape (e.g., magnetic tape, optical tape, etc.), a machine-readable storage medium (e.g., RAM, ROM, etc.), a machine-readable signal (e.g., electrical, optical, etc.), a machine-readable medium (e.g., carrier wave, etc.) or any other suitable medium or means of embodying the program. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an EPROM, a FLASH memory card, an optical fiber, and a portable compact disc read-only memory (CD-ROM). Additionally, the computer-readable medium can be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and stored in a computer memory.

[0208] It should be understood that portions of the present disclosure can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the various steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if implemented in hardware, and in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0209] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by programs instructing related hardware, and the programs can be stored in a computer-readable storage medium. When the programs are executed, one or a combination of the steps of the method embodiments is included.

[0210] In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing module, or each unit can exist physically separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0211] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A method of generating target parameters of an energy compensation filter, characterized in that, The method comprises: collecting a first electrical signal of a loudspeaker of a headset and a second electrical signal of a feedback microphone, wherein the electrical signal collected in real time on the loudspeaker line is recorded as the first electrical signal, and the electrical signal collected in real time in the feedback microphone in the headset is recorded as the second electrical signal; determining a transfer function between the loudspeaker and the feedback microphone according to the cross-spectral density of the cross-correlation of the first electrical signal and the second electrical signal, comprising: obtaining the cross-spectral density of the autocorrelation of the first electrical signal, obtaining the cross-spectral density of the cross-correlation of the first electrical signal and the second electrical signal, and determining the transfer function according to the cross-spectral density of the autocorrelation and the cross-spectral density of the cross-correlation; cutting a first transfer sub-function in a first set frequency range from the transfer function; cutting a second transfer sub-function in a second set frequency range from the transfer function; wherein the second set frequency range is greater than the first set frequency range; cutting a third transfer sub-function in a third set frequency range from the transfer function; wherein the third set frequency range is greater than the second set frequency range; performing weighted sum processing on the second transfer sub-function and the third transfer sub-function by using a set weighting factor to obtain a weighted transfer function; adding the weighted transfer function and the first transfer sub-function to obtain a first frequency response of the energy compensation filter, and determining the target value of each filter parameter in the energy compensator according to the first frequency response; determining a second frequency response corresponding to the energy compensation filter according to each filter parameter; obtaining a first set weight corresponding to the first set frequency range, a second set weight corresponding to the second set frequency range, and a third set weight corresponding to the third set frequency range; performing weighted sum on the difference between the first frequency response and the second frequency response according to the first set weight, the second set weight and the third set weight to obtain the target loss function; determining the target value of each filter parameter in the energy compensation filter according to the target loss function.

2. The method of claim 1, wherein, The determination of the target value of each filter parameter in the energy compensation filter according to the target loss function comprises: determining the value of each filter parameter corresponding to the minimum of the target loss function; taking the value of each filter parameter corresponding to the minimum of the target loss function as the target value of the corresponding filter parameter.

3. An earphone, characterized by The method comprises: a loudspeaker, an energy compensation filter and a controller, the energy compensation filter storing the target value of each filter parameter in the energy compensation filter generated by the method of any one of claims 1-2; the controller comprises a processor and a memory, and the memory stores a computer program; the processor is used to call the computer program on the memory to perform the following steps: obtaining a first audio signal to be played; filtering the first audio signal based on the energy compensation filter to obtain a second audio signal; controlling the loudspeaker to play the second audio signal.

4. The earphone of claim 3, wherein The earphone further comprises a feed-forward microphone, a feedback microphone, a feed-forward filter and a feedback filter, and the processor is further configured to perform the following steps: acquiring first ambient noise collected by the feed-forward microphone; filtering the first ambient noise based on the feed-forward filter to obtain a feed-forward noise reduction signal; acquiring second ambient noise collected by the feedback microphone, the second ambient noise being residual noise after physical noise reduction of the first ambient noise; filtering the second ambient noise based on the feedback filter to obtain a feedback noise reduction signal; superimposing the feed-forward noise reduction signal, the feedback noise reduction signal and the second audio signal; controlling the loudspeaker to play the superimposed signal.

5. The earphone of claim 4, wherein The earphone further comprises a housing comprising a first surface and a second surface arranged oppositely, the first surface being provided with the feed-forward microphone, and the second surface being provided with the feedback microphone.

6. An apparatus for generating target parameters of an energy compensation filter, characterized in that The device comprises: a collection module configured to collect a first electrical signal of a loudspeaker of an earphone and a second electrical signal of a feedback microphone, wherein the electrical signal collected in real time on a loudspeaker line is recorded as the first electrical signal, and the electrical signal collected in real time by the feedback microphone in the earphone is recorded as the second electrical signal; a first determination module configured to determine a transfer function between the loudspeaker and the feedback microphone according to cross-correlation cross-spectral densities of the first electrical signal and the second electrical signal, specifically configured to: acquire an autocorrelation cross-spectral density of the first electrical signal, acquire a cross-correlation cross-spectral density of the first electrical signal and the second electrical signal, and determine the transfer function according to the autocorrelation cross-spectral density and the cross-correlation cross-spectral density; a second determination module configured to: intercept a first transfer sub-function in a first set frequency range from the transfer function, intercept a second transfer sub-function in a second set frequency range from the transfer function, wherein the second set frequency range is greater than the first set frequency range, intercept a third transfer sub-function in a third set frequency range from the transfer function, wherein the third set frequency range is greater than the second set frequency range, perform weighted sum processing on the second transfer sub-function and the third transfer sub-function by using a set weighting factor to obtain a weighted transfer function, add the weighted transfer function and the first transfer sub-function to obtain a first frequency response of the energy compensation filter, and determine target values of filter parameters in the energy compensator according to the first frequency response. The third determining module is configured to determine a second frequency response corresponding to the energy compensation filter according to the filter parameters, obtain a first preset weight corresponding to the first preset frequency range, a second preset weight corresponding to the second preset frequency range, and a third preset weight corresponding to the third preset frequency range, perform weighted summation on a difference between the first frequency response and the second frequency response according to the first preset weight, the second preset weight, and the third preset weight to obtain the target loss function, and determine target values of the filter parameters in the energy compensation filter according to the target loss function.

7. The apparatus of claim 6, wherein, The third determining module is configured to: determine the values of the filter parameters corresponding to a minimum of the target loss function; determine the values of the filter parameters corresponding to the minimum of the target loss function as the target values of the corresponding filter parameters.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method for generating target parameters of the energy compensation filter according to any one of claims 1-2.

9. A computer program product, characterised in that, When the instructions in the computer program product are executed by the processor, the method for generating target parameters of the energy compensation filter according to any one of claims 1-2 is executed.

Citation Information

Patent Citations

  • Parameter adjustment method and device for active noise reduction earphone and wireless earphone

    CN110972014A

  • Earphone wearing state detection method and device and earphone

    CN111988690A

  • Method for inhibiting water bed effect of adaptive feedback active control system

    CN112233643A

  • Method for realizing signal equalization by using in-ear earphones and processor

    CN112492446A