Noise suppression method, noise suppression strategy construction method, and related device

By modeling and gain control of multi-speaker systems, the problem of noise interference between multiple speakers was solved, improving the sound quality and user experience of electronic devices.

CN120475094BActive Publication Date: 2026-06-02HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-24
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In electronic devices, multi-speaker systems suffer from mutual interference of noise due to the interconnection of cavities, and existing technologies struggle to effectively suppress this noise problem.

Method used

By modeling the multi-speaker system, the equivalent rectangular bandwidth energy of the input signal is calculated in real time, and gain control is performed according to the ideal control strategy of joint correction to suppress the noise influence between speakers.

Benefits of technology

It effectively reduces noise issues in multi-speaker systems, improving sound quality and user experience, especially in call and audio playback scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120475094B_ABST
    Figure CN120475094B_ABST
Patent Text Reader

Abstract

The application provides a noise suppression method, a noise suppression strategy construction method and related equipment, and relates to the technical field of audio. The noise suppression method comprises the following steps: in response to a first operation of a user, acquiring first audio and second audio; performing frame processing on the first audio and the second audio respectively, and determining first audio data frames and second audio data frames; if the tonality of the first audio data frame / second audio data frame is a preset tonality, a first suppression strategy is used for processing, third audio data frames / fourth audio data frames are obtained, and the first suppression strategy is determined based on common sound emission of a first loudspeaker and a second loudspeaker according to a first control strategy of the first loudspeaker and a second control strategy of the second loudspeaker; the first loudspeaker and the second loudspeaker play the third audio data frames and the fourth audio data frames respectively. By using the above method, the problem that the electronic equipment plays sound through multiple loudspeakers and the noises influence each other can be effectively suppressed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic devices, specifically audio processing technology, and particularly to a noise suppression method, a method for constructing a noise suppression strategy, and related equipment. Background Technology

[0002] With the development of terminal technology, electronic devices are becoming increasingly feature-rich, especially the external sound playback function, which is gradually becoming a commonly used function of electronic devices.

[0003] The stereo audio playback effect of electronic devices can be improved by incorporating dual or more speakers. However, without isolation between multiple speakers, it's easy for noise to interfere with each other. For example, if one speaker's amplitude is too large, it may cause other speakers to resonate and produce noise. Summary of the Invention

[0004] In view of the above, it is necessary to provide a noise suppression method, a method for constructing a noise suppression strategy, and related equipment, which can suppress the problem of mutual interference of noise when electronic devices play sound through multiple speakers.

[0005] In a first aspect, this application provides a noise suppression method applied to an electronic device. The electronic device includes a first speaker and a second speaker, with the cavity where the first speaker is located connected to the cavity where the second speaker is located. The noise suppression method includes: in response to a first operation by a user, acquiring a first audio and a second audio; performing frame segmentation processing on the first audio to determine a first audio data frame; performing frame segmentation processing on the second audio to determine a second audio data frame; if the tone of the first audio data frame is a preset tone, processing the first audio data frame using a first suppression strategy to obtain a third audio data frame, wherein the first suppression strategy is determined according to a first control strategy of the first speaker and a second control strategy of the second speaker when the first speaker and the second speaker are emitting sound together; if the tone of the second audio data frame is a preset tone, processing the second audio data frame using the first suppression strategy to obtain a fourth audio data frame; the first speaker plays the third audio data frame, and the second speaker plays the fourth audio data frame.

[0006] Using the above technical solution, the preset tone can refer to the tone that is more likely to cause noise in the speakers. That is, for audio data frames that are more likely to cause noise in the speakers, the first suppression strategy obtained by modeling based on the simultaneous sound output of multiple speakers is used for processing. This can effectively suppress the problem of noise affecting each other when electronic devices play sound through multiple speakers. Moreover, the noise suppression of each speaker is carried out independently and does not affect other speakers that do not have noise, thus ensuring the high volume and sound quality of the speakers.

[0007] In one possible implementation, the first suppression strategy is determined based on a first control strategy, a second control strategy, a third control strategy, and a fourth control strategy. The third control strategy is the control strategy for the first speaker when the first speaker is emitting sound alone, and the fourth control strategy is the control strategy for the second speaker when the second speaker is emitting sound alone.

[0008] The above technical solution not only models the sound produced by multiple speakers working together, but also considers the sound produced by a single speaker, which makes the first suppression strategy more accurate and further improves the effect of suppressing the problem of noise interference between electronic devices that play sound through multiple speakers. It also makes the first suppression strategy applicable to scenarios where speakers are producing sound individually or working together.

[0009] In one possible implementation, the first suppression strategy includes a first ideal control strategy corresponding to the first speaker. The first ideal control strategy includes a first equivalent rectangular bandwidth (ERB) energy threshold set, a first control frequency set, a first gain control value set, and a first quality factor set. The first suppression strategy is used to process the first audio data frame, including: acquiring the first ERB energy of the first audio data frame input to the first speaker; comparing the first ERB energy with the corresponding ERB energy threshold in the first ERB energy threshold set based on the first control frequency set; if the first ERB energy is greater than the corresponding ERB energy threshold, performing gain adjustment processing on the first audio data frame based on the first gain control value set and the first quality factor set.

[0010] Using the above technical solution, if the ERB energy of the first audio data frame exceeds the energy threshold at certain control frequency points, it indicates that the first audio data frame is more likely to generate noise at these control frequency points. If the ERB energy of the first audio data frame at certain control frequency points is greater than the corresponding ERB energy threshold, the gain adjustment processing of the first audio data frame can be performed to reduce the ERB energy of the first audio data frame at these control frequency points, thereby reducing the possibility of the first speaker generating noise when playing the first audio data frame.

[0011] In one possible implementation, the gain adjustment processing of the first audio data frame based on the first gain control value set and the first quality factor set includes: determining the audio bandwidth to be adjusted in the first audio data frame based on the first quality factor set; and adjusting the gain of the audio data in the first audio data frame located within the audio bandwidth based on the first gain control value set.

[0012] By adopting the above technical solution, since the audio signal is continuous, when the calculated ERB energy of the first audio data frame at a certain control frequency point is greater than the corresponding ERB energy threshold, it indicates that multiple frequency points near the control frequency point are also likely to have ERB energy greater than the corresponding ERB energy threshold. By determining the audio bandwidth for gain adjustment of the first audio data frame at each control frequency point through the control frequency point and the quality factor corresponding to the control frequency point, the ERB energy of all audio data in the first audio data frame at these control frequency points and within the corresponding audio bandwidth can be reduced, thereby further reducing the possibility of noise generated when the first speaker plays the first audio data frame.

[0013] In one possible implementation, the noise suppression method further includes: if the first ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment processing is performed on the first audio data frame.

[0014] Using the above technical solution, if the ERB energy of the first audio data frame at certain control frequency points is less than or equal to the energy threshold, it indicates that the first audio data frame is not likely to generate noise at certain control frequency points. In this case, gain adjustment processing is not required, saving the hardware and software resources of electronic devices.

[0015] In one possible implementation, the first suppression strategy includes a second ideal control strategy corresponding to the second speaker. The second ideal control strategy includes a second ERB energy threshold set, a second control frequency set, a second gain control value set, and a second quality factor set. Processing the second audio data frame using the first suppression strategy includes: acquiring the second ERB energy of the second audio data frame input to the second speaker; comparing the second ERB energy with the corresponding ERB energy threshold in the ERB energy threshold set based on the second control frequency set; and if the second ERB energy is greater than the corresponding ERB energy threshold, performing gain adjustment processing on the second audio data frame based on the second gain control value set and the second quality factor set.

[0016] Using the above technical solution, if the ERB energy of the second audio data frame exceeds the energy threshold at certain control frequency points, it indicates that the second audio data frame is more likely to generate noise at these control frequency points. If the ERB energy of the second audio data frame at certain control frequency points is greater than the corresponding ERB energy threshold, the gain adjustment processing of the second audio data frame can be performed to reduce the ERB energy of the second audio data frame at these control frequency points, thereby reducing the possibility of the second speaker generating noise when playing the second audio data frame.

[0017] In one possible implementation, the gain adjustment processing of the second audio data frame is performed based on the second gain control value set and the second quality factor set, including: determining the audio bandwidth to be adjusted in the second audio data frame based on the second quality factor set; and adjusting the gain of the audio data in the second audio data frame that is located within the audio bandwidth based on the second gain control value set.

[0018] By adopting the above technical solution, since the audio signal is continuous, when the calculated ERB energy of the second audio data frame at a certain control frequency point is greater than the corresponding ERB energy threshold, it indicates that multiple frequency points near the control frequency point are also likely to have ERB energy greater than the corresponding ERB energy threshold. By determining the audio bandwidth for gain adjustment of the second audio data frame at each control frequency point through the control frequency point and the quality factor corresponding to the control frequency point, the ERB energy of all audio data in the second audio data frame at these control frequency points and within the corresponding audio bandwidth can be reduced, thereby further reducing the possibility of noise generated when the second speaker plays the second audio data frame.

[0019] In one possible implementation, the noise suppression method further includes: if the second ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment processing is performed on the second audio data frame.

[0020] Using the above technical solution, if the ERB energy of the second audio data frame at certain control frequency points is less than or equal to the energy threshold, it indicates that the second audio data frame is not likely to generate noise at certain control frequency points. In this case, gain adjustment processing is not required, saving the hardware and software resources of electronic devices.

[0021] In one possible implementation, the noise suppression method further includes: if the tone of the first audio data frame is not a preset tone, processing the first audio data frame using a second suppression strategy; if the tone of the second audio data frame is not a preset tone, processing the second audio data frame using a second suppression strategy, wherein the second suppression strategy includes adjusting the first audio data frame and the second audio data frame by a preset gain, or not adjusting the gain of the first audio data frame and the second audio data frame.

[0022] Using the above technical solution, if the tone of the first audio data frame / second audio data is not a preset tone, indicating that the first audio data frame / second audio data is not likely to cause noise from the speaker, in this case, a small fixed-size gain adjustment can be made to the first audio data frame / second audio data, or no gain adjustment can be made, thereby reducing the data processing volume and hardware / software resource consumption of the electronic device.

[0023] Secondly, this application provides a method for constructing a noise suppression strategy, comprising: when a first speaker and a second speaker of an electronic device jointly play a preset audio signal and there is no noise in either, obtaining a first control strategy for the first speaker and a second control strategy for the second speaker, wherein the first control strategy is determined based on the sound output condition of the first speaker and a first influence factor of the second speaker on the first speaker, and the second control strategy is determined based on the sound output condition of the second speaker and a second influence factor of the first speaker on the second speaker; determining a first ideal control strategy for the first speaker based on the first control strategy, and determining a second ideal control strategy for the second speaker based on the second control strategy, wherein the first ideal control strategy is used to suppress noise in the audio data played by the first speaker, and the second ideal control strategy is used to suppress noise in the audio data played by the second speaker.

[0024] By adopting the above technical solution, an ideal control strategy corresponding to each speaker is constructed based on the working condition of multiple speakers emitting sound together and the mutual influence factors. This can effectively suppress the problem of noise interference between electronic devices that play sound through multiple speakers. Furthermore, since each speaker has its own corresponding control strategy, noise suppression is performed independently based on its own control strategy, which can further ensure the high volume and sound quality of the speakers.

[0025] In one possible implementation, determining a first ideal control strategy for a first speaker based on a first control strategy includes: acquiring first control strategies for multiple first speakers of multiple electronic devices; determining a first ideal control strategy for the first speaker based on the multiple first control strategies; and determining a second ideal control strategy for a second speaker based on a second control strategy includes: acquiring second control strategies for multiple second speakers of multiple electronic devices; and determining a second ideal control strategy for the second speaker based on the multiple second control strategies.

[0026] Using the above technical solution, there are also consistent minor differences in the components of electronic devices of the same model. By modeling the ideal control strategy for multiple electronic devices to produce sound from multiple speakers, the robustness of the obtained ideal control strategy can be improved, allowing users to obtain a better listening experience.

[0027] In one possible implementation, determining a first ideal control strategy for the first speaker based on a first control strategy includes: acquiring a third control strategy for the first speaker of the electronic device when playing the preset audio signal alone without noise; determining the first ideal control strategy for the first speaker based on the first control strategy and the third control strategy; determining a second ideal control strategy for the second speaker based on a second control strategy includes: acquiring a fourth control strategy for the second speaker of the electronic device when playing the preset audio signal alone without noise; and determining the second ideal control strategy for the second speaker based on the second control strategy and the fourth control strategy.

[0028] By adopting the above technical solution, the ideal control strategy not only models the sound produced by multiple speakers together, but also takes into account the sound produced by a single speaker, which makes the accuracy of the ideal control strategy higher. This further improves the effect of suppressing the problem of noise interference between electronic devices that play sound through multiple speakers, and makes the ideal control strategy applicable to scenarios where speakers produce sound individually or together.

[0029] In one possible implementation, the first control strategy includes a first ERB energy threshold set and a first control frequency set. The first control frequency set includes multiple first control frequencies, and the first ERB energy threshold set includes multiple first ERB energy thresholds corresponding one-to-one with the multiple first control frequencies. The method further includes: obtaining the resonant frequency of a first loudspeaker, and determining the first control frequency set based on the resonant frequency of the first loudspeaker; at any first control frequency, obtaining the first ERB energy of the first loudspeaker playing a preset audio signal, and the second ERB energy of the second loudspeaker playing the preset audio signal; and determining the first ERB energy threshold corresponding to any first control frequency based on the first ERB energy, the second ERB energy, and a first influence factor.

[0030] Using the above technical solution, the resonant frequency of the first speaker can be accurately determined at which control frequency points the first speaker is more likely to produce noise. Based on the first ERB energy of the first speaker playing the preset audio signal, the second ERB energy of the second speaker playing the preset audio signal, and the influence factor of the second speaker on the first speaker, the ERB energy threshold of the first speaker at any control frequency point can be accurately determined when multiple speakers are playing together. This facilitates subsequent determination of whether the gain adjustment of the first audio data frame is needed based on the ERB energy threshold.

[0031] In one possible implementation, determining the first ERB energy threshold corresponding to any first control frequency point based on the first ERB energy, the second ERB energy, and the first influence factor includes: determining the first ERB energy threshold corresponding to any first control frequency point based on the following formula: ERB A,AB =ERBA1 +α*ERB B1 ERB A1 =sum(s) A,AB (t) 2 )*f s / BW / L, ERB B1 =sum(s) B,AB (t) 2 )*f s / BW / L, BW=1.019*24.7*(4.37*f c1 / 1000+1),

[0032] Among them, ERB A,AB The first ERB energy threshold, ERB A1 For the first ERB energy, ERB B1 The second ERB energy is α, the first influence factor is s. A,AB (t) represents the audio data signal obtained by downsampling and filtering the preset audio data input to the first speaker, s B,AB (t) represents the audio data signal obtained by downsampling and filtering the preset audio data input to the second speaker, f s Here, BW is the preset audio data sampling rate, BW is the filter bandwidth, L is the preset audio data frame length after downsampling, and f is the frame length. c1 For any first control frequency point.

[0033] By adopting the above technical solution, the preset audio data input to the first speaker is downsampled and filtered to realize the Gammatone filter model. This model can accurately characterize the ERB energy threshold of the first speaker at any control frequency point when multiple speakers play the preset audio data together. This facilitates subsequent determination of whether the gain adjustment of the first audio data frame is needed based on the ERB energy threshold.

[0034] In one possible implementation, each of the multiple first control frequency points corresponds to a first influence factor.

[0035] Using the above technical solution, each control frequency point corresponds to a first influence factor, so that the ERB energy threshold of the first speaker at any control frequency point can be accurately obtained through the above formula when multiple speakers emit sound together.

[0036] In one possible implementation, when the second speaker emits sound alone, the first influence factor is obtained based on the vibration displacement information of the second speaker and the vibration displacement information of the first speaker.

[0037] By adopting the above technical solution, the first influence factor of the second speaker on the first speaker is characterized as the vibration displacement of the first speaker caused by the vibration displacement of the second speaker when the second speaker emits sound alone, thereby achieving accurate determination of the first influence factor.

[0038] In one possible implementation, the first impact factor is determined based on the following formula:

[0039]

[0040] Where, x BtoA (f c1 (n) represents the first vibration displacement information of the first loudspeaker recorded when the second loudspeaker is emitting sound alone, and x represents the displacement information of the first loudspeaker. B (f c1 (n) represents the second vibration displacement information of the second speaker recorded when the second speaker is emitting sound alone, average(|x BtoA (f c1 ,n)|) is the average of the absolute values ​​of multiple recorded first vibration displacement information, average(|x B (f c1 f(n)|) represents the average of the absolute values ​​of multiple recorded second vibration displacement information, where f(n)|) is the value of the absolute values ​​of the second vibration displacement information. c1 Let n be any first control frequency point, and n be the sampling points.

[0041] By adopting the above technical solution, the average value of the vibration displacement of the second speaker at each control frequency point is recorded, which causes the average value of the vibration displacement of the first speaker at each control frequency point to the average value of the vibration displacement of the first speaker at each control frequency point. This achieves an accurate characterization of the first influence factor of the second speaker on the first speaker at each control frequency point.

[0042] In one possible implementation, the second control strategy includes a second ERB energy threshold set and a second control frequency set. The second control frequency set includes multiple second control frequencies, and the second ERB energy threshold set includes multiple second ERB energy thresholds corresponding one-to-one with the multiple second control frequencies. The method further includes: obtaining the resonant frequency of the second speaker, and determining the second control frequency set based on the resonant frequency of the second speaker; at any second control frequency, obtaining the third ERB energy of the first speaker playing a preset audio signal, and the fourth ERB energy of the second speaker playing the preset audio signal; and determining the second ERB energy threshold corresponding to any second control frequency based on the third ERB energy, the fourth ERB energy, and a second influence factor.

[0043] Using the above technical solution, the resonant frequency of the second speaker can be used to accurately determine at which control frequency points the second speaker is more likely to produce noise. Based on the first ERB energy of the second speaker playing the preset audio signal, the second ERB energy of the first speaker playing the preset audio signal, and the influence factor of the first speaker on the second speaker, the ERB energy threshold of the second speaker at any control frequency point can be accurately determined when multiple speakers are playing together. This facilitates subsequent determination of whether gain adjustment of the second audio data frame is needed based on the ERB energy threshold.

[0044] In one possible implementation, the second ERB energy threshold corresponding to any second control frequency point is determined based on the third ERB energy, the fourth ERB energy, and the second influence factor, including: determining the second ERB energy threshold corresponding to any second control frequency point based on the following formula: ERB B,AB =ERB B2 +β*ERB A2 ERB A2 =sum(s) A,AB (t) 2 )*f s / BW / L, ERB B2 =sum(s) B,AB (t) 2 )*f s / BW / L, BW=1.019*24.7*(4.37*f c2 / 1000+1),

[0045] Among them, ERB B,AB The second ERB energy threshold, ERB A2 For the third ERB energy, ERB B2 The fourth ERB energy, β is the second influence factor, and s A,AB (t) represents the audio data signal obtained by downsampling and filtering the preset audio data input to the first speaker, s B,AB (t) represents the audio data signal obtained by downsampling and filtering the preset audio data input to the second speaker, f s Here, BW is the preset audio data sampling rate, BW is the filter bandwidth, L is the preset audio data frame length after downsampling, and f is the frame length. c2 For any second control frequency point.

[0046] By employing the above technical solution, Gammaton is achieved by downsampling and filtering the preset audio data input to the second speaker. eThe filter model can accurately characterize the ERB energy threshold of the second speaker at any control frequency point when multiple speakers are playing audio data together, which facilitates subsequent determination of whether the gain adjustment of the second audio data frame is needed based on the ERB energy threshold.

[0047] In one possible implementation, each of the multiple second control frequency points corresponds to a second influence factor.

[0048] Using the above technical solution, each control frequency point corresponds to a second influence factor, so that the ERB energy threshold of the second speaker at any control frequency point can be accurately obtained through the above formula when multiple speakers emit sound together.

[0049] In one possible implementation, when the first speaker emits sound alone, the second influence factor is obtained based on the vibration displacement information of the first speaker and the vibration displacement information of the second speaker.

[0050] By adopting the above technical solution, the second influence factor of the first loudspeaker on the second loudspeaker is characterized as the vibration displacement of the second loudspeaker caused by the vibration displacement of the first loudspeaker when the first loudspeaker emits sound alone, thereby achieving accurate determination of the second influence factor.

[0051] In one possible implementation, the second impact factor is determined based on the following formula:

[0052]

[0053] Where, x A (f c2 (n) represents the third vibration displacement information of the first loudspeaker recorded when the first loudspeaker is emitting sound alone, and x AtoB (f c2 (n) represents the fourth vibration displacement information of the second speaker recorded when the first speaker is emitting sound alone, and average(|x A (f c2 ,n)|) is the average of the absolute values ​​of multiple recorded third vibration displacement information, average(|x AtoB (f c2 ,n)|) is the average of the absolute values ​​of multiple recorded fourth vibration displacement information, f c2 Let n be any second control frequency point, and n be the sampling points.

[0054] By adopting the above technical solution, the average value of the vibration displacement of the first speaker at each control frequency point is recorded, which causes the average value of the vibration displacement of the second speaker to be caused by the average value of the vibration displacement of the first speaker at each control frequency point. This achieves an accurate characterization of the second influence factor of the first speaker on the second speaker at each control frequency point.

[0055] Thirdly, this application provides an electronic device, which includes a first speaker, a second speaker, a memory, and a processor; the first speaker, the second speaker, and the memory are all coupled to the processor; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the noise suppression method of the first aspect and its possible implementations, or the method for constructing a noise suppression strategy to implement the second aspect and its possible implementations.

[0056] Fourthly, this application provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the noise suppression method of the first aspect and its possible implementations described above, or the method for constructing a noise suppression strategy that implements the second aspect and its possible implementations described above.

[0057] Fifthly, this application provides a computer program product containing computer-readable instructions that, when executed by a processor, implement the noise suppression method of the first aspect and its possible implementations described above, or the method for constructing a noise suppression strategy that implements the second aspect and its possible implementations described above.

[0058] Sixthly, this application provides a chip system coupled to a memory, the chip system being used to read and execute a computer program stored in the memory to implement the noise suppression method of the first aspect and its possible implementations, or a method for constructing a noise suppression strategy to implement the second aspect and its possible implementations.

[0059] Furthermore, the technical effects brought about by the second to fifth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description

[0060] Figure 1 A schematic diagram of a possible sound outlet channel for a speaker in an electronic device according to an embodiment of this application;

[0061] Figure 2 This is a schematic diagram of a possible installation position of the speaker of an electronic device provided in an embodiment of this application;

[0062] Figure 3 This is a schematic diagram illustrating an application scenario of the noise suppression method provided in an embodiment of this application;

[0063] Figure 4 This is a schematic diagram illustrating an application scenario of a noise suppression method provided in another embodiment of this application;

[0064] Figure 5A schematic diagram comparing the ideal ERB energy curve and the actual ERB energy curve of a loudspeaker provided in an embodiment of this application;

[0065] Figure 6A A flowchart illustrating noise suppression of a speaker in an electronic device according to an embodiment of this application;

[0066] Figure 6B A schematic diagram showing the ERB energy change of an audio data frame before and after noise suppression, according to an embodiment of this application.

[0067] Figure 6C A schematic diagram showing the spectral changes of an audio data frame before and after noise suppression, according to an embodiment of this application.

[0068] Figure 7 A flowchart illustrating the construction of an ideal control strategy for a loudspeaker according to an embodiment of this application;

[0069] Figure 8 A flowchart illustrating the construction of an ideal control strategy for a loudspeaker according to another embodiment of this application;

[0070] Figure 9 This is a schematic diagram of a structure for measuring the influence factor between two loudspeakers, provided in an embodiment of this application.

[0071] Figure 10 A waveform diagram of a test signal for measuring the influence factor between two loudspeakers, provided as an embodiment of this application;

[0072] Figure 11 A flowchart illustrating noise suppression of a speaker in an electronic device according to another embodiment of this application;

[0073] Figure 12 This is a hardware and software architecture diagram of an electronic device provided in one embodiment of this application;

[0074] Figure 13 This is an interactive flowchart of the internal hardware and software modules of an electronic device implementing audio data processing, provided in one embodiment of this application.

[0075] Figure 14 This is a hardware architecture diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0076] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0077] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, words such as "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary," "or," and "for example" is intended to present the relevant concepts in a concrete manner.

[0078] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" means one or more. "More than one" means two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. It should be understood that the order of steps shown in the flowcharts herein can be changed, and some can be omitted.

[0079] To facilitate understanding of the embodiments of this application, the technical terms involved in this application will first be introduced:

[0080] A user interface (UI) is the medium through which an application or operating system interacts and exchanges information with the user. It converts the internal form of information into a form that the user can understand. The user interface is written in specific computer languages ​​such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements displayed on the screen of an electronic device, such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0081] Application (APP): A software program that can perform one or more specific functions. For example, calling applications, instant messaging applications, video playback applications, audio playback applications, etc.

[0082] Currently, most electronic devices incorporate dual or more speakers to enhance stereo audio playback. However, in external audio playback scenarios, the relatively small size of these speakers, coupled with factors such as the speaker's output duct and cavity structure, makes them prone to producing noise when playing low-frequency, high-amplitude audio data. This noise problem is exacerbated when the fundamental frequency of the audio data being played coincides with the speaker's resonant frequency.

[0083] like Figure 1 The diagram illustrates two different sound outlet pipe designs. Figure 1 The loudspeaker shown in (a) has a slanted sound outlet duct. Figure 1 The speaker shown in (b) has a zigzag-shaped sound outlet. Both types of sound outlets are long and narrow. Low-frequency, high-amplitude audio data corresponds to longer sound wave wavelengths and larger amplitudes, which can easily cause speaker resonance, making it easier for the speaker to produce noise when playing low-frequency, high-amplitude audio data.

[0084] This noise suppression algorithm, employing single-speaker modeling, aims to reduce speaker noise. Single-speaker modeling involves modeling the sound output of a single speaker to obtain a corrected ideal gain curve, which can suppress noise generated by the speaker when playing low-frequency, high-amplitude audio data. For electronic devices using multiple speakers, the cavity structure design of most speakers does not ensure that the individual speakers do not interfere with each other. The ideal gain curve constructed using single-speaker modeling does not consider the factors that cause mutual interference between speakers during sound output, resulting in poor noise suppression.

[0085] like Figure 2 As shown, taking electronic device 100 including two speakers as an example, the installation positions of the two speakers can be selected according to actual product design requirements, and this application embodiment does not limit this. Figure 2 As shown in (a), if the two loudspeakers each have two independent cavities, with the front and rear cavities being independent of each other (for example, the rear cavity being a sealed cavity relative to the front cavity), then the two loudspeakers can be made to not interfere with each other. In this case, modeling each loudspeaker individually can effectively reduce the noise of each loudspeaker. Figure 2As shown in (b), if the two cavities of two loudspeakers are interconnected, the sound emitted by one loudspeaker can be transmitted to the other loudspeaker through the interconnected cavity, causing the diaphragm of the other loudspeaker to vibrate. This results in mutual influence between the two loudspeakers. In this case, modeling only one loudspeaker cannot effectively reduce the noise of each loudspeaker. Because the noise of the two loudspeakers will affect each other, for example, if the diaphragm amplitude of one loudspeaker is too large, it will cause the diaphragm of the other loudspeaker to resonate through the interconnected cavity, which will also cause noise problems in the other loudspeaker. Therefore, noise suppression algorithms that use single-loudspeaker modeling cannot solve the noise problem of multiple loudspeakers that have mutual influence.

[0086] Based on this, this application provides a noise suppression method that models the sound emitted by multiple loudspeakers to obtain an ideal control strategy for the multiple loudspeakers. In actual use, the signal energy (e.g., equivalent rectangular bandwidth (ERB) energy) input to each loudspeaker is calculated in real time, and gain control is performed according to the ideal control strategy to suppress the noise problem of multiple loudspeakers that have mutual influence.

[0087] This application also provides a noise suppression method, which not only models the sound emitted by multiple loudspeakers together, but also models the sound emitted by a single loudspeaker together to obtain an ideal control strategy for multiple loudspeakers after joint correction. Gain control is then performed based on the ideal control strategy after joint correction to suppress the noise problem of multiple loudspeakers that have mutual influence.

[0088] like Figure 3 The diagram illustrates a scenario in which the noise suppression method provided in this application is applicable. This scenario can be a voice call speakerphone scenario, which includes an electronic device 100. The electronic device 100 can be a device with a sound speakerphone function; for example, the electronic device 100 includes two or more speakers. This application does not limit the type of electronic device. For example, the electronic device 100 can be a mobile phone, tablet computer, laptop computer, etc.

[0089] Taking a smartphone as an example, the electronic device 100 has an application installed that enables making calls. The electronic device 100 can respond to user actions by initiating a request to establish a call connection with other electronic devices. The call connection can be established based on the Internet or a carrier network; this embodiment does not limit this.

[0090] When the electronic device 100 displays the call interface 101, the electronic device 100 can also respond to the user's operation on the hands-free control 102 in the call interface 101 by playing a call prompt tone or the other party's voice through the speaker.

[0091] The electronic device 100 can calculate the signal energy input to each speaker in real time and perform gain control according to a jointly modified ideal control strategy (e.g., the first ideal control strategy and the second ideal control strategy described below) to effectively reduce noise from each speaker and improve the user's call experience. The specific implementation of noise suppression will be described in the following embodiments.

[0092] Please see Figure 4 This is a schematic diagram illustrating another scenario to which the noise suppression method provided in this application embodiment is applicable. This scenario can be an audio playback scenario. For example, the electronic device 100 may have an application installed that can play video or audio. Taking an audio application installed on the electronic device 100 as an example, the electronic device 100 can respond to the user's operation by opening the playback interface 103 of the audio application to play specified music.

[0093] When no external audio playback device (e.g., headphones, speakers, etc.) is connected to the electronic device 100, the electronic device 100 plays music using its speakers. The electronic device 100 can effectively reduce noise from each speaker by calculating the signal energy input to each speaker in real time and performing gain control according to a jointly corrected ideal control strategy, thereby improving the user's music listening experience.

[0094] like Figure 5 As shown, assume curve S11 is the ideal ERB energy curve of audio data played by a speaker in electronic device 100, and curve S12 is the ERB energy curve of the audio data played by the speaker in an actual external playback scenario. For this speaker, there is an ideal energy threshold at certain frequencies or frequency bands. Once this ideal energy threshold is exceeded, the speaker is more prone to generating noise, for example... Figure 5 The frequency points f1 to f3 shown all have corresponding ideal energy thresholds. To reduce speaker noise, if the ERB energy of the audio data calculated in real time is greater than the corresponding ideal energy threshold at these frequency points, gain adjustment is required to prevent the speaker from generating noise at these frequency points. For example, electronic devices can adjust the gain of the audio data based on the ERB energy difference between curves S11 and S12 for each of the frequency points f1 to f3.

[0095] For example, if the ERB energy of the audio data calculated in real time is greater than the corresponding ideal energy threshold, gain adjustment (reducing the gain of the audio data) is applied to the audio data to reduce the ERB energy, thus making it less likely for the speaker to generate noise when playing the audio data. If the ERB energy of the audio data calculated in real time is less than or equal to the corresponding ideal energy threshold, it indicates that the speaker is less likely to generate noise when playing the audio data. In this case, there is no need to adjust the gain of the audio data, and gain adjustment is not required.

[0096] like Figure 6A As shown, this application describes the specific process by which the electronic device provides a noise suppression method for a loudspeaker.

[0097] In this embodiment of the application, an electronic device including a first speaker and a second speaker is used as an example for illustration. The installation positions of the first speaker and the second speaker can be selected according to the actual product design requirements. This embodiment of the application does not limit the number of speakers included in the electronic device or the installation position of each speaker.

[0098] S601, in response to the instruction to play audio using the first speaker and the second speaker, the first audio data input to the first speaker is framed to obtain a first audio data frame, and the second audio data input to the second speaker is framed to obtain a second audio data frame.

[0099] In some embodiments, the electronic device may generate an instruction to play audio using a first speaker and a second speaker in response to a preset trigger event. The preset trigger event may be a user's click operation on the electronic device, or other events that can automatically trigger the electronic device to play audio (e.g., an alarm clock event, an incoming call event, etc.).

[0100] For example, during a voice or video call, the electronic device can respond to the user's tapping of the hands-free control on the call interface by generating a command to play audio using the first and second speakers. As another example, when the electronic device is not connected to an external audio playback device, it can respond to the user's action of playing specified audio / video by generating a command to play audio using the first and second speakers.

[0101] In some embodiments, the first audio data / second audio data can be framed using relevant audio framing algorithms, and this application does not limit this approach. For example, the first audio data / second audio data can be framed using fixed frame length framing algorithms, endpoint detection framing algorithms, overlay window framing algorithms, etc.

[0102] In some embodiments, by dividing the first audio data into frames, one or more first audio data frames can be obtained. By dividing the second audio data into frames, one or more second audio data frames can be obtained. This enables the first audio data and the second audio data to be processed in terms of tone on a frame-by-frame basis (processed using a first compression strategy or a second compression strategy), which can improve the tone detection accuracy and processing accuracy of the first audio data / second audio data.

[0103] S602, perform tone detection on the first audio data frame and the second audio data frame respectively.

[0104] In some embodiments, the tone detection of the first audio data frame and the tone detection of the second audio data frame can be performed using relevant tone detection algorithms; this application embodiment does not limit this. By performing tone detection on the first audio data frame and the second audio data frame respectively, it can be determined whether the first audio data frame and the second audio data frame are audio data frames that are more likely to cause noise from the speaker. A first suppression strategy is used to process audio data frames that are more likely to cause noise from the speaker, and a second suppression strategy is used to process audio data frames that are less likely to cause noise from the speaker.

[0105] By performing tone detection on the first audio data frame and the second audio data frame respectively, it can be determined whether the first audio data frame and the second audio data frame are audio data frames that are more likely to cause noise from the speaker. Then, different suppression strategies can be used to process different types of audio data frames, so as to maximize the use of the hardware and software resources of the electronic device while suppressing noise from the speaker.

[0106] S603, if the tone of the first audio data frame is the preset tone, the first audio data frame is processed using the first suppression strategy.

[0107] In some embodiments, the preset tone may refer to a tone that is more likely to cause noise from the speaker. The preset tone can be set according to the actual playback conditions of the speaker, and this application embodiment does not limit this. The working conditions involved in this application embodiment can refer to the working state of the speaker when playing audio. For example, the preset tone indicates that the audio data frame is a piano tone data frame or a similar piano tone data frame, that is, the preset tone can be used to indicate that the audio type of the audio data frame is a piano tone data frame or a similar piano tone data frame.

[0108] For example, if the tone of the first audio data frame is greater than a preset threshold, it is considered that the tone of the first audio data frame is the preset tone, and the first audio data frame is an audio data frame that is more likely to cause noise from the speaker. In this case, a first suppression strategy can be applied to the first audio data frame to suppress the problem of the speaker easily generating noise when playing the first audio data frame. If the tone of the first audio data frame is less than or equal to the preset threshold, it is considered that the tone of the first audio data frame is not the preset tone, and the first audio data frame is an audio data frame that is less likely to cause noise from the speaker. In this case, a second suppression strategy can be applied to the first audio data frame.

[0109] In some embodiments, the first suppression strategy may be determined based on a strategy for suppressing noise in the first speaker and a strategy for suppressing noise in the second speaker when the first speaker and the second speaker are emitting sound together.

[0110] In some embodiments, the first suppression strategy may also be determined based on a strategy for suppressing noise in the first speaker and a strategy for suppressing noise in the second speaker when the first speaker and the second speaker are emitting sound together, and a strategy for suppressing noise in the first speaker when the first speaker is emitting sound alone and a strategy for suppressing noise in the second speaker when the second speaker is emitting sound alone.

[0111] In some embodiments, the first suppression strategy may include a first ideal control strategy corresponding to the first speaker and a second ideal control strategy corresponding to the second speaker.

[0112] In some embodiments, processing the first audio data frame with a first suppression strategy may include: a1. calculating the first ERB energy of the first audio data frame input to the first speaker; b1. obtaining the first ideal control strategy of the first speaker; c1. processing the first audio data frame based on the calculated first ERB energy and the first ideal control strategy to obtain a third audio data frame, the third audio data frame being played by the first speaker.

[0113] S604, if the tone of the second audio data frame is the preset tone, the second audio data frame is processed using the first suppression strategy.

[0114] Similarly, for the second audio data frame, it can be determined whether the tone of the second audio data frame is the preset tone by judging whether the tone of the second audio data frame is greater than a preset threshold. If the tone of the second audio data frame is the preset tone, it is considered that the second audio data frame is more likely to cause noise from the speaker. The first suppression strategy is then applied to the second audio data frame to suppress the problem of noise easily generated by the speaker when playing the second audio data frame.

[0115] In some embodiments, processing the second audio data frame using a first suppression strategy may include: a2. calculating the second ERB energy of the second audio data frame input to the second speaker; b2. obtaining a first ideal control strategy for the second speaker; c2. processing the second audio data frame based on the calculated second ERB energy and the second ideal control strategy to obtain a fourth audio data frame, which is played by the second speaker.

[0116] In some embodiments, the calculation methods for the first ERB energy of the first audio data frame input to the first speaker and the second ERB energy of the second audio data frame input to the second speaker can both employ relevant ERB energy calculation algorithms, and this application embodiment does not limit this.

[0117] In some embodiments, the first ideal control strategy for the first speaker and the second ideal control strategy for the second speaker can both be constructed and stored in the electronic device before it leaves the factory.

[0118] S605, if the tone of the first audio data frame is not the preset tone, the second compression strategy is applied to the first audio data frame.

[0119] In some embodiments, if the tone of the first audio data frame is not a preset tone, it indicates that the first audio data frame is not likely to cause noise from the first speaker. In this case, the first audio data frame can be adjusted by a small fixed size, or no gain adjustment can be performed, which can reduce the amount of data processing and the amount of hardware and software resources occupied by the electronic device.

[0120] For example, the second suppression strategy could be to not perform gain adjustment processing, or to suppress the gain by a smaller amount according to a preset rule. As another example, for the first audio data frame, not performing gain adjustment processing could mean not changing the gain processing method of the first audio data frame, and using the default gain rule to process the gain of the first audio data frame. Suppressing the gain by a smaller amount according to a preset rule could mean reducing the gain of the first audio data frame by a preset value, which can avoid the problem of fluctuating volume when the first speaker plays the first audio data frame. The preset value can be set according to actual needs, and this application embodiment does not limit this.

[0121] S606 outputs the first processed audio data frame.

[0122] In some embodiments, the processed first audio data frame may be a first audio data frame processed by a first compression strategy or a first audio data frame processed by a second compression strategy. For example, the processed first audio data frame may be output to a first speaker A and played by the first speaker A to realize the playback of the first audio data frame.

[0123] S607, if the tone of the second audio data frame is not the preset tone, the second audio data frame is processed using the second compression strategy.

[0124] In some embodiments, if the tone of the second audio data frame is not a preset tone, it indicates that the second audio data frame is not likely to cause noise from the second speaker. In this case, the gain of the second audio data frame can be adjusted by a small fixed size, or no gain adjustment can be performed, which can reduce the amount of data processing and the amount of hardware and software resources occupied by the electronic device.

[0125] In some embodiments, by applying a small, fixed-size gain adjustment to the second audio data frame, the problem of fluctuating volume when the second speaker plays the second audio data frame can also be avoided.

[0126] S608 outputs the processed second audio data frame.

[0127] In some embodiments, the processed second audio data frame can be a second audio data frame processed by a first compression strategy or a second compression strategy. For example, the processed second audio data frame can be output to a second speaker B and played by the second speaker B to achieve playback of the second audio data frame.

[0128] like Figure 6B The figure shows a comparison of the ERB energy of multiple first audio data frames before and after noise suppression. Curve S21 is the ERB energy curve of multiple first audio data frames before noise suppression, and curve S22 is the ERB energy curve of multiple first audio data frames after noise suppression.

[0129] For example, Figure 6B The key of the first audio data frames, from frame 102 to frame 1119, shown in the diagram is the preset key. From Figure 6B As can be seen, if the tone of the first audio data frame is the preset tone, by applying the first suppression strategy to the first audio data frame, the ERB energy of the first audio data frame changes significantly before and after noise suppression. The ERB energy before noise suppression is significantly greater than the ERB energy after noise suppression, thus suppressing the problem of noise easily generated when the first speaker plays the first audio data frame. If the tone of the first audio data frame is not the preset tone, by applying the second suppression strategy to the first audio data frame, the ERB energy changes relatively little before and after noise suppression. This can reduce the data processing load and hardware / software resource consumption of the electronic device, and can also avoid the problem of fluctuating volume when the first speaker plays the first audio data frame.

[0130] like Figure 6CThe diagram shows the spectral changes of the first audio data frame with a preset tone before and after noise suppression. Curve S31 is the spectral curve of the first audio data frame before noise suppression, and curve S32 is the spectral curve of the first audio data frame after noise suppression.

[0131] from Figure 6C As can be seen, by applying the first suppression strategy to the first audio data frame, the amplitude of the first audio data frame after noise suppression is smaller than the amplitude before noise suppression. In other words, gain suppression of the first audio data frame is achieved, which can suppress the problem that the first speaker is more likely to generate noise when playing the first audio data frame.

[0132] The following is combined with Figure 7 and Figure 8 This paper introduces the construction process of the first ideal control strategy and the second ideal control strategy.

[0133] like Figure 7 As shown, the construction process includes at least the following steps:

[0134] S701, construct a first control strategy for the first speaker and a second control strategy for the second speaker of each of the multiple electronic devices.

[0135] In some embodiments, multiple electronic devices may refer to electronic devices of the same brand and model, wherein each electronic device is equipped with the same speaker, and the speaker is installed in the same position. This application embodiment illustrates this by taking an example where each electronic device is equipped with a first speaker and a second speaker. The number of multiple electronic devices can be set according to the actual needs of the control strategy, and this application embodiment does not limit this.

[0136] In some embodiments, the construction method of the first control strategy of the first speaker is basically the same as the construction method of the second control strategy of the second speaker. The following description uses the construction of the first control strategy of a first speaker in an electronic device as an example: i. Perform a separate sound emission test on the first speaker (without sound emission from the second speaker) to obtain the third control strategy of the first speaker in a noise-free state; ii. Perform a joint sound emission test on the first and second speakers to obtain the fourth control strategy of the first speaker when both speakers are noise-free; iii. Based on the third and fourth control strategies, obtain the first control strategy of the first speaker. Similarly, by performing separate and joint sound emission tests on the second speaker, obtain the fifth and sixth control strategies of the second speaker, and then based on the fifth and sixth control strategies of the second speaker, obtain the second control strategy of the second speaker.

[0137] Similarly, for other electronic devices, the first control strategy for the first speaker and the second control strategy for the second speaker can be obtained by referring to the above method.

[0138] S702, based on a first control strategy for multiple first speakers of multiple electronic devices, a first ideal control strategy for the first speakers is determined, and based on a second control strategy for multiple second speakers of multiple electronic devices, a second ideal control strategy for the second speakers is determined.

[0139] In some embodiments, after obtaining a first control strategy for the first speaker of each of the plurality of electronic devices, a first ideal control strategy for the first speaker can be determined by averaging the plurality of first control strategies. Similarly, a second ideal control strategy for the second speaker can also be determined by averaging the plurality of second control strategies.

[0140] like Figure 8 As shown, the construction process of the first ideal control strategy and the second ideal control strategy is described in detail.

[0141] S801 controls the first speaker in the electronic device to play preset audio data separately and obtains the third control strategy of the first speaker in the state of no noise.

[0142] In some embodiments, the preset audio data may be audio data that is more likely to cause noise in the first speaker, such as sweep tone, white noise, piano tone, etc.

[0143] In some embodiments, for the first speaker A, a sound acquisition device (e.g., a microphone or transducer) can be placed near the first speaker A to monitor the sound signal y emitted by the first speaker A during the playback of preset audio data. A (t), and then calculate the ERB energy of the sound signal monitored by the sound acquisition device in real time, which is the sound signal y. A The ERB energy of (t) can be calculated based on the signal value of the sound signal y detected by the sound acquisition device. A The ERB energy of (t) can be used to compare with the ERB energy thresholds in the ERB energy threshold set to set the gain control value.

[0144] To better reflect the human ear's auditory perception of preset audio data played by the first speaker, the preset audio data can first be downsampled, and then filtered using a finite impulse response (FIR) filter to obtain the filtered audio data signal s. A (t), where s A (t)=yA (t)⊙h(t), where ⊙ represents the convolution operation and h(t) is the equivalent expression for an FIR filter. By using an FIR filter to filter the preset audio data, Gammaton can be achieved. e Filter Model (Gammaton) e A filter model is a set of filter models used to simulate the frequency decomposition characteristics of the cochlea, thus better reflecting the human ear's auditory perception of preset audio data played by a first speaker. It is understandable that other filters that can simulate the frequency decomposition characteristics of the cochlea can also be used to filter the audio data.

[0145] Assume that the sampling rate of the preset audio data after downsampling is f. d The preset audio data sampling rate before downsampling is f s An FIR filter can be equivalent to the following formula 1:

[0146]

[0147] Where t is the sampling time, c is the preset scaling factor, n is the order of the FIR filter, b is the time attenuation factor, and f0 is the center frequency of the FIR filter. It is the phase of the FIR filter.

[0148] In some embodiments, the ERB energy of the first speaker A when playing preset audio data can be calculated using the following formula 2:

[0149] ERB A =sum(s) A (t) 2 )*f s / BW / L

[0150] ERB A,dB =10*log 10 (ERB A -- Equation 2;

[0151] Among them, ERB A The ERB energy for the first speaker when playing preset audio data, ERB A,d B is ERB A The decibel value, f s Let BW be the sampling rate of the preset audio data before downsampling, BW be the bandwidth of the FIR filter, and L be the frame length of the preset audio data after downsampling. The value of bandwidth BW can be obtained by the following formula: BW = 1.019 * 24.7 * (4.37 * f c / 1000+1), f C To control the frequency point. For example, f CIt can be any one of the following control frequency points (1 / 2f) r f1, f2, f3, ..., f i 3f r (any one of them), that is, different control frequencies correspond to different bandwidths BW, and different ERB energy thresholds can be calculated based on Equation 2.

[0152] In some embodiments, the third control strategy for the first speaker A in a noise-free state may include: the ERB energy threshold set U A1 Control frequency set F A1 Gain control value set A1 and quality factor set Q A1 .

[0153] In some embodiments, the first speaker A can be brought to a noise-free state by adjusting a multi-band equalizer (EQ), thereby obtaining the ERB energy threshold set U of the first speaker A. A1 Control frequency set F A1 Gain control value set A1 and quality factor set Q A1 .

[0154] Assume that the resonant frequency of the first loudspeaker A is measured in advance as f. r The control frequency band of the first speaker A can be set to 1 / 2 f. r -3f r This indicates that the first speaker A is more prone to generating noise in this control frequency band. The control frequency point can refer to multiple frequency points within the control frequency band that are more likely to cause noise in the first speaker A. That is, at these control frequency points, if the calculated ERB energy of the audio data exceeds the ERB energy threshold, the first speaker is more likely to generate noise. It is understood that different models of speakers may have different control frequency bands and control frequency points. The control frequency band and control frequency points are set according to the actual usage of the speaker, and this application embodiment does not limit this. Assuming that in the control frequency band 1 / 2f... r -3f r Between these, the set control frequencies, from smallest to largest, include: 1 / 2f r f1, f2, f3, ..., f i 3f r Where i is a positive integer, and U is the set of ERB energy thresholds. A 1. Control frequency set FA1, gain control value set Gain A1 and quality factor set Q A1 This can be represented by the following formulas 3 to 6 respectively:

[0155]

[0156] in, These are control frequency points 1 / 2f r f1, f2, f3, ..., f i 3f r The corresponding ERB energy threshold, It can be calculated using formula 2 and the bandwidth BW corresponding to each control frequency point.

[0157] F A1 =[1 / 2f r f1, f2, f3, ..., f i 3f r --Equation 4;

[0158]

[0159] in, Each control frequency point is 1 / 2f r f1, f2, f3, ..., f i 3f r The corresponding gain control value, The value ensures that the first speaker A is noise-free at each control frequency.

[0160] For example, the ERB energy of the preset audio data input to the first speaker can be calculated using a relevant ERB energy calculation algorithm, thus obtaining the ERB energy curve of the preset audio data. If the ERB energy calculated in real time is greater than the corresponding ERB energy threshold, the gain control value can be set to the decibel level corresponding to the difference in ERB energy between the two. The set gain control value can also be fine-tuned during multi-band EQ adjustment to ensure that the first speaker A is in a noise-free state at each control frequency point. The finely adjusted gain control value can be added to the gain control value set.

[0161]

[0162] in, To control frequency 1 / 2f r f1, f2, f3, ..., f i 3f r The corresponding bandwidth adjustment range, It can be set based on the speaker's historical noise measurement and adjustment experience. For example, when the calculated audio data has an ERB energy greater than the corresponding ERB energy threshold at a certain control frequency, there is also a high probability that multiple frequencies near that control frequency will have an ERB energy greater than the corresponding ERB energy threshold. These multiple frequencies near the control frequency are characterized by the quality factor.

[0163] In some embodiments, Alternatively, settings can be made based on the ERB energy curve and ERB energy threshold set of preset audio data, so that after gain adjustment, the ERB energy of the control frequency point and multiple frequency points near the control frequency point is less than the ERB energy threshold corresponding to the control frequency point.

[0164] For example, when the calculated ERB energy of the audio data at control frequency f1 is greater than the corresponding ERB energy threshold. Then according to Determine the frequency band that needs adjustment using f1, and then adjust the audio data for that frequency band according to... Gain adjustment is performed to make the first speaker less prone to noise in this frequency band.

[0165] S802 controls the second speaker in the electronic device to play preset audio data separately and obtains the fifth control strategy of the second speaker in the state of no noise.

[0166] In some embodiments, for the second speaker B, the fifth control strategy for the second speaker in a noise-free state may include: the ERB energy threshold set U B1 Control frequency set F B1 Gain control value set B1 and quality factor set Q B1 ERB energy threshold set U B1 Control frequency set F B1 Gain control value set B1 and quality factor set Q B1 The acquisition method and the ERB energy threshold set U A1 Control frequency set F A1 Gain control value set A1 and quality factor set Q A1 The acquisition method is similar, and will not be repeated here to avoid duplication.

[0167] S803 controls the first speaker and the second speaker in the electronic device to play preset audio data together, and obtains the fourth control strategy of the first speaker and the sixth control strategy of the second speaker when there is no noise in both the first speaker and the second speaker.

[0168] In a scenario where a first speaker A and a second speaker B in a control electronic device jointly play preset audio data, a first sound acquisition device can be deployed near the first speaker A to monitor the sound signal emitted by the first speaker A during the playback of the preset audio data. Similarly, a second sound acquisition device can be deployed near the second speaker B to monitor the sound signal emitted by the second speaker B during the playback of the preset audio data. Based on the sound signal monitored by the first sound acquisition device, the signal of the audio data obtained after filtering the preset audio data input to the first speaker A using an FIR filter can be determined. Likewise, based on the sound signal monitored by the second sound acquisition device, the signal of the audio data obtained after filtering the preset audio data input to the second speaker B using an FIR filter can be determined. Subsequently, the ERB energy of the preset audio data played by the first speaker A can be calculated based on the influence factor of the second speaker B on the first speaker A (hereinafter referred to as the first influence factor), and the ERB energy of the preset audio data played by the second speaker B can be calculated based on the influence factor of the first speaker A on the second speaker B (hereinafter referred to as the second influence factor).

[0169] For example, the ERB energy of the preset audio data played by the first speaker A can be based on: the signal s of the audio data obtained by downsampling and filtering the preset audio data input to the first speaker A. A,AB (t) The audio data signal s obtained by downsampling and filtering the preset audio data input to the second speaker B. B,AB (t) and the first impact factor were obtained.

[0170] For example, in the case where a first speaker A and a second speaker B in a control electronic device jointly play preset audio data, the ERB energy of the first speaker A playing the preset audio data can be calculated using the following formula 7:

[0171] ERB A,AB =sum(s) A,AB (t) 2 )*f s / BW / L+α*sum(s B,AB (t) 2 )*f s / BW / L

[0172] ERB A,AB,dB =10*log 10 (ERB A,AB -- Equation 7;

[0173] Among them, ERB A,AB In the case where the first speaker A and the second speaker B are playing preset audio data together, the first speaker A plays the ERB energy of the preset audio data, ERB A,AB,dB For ERBA,AB The decibel value, where α is the first influencing factor.

[0174] Similarly, the ERB energy of the second speaker B playing preset audio data can be based on: the signal s of the audio data obtained by downsampling and filtering the preset audio data input to the first speaker A. A,AB (t) The audio data signal s obtained by downsampling and filtering the preset audio data input to the second speaker B. B,AB (t) and the second impact factor were obtained.

[0175] For example, in the case where a first speaker A and a second speaker B in a control electronic device jointly play preset audio data, the ERB energy of the second speaker B playing the preset audio data can be calculated using the following formula 8:

[0176] ERB B,AB =sum(s) B,AB (t) 2 )*f s / B / L+β*sum(s A,AB (t) 2 )*f s / BW / L

[0177] ERB B,AB,dB =10*log 10 (ERB B,AB -- Equation 8;

[0178] Among them, ERB B,AB In the case where the first speaker A and the second speaker B are playing preset audio data together, the second speaker B plays the ERB energy of the preset audio data. B,AB,dB For ERB B,AB The decibel value, β is the second influencing factor.

[0179] In some embodiments, when the first speaker A and the second speaker B in the control electronic device play preset audio data together, the first speaker A and the second speaker B can also be made to be in a noise-free state by means of the above-mentioned multi-band EQ adjustment, thereby obtaining the fourth control strategy of the first speaker A and the sixth control strategy of the second speaker B.

[0180] In some embodiments, the fourth control strategy for the first speaker A may include: an ERB energy threshold set U A2 Control frequency set F A2 Gain control value set A2 and quality factor set Q A2 For example, the control frequency set F A2Each control frequency point can be set based on the resonant frequency of the first loudspeaker A. For example, the control frequency point set F A2 Can be used with the control frequency set F A1 Same. ERB energy threshold set U A2 The energy thresholds of each ERB in the set can be based on the control frequency point set F. A2 The bandwidth BW corresponding to each control frequency point is determined by formula 7. A2 For the control frequency set F A2 The gain control values ​​corresponding to each control frequency point, and the set of gain control values ​​Gain A2 The various gain control values ​​in the set F are used to ensure that the first speaker A and the second speaker B are within the control frequency range. A2 All control frequencies are in a noise-free state (when the first speaker A and the second speaker B are playing preset audio data together). Quality factor set Q A2 For the control frequency set F A2 The bandwidth adjustment range corresponding to each control frequency point.

[0181] In some embodiments, the gain control value set Gain A2 The various gain control values ​​and quality factor sets Q in the data A2 Each quality factor can be obtained during a multi-stage EQ adjustment process.

[0182] In some embodiments, the quality factor set Q A2 Each quality factor can also be determined based on the preset audio data's ERB energy curve and ERB energy threshold set U. A2 Configure the settings.

[0183] The sixth control strategy for the second speaker B may include: the ERB energy threshold set UB2, and the control frequency set F. B2 Gain control value set B2 and quality factor set Q B2 For example, the control frequency set F B2 Each control frequency point can be set based on the resonant frequency of the second speaker B. For example, the control frequency point set F B2 With control frequency set F B1 The same. Each ERB energy threshold in the ERB energy threshold set UB2 can be based on the control frequency point set F. B2 The bandwidth BW corresponding to each control frequency point is determined by formula 8. The gain control value set Gain B2 For the control frequency set F B2 The gain control values ​​corresponding to each control frequency point, and the set of gain control values ​​Gain B2The gain control values ​​in the set F make the first speaker A and the second speaker B operate at the same frequency point set. B2 All control frequencies are in a noise-free state (when the first speaker A and the second speaker B are playing preset audio data together). Quality factor set Q B2 For the control frequency set F B2 The bandwidth adjustment range corresponding to each control frequency point.

[0184] In some embodiments, the gain control value set Gain B2 The various gain control values ​​and quality factor sets Q in the data B2 Each quality factor can be obtained during a multi-stage EQ adjustment process.

[0185] In some embodiments, the quality factor set Q B2 Each quality factor can also be determined based on the preset audio data's ERB energy curve and ERB energy threshold set U. B2 Configure the settings.

[0186] In some embodiments, the values ​​of the first influence factor α and the second influence factor β can follow frequency variations. For example, they can be set at the frequency band f that causes speaker noise. a ~f b The first influence factor α and the second influence factor β are assigned values, while the first influence factor α and the second influence factor β are set to zero in other frequency bands, so as to indicate that the two speakers (first speaker A and second speaker B) will not affect each other and generate noise in other frequency bands.

[0187] In some embodiments, in the frequency band f that causes loudspeaker noise a ~f b Within this context, the values ​​assigned to the first influence factor α and the second influence factor β can correspond to different values ​​at different frequencies.

[0188] like Figure 9 As shown, the electronic device 100 includes a first speaker A and a second speaker B. The first speaker A is the upper speaker of the electronic device 100, and the second speaker B is the lower speaker of the electronic device 100. The first influence factor α and the second influence factor β can be obtained by testing using a laser vibrometer. During the period when the second speaker B plays a preset test signal alone, the first vibration displacement information x of the first speaker A is recorded using the first laser vibrometer. BtoA (f c Simultaneously, the second vibration displacement information x of the second speaker B is recorded using a second laser vibrometer. B (f c f(n), where n is the number of sampling points. c This is for controlling the frequency point, i.e., f. c It can be 1 / 2fr f1, f2, f3, ..., f i 3f r Any one of them.

[0189] For example, during the period when the second speaker B plays a preset test signal alone, a laser is emitted from a first laser vibrometer onto the diaphragm of the first speaker A, and a laser is emitted from a second laser vibrometer onto the diaphragm of the second speaker B. This allows for the recording of the vibration displacement information of the diaphragm of the first speaker A and the diaphragm of the second speaker B, respectively. That is, the first vibration displacement information x is recorded by the first laser vibrometer. BtoA (f c The second vibration displacement information x is obtained by recording the above-mentioned second vibration displacement information x using a second laser vibrometer (n). B (f c (n).

[0190] After obtaining the first vibration displacement information x BtoA (f c (n) and the second vibration displacement information x B (f c After n), the first vibration displacement information x can be used as a basis. BtoA (f c (n) and the second vibration displacement information x B (f c ,n) determine the first influencing factor α.

[0191] For example, for any control frequency point f c Multiple first vibration displacement information x can be recorded. BtoA (f c (n) and multiple second vibration displacement information x B (f c ,n), at the control frequency point f c The first influence factor of the second speaker B on the first speaker A α It can be represented as:

[0192]

[0193] Where average(|x BtoA (f c ,n)|) represents multiple first vibration displacement information x BtoA (f c The average of the absolute values ​​of (x, n), average(|x) B (f c ,n)|) represents multiple second vibration displacement information x B (f c The average of the absolute values ​​of (n) at different control frequencies.r f1, f2, f3, ..., f i 3f r The corresponding first influence factor α can be calculated from the following values ​​and substituted into formula 7 for calculation.

[0194] Similarly, when the first speaker A plays the preset test signal alone, the third vibration displacement information x of the first speaker A is recorded using the first laser vibrometer. A (f c Meanwhile, the fourth vibration displacement information x of the second speaker B is recorded using a second laser vibrometer. AtoB (f c (n).

[0195] For example, during the period when the first speaker A plays a preset test signal alone, a first laser vibrometer emits a laser beam onto the diaphragm of the first speaker A, and a second laser vibrometer emits a laser beam onto the diaphragm of the second speaker B. This allows for the recording of the vibration displacement information of the diaphragm of the first speaker A and the diaphragm of the second speaker B, respectively. That is, the third vibration displacement information x mentioned above is recorded by the first laser vibrometer. A (f c The fourth vibration displacement information x is obtained by recording the above-mentioned information using a second laser vibration meter (n). AtoB (f c (n).

[0196] After obtaining the third vibration displacement information x A (f c (n) and the fourth vibration displacement information x AtoB (f c After n), the third vibration displacement information x can be used as a basis. A (f c (n) and the fourth vibration displacement information x AtoB (f c ,n) determine the second influencing factor β.

[0197] For example, for any control frequency point f c Multiple third vibration displacement information x can be recorded. A (f c (n) and multiple fourth vibration displacement information x AtoB (f c ,n), at the control frequency point f c The second influence factor β of the first loudspeaker A on the second loudspeaker B can be expressed as:

[0198]

[0199] Among them, average(ox A(f c ,n)o) represents multiple third vibration displacement information x A (f c The average of the absolute values ​​of (n), average(ox) AtoB (f c ,n)o) represents multiple fourth vibration displacement information x AtoB (f c The average of the absolute values ​​of (n).

[0200] like Figure 10 As shown, the preset test signal can be a superimposed signal containing powder noise V1 and signals V2_1 to V2_j with different bandwidths, where j is a positive integer greater than 1. The value of j can be set according to actual test requirements, and this embodiment does not limit this. For example, the preset test signal includes multiple signals V2_1 to V2_j with different bandwidths, and the powder noise V1 is located between two adjacent signals. Figure 10 As shown, the preset test signal includes a superposition of powder noise V1 and seven signals V2_1 to V27 with different bandwidths. The first segment of the signal is at a frequency of 1 / 2f. r The first signal is a time-domain signal centered at frequency f1 with a bandwidth of B1, and the second signal is a time-domain signal centered at frequency f1 with a bandwidth of B2.

[0201] S804, based on the third and fourth control strategies of the first speaker, determines the first control strategy of the first speaker, and based on the fifth and sixth control strategies of the second speaker, determines the second control strategy of the second speaker.

[0202] For the first speaker A, after determining the third control strategy and the fourth control strategy, the first control strategy of the first speaker A can be determined based on the third control strategy and the fourth control strategy, so that the first control strategy not only considers the working condition of the first speaker A emitting sound independently, but also considers the working condition of the first speaker A and the second speaker B emitting sound together.

[0203] For example, the first control strategy for the first speaker A may include: the ERB energy threshold set U A3 Control frequency set F A3 Gain control value set A3 and quality factor set Q A3 The first control strategy, derived from the third and fourth control strategies, can be: for the ERB energy threshold set, compare U... A1 with U A2 By retaining the lower threshold values, we obtain the ERB energy threshold set U. A3By retaining a lower threshold value, a lower trigger condition for gain adjustment is achieved, thereby allowing gain adjustment to be applied to audio data at more frequencies. This reduces the likelihood of noise generated when the first speaker A plays the adjusted audio data. For the set of gain control values, the Gain value is compared... A1 and Gain A2 Retaining higher gain values ​​yields the set of gain control values, Gain. A3 By retaining higher gain values, a larger gain adjustment range is achieved, which also reduces the likelihood of noise generated when the first speaker A plays the adjusted audio data. For the control frequency set, this can be achieved by adjusting F... A1 With F A2 Find the union of sets, or other methods (e.g., by dividing F...). A2 or F A1 As F A3 ), thus obtaining the control frequency point set F A3 For a set of quality factors, this can be achieved by analyzing Q. A1 With Q A2 Find the union of sets, or other methods (e.g., by combining Q). A2 Or Q A1 As Q A3 ), thus obtaining the quality factor set Q A3 Similarly, for the second speaker B, after determining the fifth and sixth control strategies, a second control strategy for the second speaker B can be determined based on the fifth and sixth control strategies. This second control strategy considers not only the working condition of the second speaker B emitting sound independently, but also the working condition of the first speaker A and the second speaker B emitting sound together.

[0204] For example, the second control strategy for the second speaker B may include: the ERB energy threshold set U B3 Control frequency set F B3 Gain control value set B3 and quality factor set Q B3 The second control strategy, derived from the fifth and sixth control strategies, can be: for the ERB energy threshold set, compare U... B1 with U B2 By retaining the lower threshold values, we obtain the ERB energy threshold set U. B3 For the set of gain control values, compare Gain B1 and Gain B2 Retaining higher gain values ​​yields the set of gain control values, Gain. B3 For the set of control frequencies, this can be achieved by adjusting F. B1 With F B2 Find the union of sets, or other methods (e.g., by dividing F...). B2 or F B1As F B3 ), thus obtaining the control frequency point set F B3 For a set of quality factors, this can be achieved by analyzing Q. B1 With Q B2 Find the union of sets, or other methods (e.g., by combining Q). B2 Or Q B1 As Q B3 ), thus obtaining the quality factor set Q B3 .

[0205] S805, obtain a first control strategy for the first speaker of each of the multiple electronic devices, and a second control strategy for the second speaker.

[0206] In some embodiments, the first control strategy for the first speaker and the second control strategy for the second speaker of each of the plurality of electronic devices can be obtained by repeatedly executing steps S801 to S804. For example, n electronic devices can be randomly selected, and steps S801 to S804 can be executed for each electronic device to obtain the first control strategy for the first speaker and the second control strategy for the second speaker of each electronic device. n is a positive integer, and the value of n can be set according to the actual noise suppression requirements. This application embodiment does not limit this.

[0207] For example, for the first electronic device, the first control strategy for the first speaker includes: the ERB energy threshold set U A31 Control frequency set F A31 Gain control value set A31 and quality factor set Q A31 The second control strategy for the second speaker includes: the ERB energy threshold set U B31 Control frequency set F B31 Gain control value set B31 and quality factor set Q B31 For the nth electronic device, the first control strategy for the first speaker includes: the ERB energy threshold set U A3n Control frequency set F A3n Gain control value set A3n and quality factor set Q A3n The second control strategy for the second speaker includes: the ERB energy threshold set U B3n Control frequency set F B3n Gain control value set B3n and quality factor set Q B3n .

[0208] S806, preprocessing a first control strategy for multiple first speakers of multiple electronic devices, and preprocessing a second control strategy for multiple second speakers of multiple electronic devices, the preprocessing including outlier removal processing.

[0209] In some embodiments, to improve the accuracy of the ideal control strategy, multiple first control strategies and multiple second control strategies may be preprocessed. Preprocessing may include, but is not limited to, outlier removal processing to eliminate obviously anomalous values ​​from the multiple first control strategies and / or multiple second control strategies. For example, if the difference between a parameter value in a certain first control strategy and the mean or median of all parameter values ​​is greater than a preset value, it can be considered an obviously anomalous value. As another example, outlier removal analysis can be performed on each strategy factor (ERB energy threshold, control frequency, gain control value, and quality factor) in the multiple first control strategies using cluster analysis.

[0210] In some embodiments, if the probability of outliers in the plurality of first control strategies and the plurality of second control strategies is low, or if there are no outliers, step S806 can be omitted.

[0211] S807, based on the first control strategy of the multiple first speakers of the multiple electronic devices after preprocessing, determine the first ideal control strategy of the first speakers, and based on the second control strategy of the multiple second speakers of the multiple electronic devices after preprocessing, determine the second ideal control strategy of the second speakers.

[0212] In some embodiments, a first ideal control strategy for a first speaker A can be determined by averaging the first control strategies of multiple first speakers A of multiple electronic devices, and a second ideal control strategy for a second speaker B can be determined by averaging the second control strategies of multiple second speakers B of multiple electronic devices. For example, the multiple first control strategies of the multiple electronic devices include an ERB energy threshold set U. A31 ~U A3n By averaging the ERB energy thresholds, the final corrected ERB energy threshold set U is obtained. Afinal Multiple first control strategies for multiple electronic devices also include a set of gain control values, Gain. A31 Gain A3n The final set of corrected gain control values, Gain, is determined by averaging the gain control values. Afinal Multiple first control strategies for multiple electronic devices also include a set of control frequency points F. A31 ~F A3n The final set of corrected control frequencies F is determined by averaging the control frequencies. Aifinal Or, the control frequency set F A31 ~FA3n Any set of control frequency points in the set is used as the final corrected set of control frequency points F. Aifinal Multiple first control strategies for multiple electronic devices also include a set of quality factors Q. A31 ~Q A3n The final corrected set of quality factors Q is determined by averaging the quality factors. Afinal Or the quality factor set Q A31 ~Q A3n Any set of quality factors in Q is used as the final corrected set of quality factors. Afinal That is, the first ideal control strategy for the first loudspeaker A includes: the ERB energy threshold set U Afinal Gain control value set Afinal Control frequency set F Afinal The set of quality factors Q Afinal .

[0213] In some alternative embodiments, the ERB energy threshold set U in the first ideal control strategy of the first loudspeaker A A3 Control frequency set F A3 Gain control value set A3 and quality factor set Q A3 It can also be determined based on a first control strategy of only one electronic device, or based on a four-control strategy of multiple first speakers of multiple electronic devices.

[0214] Similarly, the second ideal control strategy for the second loudspeaker B can be determined: the ERB energy threshold set U. Bfinal Control frequency set F Bfinal Gain control value set Bfinal and quality factor set Q Bfinal .

[0215] In some alternative embodiments, the ERB energy threshold set U in the second ideal control strategy of the second loudspeaker B Bfinal Control frequency set F Bfinal Gain control value set Bfinal and quality factor set Q Bfinal It can also be determined based on a second control strategy of only one electronic device, or a sixth control strategy of multiple second speakers of multiple electronic devices.

[0216] Please see Figure 11 This paper describes the specific process of an electronic device based on a noise suppression method for suppressing noise in a loudspeaker, according to another embodiment of this application.

[0217] In this embodiment, an electronic device including a first speaker and a second speaker is used as an example for explanation. The mounting devices for the first speaker and the second speaker can be selected according to actual product design requirements. This embodiment does not limit the number of speakers included in the electronic device or the installation position of each speaker.

[0218] S1101, in response to the instruction to play audio using the first speaker and the second speaker, the first audio data input to the first speaker is framed to obtain a first audio data frame, and the second audio data input to the second speaker is framed to obtain a second audio data frame.

[0219] Step S1101 in this embodiment is similar to step S601 in the previous embodiment. To avoid repetition, it will not be described again here.

[0220] By segmenting the first audio data into frames, one or more first audio data frames can be obtained. Similarly, by segmenting the second audio data into frames, one or more second audio data frames can be obtained. This allows for tone detection and processing of the first and second audio data on a frame-by-frame basis (using either a first or a second compression strategy), thereby improving the tone detection and processing accuracy of the first and second audio data.

[0221] S1102, perform tone detection on the first audio data frame and the second audio data frame respectively.

[0222] Step S1102 in this embodiment is similar to step S602 in the previous embodiment. To avoid repetition, it will not be described again here.

[0223] By performing tone detection on the first audio data frame and the second audio data frame respectively, it can be determined whether the first audio data frame and the second audio data frame are audio data frames that are more likely to cause noise from the speaker. Then, different suppression strategies can be used to process different types of audio data frames, so as to maximize the use of the hardware and software resources of the electronic device while suppressing noise from the speaker.

[0224] S1103, if the tone of the first audio data frame is the preset tone, calculate the first ERB energy of the first audio data frame input to the first speaker.

[0225] In some embodiments, if the tone of the first audio data frame is a preset tone, indicating that the first audio data frame is more likely to cause noise from the speaker, a first suppression strategy needs to be applied to process the first audio data frame. That is, the first audio data frame needs to be processed based on a first ideal control strategy corresponding to the first speaker. The first ERB energy of the first audio data frame reaching the first speaker is calculated to facilitate subsequent comparison with the ERB energy threshold set U in the first ideal control strategy. Afinal By comparing the data, it is possible to accurately determine whether the first audio data frame will cause noise from the speaker.

[0226] The first ideal control strategy includes the ERB energy threshold set UAfinal and the gain control value set Gain. Afinal Control frequency set F Afinal The set of quality factors Q Afinal The first ERB energy can be calculated by inputting the first audio data frame to the first speaker, and then the first ERB energy can be compared with the ERB energy threshold set U. Afinal The corresponding ERB energy threshold is compared to determine whether gain adjustment needs to be performed on the first audio data frame.

[0227] S1104, in the control frequency set F Aifinal Each control frequency point in the set of ERB energy thresholds U is used to determine the first ERB energy and the ERB energy threshold set U. Afinal The corresponding ERB energy thresholds are compared.

[0228] In some embodiments, by controlling the set of frequency points F Afinal Each control frequency point in the set of ERB energy thresholds U is used to determine the first ERB energy and the ERB energy threshold set U. Afinal By comparing the corresponding ERB energy thresholds, it is possible to determine whether the first audio data frame will cause noise from the speaker at each control frequency point.

[0229] S1105, if the first ERB energy is greater than the corresponding ERB energy threshold, based on the gain control value set Gain Afinal With quality factor set Q Afinal Gain adjustment is performed on the first audio data frame.

[0230] In some embodiments, if the first ERB energy is greater than the ERB energy threshold corresponding to a certain control frequency, it indicates that the first audio data frame will cause noise from the speaker at that control frequency. Furthermore, when the calculated ERB energy of the first audio data frame at a certain control frequency is greater than the corresponding ERB energy threshold, there is also a high probability that multiple frequency points near that control frequency will also have ERB energy greater than the corresponding ERB energy threshold. This is based on the gain control value set Gain.Afinal With quality factor set Q Afinal By suppressing the gain of the first audio data frame (reducing the gain), the ERB energy of the first audio data frame at the control frequency point and at multiple frequencies near the control frequency point can be adjusted to be less than or equal to the corresponding ERB energy threshold, so that the first audio data frame at the control frequency point and at multiple frequencies near the control frequency point will not cause noise from the speaker.

[0231] S1106, if the first ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment is performed on the first audio data frame.

[0232] In some embodiments, if the first ERB energy is less than or equal to the ERB energy threshold corresponding to a certain control frequency point, it indicates that the first audio data frame will not cause noise from the speaker at that control frequency point. In this case, there is no need to adjust the gain of the first audio data frame, thus saving the hardware and software resources of the electronic device.

[0233] S1107, if the tone of the first audio data frame is not the preset tone, the second compression strategy is applied to the first audio data frame.

[0234] Step S1107 of this embodiment is similar to step S605 of the previous embodiment, and will not be described again here to avoid repetition.

[0235] In some embodiments, if the tone of the first audio data frame is not a preset tone, it indicates that the first audio data frame is not likely to cause noise from the first speaker. In this case, the first audio data frame can be adjusted by a small fixed size, or no gain adjustment can be performed, which can reduce the amount of data processing and the amount of hardware and software resources occupied by the electronic device.

[0236] In some embodiments, by applying a small, fixed-size gain adjustment to the first audio data frame, the problem of fluctuating volume when the first speaker plays the first audio data frame can also be avoided.

[0237] S1108 outputs the first processed audio data frame.

[0238] In some embodiments, the processed first audio data frame can be a first audio data frame processed by a first compression strategy or a first audio data frame processed by a second compression strategy. The first audio data frame processed by the first compression strategy can be the first audio data frame obtained by step S1105 or step S1106. The processed first audio data frame can be output to the first speaker and played by the first speaker to realize the playback of the first audio data frame.

[0239] S1109, if the tone of the second audio data frame is the preset tone, calculate the second ERB energy of the second audio data frame input to the second speaker.

[0240] In some embodiments, if the tone of the second audio data frame is a preset tone, indicating that the second audio data frame is more likely to cause noise from the speaker, a first suppression strategy needs to be applied to process the second audio data frame. That is, the first audio data frame needs to be processed based on a second ideal control strategy corresponding to the second speaker. The second ERB energy of the second audio data frame reaching the second speaker is calculated to facilitate subsequent comparison with the ERB energy threshold set U in the second ideal control strategy. Bfinal By comparing the data, it is possible to accurately determine whether the second audio data frame will cause noise from the speaker.

[0241] The second ideal control strategy includes the ERB energy threshold set U. Bfinal Control frequency set F Bfinal Gain control value set Bfinal and quality factor set Q Bfinal The second ERB energy can be calculated by inputting the second audio data frame to the second speaker, and then the second ERB energy can be compared with the ERB energy threshold set U. Bfinal The corresponding ERB energy threshold is compared to determine whether gain adjustment needs to be performed on the second audio data frame.

[0242] S1110, in the control frequency set F Bfinal Each control frequency point in the set of ERB energy thresholds U is used to determine the second ERB energy. Bfinal The corresponding ERB energy thresholds are compared.

[0243] In some embodiments, by controlling the set of frequency points F Bfinal Each control frequency point in the set of ERB energy thresholds U is used to determine the second ERB energy. Bfinal By comparing the corresponding ERB energy threshold, it is possible to determine whether the second audio data frame will cause noise from the speaker at each control frequency point.

[0244] S1111, if the second ERB energy is greater than the corresponding ERB energy threshold, based on the gain control value set Gain Bfinal With quality factor set Q Bfinal Gain adjustment is applied to the second audio data frame.

[0245] In some embodiments, if the second ERB energy is greater than the ERB energy threshold corresponding to a certain control frequency, it indicates that the second audio data frame will cause noise from the speaker at that control frequency. Furthermore, when the calculated ERB energy of the second audio data frame at a certain control frequency is greater than the corresponding ERB energy threshold, there is also a high probability that multiple frequency points near that control frequency will also have ERB energy greater than the corresponding ERB energy threshold. This is based on the gain control value set Gain. Bfinal With quality factor set Q Bfinal Gain suppression (reducing gain) of the second audio data frame can adjust the ERB energy of the second audio data frame at the control frequency point and multiple frequencies near the control frequency point to be less than or equal to the corresponding ERB energy threshold, so that the second audio data frame at the control frequency point and multiple frequencies near the control frequency point will not cause noise from the speaker.

[0246] S1112, if the second ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment is performed on the second audio data frame.

[0247] In some embodiments, if the second ERB energy is less than or equal to the ERB energy threshold corresponding to a certain control frequency point, it indicates that the second audio data frame will not cause noise from the speaker at that control frequency point. In this case, there is no need to adjust the gain of the second audio data frame, thus saving the hardware and software resources of the electronic device.

[0248] S1113, if the tone of the second audio data frame is not the preset tone, the second compression strategy is applied to the second audio data frame.

[0249] Step S1113 in this embodiment is similar to step S607 in the previous embodiment. To avoid repetition, it will not be described again here.

[0250] In some embodiments, if the tone of the second audio data frame is not a preset tone, it indicates that the second audio data frame is not likely to cause noise from the second speaker. In this case, the gain of the second audio data frame can be adjusted by a small fixed size, or no gain adjustment can be performed, which can reduce the amount of data processing and the amount of hardware and software resources occupied by the electronic device.

[0251] In some embodiments, by applying a small, fixed-size gain adjustment to the second audio data frame, the problem of fluctuating volume when the second speaker plays the second audio data frame can also be avoided.

[0252] S1114 outputs the processed second audio data frame.

[0253] In some embodiments, the processed second audio data frame can be either a second audio data frame processed by the first compression strategy or a second audio data frame processed by the second compression strategy. The second audio data frame processed by the first compression strategy can be the second audio data frame obtained by step S1111 or step S1112. The processed second audio data frame can be output to the second speaker for playback, thus realizing the playback of the second audio data frame.

[0254] The noise suppression method for loudspeakers in this application embodiment is compared to... Figure 6A The noise suppression method for loudspeakers, as shown, calculates the ERB energy of the audio data frame when its tone is determined to be a preset tone. This ERB energy is then compared to the ERB energy threshold in the corresponding ideal control strategy. Based on the comparison result, it can accurately determine whether the audio data frame will actually cause noise from the loudspeaker. Different processing strategies can then be applied to suppress noise generated by the loudspeaker playing the audio data frame while maximizing the utilization of the electronic device's hardware and software resources. For example, if the calculated ERB energy is greater than the ERB energy threshold corresponding to a certain control frequency, it indicates that the audio data frame will cause noise from the loudspeaker at that control frequency. In this case, gain suppression (gain reduction) is applied to the audio data frame based on the gain control value set and quality factor set in the corresponding ideal control strategy. This allows the ERB energy of the audio data frame at the control frequency and multiple frequencies near that control frequency to be adjusted to be less than or equal to the corresponding ERB energy threshold, ensuring that the audio data frame will not cause noise from the loudspeaker at the control frequency and multiple frequencies near that control frequency. If the calculated ERB energy is less than or equal to the ERB energy threshold corresponding to a certain control frequency, it indicates that the audio data frame will not cause noise from the speaker at that control frequency. In this case, there is no need to adjust the gain of the audio data frame, saving the hardware and software resources of the electronic device.

[0255] To better understand the implementation details of the above noise suppression methods in electronic devices, the following section combines... Figure 12 and Figure 13 This section describes the process by which various software and hardware components in an electronic device work together to achieve the aforementioned noise suppression method. Details are as follows:

[0256] The operating system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of the electronic device. Figure 12As shown, a layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. Taking the Android system as an example, in some implementations, the Android system is divided into four layers, from top to bottom: the application layer (Apk), the application framework layer (Framework), the hardware abstraction layer (HAL), and the kernel layer (Kernel).

[0257] The application layer can include a series of application packages. For example, an application package can include applications such as calling applications, audio playback applications, and video playback applications. Calling applications can include applications that support voice calls as well as applications that support video calls. Calling applications, audio playback applications, and video playback applications all support the ability to play sound through a speaker.

[0258] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. For example, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, etc.

[0259] The window manager manages window programs. It can obtain the screen size, determine the presence of a status bar, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images. The phone manager provides communication functionality for electronic devices, such as managing call status (including connection, hang-up, etc.). The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc.

[0260] The hardware abstraction layer includes an audio algorithm module. This module can be used to execute the noise suppression method provided in this application embodiment, thereby suppressing noise from multiple speakers.

[0261] For example, the audio algorithm module may include an audio framing module, a tone detection module, a first compression strategy processing module, a second compression strategy processing module, and an audio output module. The audio framing module is used to segment the audio data into multiple audio data frames. The tone detection module is used to perform tone detection on the audio data frames. Different tone detection results are processed by either the first compression strategy processing module or the second compression strategy processing module. The first compression strategy processing module processes the audio data frames using a first compression strategy. The second compression strategy processing module processes the audio data frames using a second compression strategy. The audio output module outputs the audio data frames processed by either the first or second compression strategy processing module.

[0262] In some embodiments, the first suppression strategy processing module may include multiple ERB energy calculation and gain control units. The number of ERB energy calculation and gain control units can match the number of speakers, i.e., one ERB energy calculation and gain control unit corresponds to one speaker. Each ERB energy calculation and gain control unit is used to calculate the ERB energy of the audio data frame input to the corresponding speaker in real time, and compare the calculated ERB energy with the ERB energy threshold set corresponding to the speaker based on the control frequency set corresponding to the speaker. If the calculated ERB energy value is greater than the corresponding ERB energy threshold, the audio data frame is gain-adjusted based on the gain control value set and quality factor set corresponding to the speaker. If the calculated ERB energy value is less than or equal to the corresponding ERB energy threshold, the audio data frame is not gain-adjusted. The audio output module can send the audio data frame processed by the ERB energy calculation and gain control unit to the speaker corresponding to the ERB energy calculation and gain control unit for playback. Assuming the electronic device includes m speakers, the first suppression strategy processing module may include m ERB energy calculation and gain control units. m is a positive integer greater than or equal to 2. Figure 12 The first ERB energy calculation and gain control unit is shown in the diagram, corresponding to the first speaker, and the m-th ERB energy calculation and gain control unit is corresponding to the m-th speaker.

[0263] This application embodiment achieves precise suppression of noise from each speaker and ensures a high volume for audio playback by performing ERB energy threshold comparison and gain adjustment for each speaker individually.

[0264] The kernel layer may contain audio drivers, display drivers, sensor drivers, etc. It may also include hardware-dependent programs such as interrupt handlers and device drivers, as well as basic, common, and frequently running modules such as clock management modules and process scheduling modules, and critical data structures. The kernel layer can be located within the processor or embedded in internal memory.

[0265] The hardware layer may include a display screen, multiple speakers, etc. Multiple speakers are used to play audio data.

[0266] It is understood that the above software structure is merely exemplary and does not constitute a limitation on the software structure of electronic devices. In other embodiments, electronic devices may have more or fewer structures, and this application does not impose any limitations on this.

[0267] To more intuitively understand the process by which the various software modules work together to suppress speaker noise, the following will use... Figure 11 The interactive diagram shown illustrates the noise suppression process of an electronic device when audio data is played through a speaker.

[0268] like Figure 13 The diagram illustrates the interaction flow between various hardware and software modules. This embodiment uses an electronic device including a first speaker and a second speaker as an example for explanation.

[0269] 1301: In response to the audio playback operation, the first application sends first audio data and second audio data to the audio framing module.

[0270] In some embodiments, the first application may be an application installed on an electronic device that enables audio playback, such as a call application, an audio playback application, a video playback application, etc. The first audio data corresponds to the first speaker, and the second audio data corresponds to the second speaker.

[0271] 1302: The audio framing module framing the first audio data to determine the first audio data frame, and framing the second audio data to determine the second audio data frame.

[0272] In some embodiments, performing tone detection and processing on a frame-by-frame basis (using a first compression strategy or a second compression strategy) can improve the tone detection accuracy and processing efficiency of the audio data. By dividing the first audio data into frames, multiple first audio data frames can be obtained, facilitating subsequent tone detection on each first audio data frame to select either the first or second compression strategy for processing. Similarly, by dividing the second audio data into frames, multiple second audio data frames can be obtained, facilitating subsequent tone detection on each second audio data frame to select either the first or second compression strategy for processing.

[0273] 1303: The audio framing module sends the first audio data frame and the second audio data frame to the tone detection module.

[0274] 1304: The tone detection module performs tone detection on the first audio data frame and the second audio data frame respectively.

[0275] By performing tone detection on the first and second audio data frames respectively, it can be determined whether the first and second audio data frames are audio data frames that are more likely to cause noise from the speaker. For audio data frames that are more likely to cause noise from the speaker, a first suppression strategy is used to process them to suppress the problem of noise easily generated by the speaker when playing this type of audio data frame. For audio data frames that are less likely to cause noise from the speaker, a second suppression strategy is used to process them, which can save the hardware and software resources of electronic devices.

[0276] 1305: If the tone of the first audio data frame is the preset tone, the tone detection module sends the first audio data frame to the first compression strategy processing module.

[0277] 1306: The first compression strategy processing module uses the first compression strategy to process the first audio data frame.

[0278] If the tone of the first audio data frame is a preset tone, it indicates that the first audio data frame is an audio data frame that is more likely to cause noise from the speaker. By adopting a first suppression strategy to process the first audio data frame, the problem of noise being easily generated when the first speaker plays the first audio data frame can be suppressed.

[0279] 1307: The first compression strategy processing module sends the processed first audio data frame to the audio output module.

[0280] 1308: If the tone of the first audio data frame is not the preset tone, the tone detection module will send the first audio data frame to the second compression strategy processing module.

[0281] 1309: The second compression strategy processing module uses the second compression strategy to process the first audio data frame.

[0282] If the tone of the first audio data frame is not a preset tone, it indicates that the first audio data frame is unlikely to cause noise from the speaker. By adopting a second suppression strategy to process the first audio data frame, the amount of data processing is small, which can save the hardware and software resources of the electronic device.

[0283] 1310: The second compression strategy processing module sends the processed first audio data frame to the audio output module.

[0284] 1311: The audio output module sends the processed first audio data frame to the first speaker.

[0285] By sending the processed first audio data frame to the first speaker, the first audio data frame can be played, and the first speaker plays the first audio data frame without any noise.

[0286] 1312: If the tone of the second audio data frame is the preset tone, the tone detection module sends the second audio data frame to the first compression strategy processing module.

[0287] 1313: The first compression strategy processing module uses the first compression strategy to process the second audio data frame.

[0288] If the tone of the second audio data frame is a preset tone, it indicates that the second audio data frame is an audio data frame that is more likely to cause noise from the speaker. By adopting a first suppression strategy to process the second audio data frame, the problem of noise being easily generated when the second speaker plays the second audio data frame can be suppressed.

[0289] 1314: The first compression strategy processing module sends the processed second audio data frame to the audio output module.

[0290] 1315: If the tone of the second audio data frame is not the preset tone, the tone detection module will send the second audio data frame to the second compression strategy processing module.

[0291] 1316: The second compression strategy processing module uses the second compression strategy to process the second audio data frame.

[0292] If the tone of the second audio data frame is not the preset tone, it indicates that the second audio data frame is unlikely to cause noise from the speaker. By adopting the second suppression strategy to process the second audio data frame, the amount of data processing is relatively small, which can save the hardware and software resources of electronic devices.

[0293] 1317: The second compression strategy processing module sends the processed second audio data frame to the audio output module.

[0294] 1318: The audio output module sends the processed second audio data frame to the second speaker.

[0295] By sending the processed second audio data frame to the second speaker, the second audio data frame can be played, and the second speaker plays the second audio data frame without any noise.

[0296] See Figure 14 As shown, the electronic device 100 involved in the embodiments of this application will be described below. The electronic device 100 in the embodiments of this application can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), large screen, smart TV, netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc., including a microphone and display screen. The embodiments of this application do not impose special limitations on the specific form of the electronic device. Please refer to... Figure 14 , Figure 14 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application.

[0297] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc.

[0298] The number of loudspeakers 170A can be multiple. For example, loudspeaker 170A includes a first loudspeaker and a second loudspeaker. For example, the first loudspeaker is used to play a first audio signal processed by a first suppression strategy or a second suppression strategy, and the second loudspeaker is used to play a second audio signal processed by the first suppression strategy or the second suppression strategy.

[0299] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0300] In addition, an operating system runs on top of the aforementioned components. Examples include Apple's iOS operating system, Google's Android open-source operating system, and Microsoft's Windows operating system.

[0301] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0302] For example, the processor 110 may invoke a first suppression strategy or a second suppression strategy to process the first audio played by the first speaker, and the processor 110 may also invoke the first suppression strategy or the second suppression strategy to process the second audio played by the second speaker.

[0303] For example, processor 110 can perform frame segmentation and tone detection on the first audio, and select either a first compression strategy or a second compression strategy to process the first audio based on the tone detection results. Processor 110 can also perform frame segmentation and tone detection on the second audio, and select either a first compression strategy or a second compression strategy to process the second audio based on the tone detection results.

[0304] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or that are being used repeatedly. If the processor 110 needs to use the instructions or data again, it can retrieve them directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency.

[0305] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0306] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0307] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0308] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0309] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0310] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0311] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0312] The display screen 194 is used to display images, videos, etc. The display screen 194 can also be used to display audio playback interfaces, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. In this embodiment, the display screen 194 can be a touch screen, that is, the display screen 194 integrates a touch sensor 180K.

[0313] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, generally referred to as DDR5 SDRAM), etc.; the NVM may include disk storage devices and flash memory.

[0314] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0315] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0316] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0317] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0318] The noise suppression methods described in the above embodiments can all be implemented in the electronic device 100 having the above hardware structure.

[0319] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on the electronic device 100, the electronic device 100 performs the above-mentioned related method steps to implement the noise suppression method or the method for constructing an ideal control strategy in the above embodiment.

[0320] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the noise suppression method or the method for constructing an ideal control strategy as described in the above embodiment.

[0321] This embodiment also provides a chip system coupled to a memory. The chip system is used to read and execute a computer program stored in the memory to implement the noise suppression method or the method for constructing an ideal control strategy in the above embodiments.

[0322] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0323] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0324] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0325] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0326] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0327] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for suppressing noise, applied to an electronic device, characterized by, The electronic device includes a first speaker and a second speaker, wherein the cavity containing the first speaker and the cavity containing the second speaker are in communication, and the method includes: In response to the user's first action, acquire the first audio and the second audio; The first audio is processed into frames to determine the first audio data frame; the second audio is processed into frames to determine the second audio data frame. If the tone of the first audio data frame is a preset tone, the first suppression strategy is used to perform gain adjustment processing on the first audio data frame to obtain the third audio data frame. The first suppression strategy is determined according to the first control strategy of the first speaker and the second control strategy of the second speaker when the first speaker and the second speaker are emitting sound together. If the tone of the second audio data frame is the preset tone, the first suppression strategy is used to perform gain adjustment processing on the second audio data frame to obtain the fourth audio data frame. The first speaker plays the third audio data frame, and the second speaker plays the fourth audio data frame; The first suppression strategy includes a first ideal control strategy corresponding to the first speaker. The first ideal control strategy includes a first equivalent rectangular bandwidth ERB energy threshold set, a first control frequency set, a first gain control value set, and a first quality factor set. The step of using the first suppression strategy to perform gain adjustment processing on the first audio data frame includes: Acquire the first ERB energy of the first audio data frame input to the first speaker; Based on the first set of control frequency points, the first ERB energy is compared with the corresponding ERB energy threshold in the first set of ERB energy thresholds; If the first ERB energy is greater than the corresponding ERB energy threshold, the first audio data frame is subjected to gain adjustment processing based on the first gain control value set and the first quality factor set.

2. The method of claim 1, wherein, The first suppression strategy is determined based on the first control strategy, the second control strategy, the third control strategy, and the fourth control strategy. The third control strategy is the control strategy for the first speaker when the first speaker is emitting sound alone, and the fourth control strategy is the control strategy for the second speaker when the second speaker is emitting sound alone.

3. The method of claim 1, wherein, The gain adjustment processing of the first audio data frame based on the first gain control value set and the first quality factor set includes: The audio bandwidth to be adjusted in the first audio data frame is determined based on the first set of quality factors. Gain adjustment is performed on the audio data within the audio bandwidth in the first audio data frame based on the first set of gain control values.

4. The method of claim 1, wherein, The method further includes: If the first ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment processing is performed on the first audio data frame.

5. The method of claim 1, wherein, The first suppression strategy includes a second ideal control strategy corresponding to the second speaker. The second ideal control strategy includes a second ERB energy threshold set, a second control frequency set, a second gain control value set, and a second quality factor set. The step of using the first suppression strategy to perform gain adjustment processing on the second audio data frame includes: Acquire the second ERB energy of the second audio data frame input to the second speaker; Based on the second control frequency point set, the second ERB energy is compared with the corresponding ERB energy threshold in the second ERB energy threshold set; If the second ERB energy is greater than the corresponding ERB energy threshold, the second audio data frame is subjected to gain adjustment processing based on the second gain control value set and the second quality factor set.

6. The method of claim 5, wherein, The gain adjustment processing of the second audio data frame based on the second gain control value set and the second quality factor set includes: The audio bandwidth to be adjusted in the second audio data frame is determined based on the second set of quality factors. Gain adjustment is performed on the audio data within the audio bandwidth in the second audio data frame based on the second set of gain control values.

7. The method of claim 5, wherein, The method further includes: If the second ERB energy is less than or equal to the corresponding ERB energy threshold, no gain adjustment processing is performed on the second audio data frame.

8. The method of any one of claims 1 to 7, wherein, The method further includes: If the tone of the first audio data frame is not the preset tone, the second suppression strategy is used to process the first audio data frame; If the tone of the second audio data frame is not the preset tone, the second suppression strategy is used to process the second audio data frame. The second suppression strategy includes adjusting the preset gain of the first audio data frame and the second audio data frame, or not adjusting the gain of the first audio data frame and the second audio data frame.

9. A method of constructing a noise suppression strategy, characterized by, The method includes: When the first speaker and the second speaker of the electronic device play a preset audio signal together and there is no noise, a first control strategy for the first speaker and a second control strategy for the second speaker are obtained. The first control strategy is determined based on the sound output condition of the first speaker and a first influence factor of the second speaker on the first speaker. The second control strategy is determined based on the sound output condition of the second speaker and a second influence factor of the first speaker on the second speaker. Based on the first control strategy, a first ideal control strategy for the first speaker is determined, and based on the second control strategy, a second ideal control strategy for the second speaker is determined. The first ideal control strategy is used to suppress noise in the first audio data played by the first speaker, and the second ideal control strategy is used to suppress noise in the second audio data played by the second speaker. The noise suppression of the first audio data played by the first speaker includes: The first audio data is segmented into frames to determine the first audio data frame; If the tone of the first audio data frame is a preset tone, the first ideal control strategy is used to perform gain adjustment processing on the first audio data frame to obtain a third audio data frame, and the first speaker is used to play the third audio data frame. The noise suppression of the second audio data played by the second speaker includes: The second audio data is segmented into frames to determine the second audio data frames; If the tone of the second audio data frame is the preset tone, the second ideal control strategy is used to perform gain adjustment processing on the second audio data frame to obtain the fourth audio data frame, and the second speaker is used to play the fourth audio data frame. The first control strategy includes a first ERB energy threshold set and a first control frequency point set. The first control frequency point set includes multiple first control frequencies, and the first ERB energy threshold set includes multiple first ERB energy thresholds that correspond one-to-one with the multiple first control frequencies. The method further includes: Obtain the resonant frequency of the first loudspeaker, and determine the first control frequency point set based on the resonant frequency of the first loudspeaker; At any first control frequency point, the first ERB energy of the first speaker playing the preset audio signal and the second ERB energy of the second speaker playing the preset audio signal are obtained; Based on the first ERB energy, the second ERB energy, and the first influence factor, a first ERB energy threshold corresponding to any of the first control frequency points is determined.

10. The method of claim 9, wherein, The step of determining the first ideal control strategy for the first speaker based on the first control strategy includes: Obtain the first control strategy for the multiple first speakers of the multiple electronic devices; Based on multiple first control strategies, a first ideal control strategy for the first speaker is determined; The step of determining the second ideal control strategy for the second speaker based on the second control strategy includes: The second control strategy for the multiple second speakers of the multiple electronic devices is obtained; Based on multiple second control strategies, a second ideal control strategy for the second speaker is determined.

11. The method of claim 9, wherein, The step of determining the first ideal control strategy for the first speaker based on the first control strategy includes: Obtain a third control strategy for the first speaker of the electronic device when it plays the preset audio signal alone without any noise; Based on the first control strategy and the third control strategy, the first ideal control strategy for the first speaker is determined; The step of determining the second ideal control strategy for the second speaker based on the second control strategy includes: Obtain a fourth control strategy for the second speaker of the electronic device when it plays the preset audio signal alone without noise; Based on the second control strategy and the fourth control strategy, the second ideal control strategy for the second speaker is determined.

12. The method of claim 9, wherein, The step of determining the first ERB energy threshold corresponding to any of the first control frequency points based on the first ERB energy, the second ERB energy, and the first influence factor includes: The first ERB energy threshold corresponding to any of the first control frequency points is determined based on the following formula: + , , , , wherein, is a first ERB energy threshold, is a first ERB energy, is a second ERB energy, is a first impact factor, is a signal of audio data obtained by down-sampling and filtering preset audio data input to the first speaker, is a signal of audio data obtained by down-sampling and filtering preset audio data input to the second speaker, is a sampling rate of the preset audio data, is a filtering bandwidth, is a frame length of the preset audio data after down-sampling, is any first control frequency point.

13. The method as described in claim 9, characterized in that, Each of the plurality of first control frequency points corresponds to a first influence factor.

14. The method as described in claim 13, characterized in that, When the second speaker emits sound alone, the first influence factor is obtained based on the vibration displacement information of the second speaker and the vibration displacement information of the first speaker.

15. The method as described in claim 14, characterized in that, The first impact factor is determined based on the following formula: , in, To record the first vibration displacement information of the first speaker when the second speaker is emitting sound alone. To record the second vibration displacement information of the second speaker when the second speaker is emitting sound alone. This is the average of the absolute values ​​of the recorded first vibration displacement information. This is the average of the absolute values ​​of the multiple recorded second vibration displacement information. For any first control frequency point, These are the sampling points.

16. The method as described in claim 9, characterized in that, The second control strategy includes a second ERB energy threshold set and a second control frequency point set. The second control frequency point set includes multiple second control frequencies, and the second ERB energy threshold set includes multiple second ERB energy thresholds that correspond one-to-one with the multiple second control frequencies. The method further includes: Obtain the resonant frequency of the second loudspeaker, and determine the second set of control frequency points based on the resonant frequency of the second loudspeaker; At any second control frequency point, the third ERB energy of the preset audio signal played by the first speaker is obtained, and the fourth ERB energy of the preset audio signal played by the second speaker is obtained. Based on the third ERB energy, the fourth ERB energy, and the second influence factor, a second ERB energy threshold corresponding to any of the second control frequency points is determined.

17. The method as described in claim 16, characterized in that, The step of determining the second ERB energy threshold corresponding to any second control frequency point based on the third ERB energy, the fourth ERB energy, and the second influence factor includes: The second ERB energy threshold corresponding to any of the second control frequency points is determined based on the following formula: + , , , , in, The second ERB energy threshold, For the third ERB energy, The fourth ERB energy, It is the second most influential factor. The signal is the audio data obtained by downsampling and filtering the preset audio data input to the first speaker. This is the signal of audio data obtained by downsampling and filtering the preset audio data input to the second speaker. To preset the sampling rate of audio data, For the filter bandwidth, The frame length of the preset audio data after downsampling. For any second control frequency point.

18. The method as described in claim 16, characterized in that, Each of the plurality of second control frequency points corresponds to a second influence factor.

19. The method as described in claim 18, characterized in that, When the first speaker emits sound alone, the second influence factor is obtained based on the vibration displacement information of the first speaker and the vibration displacement information of the second speaker.

20. The method as described in claim 19, characterized in that, The second impact factor is determined based on the following formula: , in, To record the third vibration displacement information of the first speaker when the first speaker is emitting sound alone. To record the fourth vibration displacement information of the second speaker when the first speaker is emitting sound alone. This is the average of the absolute values ​​of multiple recorded third vibration displacement information. This is the average of the absolute values ​​of multiple recorded fourth vibration displacement information. For any second control frequency point, These are the sampling points.

21. An electronic device, characterized in that, The electronic device includes a first speaker, a second speaker, a memory, and a processor; The first speaker, the second speaker, and the memory are all coupled to the processor; The memory is used to store program instructions; The processor is configured to read the program instructions stored in the memory and execute the noise suppression method as described in any one of claims 1 to 8, or execute the method for constructing a noise suppression strategy as described in any one of claims 9 to 20.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the noise suppression method as described in any one of claims 1 to 8, or implement the method for constructing a noise suppression strategy as described in any one of claims 9 to 20.

23. A computer program product, said computer program product comprising computer-readable instructions, characterized in that, When the computer-readable instructions are executed by a processor, they implement the noise suppression method as described in any one of claims 1 to 8, or the method for constructing a noise suppression strategy as described in any one of claims 9 to 20.