Control method for noise reduction of earphone

By using an improved Transformer model and proxy attention mechanism in wireless headphones, combining ambient audio signals, position and attitude information to identify and classify noise scenarios, the problem of low adaptive noise reduction efficiency and accuracy in the prior art is solved, and the problem of low adaptive noise reduction efficiency and accuracy is optimized. Power consumption configuration improves user experience.

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

Patent Information

Application Number
CN202411159685.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-10
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The existing wireless headphone adaptive noise reduction technology has low efficiency and accuracy when identifying noise scenarios, and its power consumption configuration is unreasonable, which affects the user experience.

Method used

By obtaining the ambient audio signal, position information and attitude information of the headphones, using the improved Transformer model and agent attention mechanism, combining multi-source feature information, identifying and classifying complex audio scenarios, optimizing the acquisition method of noise reduction parameters, reducing power consumption, and improving identification Efficiency and accuracy.

Benefits of technology

It realizes rapid identification and classification of complex audio scenarios, improves the efficiency and accuracy of adaptive noise reduction, enhances the adaptability of headphones to diverse usage needs and scenarios, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110198A_ABST
    Figure CN119110198A_ABST
Patent Text Reader

Abstract

The invention discloses a control method for noise reduction of an earphone. The control method comprises the following steps: acquiring an environment audio signal of a current scene of the earphone; detecting whether the current position information of the earphone can be obtained or not; if not, determining a target scene type according to the environment audio signal; if yes, acquiring current position information and residual electric quantity parameters of the earphone; detecting whether the residual electric quantity parameter is greater than a preset electric quantity threshold; if not, determining a target scene type according to the position information and the environment audio signal; if yes, obtaining current posture information of the earphone; determining a target scene type based on the environment audio signal, the position information, the attitude information and a preset improved Transform model configured with an agency attention mechanism; and obtaining a noise reduction parameter corresponding to the target scene type as a target noise reduction parameter. According to the invention, different noise reduction parameter acquisition modes are divided based on the position information and the electric quantity state, the acquisition mode of the target noise reduction parameter is optimized, and the efficiency and accuracy of adaptive noise reduction are 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 method for controlling headphone noise reduction. 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 control method for headphone noise reduction to solve the above problems. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a control method for headphone noise reduction, which aims to solve the technical problems of low scene recognition efficiency and accuracy of headphone adaptive noise reduction, unreasonable power consumption configuration, 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 controlling headphone noise reduction, which comprises:

[0007] Get the ambient audio signal of the current scene of the headset;

[0008] Check whether the current location information of the headset can be obtained;

[0009] If not, determining the target scene type based on the ambient audio signal;

[0010] If yes, obtain the current location information and remaining power parameters of the headset;

[0011] Detect whether the remaining power parameter is greater than a preset power threshold;

[0012] If not, the target scene type is determined based on the location information and the ambient audio signal;

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

[0014] Determine the target scene type based on the ambient audio signal, location information, posture information and the preset improved Transformer model configured with the proxy attention mechanism;

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

[0016] In a preferred embodiment, the step of determining the target scene type according to the ambient audio signal includes:

[0017] Obtaining a first spectrum and a second spectrum according to the ambient audio signal;

[0018] Based on the first spectrum and the preset first extraction mode, an amplitude feature matrix is ​​obtained;

[0019] Based on the second spectrum and the preset second extraction mode, a plurality of energy characteristic values ​​are obtained;

[0020] Obtaining a similarity coefficient between the amplitude feature matrix and a comparison matrix of a preset scene type;

[0021] Based on the similarity coefficient, a specific scene type is selected from the scene types;

[0022] Determine the target scene type based on the energy eigenvalue, similarity coefficient and specific scene type

[0023] In a preferred embodiment, the step of obtaining the amplitude characteristic matrix based on the first spectrum and the preset first extraction mode includes:

[0024] Obtaining a preset interception time width, a first interception frequency width and an initial matrix;

[0025] Based on the first spectrum, the interception time width and the first interception frequency width, a plurality of first target spectrums are obtained;

[0026] sequentially associating the first target spectrum with the elements of the initial matrix one by one;

[0027] respectively calculating the amplitude characteristic parameters of the first target spectrum;

[0028] According to the size of the amplitude characteristic parameter, the position of the corresponding element on the same preset target dimension in the initial matrix is ​​adjusted to obtain the amplitude characteristic matrix.

[0029] In a preferred embodiment, the step of determining the target scene type according to the energy characteristic value, the similarity coefficient and the specific scene type includes:

[0030] Get the preset energy range for a specific scene type;

[0031] Determine in turn whether the energy characteristic value falls into the corresponding energy interval;

[0032] Obtaining the number of energy characteristic values ​​falling into the energy interval of each specific scene type;

[0033] Based on the number of falls and the similarity coefficient, the target scene type is determined from the specific scene types.

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

[0035] Obtain key location information from the location information;

[0036] Obtaining an ambient audio spectrum from an ambient audio signal;

[0037] Based on the key location information, determine the initial scene type and the associated scene type;

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

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

[0040] In a preferred embodiment, the step of determining the initial scene type and the associated scene type based on the key location information includes:

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

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

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

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

[0045] 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:

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

[0047] 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;

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

[0049] 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 includes:

[0050] Extracting an audio feature sequence from an ambient audio signal;

[0051] Extracting auxiliary feature sequences from position information and posture information;

[0052] The audio feature sequence and the auxiliary feature sequence are input into the improved Transformer model configured with the proxy attention mechanism to obtain the matching value of each scene type;

[0053] According to the size of the matching value, the target scene type is obtained.

[0054] 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 the matching value of each scene type includes:

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

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

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

[0058] 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:

[0059] 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;

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

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

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

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

[0064] A second aspect of the present invention provides a headset, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned methods for controlling headset noise reduction are implemented.

[0065] 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 headphone noise reduction control methods are implemented.

[0066] The beneficial effects of the present invention are as follows: it divides the modes of obtaining noise reduction parameters according to different parameter information through the current position information and the remaining power of the earphone; when the position information is not obtained, the ambient audio signal is directly used for scene recognition to realize rapid determination of the scene type; after the position information is obtained, if the power does not meet the requirements, the ambient audio signal and the position information are combined to realize rapid initial screening and secondary screening of the scene type; if the power meets the requirements, the improved Transformer model and multi-source feature information are used to realize identification and classification of complex audio scene types while maintaining low computational complexity; the noise reduction power consumption of the earphone is reasonably configured, the method of obtaining the noise reduction parameters is optimized, the efficiency and accuracy of the adaptive noise reduction are improved, the adaptability of the earphone to cope with the diverse usage needs and usage scenarios of users is improved, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A first flow chart of the method for controlling headphone noise reduction disclosed in an embodiment of the present invention;

[0068] Figure 2 A second flow chart of the headphone noise reduction control method disclosed in an embodiment of the present invention;

[0069] Figure 3 A third flow chart of the method for controlling headphone noise reduction disclosed in an embodiment of the present invention;

[0070] Figure 4 A fourth flow chart of the method for controlling headphone noise reduction disclosed in an embodiment of the present invention;

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

[0072] 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.

[0073] 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.

[0074] In addition, some of the above terms may be used to express other meanings in addition to indicating a direction or position 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.

[0075] 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.

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

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

[0078] S1. Obtain the ambient audio signal of the current scene of the headset.

[0079] 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.

[0080] 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.

[0081] S2, detecting whether the current location information of the headset can be obtained;

[0082] S3: If the current position information of the earphone cannot be obtained, the target scene type is determined according to the ambient audio signal.

[0083] Among them, the location information of the earphone can be the location information with the earphone as the positioning center, or it can be the location information with the positioning center of the terminal device connected to the earphone. Accordingly, the method of obtaining the location information of the earphone can be direct acquisition or indirect acquisition. Specifically, a positioning module can be set inside the earphone, and the location information of the current earphone 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 earphone. In the daily use of the earphone, the earphone 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 earphone. Specifically, by detecting the output of the positioning module inside the earphone or the output of the terminal to which the earphone is connected, the acquisition of the current location information of the earphone can be determined.

[0084] By detecting whether the current position information of the earphone can be obtained, it can be determined whether the type of scene the earphone is currently in can be identified in combination with the position information, so as to trigger a mode of obtaining the target noise reduction parameters based on different types of parameter information. After detecting that the current position information of the earphone has not been obtained, the ambient audio signal can be converted into an ambient audio spectrum, and then the corresponding audio feature information can be extracted from the ambient audio spectrum to determine the type of scene the earphone is currently in from the preset scene type. Specifically, the ambient audio signal can be converted into a single type of ambient audio spectrum, or it can be converted into different types of ambient audio spectrum. Correspondingly, the audio features extracted from the ambient audio spectrum can also be a single type of audio feature information, or it can be multiple types of audio feature information. Therefore, the target scene type can be determined based on a single type of audio feature information, or it can be determined based on multiple types of audio feature information. Preferably, the method of determining the target scene type based on multiple types of audio feature information is adopted. It is easy to understand that the target scene type can be determined relatively more accurately through multiple types of audio feature information.

[0085] S4. If the current location information of the headset can be obtained, the current location information of the headset and the remaining power parameter are obtained;

[0086] S5, detecting whether the remaining power parameter is greater than a preset power threshold;

[0087] S6. If the remaining power parameter is not greater than the power threshold, determine the target scene type according to the location information and the ambient audio signal.

[0088] The power threshold is a pre-set power parameter used to distinguish and trigger different noise reduction parameter acquisition modes, and can be set according to actual design requirements.

[0089] After obtaining the current position information and remaining power parameters of the headset, the remaining power parameters are compared with the power threshold, and then the corresponding target noise reduction parameter acquisition mode is enabled based on the comparison result between the remaining power parameters and the power threshold.

[0090] When it is determined that the remaining power parameter is not greater than the power threshold, it means that the current power of the headset is relatively low, and the battery life of the headset should be prioritized. The target noise reduction parameter acquisition mode that prioritizes the battery life of the headset can be enabled. After the corresponding target noise reduction parameter acquisition mode is triggered, the required audio feature information and position feature information are respectively extracted from the position information and the ambient audio signal, and then the target scene type is determined from the preset scene types using the obtained audio feature information.

[0091] 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.

[0092] 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.

[0093] S7. If the remaining power parameter is greater than the power threshold, obtain the current posture information of the headset;

[0094] S8, determining the target scene type based on the ambient audio signal, location information, posture information and the preset improved Transformer model configured with the proxy attention mechanism;

[0095] S9. Obtain a noise reduction parameter corresponding to the target scene type as a target noise reduction parameter.

[0096] Among them, the improved Transformer model uses the encoding module of the Transformer model and uses 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, and introduces a set of additional proxy vectors A with fewer parameters in the original attention mechanism's ternary attention paradigm (Q, K, V), forming a new quaternary proxy attention paradigm (Q, A, K, V).

[0097] When it is determined that the remaining power parameter is greater than the power threshold, it means that the current power of the headset is relatively large, which can support the headset to perform a target noise reduction parameter acquisition mode with higher recognition and analysis accuracy. After triggering the corresponding target noise reduction parameter acquisition mode, 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 acceleration sensor, a gyroscope, a magnetic sensor, etc.

[0098] 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.

[0099] 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.

[0100] It is understandable that when the remaining power of the headset is relatively high, the recognition and classification function of the complex audio scene in which the headset is 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 headset in recognizing complex audio scenes is improved, thereby improving the matching degree of the headset's adaptive noise reduction, improving the effect of the headset's adaptive noise reduction, and improving the user experience.

[0101] After determining the corresponding target noise reduction parameter acquisition mode based on the current position information and remaining power parameters of the headset, the corresponding target noise reduction parameter acquisition mode is started, and the target scene type is determined based on the required parameter information. Then, the pre-set noise reduction parameters corresponding to the target scene type are obtained to obtain the target noise reduction parameters suitable for the current scene in which the headset is located.

[0102] It can be understood that the present application divides the modes of obtaining noise reduction parameters according to different parameter information through the current position information and the remaining power of the earphones. When the position information is not obtained, the ambient audio signal is directly used for scene recognition to realize rapid determination of the scene type; after obtaining the position information, if the power does not meet the requirements, the ambient audio signal and the position information are combined to realize rapid initial screening and secondary screening of the scene type; if the power meets the requirements, the improved Transformer model and multi-source feature information are used to realize the identification and classification of complex audio scene types while maintaining low computational complexity; 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, the adaptability of the earphones to cope with diverse user needs and usage scenarios is improved, and the user experience is improved.

[0103] For further information, please refer to Figure 2 In one embodiment, step S3 of determining the target scene type according to the ambient audio signal includes:

[0104] S31, obtaining a first spectrum and a second spectrum according to an ambient audio signal;

[0105] S32, obtaining an amplitude feature matrix based on the first spectrum and a preset first extraction mode;

[0106] S33, obtaining a plurality of energy characteristic values ​​based on the second spectrum and a preset second extraction mode;

[0107] S34, obtaining a similarity coefficient between the amplitude feature matrix and a comparison matrix of a preset scene type;

[0108] S35, filtering out a specific scene type from the scene types based on the similarity coefficient;

[0109] S36. Determine the target scene type according to the energy characteristic value, the similarity coefficient and the specific scene type.

[0110] The first spectrum and the second spectrum are both audio spectra obtained by converting the ambient audio signal, and the spectrum type of the first spectrum is different from the spectrum type of the second spectrum. The first spectrum and the second spectrum can be selected from spectrum types such as spectrum obtained by short-time Fourier transform and Mel spectrum. Preferably, the first spectrum is a spectrum obtained by short-time Fourier transform, and the second spectrum is a Mel spectrum.

[0111] The first extraction mode is an extraction logic method for extracting features according to the characteristics of the first spectrum. The amplitude feature matrix is ​​a matrix obtained from the first spectrum based on the first extraction mode, which can, to a certain extent, represent the characteristics of the amplitude intensity changes of the ambient audio signal in each frequency band at the overall level.

[0112] The second extraction mode is an extraction logic method for extracting features set according to the characteristics of the second spectrum. The energy characteristic value is energy parameter information corresponding to the frequency band in the second spectrum, which can be used to represent the energy situation of the frequency band.

[0113] The comparison matrix is ​​a matrix extracted from the pre-trained scene types and can be used to match and compare with the amplitude feature matrix. The similarity coefficient is a reflection value of the similarity between the amplitude feature matrix and the comparison matrix. The specific scene type is a scene type in which the matching degree between the comparison matrix and the amplitude feature matrix meets the requirements.

[0114] Specifically, after the ambient audio signal is converted into the first spectrum, the first extraction mode is started, and the first spectrum can be segmented based on the two dimensions of time and frequency to obtain the required first target spectrum. Specifically, the first spectrum can be intercepted from the time dimension and then from the frequency dimension to obtain the first target spectrum; or the first spectrum can be intercepted from the frequency dimension and then from the time dimension to obtain the first target spectrum.

[0115] After obtaining the required first target spectrum, the amplitude parameters corresponding to each first target spectrum are calculated respectively. Specifically, the amplitude can be the maximum value of the amplitude in the corresponding first target spectrum, or the average value of the amplitude in the corresponding first target spectrum, or the variance of the amplitude in the corresponding first target spectrum. Preferably, the amplitude is the average value of the amplitude in the first target spectrum. It can be understood that the selection of the average value can better represent the overall situation of the amplitude in the first target spectrum, and can effectively reduce the interference of the mutation signal.

[0116] After obtaining the first target spectrum and the corresponding amplitude parameters, the amplitude characteristic matrix can be obtained by marking the first target spectrum with a serial number, and arranging the aforementioned serial numbers based on the arrangement of the positions of the first target spectrum in the first spectrum to obtain an initial matrix, and adjusting the positions of the elements under the same target dimension in the initial matrix according to the amplitude and the preset target dimension, thereby obtaining the amplitude characteristic matrix. For example, the first spectrum has the time dimension as the row (or horizontal axis) and the frequency dimension as the column (or vertical axis), and the serial numbers of the first target spectrum are arranged based on the arrangement of the time dimension and the frequency dimension of the first spectrum to obtain the initial matrix, then the column dimension of the initial matrix is ​​the target dimension, and the elements in the same column are sorted according to the amplitude corresponding to each serial number to obtain the amplitude characteristic matrix.

[0117] It is easy to understand that the arrangement of elements in the amplitude feature matrix reflects, to a certain extent, the changes in amplitude intensity between frequency bands in the same time dimension. Therefore, the characteristics of the amplitude intensity changes of the ambient audio signal of the scene in which the headphones are currently located at the overall level can be determined. Furthermore, based on the similarity between the amplitude feature matrix and the comparison matrix, the degree of match between the current scene in which the headphones are located and the scene type can be determined.

[0118] The method for obtaining the amplitude characteristic matrix can also be to pre-set an initial matrix, the number of elements in the initial matrix is ​​the same as the number of the first target spectrum, the position arrangement method of the elements in the initial matrix is ​​the same as the position arrangement method of the first target spectrum in the first spectrum, and the first target spectrum is sequentially associated with the elements in the preset initial matrix one-to-one, and then according to the amplitude corresponding to the first target spectrum, the arrangement position of the elements under the same target dimension in the initial matrix is ​​adjusted to obtain the amplitude characteristic matrix.

[0119] After obtaining the second spectrum, the frequency band to which the human ear is relatively sensitive can be intercepted, and then the intercepted spectrum can be intercepted again according to the preset bandwidth to obtain several second target spectra. Alternatively, the spectrum can be intercepted first with the preset bandwidth, and then the spectrum in the frequency band to which the human ear is relatively sensitive can be obtained to obtain several second target spectra.

[0120] After obtaining a number of second target spectra, the energy characteristic values ​​corresponding to the second target spectra are calculated respectively. The energy characteristic value can be the maximum energy value in the second target spectrum, or it can be the energy average value of the second target spectrum. Preferably, the energy characteristic value is the energy average value, which can better reflect the energy distribution of a specific frequency band of the second target spectrum.

[0121] After obtaining the amplitude feature matrix, the preset comparison matrix of each scene type can be obtained, and then the similarity coefficient between the amplitude feature matrix and the comparison matrix can be calculated item by item based on the calculation formula of the similarity coefficient. Specifically, the dimensional similarity coefficient values ​​between the amplitude feature matrix and the comparison matrix on the same preset target dimension can be calculated respectively, and then the similarity coefficient between the amplitude feature matrix and the comparison matrix can be obtained based on the dimensional similarity coefficient. The calculation formula of the similarity coefficient can be a cosine similarity calculation formula, or a Euclidean distance calculation formula, etc., which can be selected according to the actual design requirements. After obtaining the dimensional similarity coefficient, the average value of the similarity coefficient of each dimension can be calculated as the similarity coefficient between the amplitude feature matrix and the comparison matrix, or the similarity coefficient of each dimension can be weighted to obtain the similarity coefficient between the amplitude feature matrix and the comparison matrix, which can be selected according to the actual design requirements.

[0122] After obtaining the similarity coefficients of the amplitude feature matrix and each comparison matrix, the matching degree between the current scene of the headset and each preset scene type can be determined, and then the required specific scene type can be screened out from the preset scene types by whether the similarity coefficient meets the preset requirements. It is easy to understand that specific scene types can be screened out from the preset scene types based on the size of the similarity coefficient, and a preset number of specific scene types can be screened out from the preset scene types by obtaining the required number of similarity coefficients.

[0123] After obtaining the energy characteristic value, similarity coefficient and specific scene type, the energy interval corresponding to the preset frequency band of each specific scene type can be obtained, and then it can be determined whether the energy characteristic value is within the corresponding energy interval. After obtaining the situation where the energy characteristic value falls into the energy interval, the target scene type can be progressively screened from the specific scene type according to the falling situation of the energy characteristic value and the size of the similarity coefficient; the target scene type can also be screened out from the specific scene type by combining the falling situation of the energy characteristic value, the similarity coefficient and the preset weight coefficient; or the above two methods can be combined to screen out the target scene type from the specific scene type, and the selection can be made according to the actual design requirements.

[0124] It can be understood that by utilizing the dual-spectrum and dual-extraction recognition and screening methods, hierarchical recognition and screening of scene types are carried out from different feature angles, and the similarity coefficients of the amplitude feature matrix and the comparative amplitude feature matrix are used to preliminarily screen the scene types from an overall level. Then, combined with the energy eigenvalues ​​and the similarity coefficients, the specific scene types are re-screened from the local level of the sensitive frequency band to determine the target scene type, thereby optimizing the method of obtaining headphone noise reduction parameters, improving the efficiency and accuracy of scene recognition, reducing the computational complexity of scene recognition, reducing the power consumption of headphones, and improving the user experience.

[0125] Further, in one embodiment, the step S32 of obtaining the amplitude characteristic matrix based on the first spectrum and the preset first extraction mode includes:

[0126] S321, obtaining a preset interception time width, a first interception frequency bandwidth and an initial matrix;

[0127] S322, obtaining a plurality of first target spectra based on the first spectrum, the interception time width and the first interception frequency width;

[0128] S323, sequentially associating the first target spectrum with the elements of the initial matrix in a one-to-one correspondence;

[0129] S324, respectively calculating the amplitude characteristic parameters of the first target spectrum;

[0130] S325. According to the magnitude of the amplitude characteristic parameter, the positions of the corresponding elements on the same preset target dimension in the initial matrix are adjusted to obtain the amplitude characteristic matrix.

[0131] Among them, the interception time width is the frame number interception unit for segmenting the first spectrum from the time dimension. The first interception bandwidth is the frequency interception unit for segmenting the first spectrum from the frequency dimension. The parameter sizes of the interception time width and the first interception bandwidth can be set according to the actual design requirements. The first target spectrum is the spectrum obtained after the first spectrum is intercepted in both time and frequency dimensions. The initial matrix is ​​a pre-set matrix that can be used to associate several first target spectra. The target dimension is a row dimension or a column dimension, and the type of the target dimension depends on the dimension where the time dimension in the first spectrum is located.

[0132] After the first spectrum is obtained, the corresponding first extraction mode is triggered to obtain the preset interception time width, the first interception frequency width and the initial matrix. According to the interception time width and the first interception frequency width, the first spectrum is segmented from the time dimension and the frequency dimension to obtain a plurality of first target spectra.

[0133] After obtaining a number of first target spectra, the first target spectra are sequentially associated with the elements of the initial matrix one-to-one according to the position arrangement of the first target spectra in the first spectrum. That is, after intercepting the time dimension and the frequency dimension, the arrangement of the first target spectra in the first spectrum can be regarded as a specific matrix, and the specific matrix can be associated one-to-one with the elements in the same position in the initial matrix. For example, in the first spectrum, the first target spectra in the first column are A1, A2, and A3, the first target spectra in the second column are B1, B2, and B3, and the first target spectra in the third column are C1, C2, and C3, while in the initial matrix, the elements in the first column are X1, X2, and X3, the elements in the second column are Y1, Y2, and Y3, and the elements in the third column are Z1, Z2, and Z3, then A1, A2, and A3 can be associated one-to-one with X1, X2, and X3, B1, B2, and B3 can be associated one-to-one with Y1, Y2, and Y3, and C1, C2, and C3 can be associated one-to-one with Z1, Z2, and Z3.

[0134] Calculate the amplitude characteristic parameters of the first target spectrum respectively. The amplitude characteristic parameters can be the average amplitude of the first target spectrum, the maximum amplitude of the first target spectrum, or the amplitude variance of the first target spectrum, which can be selected according to the actual design requirements. After calculating the amplitude characteristic parameters of each first target spectrum, adjust the position of the corresponding elements on the same preset target dimension in the initial matrix according to the size of the amplitude characteristic parameters. Specifically, if the time dimension is the row dimension in the first spectrum, the target dimension is the column dimension; if the time dimension is the column dimension in the first spectrum, the target dimension is the row dimension. After adjusting the position of the elements in the initial matrix, the amplitude characteristic matrix can be obtained.

[0135] It can be understood that by adjusting the position of the elements in the initial matrix according to the size of the amplitude characteristic parameters of the first target spectrum to obtain the amplitude characteristic matrix, the characteristics of the amplitude intensity changes in different frequency bands of the ambient audio signal under the same time dimension can be relatively clearly reflected, thereby reflecting the characteristics of the amplitude intensity changes on the overall level, thereby improving the efficiency of feature information extraction and the efficiency of subsequent scene recognition and screening.

[0136] Further, in one embodiment, the step S33 of obtaining a plurality of energy characteristic values ​​based on the second spectrum and the preset second extraction mode includes:

[0137] S331, obtaining a preset sensitive frequency range and a second interception bandwidth;

[0138] S332, obtaining a plurality of second target spectra based on the second spectrum, the sensitive frequency range and the second interception bandwidth;

[0139] S333. Calculate energy characteristic parameters of the second target spectrum respectively to obtain energy characteristic values.

[0140] Among them, the sensitive frequency range is a specific frequency range for feature extraction pre-set according to the auditory characteristics of the human ear. Preferably, the sensitive frequency range is 1000Hz to 4000Hz. The second interception bandwidth is the interception unit for intercepting the spectrum within the sensitive frequency range from the frequency dimension. The second target spectrum is the spectrum obtained after the second spectrum is intercepted twice. The energy characteristic parameter is the energy characteristic information extracted from the second target spectrum.

[0141] After obtaining the second spectrum, the corresponding second extraction mode is triggered to obtain the preset sensitive frequency range and the second interception bandwidth, and then the second spectrum is intercepted according to the sensitive frequency range and the second interception bandwidth. Specifically, the second spectrum can be processed according to the sensitive frequency range to obtain the sensitive spectrum, and then the sensitive spectrum can be processed using the second interception bandwidth to obtain several second target spectra. It can also be that the second spectrum is first processed according to the second interception bandwidth to obtain several second sub-spectra, and then the second sub-spectra within the sensitive frequency range are obtained from the several second sub-spectra as the second target spectrum. It is easy to understand that since the human ear has different perceptual sensitivities to different frequencies, based on the difference in frequency sensitivity, the spectrum of the frequency range to which the human ear is relatively sensitive is obtained from the second spectrum as the second target spectrum, which can obtain a feature extraction range that is more in line with the auditory characteristics of the human ear and has a more obvious impact on the noise reduction effect, reducing the amount of required feature extraction, improving the efficiency of subsequent feature extraction, and at the same time reducing the calculation of subsequent scene recognition, improving the efficiency and accuracy of scene recognition.

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

[0143] It can be understood that by setting the sensitive frequency range and the second cutoff bandwidth, a second target spectrum that is more in line with the auditory characteristics of the human ear can be obtained, and then an energy eigenvalue that is more in line with the auditory characteristics of the human ear and has a more obvious impact on the noise reduction effect can be obtained, 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.

[0144] Furthermore, in a preferred embodiment, the step S34 of obtaining the similarity coefficient between the amplitude feature matrix and the comparison matrix of the preset scene type includes:

[0145] S341, obtaining a comparison matrix of preset scene types;

[0146] S342. According to the cosine similarity formula, a number of initial similarity coefficients between the amplitude feature matrix and the comparison matrix in a preset target dimension are obtained;

[0147] S343. Calculate the average value of the initial similarity coefficients to obtain the similarity coefficients between the amplitude feature matrix and the comparison matrix.

[0148] Among them, the target dimension is a row dimension or a column dimension, and the type of the target dimension depends on the dimension where the time dimension in the first spectrum is located. Specifically, if the time dimension in the first spectrum is a row dimension, the target dimension is a column dimension; if the time dimension in the first spectrum is a column dimension, the target dimension is a row dimension.

[0149] After obtaining the amplitude feature matrix, the comparison matrix of the preset scene type can be obtained, and the similarity coefficients between the amplitude feature matrix and each comparison matrix can be calculated respectively. Take the time dimension as the row dimension in the first spectrum and the target dimension as the column dimension as an example for explanation. Specifically, according to the cosine similarity formula, the initial similarity coefficients between the amplitude feature matrix and the comparison matrix in the column dimension are calculated respectively, that is, the similarity degree of the corresponding column vectors between the amplitude feature matrix and the comparison matrix is ​​calculated. After obtaining the initial similarity coefficients of each column vector, the average value of the initial similarity coefficients is calculated respectively, and the similarity coefficients between the amplitude feature matrix and the comparison matrix can be obtained. Then, according to the same calculation method, the similarity coefficients between the amplitude feature matrix and each comparison matrix can be obtained in turn.

[0150] It can be understood that by calculating the initial similarity coefficients between the amplitude feature matrix and the comparison matrix, and then using the average value of the initial similarity coefficients as the similarity coefficients between the amplitude feature matrix and the comparison matrix, the similarity between the amplitude feature matrix and the comparison matrix can be relatively better reflected, thereby improving the efficiency and accuracy of the subsequent preliminary screening of scene recognition.

[0151] Further, in a preferred embodiment, the step S35 of selecting a specific scene type from the scene types based on the similarity coefficient includes:

[0152] S351, obtaining the maximum value among the similarity coefficients as the maximum similarity coefficient;

[0153] S352, obtaining a corresponding comparison value according to the maximum similarity coefficient;

[0154] S353, determining whether the similarity coefficient is less than the comparison value one by one;

[0155] S354, if not, marking the similarity coefficient as the target similarity coefficient;

[0156] S353. Filter out a specific scene type from the scene types according to the target similarity coefficient.

[0157] Among them, the comparison value is used to compare with the similarity coefficient to screen out the parameters of the target similarity coefficient that meets the requirements.

[0158] Specifically, after obtaining the similarity coefficients, the similarity coefficients can be compared with each other to determine the maximum value among the similarity coefficients, and then the maximum similarity coefficient is obtained. After obtaining the maximum similarity coefficient, the maximum similarity coefficient is compared with a plurality of preset comparison intervals, each comparison interval is preset with a corresponding comparison value, and the larger the endpoint value of the comparison interval, the larger the corresponding comparison value. After determining the comparison interval in which the maximum similarity coefficient falls, the comparison value corresponding to the comparison interval can be obtained, and then the similarity coefficient is compared with the obtained comparison value, and then the target similarity coefficient that meets the requirements can be determined.

[0159] It is easy to understand that when the value of the maximum similarity coefficient is relatively large, the value of the comparison value obtained is also relatively large, which can reduce the number of target similarity coefficients obtained subsequently to a certain extent, thereby reducing the number of specific scene types and improving the efficiency of subsequent scene recognition. When the value of the maximum similarity coefficient is relatively small, the value of the comparison value obtained is also relatively small, thereby increasing the target similarity coefficients obtained to a certain extent, thereby increasing the number of specific scene types and improving the accuracy of subsequent scene recognition.

[0160] It can be understood that by obtaining the corresponding comparison value based on the maximum similarity coefficient, it is possible to dynamically adjust the number of target similarity coefficients obtained, and then control the number of specific scene types obtained subsequently according to the numerical value of the maximum similarity coefficient, so as to improve the efficiency and accuracy of subsequent scene type recognition to a certain extent.

[0161] Furthermore, in one embodiment, the step S36 of determining the target scene type according to the energy characteristic value, the similarity coefficient and the specific scene type includes:

[0162] S361, obtaining a preset energy range for a specific scene type;

[0163] S362, determining in sequence whether the energy characteristic values ​​fall into the corresponding energy interval;

[0164] S363, obtaining the number of energy characteristic values ​​falling into the energy interval of each specific scene type;

[0165] S364: Determine the target scene type from the specific scene types based on the number of falls and the similarity coefficient.

[0166] 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.

[0167] Each scene type has a preset energy range for comparison. After obtaining a number of energy characteristic values ​​and specific scene types, the energy range corresponding to the specific scene type can be obtained. The obtained energy characteristic values ​​are then compared item by item with the energy range corresponding to each specific scene type, and the number of energy characteristic values ​​that fall into the corresponding energy range is obtained.

[0168] Since the energy characteristic value is extracted based on a specific frequency band to which the human ear is relatively sensitive, there may be a situation where similar scene types have the same number of falls. Therefore, the number of falls and the similarity coefficient can be combined to determine the target scene type from the specific scene type. Specifically, the target scene type can be determined by weighting the number of falls and the similarity coefficient, and then determining the target scene type from the specific scene type; or the number of falls and the similarity coefficient can be used for conditional screening to determine the target scene type from the specific scene type; or the above two methods can be combined to determine the target scene type from the specific scene type.

[0169] It can be understood that by obtaining the number of energy characteristic values ​​that fall into the energy interval of a specific scene type, the degree of match between the current scene of the headset and the specific scene type in the sensitive frequency band can be obtained relatively quickly. Combined with the number of falls and the similarity coefficient, the specific scene type can be re-screened from the local and overall levels to obtain the target scene type, thereby optimizing the method of obtaining the target scene type and improving the efficiency and accuracy of scene type re-screening.

[0170] In a preferred embodiment, the step S364 of determining the target scene type from the specific scene types based on the number of falls and the similarity coefficient includes:

[0171] S3641. Obtain the maximum number of falling-in numbers and the maximum similarity coefficient among the similarity coefficients;

[0172] S3642, determining whether the maximum number of falls and the maximum similarity coefficient correspond to the same specific scene type;

[0173] S3643: If yes, mark the specific scene type as the target scene type;

[0174] S3644: If not, obtain a reference value corresponding to the specific scene type based on the number of falls, the similarity coefficient and the preset weight coefficient;

[0175] S3645: Mark the specific scene type corresponding to the maximum reference value among the reference values ​​as the target scene type.

[0176] Among them, the reference value is the adaptation degree value between the specific scene type and the current scene type of the headset calculated based on the weight coefficient according to the number of falls and the similarity coefficient, which can be used to filter out the target scene type from the specific scene type.

[0177] After obtaining the number of falls and the similarity coefficient, the numbers of falls are compared with each other to obtain the maximum number of falls, and the similarity coefficients are compared with each other to obtain the maximum similarity coefficient. After obtaining the maximum number of falls and the maximum similarity coefficient, the specific scene type corresponding to the maximum number of falls and the specific scene type corresponding to the maximum similarity coefficient can be obtained, and then it is determined whether the maximum number of falls and the maximum similarity coefficient correspond to the same specific scene type.

[0178] If the maximum number of falls and the maximum similarity coefficient both correspond to the same specific scene type, the specific scene type is marked as the target scene type. It is easy to understand that when the maximum number of falls and the maximum similarity coefficient both correspond to the same specific scene type, it means that the matching degree of the specific scene type at the local level and the overall level is the highest, so the specific scene type can be marked as the target scene type.

[0179] If the maximum number of falls and the maximum similarity coefficient do not correspond to the same specific scene type, it is necessary to determine the reference value of the specific scene type based on the weight coefficient, the number of falls and the similarity coefficient. Specifically, the weight coefficient can be obtained by directly obtaining a preset weight coefficient, or by combining the maximum number of falls and the maximum similarity coefficient to obtain the corresponding weight coefficient. Preferably, the corresponding weight coefficient is obtained by combining the maximum number of falls and the maximum similarity coefficient to ensure the accuracy of the reference value obtained.

[0180] After determining the corresponding weight coefficient, the reference value corresponding to the specific scene type can be calculated according to the number of falls, the similarity coefficient and the weight coefficient. After obtaining the reference value of the specific scene type, the maximum reference value is selected from the reference values, and the specific scene type corresponding to the maximum reference value is marked as the target scene type.

[0181] It can be understood that the method of first screening based on the correspondence between the maximum number of falls and the maximum similarity coefficient, and then screening according to the specific circumstances of the reference value, can relatively well re-screen the specific scene type from the local level and the overall level, and then obtain the target scene type, thereby optimizing the method of obtaining the target scene type and improving the efficiency and accuracy of scene type re-screening.

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

[0183] S61, obtaining key location information from the location information;

[0184] S62, obtaining an ambient audio spectrum from the ambient audio signal;

[0185] S63, determining an initial scene type and an associated scene type based on the key location information;

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

[0187] S65. Determine the target scene type from the initial scene type and the associated scene types according to the energy characteristic value.

[0188] Among them, the key position information is the marking parameter information used to reflect the position characteristics of the scene the headset is currently in. The initial scene type is the scene type used for subsequent recognition and determination 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.

[0189] A geographic information database that preliminarily determines the scene type based on 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.

[0190] 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 adaptation degree of the key position information is used as the basis for division, and then the initial scene type and the associated scene type are obtained respectively; the initial scene type can also be determined first through the key position information, and then the associated scene type is determined according to the degree of association between the initial scene type and other remaining scene types.

[0191] After obtaining the ambient audio spectrum, feature extraction can be performed on the ambient audio spectrum based on a preset extraction mode. The extraction mode can be extraction of the entire frequency band of the ambient audio spectrum or extraction of a specific frequency band of the ambient audio signal.

[0192] Preferably, the extraction mode is to extract specific frequency bands of the ambient audio signal. It is understandable 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 through preliminary screening, the method of extracting specific frequency bands of the ambient audio spectrum can be combined with the characteristics of the human ear to focus on extracting feature information of frequency bands to which the human ear is relatively sensitive. While improving the accuracy of feature extraction, it reduces the amount of feature information to be extracted, thereby improving the efficiency and accuracy of screening using feature information in subsequent scene recognition.

[0193] 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.

[0194] 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.

[0195] 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.

[0196] Further, in one embodiment, the step S63 of determining the initial scene type and the associated scene type based on the key position information includes:

[0197] S631, obtaining an adaptation value between key location information and a preset scene type;

[0198] S632: Determine an initial scene type from preset scene types based on the adaptation value

[0199] S633, obtaining the association value between the initial scene type and the remaining scene types;

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

[0201] 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.

[0202] 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.

[0203] 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.

[0204] After obtaining the adaptation value, the initial scene type can be determined from the scene types according to the adaptation value by setting a comparison value for screening, thereby screening out the initial scene type that meets the requirements; or the scene type with the highest degree of adaptation in the adaptation value can be screened out as the initial scene type, which can be selected according to the actual design requirements. Preferably, the scene type corresponding to the maximum value in the adaptation value is marked as the initial scene type.

[0205] Further, in a preferred embodiment, the step S634 of obtaining the associated scene type from the remaining scene types based on the associated value and the preset first threshold includes:

[0206] S6341. Obtain the maximum value among the adaptation values ​​as the maximum adaptation value;

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

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

[0209] S6344, determining whether the correlation value is less than a first threshold;

[0210] S6345. If not, mark the scene type corresponding to the associated value as the associated scene type.

[0211] 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.

[0212] 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.

[0213] 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.

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

[0215] S641, obtaining a preset sensitive interception frequency band and a preset interception bandwidth;

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

[0217] S643. Calculate energy characteristic parameters of the target spectrum respectively to obtain corresponding energy characteristic values.

[0218] 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.

[0219] 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.

[0220] 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.

[0221] 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.

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

[0223] S651, obtaining an energy interval of an initial scene type and an energy interval of an associated scene type;

[0224] S652, 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;

[0225] S653: Based on the number of falls, obtain the target scene type.

[0226] 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.

[0227] 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.

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

[0229] S6531. Obtain the value of the maximum number of falling numbers among the falling numbers;

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

[0231] S6533. 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;

[0232] S6534. Mark the scene type corresponding to the maximum value in the adaptation value as the target scene type.

[0233] 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.

[0234] 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.

[0235] For further information, please refer to Figure 4 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 S8 of determining the target scene type includes:

[0236] S81, extracting an audio feature sequence from the ambient audio signal;

[0237] S82, extracting an auxiliary feature sequence from the position information and the posture information;

[0238] S83, 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 for each scene type;

[0239] S84: Obtain a target scene type according to the size of the matching value.

[0240] The audio feature sequence is 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 extracted from the position information and posture information, respectively, and transformed and fused, which can represent the characteristics of the current state of the headset and can be input into the improved Transformer model.

[0241] After the microphone array set in the headset collects the ambient audio signal of the current scene of the headset, 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.

[0242] After obtaining the location information of the current scene of the headset and the current posture information of the headset, the location information and posture information need to be preprocessed to remove redundant or irrelevant interference information. After completing the preprocessing of the location information and posture information, the required location features and posture features are extracted from the location information and posture information respectively, and the obtained location features and posture features are combined to obtain the location feature sequence and posture feature sequence, and then the two feature sequences are feature fused to obtain the required auxiliary feature sequence.

[0243] 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.

[0244] 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.

[0245] Then, based on the obtained enhanced feature matrix and the fully connected layer, the matching value of each scene type can be determined. Specifically, after the enhanced feature matrix is ​​input into the fully connected layer, the fully connected layer will perform feature mapping on the enhanced feature matrix, that is, the fully connected layer will perform a linear transformation on each feature vector in the enhanced feature matrix, and output a vector with the same number of elements as the number of scene types, and each element of the vector corresponds to a prediction score for a scene type. 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. Then the maximum value in the matching value is filtered out, and 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.

[0246] 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.

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

[0248] S811, preprocessing the ambient audio signal to obtain a noise-removed audio signal;

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

[0250] S813, dividing the ambient audio spectrum into a plurality of target spectra;

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

[0252] 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.

[0253] 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.

[0254] 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.

[0255] 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.

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

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

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

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

[0260] S824, perform feature fusion on the position feature sequence and the posture feature sequence to obtain an auxiliary feature sequence.

[0261] 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.

[0262] 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.

[0263] 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.

[0264] 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.

[0265] 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.

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

[0267] S8221, extracting the current geographical location information of the headset from the denoising location information;

[0268] S8222. Determine initial scene type information based on the geographic location information and a preset geographic information database;

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

[0270] 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.

[0271] 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.

[0272] 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.

[0273] 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.

[0274] 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.

[0275] 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.

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

[0277] S8231, extracting the current acceleration feature of the headset from the denoised posture information;

[0278] S8232. Encode and transform the acceleration features to obtain a posture feature sequence.

[0279] 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.

[0280] 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.

[0281] 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.

[0282] 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.

[0283] Further, in one embodiment, the step S83 of inputting 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 each scene type includes:

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

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

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

[0287] Among them, 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 ​​the data with weight information obtained after calculation through the proxy attention mechanism. The matching value is the matching degree between the preset scene type and the sound scene currently in which the headset is located. The larger the matching value, the higher the matching degree, and vice versa.

[0288] 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.

[0289] 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.

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

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

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

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

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

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

[0296] 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 WV 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.

[0297] 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 V The 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.

[0298] 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.

[0299] 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.

[0300] After obtaining the information output by the first attention operation, the proxy matrix broadcasts the obtained information back to the first matrix. The second softmax attention operation is performed with the first matrix as the query matrix, the proxy matrix as the key matrix, and the fusion matrix as the value matrix to realize the interaction between the first matrix, the proxy matrix and the fusion matrix. Similar to the first softmax attention operation, the second attention score is first calculated using the first matrix and the proxy matrix, and then the second attention score is normalized to obtain the second attention weight, and then the second attention weight is weighted and summed with the fusion matrix to obtain the attention weight matrix. After obtaining the attention weight matrix, the attention weight matrix is ​​weighted and summed with the third matrix to obtain an enhanced feature matrix containing the weight relationship of each eigenvector.

[0301] It is understandable that the proxy attention mechanism can effectively process and integrate multi-source data information in complex acoustic environments, achieving a good balance between computational complexity and classification accuracy, and significantly improving the accuracy and efficiency in identifying complex audio scenes.

[0302] In summary, the present application divides the modes of obtaining noise reduction parameters according to different parameter information through the current position information and the remaining power of the earphones. When the position information is not obtained, the ambient audio signal is directly used for scene recognition to realize rapid determination of the scene type; after obtaining the position information, if the power does not meet the requirements, the ambient audio signal and the position information are combined to realize rapid initial screening and secondary screening of the scene type; if the power meets the requirements, the improved Transformer model and multi-source feature information are used to realize the identification and classification of complex audio scene types while maintaining low computational complexity; 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, the adaptability of the earphones to cope with diverse user needs and usage scenarios is improved, and the user experience is improved.

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

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

[0305] 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.

[0306] 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.

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

[0308] 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 noise reduction control method are implemented.

[0309] 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 controlling headphone noise reduction, characterized in that: include: Get the ambient audio signal of the current scene of the headset; Check whether the current location information of the headset can be obtained; If not, determining the target scene type according to the ambient audio signal; If yes, obtain the current location information and remaining power parameters of the headset; Detecting whether the remaining power parameter is greater than a preset power threshold; If not, determining the target scene type according to the location information and the ambient audio signal; If yes, obtain the current posture information of the headset; Determine the target scene type based on the environmental audio signal, the position information, the posture information and the preset improved Transformer model configured with the proxy attention mechanism; A noise reduction parameter corresponding to the target scene type is obtained as a target noise reduction parameter.

2. The method for controlling headphone noise reduction according to claim 1, characterized in that: The step of determining the target scene type according to the ambient audio signal comprises: Obtaining a first frequency spectrum and a second frequency spectrum according to the ambient audio signal; Based on the first spectrum and a preset first extraction mode, an amplitude feature matrix is ​​obtained; Based on the second spectrum and a preset second extraction mode, a plurality of energy characteristic values ​​are obtained; Obtaining a similarity coefficient between the amplitude feature matrix and a comparison matrix of a preset scene type; Based on the similarity coefficient, filtering out a specific scene type from the scene types; The target scene type is determined according to the energy characteristic value, the similarity coefficient and the specific scene type.

3. The headphone noise reduction control method according to claim 2, characterized in that: The step of obtaining an amplitude characteristic matrix based on the first spectrum and a preset first extraction mode comprises: Obtaining a preset interception time width, a first interception frequency width and an initial matrix; Based on the first spectrum, the interception time width and the first interception frequency width, a plurality of first target spectrums are obtained; Associating the first target spectrum with the elements of the initial matrix in a one-to-one correspondence in sequence; respectively calculating the amplitude characteristic parameters of the first target spectrum; According to the magnitude of the amplitude characteristic parameter, the position of the corresponding element on the same preset target dimension in the initial matrix is ​​adjusted to obtain the amplitude characteristic matrix.

4. The headphone noise reduction control method according to claim 2, characterized in that: The step of determining the target scene type according to the energy characteristic value, the similarity coefficient and the specific scene type comprises: Obtaining a preset energy range for the specific scene type; Determining in sequence whether the energy characteristic values ​​fall into corresponding energy intervals; Obtaining the number of energy intervals in which the energy characteristic value falls into each specific scene type; Based on the falling quantity and the similarity coefficient, a target scene type is determined from the specific scene types.

5. The headphone noise reduction control method according to claim 1, characterized in that: The step of determining the target scene type according to the position information and the ambient audio signal comprises: Obtaining key location information from the location information; Acquire an ambient audio spectrum from the ambient audio signal; Based on the key location information, determining an initial scene type and an associated scene type; 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.

6. The method for controlling headphone noise reduction according to claim 6, characterized in that: The step of determining the initial scene type and the associated scene type 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.

7. The headphone noise reduction control method 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.

8. The headphone noise reduction control method according to claim 1, characterized in that: The step of determining the target scene type 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 an improved Transformer model configured with a proxy attention mechanism to obtain matching values ​​for each scene type; The target scene type is obtained according to the size of the matching value.

9. The headphone noise reduction control method according to claim 8, 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 the matching value of each scene type includes: 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.

10. The method for controlling headphone noise reduction according to claim 9, 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.

Citation Information

Patent Citations

  • Earphone noise reduction method and device, storage medium and electronic equipment

    CN112423175A

  • Earphone noise reduction method and device, storage medium and noise reduction earphone

    CN112423176A

  • Earphone control method and device, earphone and computer readable storage medium

    CN115396776A

  • Active noise reduction method and device, chip, earphone and storage medium

    CN115474121A

  • Noise reduction method and device and electronic equipment

    CN116110361A