Active noise reduction method for earphone

The improved Transformer model with a proxy attention mechanism in headphones optimizes noise reduction by accurately identifying scenes and adjusting power consumption, addressing inefficiencies in existing methods.

CN119110197APending Publication Date: 2024-12-10JIANGXI RUISHENG ELECTRONIC CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411159426.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing adaptive noise reduction methods for headphones lack scene recognition efficiency and accuracy, leading to low matching degrees of noise reduction requirements and high power consumption, affecting user experience.

Method used

A method utilizing an improved Transformer model with a proxy attention mechanism to determine noise reduction parameters based on headset location, posture, and ambient audio signals, optimizing power consumption by switching modes based on available power, ensuring efficient and accurate noise reduction.

Benefits of technology

Enhances the efficiency and accuracy of noise reduction by dynamically adjusting to power status, improving adaptability to diverse usage scenarios and user needs, optimizing power consumption, and enhancing user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110197A_ABST
    Figure CN119110197A_ABST
Patent Text Reader

Abstract

The invention discloses an active noise reduction method for an earphone. The method comprises the following steps: acquiring current position information and an environment audio signal of the earphone; detecting whether the current electric quantity of the earphone is greater than a preset electric quantity threshold; if yes, obtaining current posture information of the earphone; determining a target scene type from preset scene types based on the environment audio signal, the position information, the attitude information and a preset improved Transform model configured with an agency attention mechanism; if not, determining a target scene type from preset scene types according to the position information and the environment audio signal; and obtaining a noise reduction parameter corresponding to the target scene type as a target noise reduction parameter. According to the invention, the function of dynamically starting the corresponding noise reduction parameter acquisition mode based on the current electric quantity state of the earphone is realized, the noise reduction power consumption of the earphone is reasonably configured, the noise reduction parameter acquisition mode is optimized, the efficiency and accuracy of adaptive noise reduction are improved, the adaptability of the earphone to the use of a user is improved, and the use experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of headphone noise reduction, and in particular to a headphone active noise reduction method. Background Art

[0002] With the rapid development of electronic technology, wireless headphones have become an indispensable item for people's daily travel. When facing various relatively noisy environments, people usually choose to wear wireless headphones to reduce the impact of environmental noise.

[0003] Different noise environments have different requirements for noise reduction. To better cope with the changing noise environment, some existing wireless headphones use adaptive noise reduction to reduce the impact of environmental noise. However, the existing adaptive noise reduction method cannot identify the noise scene relatively accurately and efficiently, which leads to a low matching degree of noise reduction requirements, and the existing adaptive noise reduction has high power consumption, which in turn affects the user experience.

[0004] In view of this, it is necessary to provide a method for active noise reduction of headphones to solve the above problems. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a method for active noise reduction of headphones, which aims to solve the technical problems of low scene recognition efficiency and accuracy of adaptive noise reduction of headphones, excessive power consumption, and low adaptability to users' diverse usage needs and complex usage scenarios.

[0006] To achieve the above-mentioned purpose, a first aspect of the present invention provides a method for active noise reduction of headphones, comprising:

[0007] Get the current location information of the headset and the ambient audio signal;

[0008] Detect whether the current power level of the headset is greater than the preset power threshold;

[0009] If yes, obtain the current posture information of the headset;

[0010] Based on the ambient audio signal, position information, posture information and the preset improved Transformer model configured with the proxy attention mechanism, the target scene type is determined from the preset scene types;

[0011] If not, determining the target scene type from preset scene types based on the position information and the ambient audio signal;

[0012] Get the noise reduction parameters corresponding to the target scene type as the target noise reduction parameters.

[0013] In a preferred embodiment, based on the ambient audio signal, the position information, the posture information and the preset improved Transformer model configured with the proxy attention mechanism, the step of determining the target scene type from the preset scene types includes:

[0014] Extracting audio feature sequences from environmental audio signals;

[0015] Extract auxiliary feature sequences from position information and posture information;

[0016] Input the audio feature sequence and the auxiliary feature sequence into the improved Transformer model configured with the proxy attention mechanism to obtain the matching value of the preset scene type;

[0017] According to the size of the matching value, the target scene type is determined.

[0018] In a preferred embodiment, the step of inputting the audio feature sequence and the auxiliary feature sequence into an improved Transformer model configured with a proxy attention mechanism to obtain a matching value of a preset scene type includes:

[0019] Mapping and encoding the audio feature sequence and the auxiliary feature sequence to obtain an audio enhancement sequence and an auxiliary enhancement sequence respectively;

[0020] Based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism, an enhanced feature matrix is ​​obtained;

[0021] Based on the preset fully connected layer and enhanced feature matrix, the matching value of each scene type is obtained.

[0022] In a preferred embodiment, the step of obtaining an enhanced feature matrix based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism includes:

[0023] According to the audio enhancement sequence and the preset conversion weight matrix, a first matrix, a second matrix and a third matrix are obtained respectively;

[0024] According to the auxiliary enhancement sequence and the preset proxy conversion matrix, a proxy matrix is ​​obtained;

[0025] Interactively calculate the proxy matrix, the second matrix and the third matrix to obtain a fusion matrix;

[0026] Interactively calculate the first matrix, the proxy matrix and the fusion matrix to obtain the attention weight matrix;

[0027] The attention weight matrix is ​​weighted summed with the third matrix to obtain the enhanced feature matrix.

[0028] In a preferred embodiment, the step of extracting the auxiliary feature sequence from the position information and the posture information includes:

[0029] Preprocess the position information and attitude information respectively to obtain denoised position information and denoised attitude information;

[0030] Extract position features from the denoised position information to obtain a position feature sequence;

[0031] Extract posture features from the denoised posture information to obtain a posture feature sequence;

[0032] The position feature sequence and the posture feature sequence are fused to obtain an auxiliary feature sequence.

[0033] In a preferred embodiment, the step of determining the target scene type from preset scene types according to the position information and the ambient audio signal includes:

[0034] Obtaining the ambient audio spectrum and key position information from the ambient audio signal and the position information respectively;

[0035] Based on the key position information, determining an initial scene type and an associated scene type from preset scene types;

[0036] According to the ambient audio spectrum and the preset extraction mode, a number of energy characteristic values ​​are obtained;

[0037] According to the energy characteristic value, the target scene type is determined from the initial scene type and the associated scene type.

[0038] In a preferred embodiment, based on the key position information, the step of determining the initial scene type and the associated scene type from the preset scene types includes:

[0039] Obtaining the adaptation value of key location information and preset scene type;

[0040] Based on the adaptation value, determining an initial scene type from preset scene types;

[0041] Get the associated values ​​of the initial scene type and the remaining scene types;

[0042] Based on the association value and a preset first threshold, an associated scene type is obtained from the remaining scene types.

[0043] In a preferred embodiment, the step of obtaining the associated scene type from the remaining scene types based on the associated value and the preset first threshold comprises:

[0044] Get the maximum value among the adaptation values ​​as the maximum adaptation value;

[0045] Obtaining a preset adaptation value interval in which the maximum adaptation value falls, and using it as a target adaptation value interval;

[0046] Obtaining a preset first threshold value corresponding to the target adaptation value interval;

[0047] Determining whether the correlation value is less than a first threshold;

[0048] If not, the scene type corresponding to the associated value is marked as the associated scene type.

[0049] In a preferred embodiment, the step of determining the target scene type from the initial scene type and the associated scene type according to the energy characteristic value includes:

[0050] Obtaining an energy interval of an initial scene type and an energy interval of an associated scene type;

[0051] Obtaining the number of energy characteristic values ​​falling into the energy interval of the initial scene type and the energy interval of the associated scene type;

[0052] Based on the number of falls, the target scene type is obtained.

[0053] In a preferred embodiment, the step of obtaining the target scene type based on the number of falls includes:

[0054] Get the value of the maximum number of numbers that fall into the number;

[0055] If the value is 1, the scene type corresponding to the maximum number of falls is marked as the target scene type;

[0056] If the value is greater than 1, the adaptation value between the scene type corresponding to the maximum number of falls and the key position information is obtained;

[0057] The scene type corresponding to the maximum value in the adaptation value is marked as the target scene type.

[0058] A second aspect of the present invention provides an earphone, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned steps of the method for active noise reduction of the earphone when executing the computer program.

[0059] A third aspect of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for active noise reduction of headphones are implemented.

[0060] The beneficial effects of the present invention are as follows: it divides different noise reduction parameter acquisition modes according to the current power status of the earphone, and when the current power of the earphone meets the power requirement, it uses the improved Transformer model and multi-source feature information to achieve identification and classification of complex audio scene types while maintaining low computational complexity; when the current power of the earphone does not meet the power requirement, it combines the ambient audio signal and position information to achieve rapid initial screening and side-by-side repeated screening of scene types, and then realizes the function of dynamically enabling the corresponding noise reduction parameter acquisition mode based on the current power status of the earphone, reasonably configures the noise reduction power consumption of the earphone, optimizes the method of obtaining noise reduction parameters, improves the efficiency and accuracy of adaptive noise reduction, improves the adaptability of the earphone to cope with diverse user usage needs and usage scenarios, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a first process flow of a method for active noise reduction of headphones disclosed in an embodiment of the present invention;

[0062] Figure 2 A second flow chart of the method for active noise reduction of headphones disclosed in an embodiment of the present invention;

[0063] Figure 3 A third flow chart of the method for active noise reduction of headphones disclosed in an embodiment of the present invention;

[0064] Figure 4 This is a schematic diagram of the module structure of the earphone disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In the present invention, the terms "disposed", "provided with" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection, or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be an internal connection between two devices, elements or components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0066] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0067] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those skilled in the art, the specific meanings of these terms in the present invention can be understood according to specific circumstances.

[0068] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0069] The following is the content of the first aspect of the present invention:

[0070] Please refer to Figure 1 In this embodiment, the steps of the headphone active noise reduction method include:

[0071] S1. Obtain the current position information of the headset and the ambient audio signal.

[0072] Among them, the earphones mentioned in this embodiment are earphones with active noise reduction function. The earphones can be wireless earphones or wired earphones. They include a processor and an audio output unit. The processor can generate an audio signal with a phase opposite to the ambient noise through the acquired noise reduction parameters, thereby offsetting the external ambient noise.

[0073] The location information of the headset can be location information with the headset as the positioning center, or it can be location information with the positioning center of the terminal device connected to the headset. Accordingly, the location information of the headset can be obtained directly or indirectly. Specifically, a positioning module can be set inside the headset, and the location information of the current headset can be directly obtained through the positioning module; it can also be indirectly obtained through a terminal device (such as a mobile phone, smart watch, etc.) with a positioning module set inside, and the location information of the terminal device is approximately equivalent to the location information of the headset. In the daily use of the headset, the headset is mostly connected to a terminal device for use. Preferably, the location information of the terminal device can be used to indirectly obtain the location information of the headset.

[0074] The ambient audio signal can be obtained through a collection microphone array set on the headset, or through a collection microphone array on a terminal device connected to the headset. Specifically, the collection microphone array can obtain the ambient audio signal in real time or periodically.

[0075] S2, detecting whether the current power of the headset is greater than a preset power threshold;

[0076] S3. If yes, obtain the current posture information of the headset;

[0077] S4, based on the environmental audio signal, position information, posture information and the preset improved Transformer model configured with the proxy attention mechanism, determine the target scene type from the preset scene types;

[0078] S5. If not, determining the target scene type from preset scene types according to the position information and the ambient audio signal;

[0079] S6. Obtain noise reduction parameters corresponding to the target scene type as target noise reduction parameters.

[0080] Among them, the power threshold is a pre-set power parameter used to distinguish the power parameters that trigger different noise reduction parameter acquisition modes, which can be set according to the actual design requirements. The improved Transformer model uses the encoding module of the Transformer model and quotes the proxy attention mechanism to replace the original self-attention mechanism in the Transformer model, which can achieve more accurate and efficient recognition and classification of complex sound scenes using multi-source feature information. The proxy attention mechanism consists of two softmax attention operations. A set of additional proxy vectors A with fewer parameters are introduced into the ternary attention paradigm (Q, K, V) of the original attention mechanism to form a new quaternary proxy attention paradigm (Q, A, K, V).

[0081] After obtaining the current position information of the headset and the ambient audio signal of the current scene in which the headset is located, the current power parameters of the headset are obtained, and it is determined whether the current power parameters of the headset meet the preset power threshold, so as to enable the corresponding noise reduction parameter acquisition mode according to the current power status of the headset. It is easy to understand that according to the current power status of the headset, the corresponding noise reduction parameter acquisition mode is determined, which can better adapt to the usage of the headset. When the power is sufficient, the accuracy of the noise reduction parameter acquisition is prioritized. When the power is relatively low, the battery life of the headset is prioritized, thereby realizing the function of dynamically enabling the corresponding noise reduction parameter acquisition mode based on the current power status of the headset, more reasonably configuring the noise reduction power consumption of the headset, and optimizing the method of obtaining noise reduction parameters.

[0082] If it is detected that the current power parameter of the headset is greater than the preset power threshold, it means that the current remaining power of the headset is relatively large, which can support the headset to perform a noise reduction parameter acquisition mode with higher recognition and analysis accuracy. After triggering the noise reduction parameter acquisition mode that combines multi-source information for scene recognition, the current posture information of the headset is obtained. Specifically, the current posture information of the headset can be obtained through a posture sensor set inside the headset, which includes but is not limited to an accelerometer, a gyroscope, a magnetic sensor, and the like.

[0083] After obtaining the current posture information of the headset, the current ambient audio signal, position information and posture information of the headset are preprocessed to obtain a feature sequence that can be input into the improved Transformer model from the ambient audio signal, position information and posture information. Specifically, the feature sequence can be a sequence containing a single feature information, or a fusion sequence that integrates multiple feature information, which can be selected according to the actual design requirements. Accordingly, the feature sequence can be obtained by respectively extracting the corresponding feature sequences from the ambient audio signal, position information and posture information that have undergone denoising processing, or it can be a fusion sequence that integrates the required features extracted from the ambient audio signal, position information and posture information that have undergone denoising processing according to design requirements.

[0084] After obtaining the required feature sequence, the feature sequence is input into the improved Transformer model. The improved Transformer model first further processes the feature sequence to convert it into a high-dimensional enhanced sequence with sorting information. The obtained enhanced sequence is then passed through the proxy attention mechanism of the improved Transformer model to obtain an enhanced feature matrix containing weight information. The enhanced feature matrix is ​​then transformed and calculated through the fully connected layer to obtain the matching values ​​of each preset scene type, and then the target scene type is determined according to the matching values.

[0085] It is easy to understand that when the remaining power of the headphones is relatively high, the recognition and classification function of the complex audio scene in which the headphones are located is realized by improving the Transformer model and multi-source feature information. By utilizing the proxy attention mechanism of the improved Transformer model, while maintaining low computational complexity, the integration and recognition of multi-source feature information is realized, the accuracy of the dynamic adjustment of the recognition attention weight is improved, and the efficiency and accuracy of the headphones in recognizing complex audio scenes are improved, thereby improving the matching degree of the headphones' adaptive noise reduction, improving the effect of the headphones' adaptive noise reduction, and improving the user experience.

[0086] If it is detected that the current power of the headset is not greater than the preset power threshold, it means that the current remaining power of the headset is relatively low, and the noise reduction parameter acquisition mode that prioritizes ensuring the battery life of the headset can be enabled. After the corresponding noise reduction parameter acquisition mode is triggered, the required audio feature information and location feature information are extracted from the location information and the ambient audio signal respectively, and then the obtained feature information is used to determine the target scene type from the preset scene types.

[0087] Specifically, after obtaining the audio feature information and the position feature information, a hierarchical screening method of comparing the feature information one by one can be adopted to determine the target scene type; or a screening method of comparing the feature information in parallel and then adding weights can be adopted to determine the target scene type. The choice can be made according to the actual design needs.

[0088] It is easy to understand that by combining location information with ambient audio signals, the method of obtaining target noise reduction parameters can be optimized, the amount of calculation for scene recognition can be reduced, the efficiency and accuracy of adaptive noise reduction can be improved, and the power consumption of headphones can be reduced to a certain extent, thereby ensuring the battery life of the headphones and improving the user experience.

[0089] It can be understood that different noise reduction parameter acquisition modes are divided according to the current power status of the earphones. When the current power of the earphones meets the power requirements, the improved Transformer model and multi-source feature information are used to achieve the identification and classification of complex audio scene types while maintaining low computational complexity; when the current power of the earphones does not meet the power requirements, the ambient audio signals and location information are combined to achieve rapid initial screening and side-by-side repeated screening of scene types, and then the function of dynamically enabling the corresponding noise reduction parameter acquisition mode based on the current power status of the earphones is realized, the noise reduction power consumption of the earphones is reasonably configured, the method of obtaining noise reduction parameters is optimized, the efficiency and accuracy of adaptive noise reduction are improved, and the adaptability of the earphones to meet diverse user needs and usage scenarios is improved, thereby improving the user experience.

[0090] For further information, please refer to Figure 2 In one embodiment, based on the ambient audio signal, the position information, the posture information and the preset improved Transformer model configured with the proxy attention mechanism, step S4 of determining the target scene type from the preset scene types includes:

[0091] S41, extracting an audio feature sequence from an ambient audio signal;

[0092] S42, extracting an auxiliary feature sequence from the position information and the posture information;

[0093] S43, inputting the audio feature sequence and the auxiliary feature sequence into an improved Transformer model configured with a proxy attention mechanism to obtain a matching value of a preset scene type;

[0094] S44: Determine the target scene type according to the size of the matching value.

[0095] Among them, the audio feature sequence is the data extracted and transformed from the ambient audio signal, which can represent the sound characteristics of the current scene of the headset and can be input into the improved Transformer model. The auxiliary feature sequence is the data extracted from the position information and posture information respectively and transformed and fused to represent the current state characteristics of the headset and can be input into the improved Transformer model. The matching value indicates the degree of matching between the preset scene type and the current scene of the headset. The larger the matching value, the higher the degree of matching between the current scene of the headset and the corresponding scene type. Conversely, the lower the degree of matching between the current scene of the headset and the corresponding scene type.

[0096] After the microphone array collects the ambient audio signal of the scene in which the headset is currently located, the ambient audio signal needs to be preprocessed to remove redundant or irrelevant interference information. After obtaining the preprocessed ambient audio signal, the obtained audio signal can be converted into a spectrum diagram of the required type according to the actual design requirements, and then the obtained spectrum diagram can be divided into several sub-spectra according to the preset requirements, and then audio features are extracted from several sub-spectra. After obtaining the audio features, the extracted audio features are combined into an audio feature sequence.

[0097] After obtaining the position information of the current scene of the headset and the current posture information of the headset, it is necessary to preprocess the position information and posture information respectively to remove redundant or irrelevant interference information. After completing the preprocessing of the position information and posture information, the required position features and posture features are extracted from the position information and posture information respectively, and the obtained position features and posture features are combined respectively to obtain the position feature sequence and posture feature sequence, and then the two feature sequences are feature fused to obtain the required auxiliary feature sequence. It can be understood that by fusing the position feature sequence with the posture feature sequence, the feature relationship between the current position of the headset and the posture of the headset can be better reflected from the overall level, preparing for the subsequent use of multimodal feature information to comprehensively adjust the agent attention weight, and to a certain extent, it can also reduce the complexity of subsequent calculations.

[0098] After the audio feature sequence and the auxiliary feature sequence are input into the improved Transformer model, the audio feature sequence and the auxiliary feature sequence are further processed to convert them into high-dimensional audio enhancement sequences and auxiliary enhancement sequences with sorting information. The obtained audio enhancement sequence and auxiliary enhancement sequence are then passed through the proxy attention mechanism of the improved Transformer model to obtain an enhanced feature matrix containing weight information. The enhanced feature matrix is ​​then transformed and calculated through the fully connected layer to obtain the matching value of each scene type.

[0099] Specifically, in the process of calculating the proxy attention weight, the audio enhancement sequence will convert the Q, K and V matrices with different weights and functions, and the auxiliary enhancement sequence will convert the proxy matrix A, that is, generate the corresponding four-element proxy attention paradigm (Q, A, K, V), and then use A, K and V to perform the first softmax attention operation to obtain the fusion matrix V' that integrates the feature information of both the audio enhancement sequence and the auxiliary enhancement sequence, and then use Q, A and V' to perform the second softmax attention operation to obtain the required attention weight matrix, and then use the weighted sum of the attention weight matrix and V to obtain the enhanced feature matrix containing weight information.

[0100] It can be understood that the characteristic of the proxy attention mechanism is that it first uses A with fewer parameters to replace Q with more parameters to query and collect information in K and V, and then fuses the feature information contained in A, K and V, and then broadcasts the information obtained from the above operations to Q, establishing a cross-modal information fusion mechanism and realizing the interactive fusion of multi-source feature information. At the same time, it can avoid direct calculation between Q and K, and complete the modeling of global information with lower computational complexity.

[0101] Based on the obtained enhanced feature matrix and the fully connected layer, the matching value of each scene type can be determined, and then the maximum value among the matching values ​​can be screened out. The scene type corresponding to the maximum matching value is the target scene type, and then the noise reduction parameters of the target scene type can be obtained to realize the adaptive noise reduction function of the headphones.

[0102] It is understandable that by improving the Transformer model and multi-source feature information, the recognition and classification function of the complex audio scene in which the headphones are located is realized. By utilizing the proxy attention mechanism of the improved Transformer model, while maintaining low computational complexity, the integration and recognition of multi-source feature information is realized, the accuracy of the dynamic adjustment of the recognition attention weight is improved, and the efficiency and accuracy of the headphones in recognizing complex audio scenes are improved, thereby improving the matching degree of the headphones' adaptive noise reduction, improving the effect of the headphones' adaptive noise reduction, and improving the user experience.

[0103] Further, in one embodiment, step S41 of extracting an audio feature sequence from an ambient audio signal includes:

[0104] S411, preprocessing the ambient audio signal to obtain a noise-removed audio signal;

[0105] S412, converting the noise-removed frequency signal into an ambient audio spectrum;

[0106] S413, dividing the ambient audio spectrum into a plurality of target spectra;

[0107] S414: extract audio features from the target spectrum in sequence to obtain an audio feature sequence.

[0108] Specifically, after collecting the ambient audio signal of the scene in which the headset is currently located, since the ambient audio signal may be mixed with interference signals such as background noise, it is necessary to perform preprocessing such as filtering on the ambient audio signal to obtain a denoised audio signal.

[0109] After obtaining the denoised audio signal, in order to further extract the audio features, the denoised audio signal needs to be converted into an ambient audio spectrum that can extract the required audio features. It is easy to understand that the type of ambient audio spectrum can be selected according to the design requirements, and the ambient audio spectrum includes but is not limited to the ambient audio spectrum obtained by short-time Fourier transform, Mel spectrum, etc. Preferably, since the sensitivity of the human ear to different frequencies of sound is different, in order to extract audio features that are more in line with the auditory characteristics of the human ear, the denoised audio signal can be converted into a Mel spectrum.

[0110] After obtaining the ambient audio spectrum, it is necessary to divide the ambient audio spectrum into several target spectra to facilitate the subsequent audio feature extraction. Specifically, the ambient audio spectrum can be divided in a linear or nonlinear way. Preferably, the ambient audio spectrum is divided in a nonlinear way, and the frequency bands to which the human ear is relatively highly sensitive are intercepted with a relatively denser width, and the frequency bands to which the human ear is relatively less sensitive are intercepted with a relatively sparser width, so that the overall distribution of the obtained target spectrum is more consistent with the auditory characteristics of the human ear, so as to improve the accuracy of subsequent feature extraction.

[0111] After obtaining several target spectra, audio features are extracted from the target spectra in turn, and the obtained audio features are sorted and combined to obtain an audio feature sequence. Specifically, feature encoders such as convolutional neural networks or recurrent neural networks can be used to extract high-order features, or spectral features, statistical features and other features of sub-spectra can be directly extracted to obtain audio features. Preferably, feature encoders such as convolutional neural networks or recurrent neural networks can be used to extract high-order features as audio features.

[0112] Further, in one embodiment, step S42 of extracting the auxiliary feature sequence from the position information and the posture information includes:

[0113] S421, pre-processing the position information and the attitude information respectively to obtain denoised position information and denoised attitude information;

[0114] S422, extracting position features from the denoised position information to obtain a position feature sequence;

[0115] S423, extracting posture features from the denoised posture information to obtain a posture feature sequence;

[0116] S424: Fusing the position feature sequence with the posture feature sequence to obtain an auxiliary feature sequence.

[0117] The position feature is key information in the position information that can be used to represent the position characteristics of the current scene of the headset to a certain extent. The posture feature is key information in the posture feature that can be used to represent the current state of the headset to a certain extent.

[0118] Specifically, after obtaining the current position information and posture information of the headset, since both the position information and the posture information may be mixed with interference information or repeated meaningless information, it is necessary to denoise the position information and the posture information to obtain denoised position information and denoised posture information.

[0119] After obtaining the denoised position information and denoised posture information, feature extraction can be performed on the denoised position information and denoised posture information according to preset requirements. Specifically, the position features include but are not limited to geographic location information, scene type information, and point of interest information; posture feature information includes but is not limited to headset wearing posture information and headset acceleration information. It can be understood that the position features extracted from the denoised position information can be only a single type of position features or several types of position features; similarly, the posture features can be only a single type of posture features or several types of posture features, which can be selected according to actual design requirements.

[0120] After obtaining the position features and the posture features, the position features can be combined to obtain the position feature sequence, and the posture features can be combined to obtain the posture feature sequence. After the obtained position feature sequence and posture feature sequence are subjected to feature fusion, an auxiliary feature sequence can be obtained. Specifically, the method of feature fusion of the position feature sequence and the posture feature sequence includes but is not limited to direct splicing and weighted splicing between sequences, which can be selected according to the design requirements. Preferably, the weighted splicing method is adopted to better divide the weight between the position information and the posture information according to the actual situation, thereby improving the adaptability of the subsequent adjustment of the attention weight.

[0121] It can be understood that by obtaining an auxiliary feature sequence obtained by feature fusion of the position feature sequence and the posture feature sequence, the characteristic relationship between the current position of the headset and the headset posture can be better reflected from the overall level, enriching the amount of recognition information for subsequent sound scene classification, assisting in adjusting the proxy attention weight, improving the accuracy of the proxy attention weight, and thereby improving the accuracy of the sound scene classification.

[0122] Furthermore, in a preferred embodiment, the step S422 of extracting position features from the denoised position information to obtain a position feature sequence includes:

[0123] S4221, extracting the current geographical location information of the headset from the noise removal location information;

[0124] S4222, determining scene type initial information according to the geographic location information and a preset geographic information database;

[0125] S4223. Encode and transform the initial scene type information to obtain a position feature sequence.

[0126] The geographic location information includes the latitude and longitude information and altitude information of the current location of the headset. The scene type initial information is information about the scene type in which the headset may be currently located, which is preliminarily determined based on the current geographic location information of the headset.

[0127] After extracting the current latitude and longitude information and altitude information of the headset from the denoised location information, the current geographic location information of the headset can be used to preliminarily determine the scene type that the headset is currently in through the geographic information database. It can be understood that after the geographic location information interacts with the geographic information database, the geographic information database can map the initial scene type that the current geographic location information of the headset may conform to. Due to the complexity of the actual scene, the initial scene type information preliminarily determined by the geographic location information may be a single scene type or multiple scene types. In order to ensure the comprehensiveness of the location feature sequence, all the scene types that are preliminarily determined to meet the requirements should be obtained as the initial scene type.

[0128] Specifically, the interaction between the geographic location information and the geographic information library can be achieved through a terminal connected to the headset. The interaction can be achieved through online interaction in the cloud, that is, the initial information of the scene type is determined through real-time data exchange between the terminal device and the cloud, or offline interaction, that is, the geographic information library can be pre-downloaded to the APP of the headset of the terminal. Preferably, the interaction method is offline interaction, which can better adapt to actual usage and improve the efficiency of obtaining the initial information of the scene type to a certain extent.

[0129] In a preferred embodiment, the user can choose to download the geographic information library of the required area in advance in the headset APP of the terminal according to their own usage needs. When the terminal receives a signal that requires the determination of the initial information of the scene type, the initial information of the scene type can be directly determined from the downloaded geographic information library, and then the initial information of the scene type corresponding to the current geographic location information can be determined relatively quickly. At the same time, after the headset is connected to the terminal, it will automatically trigger the detection of whether the geographic information library needs to be updated. If necessary, it will automatically update to ensure the accuracy of the initial scene type determined subsequently.

[0130] After determining the initial scene type information, the obtained initial scene type needs to be encoded and transformed to obtain a position feature sequence to ensure that the position feature sequence can be input into the improved Transformer model so as to be recognized and analyzed by the improved Transformer model.

[0131] It can be understood that the position feature sequence determined by the initial information of the scene type can be used to assist in adjusting the recognition weights of the proxy attention mechanism of the improved Transformer model according to the initial information of the scene type, thereby improving the accuracy of subsequent calculations of the proxy attention weights, thereby improving the accuracy and efficiency of the classification of complex sound scenes.

[0132] Furthermore, in a preferred embodiment, step S423 of extracting posture features from the denoised posture information to obtain a posture feature sequence includes:

[0133] S4231, extracting the current acceleration feature of the headset from the denoised posture information;

[0134] S4232. Encode and transform the acceleration features to obtain a posture feature sequence.

[0135] Among them, the acceleration feature can be used to reflect the current motion state of the headset, that is, the acceleration feature can be used to determine whether the headset is currently in a dynamic or static state as a whole, and then determine the current motion state of the user.

[0136] Specifically, acceleration data including acceleration components of the headset in the three directions of X-axis, Y-axis and Z-axis are obtained from the denoised posture information, and then the acceleration data are feature extracted to obtain acceleration features. It can be understood that acceleration features include but are not limited to peak acceleration, average acceleration, acceleration variance, etc., which can be selected and extracted according to actual design requirements.

[0137] After obtaining the required acceleration features, the obtained acceleration features are encoded and transformed to obtain a posture feature sequence, so as to ensure that the posture feature sequence can be input into the improved Transformer model so as to be recognized and analyzed by the improved Transformer model.

[0138] It can be understood that the posture feature sequence determined by the acceleration feature can determine the user's current motion state, and can assist in adjusting the recognition weights of the proxy attention mechanism of the improved Transformer model according to the user's current motion state, thereby improving the accuracy of subsequent calculations of the proxy attention weights, and thereby improving the accuracy and efficiency of the classification of complex sound scenes.

[0139] Further, in one embodiment, the audio feature sequence and the auxiliary feature sequence are input into an improved Transformer model configured with a proxy attention mechanism to obtain a matching value of a preset scene type. Step S43 includes:

[0140] S431, mapping and encoding the audio feature sequence and the auxiliary feature sequence to obtain an audio enhancement sequence and an auxiliary enhancement sequence respectively;

[0141] S432, obtaining an enhanced feature matrix based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism;

[0142] S433. Based on the preset fully connected layer and enhanced feature matrix, obtain the matching value of each scene type.

[0143] The audio enhancement sequence and the auxiliary enhancement sequence are high-dimensional data with sorting information obtained after the conversion of the audio feature sequence and the auxiliary feature sequence, respectively. The enhanced feature matrix is ​​data with weight information obtained after calculation through the proxy attention mechanism.

[0144] After the audio feature sequence and the auxiliary feature sequence are input into the improved Transformer model, the audio feature sequence and the auxiliary feature sequence need to be linearly mapped through the embedding layer respectively, and each feature vector in the audio feature sequence and the auxiliary feature sequence is mapped to a higher-dimensional embedding space, thereby obtaining an audio embedding vector sequence and an auxiliary embedding vector sequence respectively. After obtaining the audio embedding vector sequence and the auxiliary embedding vector sequence, since the improved Transformer model does not have built-in position information, it is also necessary to add position encoding to indicate the order of the feature vectors in the feature sequence. After completing the position encoding, the audio enhancement sequence and the auxiliary enhancement sequence can be obtained.

[0145] After the audio enhancement sequence and the auxiliary enhancement sequence are input into the proxy attention mechanism in the improved Transformer model, the proxy attention mechanism uses the audio enhancement sequence and the auxiliary enhancement sequence to perform two softmax attention operations respectively. Based on the overall level, from the perspective of multi-source feature information fusion, the initial attention weight matrix is ​​obtained, and then the initial attention matrix is ​​normalized to obtain the attention weight matrix. The attention weight matrix is ​​further used for weighted summation to obtain the enhanced feature matrix containing the weight information of each feature vector.

[0146] After obtaining the enhanced feature matrix output by the proxy attention mechanism, the enhanced feature matrix is ​​input into the fully connected layer, which then performs feature mapping on the enhanced feature matrix. That is, the fully connected layer performs a linear transformation on each feature vector in the enhanced feature matrix and outputs a vector with the same number of elements as the number of scene types, where each element of the vector corresponds to the prediction score of a scene type.

[0147] After completing the feature mapping and obtaining the prediction score, the softmax activation function is used to convert the obtained prediction score into a probability distribution between 0 and 1, and then the matching value of each scene type is obtained.

[0148] Furthermore, in a preferred embodiment, step S432 of obtaining an enhanced feature matrix based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism includes:

[0149] S4321, obtaining a first matrix, a second matrix, and a third matrix respectively according to the audio enhancement sequence and a preset conversion weight matrix;

[0150] S4322, obtaining a proxy matrix according to the auxiliary enhancement sequence and a preset proxy conversion matrix;

[0151] S4323, interactively calculating the proxy matrix, the second matrix, and the third matrix to obtain a fusion matrix;

[0152] S4324, interactively calculating the first matrix, the proxy matrix, and the fusion matrix to obtain an attention weight matrix;

[0153] S4325. Perform weighted summation on the attention weight matrix and the third matrix to obtain an enhanced feature matrix.

[0154] The conversion weight matrix is ​​obtained in advance through training and is used to convert the audio enhancement sequence into data that can be used by the agent attention mechanism. The conversion weight matrix includes a first conversion matrix W corresponding to the first matrix, the second matrix and the third matrix respectively. A , the second transformation matrix W K and the third transformation matrix W V The proxy conversion matrix is ​​data obtained in advance through training and used to convert the auxiliary enhancement sequence into a proxy matrix applied to the proxy attention mechanism.

[0155] Specifically, after the audio enhancement sequence is input into the proxy attention mechanism, the first transformation matrix W A , the second transformation matrix W K and the third transformation matrix W VThe first matrix, the second matrix and the third matrix are obtained by converting and calculating with the audio enhancement sequence respectively. After the auxiliary enhancement sequence is input into the proxy attention mechanism, the auxiliary enhancement sequence is calculated with the proxy conversion matrix to obtain the proxy matrix. The number of parameters of the proxy matrix is ​​much less than that of the first matrix.

[0156] After completing the conversion between the audio enhancement sequence and the auxiliary enhancement sequence, the first softmax attention operation is performed first, with the proxy matrix replacing the first matrix as the query matrix, the second matrix as the key matrix, and the third matrix as the value matrix, to achieve the interaction between the proxy matrix, the second matrix, and the third matrix, so as to aggregate the information in the audio enhancement sequence, and then fuse the aggregated information with the information in the auxiliary enhancement sequence. Specifically, each proxy vector in the proxy matrix is ​​dot-multiplied with each key vector in the second matrix to obtain a first attention score that reflects the strength of the correlation between different positions in the sequence, and then the first attention score is normalized to obtain a first attention weight, and then the first attention weight is weighted and summed with the value vector in the third matrix to obtain a fusion matrix.

[0157] It can be understood that by replacing the first matrix as the query matrix with a proxy matrix with fewer parameters, the direct interactive calculation between the first matrix and the second matrix can be avoided to reduce the complexity of the calculation. At the same time, a multi-source feature information fusion mechanism is established to integrate audio feature information, position feature information and posture feature information, so as to prepare for the subsequent recognition and classification of complex sound scenes.

[0158] For further information, please refer to Figure 3 In one embodiment, step S5 of determining the target scene type from preset scene types according to the position information and the ambient audio signal includes:

[0159] S51, respectively obtaining an ambient audio spectrum and key position information from the ambient audio signal and the position information;

[0160] S52, determining an initial scene type and an associated scene type from preset scene types based on the key position information;

[0161] S53, obtaining a number of energy characteristic values ​​according to the ambient audio spectrum and a preset extraction mode;

[0162] S54. Determine the target scene type from the initial scene type and the associated scene type according to the energy characteristic value.

[0163] Among them, the key position information is the marking parameter information used to reflect the position characteristics of the scene where the headset is currently located. The initial scene type is the scene type used for subsequent identification and judgment obtained from the preset scene types through the key position information. The associated scene type is a scene type that has a certain degree of similarity between the sound characteristics and the determined initial scene type. The energy characteristic value is the energy parameter information corresponding to the frequency band of the ambient audio spectrum, which can be used to reflect the energy characteristics of the ambient audio spectrum.

[0164] Specifically, a geographic information database that preliminarily determines the scene type based on the key location information is pre-set in the headset system or the headset's accompanying APP. By comparing the extracted key location information, the corresponding scene type can be confirmed. Similarly to the method of obtaining location information, the key location information can be extracted through the headset or through a terminal device connected to the headset.

[0165] After extracting the key position information from the position information, the initial scene type and the associated scene type can be determined respectively through the key position information, that is, the initial scene type and the associated scene type can be obtained respectively based on the degree of adaptation of the key position information; the initial scene type can also be determined first through the key position information, and then the associated scene type can be determined based on the degree of association between the initial scene type and other remaining scene types. It can be understood that the method of determining the initial scene type and the associated scene type through the key position information can relatively quickly perform preliminary screening of scene types, effectively reducing the number of scene types used for identification and comparison, improving the efficiency and accuracy of scene recognition, reducing the amount of calculation for subsequent scene recognition, and reducing the power consumption of the headset to a certain extent.

[0166] After the ambient audio signal is converted to obtain the ambient audio spectrum, the required energy characteristic value can be obtained based on the preset extraction mode. The extraction mode can be to extract the overall frequency band of the ambient audio spectrum, or to extract a specific frequency band of the ambient audio signal. Preferably, the extraction mode is to extract a specific frequency band of the ambient audio signal. It can be understood that since the human ear has different perceptual sensitivities to different frequencies, and the initial scene type and the associated scene type are both scene types obtained after preliminary screening, the specific frequency band of the ambient audio spectrum is extracted. In combination with the characteristics of the human ear, the feature information of the frequency band to which the human ear is relatively sensitive can be extracted with more emphasis. While improving the accuracy of feature extraction, the amount of feature information to be extracted can be reduced, thereby improving the efficiency and accuracy of screening using feature information in subsequent scene recognition.

[0167] Specifically, based on the preset extraction mode, several required intercepted spectra can be intercepted from the ambient audio spectrum, and then corresponding energy characteristic values ​​can be extracted from the obtained several intercepted spectra. The energy characteristic value can be the average value of the energy values ​​of each frequency on the intercepted spectrum, the maximum value of the energy values ​​of each frequency on the intercepted spectrum, or the variance value of the energy values ​​of each frequency on the intercepted spectrum.

[0168] After obtaining the energy characteristic value, the target scene type can be determined from the initial scene type and the associated scene type according to the energy characteristic value by obtaining the energy interval of the initial scene type and the associated scene type, and then comparing the energy characteristic value with the corresponding energy interval, and then screening the target scene type according to the number of energy characteristic values ​​falling into the energy interval; or it can be based on the preset energy characteristic value weight formula, calculate the energy integration value, and then compare it with the preset comparison interval to determine the target scene type. After determining the target scene type, the noise reduction parameters corresponding to the target scene type can be obtained, thereby realizing the adaptive noise reduction function of the headphones.

[0169] It can be understood that by utilizing key position information to obtain the initial scene type and the associated scene type, the scene types can be preliminarily screened relatively quickly, reducing the number of scene types that need to be identified. Combined with a number of energy eigenvalues, the initial scene type and the associated scene type can be further re-screened with more focus to obtain the target scene type, thereby optimizing the method of obtaining the target noise reduction parameters, reducing the amount of calculation for scene recognition, and improving the efficiency and accuracy of adaptive noise reduction. To a certain extent, it reduces the power consumption of the headphones and improves the user experience.

[0170] Further, in one embodiment, the step S52 of determining the initial scene type and the associated scene type from the preset scene types based on the key position information includes:

[0171] S521, obtaining an adaptation value between key position information and a preset scene type;

[0172] S522: Based on the adaptation, determine an initial scene type from preset scene types;

[0173] S523, obtaining the association value between the initial scene type and the remaining scene types;

[0174] S524: Obtain an associated scene type from the remaining scene types based on the associated value and a preset first threshold.

[0175] Among them, the adaptation value is the adaptation degree value between the key position information and each scene type, which can be used to quantify the adaptation degree between each scene type and the key position information. The association value reflects the similarity of the characteristics of each scene type on the spectrum. The association value is a parameter generated by pre-training and analyzing each scene type. Each scene type generates a corresponding association value for the other scene types. The first threshold is a value used for association value screening. The association value can be screened to obtain the associated scene type that meets the requirements.

[0176] Specifically, when obtaining the adaptation value of the key position information and the scene type, a weight relationship can be assigned to specific parameters in the key position information to determine the adaptation degree value of the key position information and each scene type, and then determine the initial scene type that meets the requirements. It is easy to understand that the number of initial scene types that can be determined by the key position information can be one or more, and can be set according to the actual design requirements to control the number of initial scene types obtained.

[0177] It can be understood that the method of using adaptation values ​​to filter the initial scene types can achieve quantitative filtering of the initial scene types, which can better control the number of initial scene types obtained. At the same time, the method of adaptation values ​​can also better control the number of subsequent associated scene types obtained.

[0178] After obtaining the adaptation value, the method of determining the initial scene type from the scene types according to the adaptation value can be by setting a comparison value for screening, and then screening out the initial scene type that meets the requirements; or it can be by screening out the scene type with the highest degree of adaptation in the adaptation value as the initial scene type, which can be selected according to actual design requirements.

[0179] In a preferred embodiment, the step S524 of obtaining the associated scene type from the remaining scene types based on the associated value and the preset first threshold includes:

[0180] S5241. Obtain the maximum value among the adaptation values ​​as the maximum adaptation value;

[0181] S5242. Obtain a preset adaptation value interval in which the maximum adaptation value falls, and use it as a target adaptation value interval;

[0182] S5243. Obtain a preset first threshold corresponding to the target adaptation value interval;

[0183] S5244, determining whether the correlation value is less than a first threshold;

[0184] S5245: If not, mark the scene type corresponding to the associated value as the associated scene type.

[0185] Among them, the adaptation value interval is a pre-set comparison interval for determining the first threshold corresponding to the maximum adaptation value. Each adaptation value interval corresponds to a first threshold. The larger the endpoint of the adaptation value interval, the larger the corresponding first threshold. The number and interval size of the adaptation value interval can be set according to actual design requirements.

[0186] Specifically, after obtaining the maximum adaptation value, the adaptation value interval in which the maximum adaptation value falls can be determined first, and then the corresponding first threshold value can be obtained according to the adaptation value interval in which it falls. When the maximum adaptation value is relatively high, a first threshold value with a relatively large value can be obtained, and when the maximum adaptation value is relatively low, a first threshold value with a relatively small value can be obtained.

[0187] It is easy to understand that by obtaining the corresponding first threshold based on the maximum adaptation value, it is possible to dynamically adjust the difficulty of obtaining associated scene types according to the degree of adaptation of the key position information and the scene type, thereby controlling the number of associated scene types obtained according to the adaptation value. That is, when the maximum adaptation value is relatively high, the size of the first threshold can be appropriately increased, which can effectively reduce the amount of associated scene models obtained, thereby improving the efficiency of subsequent scene recognition; when the maximum adaptation value is relatively low, the size of the first threshold can be appropriately reduced, and relatively more associated scene models can be obtained, thereby ensuring the accuracy of subsequent scene recognition.

[0188] Further, in one embodiment, step S53 of obtaining a plurality of energy characteristic values ​​according to the ambient audio spectrum and the preset extraction mode includes:

[0189] S531, obtaining a preset sensitive interception frequency band and a preset interception bandwidth;

[0190] S532, obtaining a plurality of target spectra according to the sensitive interception frequency band, the interception bandwidth and the ambient audio spectrum;

[0191] S533 , respectively calculating energy characteristic parameters of the target spectrum to obtain corresponding energy characteristic values.

[0192] The sensitive interception frequency band is a specific frequency range for feature extraction pre-set according to the auditory characteristics of the human ear. Preferably, the sensitive interception frequency band is 1000Hz to 4000Hz. The interception bandwidth is an interception unit for further intercepting the spectrum within the sensitive interception frequency band from the frequency dimension. The target spectrum is the spectrum obtained after two interceptions of the ambient audio spectrum, which is the spectrum calculation unit of the energy characteristic value.

[0193] After obtaining the ambient audio spectrum, the corresponding sensitive interception frequency band and interception bandwidth are obtained, and then the ambient audio spectrum is intercepted according to the obtained sensitive interception frequency band and interception bandwidth. Specifically, the ambient audio spectrum can be first processed according to the sensitive interception frequency band to obtain a sensitive spectrum, and then the sensitive spectrum is processed using the interception bandwidth to obtain several target spectra. The ambient audio spectrum can also be first processed according to the interception bandwidth to obtain several sub-spectra, and then the sub-spectra within the sensitive interception frequency band are obtained from the several sub-spectra as the target spectrum.

[0194] After obtaining a number of target spectra, the energy characteristic parameters in the target spectrum are extracted, and then the energy characteristic value is calculated. The energy characteristic value can be the energy average value in the target spectrum, the maximum value of the energy in the target spectrum, or the energy variance value in the target spectrum, which can be selected according to the actual design requirements. Preferably, the energy characteristic value is the energy average value of the target spectrum. It is easy to understand that the energy characteristic value is the energy average value in the target spectrum, which can better reflect the overall energy situation of the target spectrum and effectively reduce the impact of energy mutation.

[0195] It can be understood that by setting the sensitive interception frequency band and interception bandwidth, a target spectrum that is more in line with the auditory characteristics of the human ear can be obtained, and then energy eigenvalues ​​that are more in line with the auditory characteristics of the human ear and have a more obvious impact on the noise reduction effect can be extracted, thereby reducing the amount of computational cost of feature extraction, improving the efficiency and accuracy of feature extraction, and thus improving the efficiency and accuracy of subsequent scene recognition.

[0196] Further, in one embodiment, the step S54 of determining the target scene type from the initial scene type and the associated scene type according to the energy characteristic value includes:

[0197] S541, obtaining an energy interval of an initial scene type and an energy interval of an associated scene type;

[0198] S542, obtaining the number of energy characteristic values ​​falling into the energy interval of the initial scene type and the energy interval of the associated scene type;

[0199] S543: Based on the number of falls, obtain the target scene type.

[0200] The energy interval is the energy fluctuation interval of the corresponding frequency band in the scene type, which represents the acceptable range of energy fluctuation of the scene type in the corresponding frequency band. The falling number is the number of energy characteristic values ​​falling into the corresponding energy interval.

[0201] After obtaining the energy characteristic value, the energy interval of the initial scene type and the associated scene type is obtained, and then the energy characteristic value is compared with the energy interval corresponding to the initial scene type and the associated scene type item by item, and then the number of energy characteristic values ​​falling into the corresponding energy interval can be obtained. After obtaining the number of falls corresponding to the initial scene type and the associated scene type, the target scene type can be screened according to the specific situation of the number of falls. Specifically, by comparing the number of falls, the scene type corresponding to the maximum number of falls can be used as the target scene type; the corresponding situation can also be divided according to the number of maximum falls, and then the target scene type can be obtained; it can also be combined with the key position information and the adaptability of the scene type for comprehensive screening, and then the target scene type can be obtained.

[0202] Further, in a preferred embodiment, step S543 of obtaining the target scene type based on the number of falls includes:

[0203] S5431, obtaining the value of the maximum number of falling numbers among the falling numbers;

[0204] S5432: If the value is 1, the scene type corresponding to the maximum number of falls is marked as the target scene type;

[0205] S5433. If the value is greater than 1, obtain the adaptation value between the scene type corresponding to the maximum number of falls and the key position information;

[0206] S5434: Mark the scene type corresponding to the maximum value of the adaptation value as the target scene type.

[0207] After obtaining the number of falls, the numbers of falls are compared with each other to obtain the maximum number of falls, and then the number of the maximum number of falls can be obtained. When the number of the maximum number of falls is only one, it means that there is a scene type in which the degree of conformity of the energy characteristic values ​​of the human ear's high-sensitivity frequency band exists between the initial scene type and the associated scene type. Therefore, the scene type corresponding to the maximum number of falls can be directly used as the target scene type. When the number of the maximum number of falls is greater than one, the target scene type can be comprehensively determined in combination with the adaptation value of the key position information. By comparing the adaptation values ​​between the scene types corresponding to the maximum number of falls, the maximum adaptation value is determined, and the scene type corresponding to the maximum number of falls and the maximum adaptation value is used as the target scene type.

[0208] It can be understood that by comparing the energy characteristic value with the energy interval and based on the number of energy characteristic values ​​falling into the energy interval, the target scene type can be determined, and then the initial scene type and the associated scene type can be further re-screened, thereby optimizing the method of obtaining the target scene type and improving the efficiency and accuracy of scene type re-screening.

[0209] To summarize, the present application divides different noise reduction parameter acquisition modes according to the current power status of the earphone. When the current power of the earphone meets the power requirements, the improved Transformer model and multi-source feature information are used to achieve the identification and classification of complex audio scene types while maintaining low computational complexity; when the current power of the earphone does not meet the power requirements, the ambient audio signal and position information are combined to achieve rapid initial screening and side-by-side repeated screening of scene types, thereby realizing the function of dynamically enabling the corresponding noise reduction parameter acquisition mode based on the current power status of the earphone, reasonably configuring the noise reduction power consumption of the earphone, optimizing the method of obtaining noise reduction parameters, improving the efficiency and accuracy of adaptive noise reduction, and improving the adaptability of the earphone to cope with diverse user needs and usage scenarios, thereby improving the user experience.

[0210] The following is the content of the second aspect of the present invention:

[0211] The present invention provides an earphone, such as Figure 4 As shown, the headset includes a memory 10, a processor 20, and a method program instruction 30 for active noise reduction of the headset stored in the memory 10 and executable on the processor 20. When the method program instruction 30 for active noise reduction of the headset is executed by the processor 20, the aforementioned method for active noise reduction of the headset is implemented.

[0212] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of the headset. In this embodiment, the processor is used to run program codes stored in a readable storage medium or process data.

[0213] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a readable storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0214] The following is the content of the third aspect of the present invention:

[0215] The present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned headphone active noise reduction method are implemented.

[0216] The above is only a specific implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for active noise reduction of headphones, characterized in that: include: Get the current location information of the headset and the ambient audio signal; Detect whether the current power level of the headset is greater than the preset power threshold; If yes, obtain the current posture information of the headset; Based on the environmental audio signal, the position information, the posture information and the preset improved Transformer model configured with the proxy attention mechanism, determining the target scene type from the preset scene types; If not, determining a target scene type from preset scene types according to the position information and the ambient audio signal; A noise reduction parameter corresponding to the target scene type is obtained as a target noise reduction parameter.

2. The method for active noise reduction of headphones according to claim 1, characterized in that: The step of determining the target scene type from preset scene types based on the environmental audio signal, the position information, the posture information and the preset improved Transformer model configured with the proxy attention mechanism comprises: Extracting an audio feature sequence from the ambient audio signal; Extracting an auxiliary feature sequence from the position information and the posture information; Inputting the audio feature sequence and the auxiliary feature sequence into the improved Transformer model configured with the proxy attention mechanism to obtain a matching value of a preset scene type; The target scene type is determined according to the size of the matching value.

3. The method for active noise reduction of headphones according to claim 2, characterized in that: The step of inputting the audio feature sequence and the auxiliary feature sequence into the improved Transformer model configured with the proxy attention mechanism to obtain a matching value of a preset scene type comprises: Mapping and encoding the audio feature sequence and the auxiliary feature sequence to obtain an audio enhancement sequence and an auxiliary enhancement sequence respectively; Based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism, an enhancement feature matrix is ​​obtained; Based on the preset fully connected layer and the enhanced feature matrix, a matching value for each scene type is obtained.

4. The method for active noise reduction of headphones according to claim 3, characterized in that: The step of obtaining an enhanced feature matrix based on the audio enhancement sequence, the auxiliary enhancement sequence and the preset proxy attention mechanism includes: According to the audio enhancement sequence and a preset conversion weight matrix, a first matrix, a second matrix and a third matrix are obtained respectively; Obtaining a proxy matrix according to the auxiliary enhancement sequence and a preset proxy conversion matrix; Interactively calculating the proxy matrix, the second matrix and the third matrix to obtain a fusion matrix; Interactively calculate the first matrix, the proxy matrix and the fusion matrix to obtain an attention weight matrix; The attention weight matrix is ​​weighted and summed with the third matrix to obtain an enhanced feature matrix.

5. The method for active noise reduction of headphones according to claim 2, characterized in that: The step of extracting an auxiliary feature sequence from the position information and the posture information comprises: Preprocessing the position information and the attitude information respectively to obtain denoised position information and denoised attitude information; Extracting position features from the denoised position information to obtain a position feature sequence; Extracting posture features from the denoised posture information to obtain a posture feature sequence; The position feature sequence and the posture feature sequence are subjected to feature fusion to obtain an auxiliary feature sequence.

6. The method for active noise reduction of headphones according to claim 1, characterized in that: The step of determining the target scene type from preset scene types according to the position information and the ambient audio signal comprises: Acquire an ambient audio spectrum and key position information from the ambient audio signal and the position information respectively; Based on the key position information, determining an initial scene type and an associated scene type from preset scene types; According to the ambient audio spectrum and a preset extraction mode, a plurality of energy characteristic values ​​are obtained; According to the energy characteristic value, a target scene type is determined from the initial scene type and the associated scene type.

7. The method for active noise reduction of headphones according to claim 6, characterized in that: The step of determining the initial scene type and the associated scene type from the preset scene types based on the key position information includes: Obtaining an adaptation value between the key location information and a preset scene type; Based on the adaptation value, determining an initial scene type from preset scene types; Obtaining association values ​​between the initial scene type and the remaining scene types; Based on the association value and a preset first threshold, an associated scene type is obtained from the remaining scene types.

8. The method for active noise reduction of headphones according to claim 7, characterized in that: The step of obtaining the associated scene type from the remaining scene types based on the associated value and the preset first threshold comprises: Obtaining a maximum value among the adaptation values ​​as a maximum adaptation value; Obtaining a preset adaptation value interval within which the maximum adaptation value falls, and using the preset adaptation value interval as a target adaptation value interval; Obtaining a preset first threshold corresponding to the target adaptation value interval; Determining whether the correlation value is less than the first threshold; If not, the scene type corresponding to the associated value is marked as an associated scene type.

9. The method for active noise reduction of headphones according to claim 6, characterized in that: The step of determining the target scene type from the initial scene type and the associated scene type according to the energy characteristic value comprises: Acquire an energy interval of the initial scene type and an energy interval of an associated scene type; Obtaining the number of times that the energy characteristic value falls within the energy interval of the initial scene type and the energy interval of the associated scene type; Based on the falling number, a target scene type is obtained.

10. The method for active noise reduction of headphones according to claim 9, characterized in that: The step of obtaining the target scene type based on the falling number includes: Obtain the maximum number of falling numbers among the falling numbers; If the number is 1, the scene type corresponding to the maximum number of falls is marked as the target scene type; If the number is greater than 1, obtaining an adaptation value between the scene type corresponding to the maximum number of falls and the key position information; The scene type corresponding to the maximum value of the adaptation values ​​is marked as the target scene type.

Citation Information

Cited By

  • Bluetooth earphone noise reduction prompting method and Bluetooth earphone

    CN119653280A

  • System and method of adaptive noise reduction earphone magnetic type charging box

    CN119893379A

  • System and method for a magnetic charging case of an adaptive noise-canceling headphone

    CN119893379B