Audio processing method and electronic equipment based on howling detection
By dynamically adjusting the volume and combining multiple algorithms to screen howling frequency points, it solves the problems of false detection of howling suppression and sound quality damage in the existing technology, achieves effective howling suppression and sound quality protection, and is suitable for a variety of scenarios.
Patent Information
- Application Number
- CN202210124282.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-02-10
AI Technical Summary
Under the assumption that the number of howling frequency points is limited, existing howling suppression technology can easily lead to misdetection, damage to human voice and music information, and cannot flexibly and effectively balance sound quality and howling suppression effects.
By dynamically adjusting the volume based on howling frequency point screening results and target sound detection results, multiple algorithms are used to comprehensively screen howling frequency points, including peak threshold power ratio, peak average power ratio, peak harmonic power ratio and short-time autocorrelation. function to ensure the accuracy and effectiveness of volume adjustment.
It achieves the protection of human voice and music information while suppressing howling, improves user experience, ensures both sound quality and effective suppression of howling, and is suitable for a variety of scenarios and frequency bands.
Smart Images

Figure CN114464205B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of audio processing technology, and in particular, relates to an audio processing method and electronic equipment based on howling detection. Background Art
[0002] Howling is often generated when using speakers or other sound amplification equipment, especially when using microphones as pickups indoors. The reason for the howling is that there is an echo phenomenon indoors. When the reflected sound of the original sound and the generated echo pass through the microphone, they will be picked up by the microphone again, causing the echo to enter the speakers or other sound amplification equipment for amplification; and when the echo and the original sound are in the same phase, the two sounds will be superimposed and strengthened, and the strengthened sound and the echo generated again will pass through the microphone to enter the speakers or other sound amplification equipment for amplification, and the echo will be strengthened again. This cycle repeats, resulting in a strong and harsh howling.
[0003] Howling can seriously affect user experience and may even damage equipment in serious cases, so howling needs to be suppressed. Existing howling suppression methods generally use notch filters to suppress a few howling frequency points, assuming that the number of howling frequency points is limited or even very small. However, the existing howling frequency point screening basis is too single, which is prone to false detection, resulting in damage to useful sound information such as human voices and music, and poor howling suppression effect, affecting user experience.
[0004] Therefore, how to flexibly and effectively perform audio processing based on howling detection so as to balance sound quality and howling suppression effect has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides an audio processing method and electronic device based on howling detection, which dynamically adjusts the volume based on the howling frequency point screening results and the detection results of the target sound, thereby solving the problem of not being able to flexibly and efficiently balance the howling suppression and the sound quality assurance.
[0006] In a first aspect, an audio processing method based on howling detection is provided, which is applied to an electronic device, and the method includes:
[0007] Acquire an audio signal, and acquire an audio frame in a frequency domain space according to the audio signal, wherein the audio frame includes a plurality of frequency points;
[0008] screening the multiple frequency points for howling frequency points, and obtaining corresponding screening results; and,
[0009] Performing target sound detection on the audio signal and obtaining a corresponding detection result, wherein the detection result is used to indicate whether the audio frame has the target sound, wherein the target sound includes human voice and / or music sound;
[0010] According to the screening result and the detection result, the volume level of the audio frame is dynamically adjusted; wherein, when the screening result indicates that the howling frequency point exists,
[0011] If the detection result indicates that the target sound exists, the volume of the audio frame is lowered according to a preset volume reduction level, and the above steps are repeated until the volume reaches a preset first volume threshold; or,
[0012] If the detection result indicates that the target sound does not exist, the volume of the audio frame is lowered according to a preset volume reduction level, and the above steps are repeated until the volume reaches a preset second volume threshold, and the volume corresponding to the second volume threshold is lower than the volume corresponding to the first volume threshold.
[0013] Among them, repeating the above steps may specifically include repeating the following steps: repeatedly acquiring an audio signal, and acquiring an audio frame in a frequency domain space based on the audio signal, the audio frame including multiple frequency points; performing howling frequency point screening on the multiple frequency points, and obtaining corresponding screening results; and performing target sound detection on the audio signal, and obtaining corresponding detection results, the detection results being used to indicate whether the audio frame contains the target sound, the target sound including human voice and / or music sound; and dynamically adjusting the volume level of the audio frame based on the screening results and the detection results.
[0014] In one implementation, the first volume threshold may be the minimum volume that can be lowered when there is a howling frequency point and a target sound; the second volume threshold may be the minimum volume that can be lowered when there is a howling frequency point but no target sound. In order to highlight the target sound, the first volume threshold here may be higher than the second volume threshold. For example, in the case where there is a howling frequency point in the audio frame, if there is no target sound, then in order to suppress the howling, the minimum volume that can be lowered (the second volume threshold) can be set to 40 decibels. If there is a target sound, although it is also necessary to suppress the howling, in order to take into account the sound quality, the minimum decibel that the volume can be lowered will be limited. For example, the minimum volume limit (first volume threshold) can be adjusted to 50 decibels. At this time, the first volume threshold corresponds to 50 decibels, which is 40 decibels higher than the minimum volume that can be lowered when there is no target sound (the second volume threshold).
[0015] It should be understood that the specific values of the first volume threshold and the second volume threshold can be flexibly set as needed. For example, the first volume threshold can be set to the volume corresponding to when the howling is completely suppressed, and the second volume threshold can be set to the volume corresponding to when the howling is partially suppressed, etc. The embodiments of the present application are not limited to this.
[0016] In one implementation, lowering the volume of the audio frame may specifically include lowering the current volume of the audio frame according to a preset volume reduction level, wherein each preset volume reduction level may correspond to a certain decibel number, such as 5 decibels, 10 decibels, etc.
[0017] It should be understood that in the method of this implementation, a stepped volume adjustment method can be adopted. Specifically, when howling is detected in each round, the volume level will be reduced according to the preset volume reduction level to make the volume attenuate by a certain number of decibels. Since howling will continue to exist periodically, if howling is continuously detected, the volume level will also be continuously lowered. Therefore, the volume can be quickly reduced until the howling is suppressed and disappears by the set minimum volume.
[0018] The above volume adjustment method has a small amount of calculation and is stable, does not require filtering operation, and will not cause a sudden increase in the amount of calculation due to an increase in the howling frequency.
[0019] According to the audio processing method based on howling detection provided in the implementation mode, the target sound is detected simultaneously during the process of screening the howling frequency points, and when the howling frequency points exist, the volume is dynamically adjusted based on the detection result of the target sound, and the volume is adjusted to the lowest volume level corresponding to the target sound detection result. In this way, the howling can be suppressed efficiently and flexibly without losing effective sound information and ensuring sound quality, thereby improving the user experience.
[0020] In combination with the first aspect, in some implementations of the first aspect, when the screening result indicates that the howling frequency point does not exist, the method further includes:
[0021] Increase the volume of the audio frame according to a preset volume increase level, and repeat the above steps until the volume reaches a preset third volume threshold; or,
[0022] The volume of the audio frame is directly increased to a third volume threshold.
[0023] The third volume threshold may be a preset maximum volume that can be increased when there is no howling frequency point.
[0024] Exemplarily, the volume corresponding to the third volume threshold may be the maximum volume preset by the user, or may be another volume initially (or by default) set to be suitable for the user to listen to audio, etc. The specific value (decibel number) corresponding to the third volume threshold may be flexibly set as needed, and the embodiment of the present application does not limit this.
[0025] It should be understood that when the screening result indicates that there is no howling frequency point, the volume of the audio frame can be increased. There are multiple ways to increase the volume of the audio frame, including: based on the detection result of the target sound, the volume of the audio frame is increased in a step-by-step manner; or, instead of using the step-by-step volume increase method, the volume of the audio frame is directly increased to the corresponding preset volume.
[0026] It should be understood that the method provided by this implementation can make targeted adjustments to the howling suppression when the target sound is identified in the audio frame (for example, when there are human voices and / or music sounds, the maximum volume attenuation is limited, or when there are human voices and / or music sounds, the audio level is adjusted to directly restore the normal volume, etc.), thereby avoiding the loss of important information and ensuring sound quality.
[0027] According to the method provided by the present implementation, when no howling is detected, by adopting a step-by-step approach to increase the volume of the audio frame, the volume level can be continuously increased when the howling has not existed until the normal volume is restored, and the volume control is more accurate; and when no howling is detected, by directly increasing the volume of the audio frame, the volume can be quickly restored when the howling does not exist, the volume level can be increased to restore the volume to a certain decibel number, thereby improving the efficiency of volume adjustment.
[0028] In combination with the first aspect, in some implementations of the first aspect, screening the multiple frequency points for howling frequency points and obtaining corresponding screening results specifically includes:
[0029] Acquire power spectrum energy corresponding to the multiple frequency points according to the audio frame;
[0030] Selecting at least one first candidate frequency point having the highest power spectrum energy from the multiple frequency points;
[0031] The howling frequency point is screened from the at least one candidate frequency point according to a peak threshold power ratio PTPR, a peak to average power ratio PAPR, a peak harmonic power ratio PHPR, and a short-time autocorrelation function STACF.
[0032] According to the method provided by the present implementation, by using multiple algorithms to comprehensively screen the howling frequency points, the accuracy of howling frequency point screening can be improved, avoiding the problem of missing or misselecting howling frequency points due to a single screening basis, and facilitating subsequent effective suppression of howling.
[0033] In combination with the first aspect, in some implementations of the first aspect, the performing target sound detection on the audio signal and obtaining a corresponding detection result specifically includes:
[0034] When the howling frequency points are screened for the multiple frequency points, counting the number of harmonics in the audio frame;
[0035] The detection result of the target sound is obtained according to the power spectrum energy corresponding to the multiple frequency points and the number of harmonics.
[0036] In combination with the first aspect, in some implementations of the first aspect, acquiring the detection result of the target sound according to the power spectrum energy and the number of harmonics corresponding to the multiple frequency points specifically includes:
[0037] Calculating the identification feature corresponding to the target sound according to the power spectrum energy corresponding to the multiple frequency points, the identification feature including at least one of a harmonicity feature, a spectrum flux feature, and a sub-band energy proportion balance feature;
[0038] Performing historical smoothing processing on the identification features to obtain target identification features;
[0039] The detection result of the target sound is obtained according to the target identification feature and the number of harmonics.
[0040] According to the audio processing method based on howling detection provided by the present implementation, in the process of detecting the howling frequency point, by using features such as harmonicity features, spectrum flux features and sub-band energy ratio balance to detect human voice and / or music, it is possible to more accurately obtain whether there is human voice and / or music in the audio, so as to facilitate the subsequent flexible volume adjustment according to the corresponding recognition results, thereby achieving the protection of human voice and / or music while suppressing howling, avoiding the loss of important information, and ensuring the sound quality.
[0041] In combination with the first aspect, in some implementations of the first aspect, acquiring an audio signal and acquiring an audio frame in a frequency domain space according to the audio signal specifically includes:
[0042] Acquire the audio signal from a buffer area, wherein the buffer area stores the audio signal received by the electronic device;
[0043] According to a preset sampling rate and a number of samples corresponding to an audio frame length, the audio signal is subjected to frame processing to obtain the audio frame;
[0044] Performing windowing processing on the audio frame according to a window function to obtain the audio frame after the windowing processing;
[0045] Perform Fourier transform on the audio frame after the windowing process to obtain the audio frame in the frequency domain space.
[0046] In combination with the first aspect, in some implementations of the first aspect, the screening of the howling frequency point from the at least one candidate frequency point according to the peak threshold power ratio PTPR, the peak to average power ratio PAPR, the peak harmonic power ratio PHPR, and the short-time autocorrelation function STACF specifically includes:
[0047] The first candidate frequency point is screened once using a peak threshold power ratio criterion PTPR and a peak to average power ratio criterion PAPR to obtain a second candidate frequency point;
[0048] Performing a secondary screening on the second candidate frequency point by using the peak harmonic power ratio PHPR to obtain a third candidate frequency point;
[0049] The third candidate frequency point is screened three times using a short-time autocorrelation function STACF to obtain the howling frequency point.
[0050] According to the audio processing method based on howling detection provided in the implementation mode, howling frequency points are screened by utilizing a variety of criteria, and when howling frequency points exist, the volume level is dynamically adjusted based on the howling frequency point screening results. This can efficiently and flexibly suppress howling and improve user experience while ensuring sound quality.
[0051] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0052] Performing a periodic timing operation by a timer, wherein the timing operation includes a timing start and a timing end;
[0053] When each timing ends, the screening result and the detection result corresponding to the current timing period are obtained.
[0054] According to the method provided in this implementation, by setting the start time and end time of the howling frequency point detection through a timer, it is possible to implement multiple periodic detections of the howling frequency points, making the howling detection more flexible and the obtained howling frequency point detection results more timely.
[0055] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0056] When the timing ends and the detection result corresponding to the current timing period indicates that the target sound does not exist, and the screening result indicates that the howling frequency point exists, the volume level of the audio frame is lowered by one according to the preset volume reduction level; or,
[0057] When the timing ends and the screening result indicates that the howling frequency point does not exist, the volume level of the audio frame is increased according to the preset volume increase level.
[0058] According to the method provided by the present implementation, by adjusting the volume step by step according to the volume level, it is possible to achieve the beneficial effects of small and stable calculation amount, no need for filtering operation, and no sudden increase in calculation amount due to an increase in howling frequency.
[0059] In a second aspect, an electronic device for howling suppression is provided, comprising:
[0060] one or more processors;
[0061] one or more memories;
[0062] The memory stores computer-readable program instructions. When the processor runs the computer-readable program instructions, the electronic device executes the audio processing method based on howling detection as described in any implementation of the first aspect above.
[0063] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes computer instructions. When the computer instructions are executed, the audio processing method based on howling detection as described in any implementation manner of the first aspect is implemented.
[0064] In a fourth aspect, a computer product is provided, the computer product comprising computer instructions, and when the computer instructions are executed in a computer, the audio processing method based on howling detection described in any implementation manner of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a structural schematic diagram of an electronic device for howling suppression provided in an embodiment of the present application.
[0066] Figure 2 It is a schematic flow chart of an audio processing method based on howling detection provided in an embodiment of the present application.
[0067] Figure 3 It is a flowchart of processing an audio signal provided in an embodiment of the present application.
[0068] Figure 4 It is a schematic flow chart of another audio processing method based on howling detection provided in an embodiment of the present application.
[0069] Figure 5 This is a schematic flowchart of another audio processing method based on howling detection provided in an embodiment of the present application.
[0070] Figure 6 This is a schematic flowchart of another audio processing method based on howling detection provided in an embodiment of the present application.
[0071] Figure 7 It is a schematic diagram of the hardware structure of an electronic device for howling suppression provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0073] It should be noted that the terms used in the implementation methods of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.
[0074] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, it is defined that the "first" and "second" features may explicitly or implicitly include one or more of the features.
[0075] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0076] The most commonly used condition for determining whether a system has howling is the Nyquist stability criterion, that is, when the overall loop gain of the system at a frequency point is greater than or equal to 1, and the overall phase difference of the system is an integer multiple of 2π, it is considered that the frequency point can form howling, and the system is unstable. At this time, howling suppression is required. In actual scenarios, the room or environment may change, and the location of the equipment may also change, so the phase condition is uncertain. Therefore, in extreme cases, the phase conditions of all frequency points may cause howling, and there may be a lot of howling frequency points. Therefore, as long as the overall loop gain of the system is likely to be greater than or equal to 1, howling suppression is required.
[0077] Combined with the introduction in the background technology, trap filters are usually used for howling suppression. However, when there are many howling frequency points, the number of trap filters required increases, which will lead to a sharp increase in the amount of calculation; or if the number of trap filters is limited, it is impossible to cope with multi-frequency howling or wide-band howling, and it is impossible to completely suppress howling. In other existing howling suppression technologies, the frequency bands are usually divided according to the experience of fixed scenes, and it is assumed that the frequency ranges of human voice, music and howling are within a certain limited range. However, in fact, the effective frequency ranges of the three overlap, and the overall loop gain is not only related to the environment, but also to the frequency response of the device itself. When the device changes, the common howling frequency points will also change accordingly, resulting in the poor universality of the howling suppression method and the easy loss of important sound information. In addition, the existing howling suppression methods are generally unable to cope with network delays, and cannot effectively detect the periodic howling problem caused by delays.
[0078] In response to the above-mentioned deficiencies in howling detection and suppression performance, an embodiment of the present application provides an audio processing method based on howling detection, by simultaneously identifying human voices, music sounds, etc. during the screening process of howling frequency points, and then dynamically adjusting the volume according to the screening results of the howling frequency points and the detection results of the sound. It can flexibly and stably suppress howling while avoiding the loss of important sound information, taking into account both howling suppression and protection of important sound information.
[0079] The audio processing method based on howling detection provided in the embodiment of the present application can be applied to various scenarios where howling suppression is required, such as improving the sound quality of sound amplification, such as indoor conference sound amplification, karaoke, or karaoke with a portable mobile terminal. The audio processing method based on howling detection provided in the embodiment of the present application can be applied to various electronic devices, such as smart phones, computers, microphones, speakers, etc.
[0080] For example, Figure 1 , which is a schematic diagram of a structure of an electronic device for howling suppression provided by an embodiment of the present application. The electronic device for howling suppression 100 may include a frequency domain transformation module 101 , a howling frequency point detection module 102 , a human voice and music detection module 103 , and an energy control logic module 104 .
[0081] In some embodiments, the frequency domain transformation module 101 is mainly used to perform various basic processing on the input audio signal, including caching, framing, windowing and discrete Fourier transform of the input audio signal, thereby transforming the audio signal from the time domain form to the frequency domain form, and finally taking the amplitude spectrum and power spectrum and statistically calculating the total energy and average energy of the current audio frame.
[0082] In some embodiments, the howling frequency point detection module 102 is mainly used to detect whether there is howling, including selecting candidate frequency points, performing a primary screening on the candidate frequency points, performing a secondary screening on the candidate frequency points, and performing a tertiary screening on the candidate frequency points, etc. After multiple screenings, the frequency point finally retained is the howling frequency point.
[0083] In some embodiments, the vocal music detection module 103 is mainly used to detect whether there is vocal or music, including calculating recognition features such as harmonic features, spectrum flux features, sub-band energy ratio balance features, and corresponding judgment logic.
[0084] In some embodiments, the energy control logic module 104 is mainly used to control energy, and adjust the current volume level according to the detection results of the howling frequency point detection module and the vocal music detection module, so as to achieve rapid suppression of howling and rapid recovery of volume.
[0085] It should be noted that the structure of the howling suppression electronic device described above is only an example. In actual applications, the howling suppression electronic device may also include other modules (such as an audio receiving module) and have other functions, which is not limited in the embodiments of the present application.
[0086] In order to more clearly illustrate the audio processing method based on howling detection provided in the embodiment of the present application, the implementation process of the audio processing method based on howling detection provided in the embodiment of the present application is introduced below in conjunction with the accompanying drawings.
[0087] For example, Figure 2 As shown, it is a schematic flow chart of an audio processing method based on howling detection provided by an embodiment of the present application. The execution subject of the method is an electronic device (as shown above) Figure 1 The howling suppression electronic device shown in the figure), the process may include the following steps:
[0088] S201, acquiring an audio signal, and acquiring an audio frame in a frequency domain space according to the audio signal, where the audio frame includes a plurality of frequency points.
[0089] In some embodiments, the specific process of an electronic device acquiring an audio signal and acquiring an audio frame in a frequency domain space based on the audio signal may include: the electronic device may receive an audio signal through an audio acquisition module such as a microphone, and store the audio signal in a cache area (such as a cache); thereafter, the electronic device may acquire an audio signal (such as the most recently stored audio signal) from the cache area, and perform frame processing on the audio signal according to a preset sampling rate and the number of samples corresponding to the audio frame length, to acquire an audio frame; thereafter, perform windowing processing on the audio frame according to a window function, to obtain a windowed audio frame; and then perform Fourier transform on the windowed audio frame, to acquire an audio frame in the frequency domain space.
[0090] It should be noted that the frequency point in the embodiment of the present application may refer to the center frequency corresponding to a frequency band, and a frequency point can be used to characterize a frequency band. In addition, each frequency point has a corresponding power spectrum energy, so the meaning of the frequency point in the embodiment of the present application may also include its corresponding power spectrum energy.
[0091] In some embodiments, the electronic device may also obtain total energy and average energy corresponding to the audio frame according to frequency points in the audio frame.
[0092] The specific implementation of this process can be found below. Figure 3 The introduction in the embodiments will not be described in detail here.
[0093] S202, screening howling frequency points for multiple frequency points, and obtaining corresponding screening results.
[0094] In some embodiments, the process of screening howling frequency points for multiple frequency points may include: obtaining power spectrum energy corresponding to multiple frequency points according to an audio frame; selecting at least one first candidate frequency point with the highest power spectrum energy from the multiple frequency points; and screening howling frequency points from at least one candidate frequency point according to a peak-to-threshold power ratio (PTPR), a peak-to-average power ratio (PAPR), a peak-to-harmonic power ratio (PHPR) and a short time autocorrelation function (STACF).
[0095] Exemplarily, the process of screening a howling frequency point from at least one candidate frequency point according to the peak threshold power ratio PTPR, the peak to average power ratio PAPR, the peak harmonic power ratio PHPR and the short-time autocorrelation function STACF may include: screening the first candidate frequency point once using the peak threshold power ratio criterion PTPR and the peak to average power ratio criterion PAPR to obtain a second candidate frequency point; screening the second candidate frequency point twice using the peak harmonic power ratio PHPR to obtain a third candidate frequency point; screening the third candidate frequency point three times using the short-time autocorrelation function STACF to obtain the howling frequency point.
[0096] It should be noted that the execution order of the criteria for screening the howling frequency points introduced above is only an example. In practical applications, the specific execution order of each screening basis is not limited. For example, the screening criteria for a screening is not limited to PAPR and PTPR, but can also be PHPR criteria or STACF criteria, etc. In addition, in practical applications, the combination of criteria for screening the howling frequency points can also be other combinations, such as using two of the above-mentioned screening criteria to determine the howling frequency points, etc., and the embodiments of the present application are not limited to this.
[0097] The specific process of using the multi-layer algorithm to screen the howling frequency points at multiple frequency points in this step will be described below. Figure 4 A more specific introduction is given in the embodiments and will not be described in detail here.
[0098] S203, performing target sound detection on the audio signal and obtaining a corresponding detection result, where the detection result is used to indicate whether the audio frame has a target sound, where the target sound includes a human voice and / or a musical sound.
[0099] In some embodiments, the process of performing target sound detection on an audio signal and obtaining corresponding detection results may include: when howling frequency points are screened for multiple frequency points, counting the number of harmonics in the audio frame; and obtaining the detection results of the target sound based on the power spectrum energy and the number of harmonics corresponding to the multiple frequency points.
[0100] Furthermore, the process of the electronic device obtaining the detection result of the target sound based on the power spectrum energy and the number of harmonics corresponding to multiple frequency points may include: calculating the identification features corresponding to the target sound based on the power spectrum energy corresponding to multiple frequency points, the identification features including at least one of harmonicity features, spectrum flux features, and sub-band energy ratio balance features; performing historical smoothing on the identification features to obtain the target identification features; and obtaining the detection result of the target sound based on the target identification features and the number of harmonics.
[0101] The specific implementation process of obtaining the target recognition feature and obtaining the detection result of the target sound according to the target recognition feature and the number of harmonics can be seen below. Figure 5 The relevant introduction in the embodiments will not be described in detail here.
[0102] S204, dynamically adjusting the volume level of the audio frame according to the screening result and the detection result, wherein when the screening result indicates the presence of a howling frequency point, including: if the detection result indicates the presence of a target sound, lowering the volume of the audio frame according to a preset volume reduction level, and repeating the above steps until the volume reaches a preset first volume threshold; or, if the detection result indicates that there is no target sound, lowering the volume of the audio frame according to a preset volume reduction level, and repeating the above steps until the volume reaches a preset second volume threshold, and the volume corresponding to the second volume threshold is lower than the volume corresponding to the first volume threshold.
[0103] Among them, repeating the above steps specifically refers to repeating the above steps S201 to S203. Specifically, it is to repeatedly acquire the audio signal, and acquire the audio frame in the frequency domain space according to the audio signal, the audio frame includes multiple frequency points; perform howling frequency point screening on the multiple frequency points, and obtain corresponding screening results; and perform target sound detection on the audio signal, and obtain corresponding detection results, the detection results are used to indicate whether the audio frame has the target sound, the target sound includes human voice and / or music; according to the screening results and the detection results, dynamically adjust the volume level of the audio frame. In other words, the next round of howling frequency point screening and target sound detection process for the audio signal is repeated.
[0104] In some embodiments, the electronic device adjusts the volume level of the audio frame according to the pre-acquired detection result and screening result of the target sound, which may include: when the screening result indicates the presence of a howling frequency point, if the detection result indicates the presence of the target sound, then lowering the volume of the audio frame according to a preset volume reduction level, and repeating the above steps S201 to S203 until the volume reaches a preset first volume threshold; or, if the detection result indicates that the target sound does not exist, then lowering the volume of the audio frame according to the preset volume reduction level, and repeating the above steps S201 to S203 until the volume reaches a preset second volume threshold, and the volume corresponding to the second volume threshold is lower than the volume corresponding to the first volume threshold.
[0105] In some embodiments, the preset volume reduction level may correspond to a certain decibel number, such as 5 decibels, 10 decibels, etc. The volume reduction level may be flexibly set as needed, and the embodiments of the present application are not limited thereto.
[0106] In some embodiments, the first volume threshold may be the minimum volume that can be lowered when there is a howling frequency point and a target sound; the second volume threshold may be the minimum volume that can be lowered when there is a howling frequency point but no target sound. In order to highlight the target sound, the first volume threshold here may be higher than the second volume threshold. For example, in the case where there is a howling frequency point in the audio frame, if there is no target sound, then in order to suppress the howling, the minimum volume that can be lowered (the second volume threshold) can be set to 40 decibels. If there is a target sound, although it is also necessary to suppress the howling, in order to take into account the sound quality, the minimum decibel that the volume can be lowered will be limited. For example, the minimum volume limit (first volume threshold) can be adjusted to 50 decibels. At this time, the first volume threshold corresponds to 50 decibels, which is 40 decibels higher than the minimum volume that can be lowered when there is no target sound (the second volume threshold).
[0107] It should be understood that the specific values of the first volume threshold and the second volume threshold can be flexibly set as needed. For example, the first volume threshold can be set to the volume corresponding to when the howling is completely suppressed, and the second volume threshold can be set to the volume corresponding to when the howling is partially suppressed, etc. The embodiments of the present application are not limited to this.
[0108] It should be understood that in the method of this implementation, a stepped volume adjustment method can be adopted. Specifically, when howling is detected in each round, the volume level will be lowered to attenuate the volume by a certain number of decibels. Since howling will continue to exist periodically, if howling is continuously detected, the volume level will also be continuously lowered. Therefore, the volume can be quickly reduced until the howling is suppressed and disappears at the set minimum volume.
[0109] The above volume adjustment method has a small amount of calculation and is stable, does not require filtering operation, and will not cause a sudden increase in calculation amount due to an increase in the howling frequency.
[0110] In other embodiments, when the screening result indicates that there is no howling frequency point, the method further includes: increasing the volume of the audio frame according to a preset volume increase level, and repeating the above steps S201 to S203 until the volume reaches a preset third volume threshold; or, directly increasing the volume of the audio frame to the third volume threshold.
[0111] The third volume threshold may be a preset maximum volume that can be increased when there is no howling frequency point.
[0112] Exemplarily, the volume corresponding to the third volume threshold may be the maximum volume preset by the user, or may be another volume initially (or by default) set suitable for the user to listen to audio, etc. The specific value (decibel number) corresponding to the third volume threshold may be flexibly set as needed, and the embodiments of the present application are not limited thereto.
[0113] In some embodiments, the preset volume increase level may correspond to a certain decibel number, such as 5 decibels, 10 decibels, etc. The volume increase level may be flexibly set in advance as needed, and the embodiments of the present application are not limited thereto.
[0114] It should be understood that when the screening result indicates that there is no howling frequency point, the volume of the audio frame can be increased. There are multiple ways to increase the volume of the audio frame, including: based on the detection result of the target sound, the volume of the audio frame is increased in a step-by-step manner, such as increasing the volume according to the preset volume increase level as mentioned above. More specifically, one (or more) volume increase levels can be increased in each round of volume adjustment; or, instead of using the step-by-step volume increase method, the volume of the audio frame is directly increased to the corresponding preset volume.
[0115] It should also be understood that the method provided by this implementation can make targeted adjustments to the howling suppression when the target sound is identified in the audio frame (for example, when there are human voices and / or music sounds, the maximum volume attenuation is limited, or when there are human voices and / or music sounds, the audio level is adjusted to directly restore the normal volume, etc.), thereby avoiding the loss of important information and ensuring sound quality.
[0116] It should be noted that the howling frequency point screening process in the embodiment of the present application can be performed cyclically. For example, the electronic device can perform a periodic timing operation through a timer, and the timing operation includes a timing start and a timing end. During each round of timing, the howling frequency point screening and the target sound detection will be performed according to the above process; when each timing ends, the screening result and the detection result corresponding to this timing period can be obtained.
[0117] In some embodiments, adjusting the volume level of the audio frame according to the screening result and the detection result may include: adjusting the volume level of the audio frame by a volume level according to the screening result and the detection result after each timing. For example, after the timing is over, if the screening result corresponding to the current timing period indicates that there is a howling frequency point, and the detection result indicates that there is no target sound, the volume level of the audio frame is lowered by the volume lowering level; or, after the timing is over, if the current detection result indicates that there is a target sound, the volume level of the audio frame is raised by the volume raising level.
[0118] In some embodiments, after the volume level of the audio frame is adjusted, the timer can be reset to perform a new round of howling screening and target sound recognition.
[0119] The specific implementation of this process can be found in Figure 4 and Figure 6 The relevant introduction in the embodiments will not be described in detail here.
[0120] According to the audio processing method based on howling detection provided in the implementation mode, the target sound is detected simultaneously during the process of screening the howling frequency points, and when the howling frequency points exist, the volume is dynamically adjusted based on the detection result of the target sound, and the volume is adjusted to the lowest volume level corresponding to the target sound detection result. In this way, the howling can be suppressed efficiently and flexibly without losing effective sound information and ensuring sound quality, thereby improving the user experience.
[0121] The audio processing method based on howling detection provided in the embodiment of the present application is widely applicable and is still effective even when the overall loop gain is large. The effect is not limited by the number of howling frequencies, nor is it limited by the effective frequency range. The frequency bands can be divided arbitrarily, and different parameters or thresholds can be set for different frequency bands to adapt to different scenarios. More efficient detection and suppression can be performed specifically for the howling-prone frequency bands in fixed scenarios. It can also be applied to network communication situations and is equally effective for periodic howling.
[0122] For example, Figure 3 As shown, it is a schematic diagram of a process for processing an audio signal provided by an embodiment of the present application. The process is used to perform frequency domain conversion on a time domain audio signal received by an electronic device, and calculate the total energy and average energy corresponding to the audio frame in the frequency domain space. The process can be executed by an electronic device, such as an audio signal receiving module ( Figure 1 Not shown) and a frequency domain transformation module are executed, which may specifically include the following steps:
[0123] S301, receiving an audio signal.
[0124] The electronic device may receive audio signals via an audio receiving module (such as a corresponding microphone).
[0125] S302, buffering the audio signal into a buffer and dividing it into frames to obtain audio frames.
[0126] In some embodiments, the electronic device may cache the acquired audio signal in a buffer. Afterwards, the electronic device may obtain audio frames from the cached audio signal in the buffer at a preset sampling rate, so as to subsequently process the retrieved audio frames. Exemplarily, assuming that the frame length of an audio frame is N, when framing based on the audio signal, the sampling frequency may be set to 8000 Hz, for example, and the frame length N may be 1024 sampling points, that is, an audio frame includes 1024 sampling points.
[0127] Exemplarily, the process of the electronic device processing the current audio signal can be performed simultaneously with the process of collecting other audio signals. For example, the audio signal can be processed synchronously and in real time in a sound amplification scenario to obtain audio frames.
[0128] S303: Perform windowing processing on the audio frame signal.
[0129] It should be noted that before performing discrete Fourier transform on the audio signal, the obtained audio frame needs to be windowed, that is, multiplied by a window function. The purpose of windowing is to make the amplitude of a frame of audio signal after frequency domain space transformation gradually change to 0 at both ends, so as to obtain discrete Fourier transform data that is easier to analyze.
[0130] In some embodiments, the electronic device may perform a windowing operation on the audio frame obtained in step S302, or perform a windowing operation after intercepting the sub-frames (audio frames) obtained in step S302.
[0131] The windowing operation can be performed using the following formula (1-1):
[0132] y[i]=x[i]×w[i],0≤i≤N-1 (1-1)
[0133] Wherein, x[i] represents the i-th sampling point of the audio frame before windowing; w[i] represents the i-th sampling point of the window function; y[i] represents the i-th sampling point of the audio frame after windowing; and N represents the frame length.
[0134] It should be noted that the window function used in the windowing operation in the embodiment of the present application is not limited, and it can be implemented using a variety of existing window functions, such as Hamming window, Hanning window and Kaiser window. Exemplarily, when the Hanning window is used, its expression can be shown as formula (1-2):
[0135]
[0136] Wherein, w[i] represents the i-th sampling point of the window function; N represents the frame length.
[0137] S304: Perform Fourier transform on the windowed audio frame signal to obtain an audio frame in the frequency domain.
[0138] In some embodiments, the windowed audio frame is subjected to a Fourier transform to obtain an audio signal in the frequency domain. Exemplarily, the electronic device may use the following formula (1-3) to perform a fast Fourier transform using an accelerated algorithm:
[0139]
[0140] Wherein, X[k] represents the energy value of the kth frequency point of the audio frame spectrum; i is the i-th sampling point; and N is the frame length.
[0141] S305: Calculate the corresponding amplitude spectrum and power spectrum according to the audio frame in the frequency domain space.
[0142] The amplitude spectrum here may be amplitude spectrum energy, and the power spectrum may be power spectrum energy.
[0143] In some embodiments, the process of calculating the amplitude spectrum corresponding to the audio frame in the frequency domain space may include: taking the modulus value of the frequency spectrum complex sequence to obtain the amplitude spectrum energy corresponding to the audio frame in the frequency domain space. Exemplarily, the amplitude spectrum may be calculated using the following formula (1-4):
[0144] Y[k]=|X[k]|,0≤k≤P-1 (1-4)
[0145] Where P is the number of frequency points in the audio frame.
[0146] In some embodiments, the process of calculating the amplitude spectrum corresponding to the audio frame in the frequency domain space may include: after the amplitude spectrum is calculated according to the above method, the square of the amplitude spectrum is calculated to obtain the corresponding power spectrum. Exemplarily, the power spectrum may be calculated using the following formula (1-5):
[0147] Z[k]=|X[k]| 2 ,0≤k≤P-1 (1-5)
[0148] Wherein, Y[k] represents the amplitude spectrum of the kth frequency point of the amplitude spectrum of the audio frame; Z[k] represents the power spectrum energy value of the kth frequency point of the power spectrum of the audio frame; and P represents the number of frequency points in the audio frame.
[0149] Optionally, after obtaining the audio frame in the frequency domain space, the total energy and average energy corresponding to the audio frame may be calculated, which may be specifically achieved by the following steps:
[0150] S306: Count the total energy and average energy corresponding to the audio frame according to the amplitude spectrum and the power spectrum.
[0151] In some embodiments, the electronic device can count the total energy and average energy in the frequency domain corresponding to the audio frame according to the amplitude spectrum and power spectrum calculated in the above step S305. Specifically, the total energy in the frequency domain can be calculated according to the following formula (1-6), and the average energy corresponding to the audio frame can be calculated according to the following formula (1-7):
[0152]
[0153]
[0154] Where E represents the total energy in the frequency domain corresponding to the audio frame; Z[k] represents the power value corresponding to the kth frequency point of the audio frame power spectrum; A ve Represents the average energy corresponding to the audio frame; P is the number of frequency points in the audio frame.
[0155] It should be noted that the electronic device can process multiple audio frames in sequence according to the process shown in the above steps S301 to S306 to obtain the total frequency domain space energy corresponding to the multiple audio frames and the average energy corresponding to each audio frame.
[0156] According to the audio processing method based on howling detection provided in the embodiment of the present application, by framing, windowing, and Fourier transforming the audio signal in the time domain space, it is transformed into the frequency domain space, and then the howling frequency points are screened based on a variety of criteria, which can improve the accuracy of howling frequency point screening, thereby facilitating accurate and efficient suppression of howling and improving user experience.
[0157] For ease of understanding, the following Figure 4 An exemplary process of how to perform howling frequency point screening in the audio processing method based on howling frequency point detection provided in an embodiment of the present application is introduced.
[0158] For example, Figure 4 As shown, it is a schematic flow chart of another audio processing method based on howling detection provided by an embodiment of the present application. The process can be performed by a howling suppression electronic device (such as a corresponding Figure 1 The howling suppression electronic device shown in the figure, hereinafter referred to as the electronic device) is executed, which may specifically include the following steps:
[0159] S401: Receive an audio signal, and obtain audio energy corresponding to an audio frame in a frequency domain space based on the audio signal.
[0160] The audio energy corresponding to the audio frame in the frequency domain space may include the distribution of each frequency point in the audio frame in the frequency domain space, that is, the frequency domain energy distribution corresponding to the audio frame in the frequency domain space. The audio energy may include the total frequency domain energy and average energy corresponding to the audio frame, wherein the average energy corresponding to the audio frame refers to the total frequency domain energy of the audio frame divided by the number of frequency points.
[0161] It should be noted that the frequency points involved in the embodiments of the present application can also be used to refer to energy. For example, the frequency points (or the energy of the frequency points) in the following embodiments can be used to represent the power spectrum energy corresponding to the frequency points. It should be understood that each audio frame can correspond to multiple frequency bands (characterized by frequency points), and each frequency point corresponds to a power spectrum energy.
[0162] In some embodiments, after receiving the audio signal, the electronic device caches and frames the audio signal, uses discrete Fourier transform to convert the audio frame from the time domain to the frequency domain, obtains each frequency point included in the audio frame, and calculates the corresponding total energy and average energy of the frequency domain spatial audio frame according to the power spectrum energy corresponding to each frequency point. The specific implementation of the calculation process can be found in the above Figure 3The details are introduced in the embodiments and will not be described again here.
[0163] S402: According to the audio energy, select the frequency points corresponding to the first n highest audio energies as the first candidate frequency points, where n is an integer greater than or equal to 1.
[0164] The frequency points corresponding to the n highest audio energies respectively correspond to at least one first candidate frequency point mentioned above.
[0165] It should be noted that if the current audio frame is a silent frame, the audio frame has no howling, and no howling frequency point detection and howling suppression are required. Therefore, the embodiment of the present application is mainly introduced for the case where the current audio frame is a non-silent frame.
[0166] The first candidate frequency point in the embodiment of the present application may be at least one frequency point with the largest energy selected from the frequency points of the audio frame based on the energy value (such as power spectrum energy).
[0167] Specifically, when the audio frame is a non-silent frame, the first n frequency points with the largest energy can be selected from all the frequency points of the audio frame as the first candidate frequency points according to the energy corresponding to each frequency point in the audio frame. That is, according to the energy corresponding to the frequency point, a specific number of frequency points are selected as the first candidate frequency points. Exemplarily, in one implementation, the number n of the first candidate frequency points can be preset, and then the n frequency points with the largest energy are selected from the frequency points of the audio frame.
[0168] Optionally, in other embodiments, the first candidate frequency point may be selected based on the energy of the frequency point, rather than based on a preset number. For example, a frequency point whose energy is greater than a first threshold may be selected from the audio frame as the first candidate frequency point, that is, all frequency points whose energy is greater than the first threshold are used as the first candidate frequency point. The first threshold may be flexibly set as needed, and the embodiments of the present application are not limited thereto.
[0169] S403, screen the first candidate frequency point once using the peak threshold power ratio criterion PTPR and the peak average power ratio criterion PAPR to obtain a second candidate frequency point.
[0170] In some embodiments, after the first candidate frequency point is obtained, the howling frequency point can be screened once using the peak threshold power ratio PTPR criterion and the peak average power ratio PAPR criterion to obtain the second candidate frequency point.
[0171] Specifically, the formula involved in the PTPR criterion is shown in (1-8), and the formula involved in the PAPR criterion is shown in (1-9):
[0172] PTPR:Z[k] <thres1 (1-8)
[0173] PAPR:Z[k] <thres2×Ave (1-9)
[0174] Wherein, Ave represents the average energy of the audio frame; thres1 and thres2 represent preset thresholds respectively, and their specific values can be flexibly set as needed, and this application does not limit this.
[0175] S404, performing secondary screening on the second candidate frequency point by using the peak harmonic power ratio PHPR to obtain a third candidate frequency point.
[0176] In some embodiments, after the second candidate frequency point is obtained, the peak harmonic power ratio PHPR criterion may be used to perform a second screening on the candidate frequency points to obtain a third candidate frequency point.
[0177] Specifically, the formula involved in the PHPR criteria is shown in (1-10):
[0178] PHPR:Z[2k]>thres3×Z[k]and Z[3k]>thres4×Z[k] (1-10)
[0179] Among them, thres3 and thres4 represent preset thresholds respectively, and their specific values can be flexibly set as needed, and this application does not limit this.
[0180] In some embodiments, the number of harmonics of the frequency points that meet the screening conditions can be counted and historical smoothing can be performed. Specifically, the following formula (1-11) can be used for historical smoothing:
[0181] acc_har_num[n+1]=a×acc_har_num[n]+(1-a)×har_num (1-11)
[0182] Wherein, har_num represents the number of harmonics counted, acc_har_num[n] represents the historical smoothed value; acc_har_num[n+1] represents the updated smoothed value; a is a constant, for example, it can be 0.90 to 0.99.
[0183] S405 , screening the third candidate frequency point three times by using the short-time autocorrelation function STACF to obtain a howling frequency point.
[0184] In some embodiments, after obtaining the third candidate frequency point, the STACF short-time autocorrelation function may be used to screen the candidate frequency points three times, and the screening condition is the following formula (1-12):
[0185] STACF:max{ρ[k][t],delay_min≤t≤delay_max} <thres5 (1-12)
[0186] Among them, max{} represents the maximum value function; ρ[k][t] represents the normalized autocorrelation value; delay_min and delay_max respectively represent the preset maximum system delay frame number; t represents the autocorrelation time-shift frame number; thres5 represents the preset threshold value, and its specific value can be flexibly set as needed, and this application does not limit this.
[0187] Specifically, ρ[k][t] in the above formula (1-12) can be calculated according to the following formulas (1-13) to (1-16):
[0188]
[0189]
[0190]
[0191]
[0192] Among them, in the above formulas (1-13) to (1-16), L represents the maximum number of tracking frames, Mean[k] represents the historical amplitude spectrum mean of the kth frequency point, Y[k][l] represents the amplitude spectrum value of the kth frequency point in the first l frames, represents the amplitude spectrum value after zero mean, and R[k][t] represents the short-time autocorrelation function.
[0193] In some embodiments, the amplitude spectrum value after zero-averaging may be in an accelerated form, such as binarization.
[0194] In some embodiments, after the above three screenings, the frequency point finally retained in the screening results is used as the howling frequency point.
[0195] It should be noted that the execution order of the above steps S203 to S205 is only an example. In practical applications, the specific implementation order of the above steps is not limited. For example, the screening criteria based on a screening is not limited to PAPR and PTPR, but can also be PHPR criteria and / or STACF criteria, etc., and it is not limited to executing each screening criterion in the order of the above examples. In addition, in practical applications, the combination of criteria for screening the howling frequency point can also be other combinations, such as using two of the above-mentioned screening criteria to determine the howling frequency point, etc., and the embodiments of the present application are not limited to this.
[0196] Optionally, in some embodiments, after the howling frequency points are screened out, howling suppression may be performed according to the screening results. The howling suppression process may include the following steps:
[0197] S406: After the howling frequency points are screened out, the current volume of the audio signal is gradually reduced according to the preset volume reduction levels.
[0198] In some embodiments, the process of screening the howling frequency points can be performed periodically. For example, the electronic device can perform periodic timing operations (i.e., perform cyclic timing) through a timer, and the timely operation includes timely start and end of timing; if the howling frequency points are screened out after one timing ends, the volume can be lowered according to the preset volume down level to suppress the howling; if the howling frequency points are not screened out after one timing ends, the volume can be raised according to the preset volume up level to improve the audio playback effect.
[0199] In some embodiments, multiple volume reduction levels and volume increase levels may be preset, for example, each volume reduction level and each volume increase level may correspond to a certain decibel, such as 5 decibels, 10 decibels, etc. Among them, the volume reduction level corresponding to the volume reduction and the volume increase level corresponding to the volume increase may be the same or different when the volume is reduced, and this embodiment of the application is not limited to this.
[0200] In some embodiments, if the howling frequency points are screened out in multiple rounds of howling frequency point screening processes, the volume can be gradually lowered according to the preset volume reduction level. After reducing one volume reduction level, the timer can be reset to perform another round of timing and perform the next round of howling frequency point screening process; if the howling frequency points are still screened out after the next round of screening, then the volume reduction level can be further reduced; thereafter, the above process is repeated until the actual volume of the audio reaches the preset first volume threshold, or until the screening result indicates that there is no howling frequency point.
[0201] In some embodiments, when no howling frequency point is screened out after the above screening process, the volume can be gradually increased according to the preset volume increase level. After raising one volume increase level, the timer can be reset for another round of timing, and the next round of howling frequency point screening process can be carried out; if the howling frequency point is still not screened out after the next round of screening, then the volume increase level can be increased; thereafter, the above process is repeated until the volume level reaches the preset third volume threshold, or until the existence of a howling frequency point is detected. Among them, the volume corresponding to the preset third volume threshold can be a preset maximum volume, or it can be another volume that is initially (or default) set and suitable for the user to listen to audio. The specific value (decibel number) corresponding to the third volume threshold can be flexibly set as needed, and the embodiments of the present application are not limited to this.
[0202] Optionally, if after the volume level is increased, a howling frequency point is screened out in the next round of screening, the volume can be lowered according to the preset volume level. The specific process can be referred to the relevant introduction in other embodiments of the present application, which will not be repeated here.
[0203] It should be noted that the volume adjustment based on the screening results of the howling frequency points is only a feasible example provided in the embodiment of the present application, but in other embodiments, the screening results can also be combined with other detection results (such as the detection results of the target sound) as a basis for volume adjustment.
[0204] According to the audio processing method based on howling detection provided by the embodiment of the present application, by using a variety of criteria to screen howling frequency points, the accuracy of howling frequency point detection is improved, and the problems of false detection and missed detection are reduced.
[0205] It should be noted that the audio processing method based on howling detection provided in the embodiment of the present application can, while screening the howling frequency points, also count the number of harmonics corresponding to the audio frame, and then calculate the recognition features such as harmonicity, spectrum flux, and sub-band energy proportion balance characteristics, and use these recognition features to recognize human voices, music sounds, etc. The following is an introduction to the process of recognizing human voices and / or music sounds in the audio processing method based on howling detection provided in the embodiment of the present application, in conjunction with the accompanying drawings.
[0206] The following describes the specific process of how to perform target sound detection in the audio processing method based on howling detection provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0207] For example, Figure 5 As shown, it is a schematic flow chart of another audio processing method based on howling detection provided by an embodiment of the present application. The process may include the following steps:
[0208] S501, calculating the recognition feature corresponding to the target sound according to the average energy corresponding to the audio frame.
[0209] The target sound here includes human voice and / or music sound.
[0210] The average energy corresponding to the audio frame refers to the total energy of the audio frame in the frequency domain divided by the number of frequency points. The identification features here may include: harmonicity features, spectrum flux features, sub-band energy proportion balance features, and other features that can be used for sound recognition.
[0211] In some embodiments, the harmonicity characteristic may be calculated using the following formulas (1-17) and (1-18):
[0212]
[0213]
[0214] Among them, h represents the harmonicity value; r[k] represents the power ratio of the frequency point; floor() represents rounding down; i represents the i-th sampling point in the audio frame; j represents the j-th frequency point; and P represents the number of frequency points.
[0215] In some embodiments, the spectral flux characteristics may be calculated using the following formula (1-19):
[0216]
[0217] Wherein, f represents the spectrum flux value; M represents the statistical window length; P represents the number of frequency points; i represents the i-th frequency point in the audio frame; and j represents the j-th frequency point.
[0218] In some embodiments, the following formula (1-20) can be used to calculate the degree of balance of the sub-band energy proportion of the current frame. Freely divide the corresponding sub-bands, such as dividing into K sub-bands, and calculate the energy proportion of each sub-band:
[0219]
[0220] Wherein, sub_r[i] represents the energy proportion of the ith subband, and sub_e[i] represents the total energy of the ith subband. The sub_e[i] in formula (1-20) can be calculated according to the following formula (1-21):
[0221]
[0222] Where sub_r[i] represents the energy proportion of the i-th subband, sub_e[i] represents the total energy of the i-th subband, kmin_i represents the lower frequency limit of the i-th subband, and kmax_i represents the upper frequency limit of the i-th subband.
[0223] In some embodiments, the degree of balance can be numerically measured using a flatness feature or a standard deviation, for example, the flatness feature can be calculated using the following formula (1-22):
[0224]
[0225] The standard deviation can be calculated using the following formula (1-23):
[0226]
[0227] Wherein, std represents the standard deviation; sub_r[i] represents the energy proportion of the ith subband; and sub_r_mean represents the mean of the subband energy proportion. The sub_r_mean in formula (1-23) can be calculated according to the following formula (1-24):
[0228]
[0229] Among them, sub_r_mean represents the mean of the subband energy proportion; sub_r[i] represents the energy proportion of the i-th subband.
[0230] S502, performing historical smoothing processing on the recognition feature corresponding to the target sound to obtain the target recognition feature.
[0231] In some embodiments, after obtaining the identification features (harmonicity features, spectrum flux features, sub-band energy proportion balance features) in step S401, these identifications can be further subjected to historical smoothing processing to obtain target identification features after historical smoothing processing. Specifically, the formula for the historical smoothing processing is shown in (1-25):
[0232] y[n+1]=a×y[n]+(1-a)×x (1-25)
[0233] Among them, x represents the feature value of the current frame; y[n] represents the historical smoothing value; y[n+1] represents the updated smoothing value; a can usually be 0.90 to 0.99.
[0234] S503: Determine whether there is a target sound in the audio frame according to the target recognition feature.
[0235] In some embodiments, after acquiring the target identification feature, the electronic device can detect whether there is human voice and / or music in the audio frame based on the target identification feature and the number of harmonics. The number of harmonics can be counted in the process of screening whether there is a howling frequency point in the audio frame.
[0236] Exemplarily, the process of judging whether there is human voice or music in the current frame according to the smoothed characteristic value and the number of harmonics counted in the howling frequency point detection module may include:
[0237] First, a preset existence level is set for human voices and / or music sounds. For example, the initial existence level is set to 0, the lowest existence level is 0, and the highest existence level is set to 3, wherein a higher existence level means a higher probability of the existence of human voices and / or music sounds, which means a greater need to protect the sounds in the audio. Therefore, the existence level can also be described as a protection level.
[0238] Afterwards, the comparison results between each target feature value and the corresponding preset threshold are obtained, and the protection level (or existence level) is determined according to the comparison results. For example, if the harmonicity value is greater than the preset threshold thres6, it can be considered that the harmonics are rich and the probability of the existence of human voices and music is high, then the protection level is increased by 1; if the number of statistical harmonics is greater than the preset threshold thres7, it can be considered that the harmonics are rich and the probability of the existence of human voices and music is high, then the protection level is increased by 1; if the spectrum flux is greater than the preset threshold thres8, it is considered that the probability of the existence of howling is high, then the protection level is decreased by 1; if the degree of balance of the sub-band energy proportion meets the conditions (the flatness is greater than the preset threshold, and the standard deviation is less than the preset threshold), and the preset threshold is thres9, then it is considered that the power spectrum energy distribution is uniform, the probability of the existence of music is high, then the protection level is increased by 1.
[0239] Afterwards, it is determined whether there is human voice and / or music in the audio frame according to the protection level (or existence level). For example, the final protection level result is historically smoothed, and the protection level is always limited within the allowable range. If the protection level is greater than a preset threshold thres10, it is considered that there is human voice or music.
[0240] It should be noted that, in the embodiments of the present application, only the recognition features introduced above are taken as examples, i.e., harmonicity features, spectral flux features, and sub-band energy ratio balance features, but are not limited thereto. For example, in practical applications, other recognition features such as spectral centroid features and zero-crossing rate frame difference features can also be used to detect whether there are human voices and / or music sounds in the audio frame. For another example, in practical applications, the audio processing method based on howling detection provided in the embodiments of the present application can also support vector machines, decision trees, neural networks and other machine learning or deep learning methods to detect whether there are human voices and / or music sounds in the audio frame. The embodiments of the present application are not limited to this.
[0241] According to the audio processing method based on howling detection provided in the embodiment of the present application, by identifying the human voice and / or music sound in the audio frame during the process of detecting the howling frequency point, it is possible to flexibly adjust the volume according to the corresponding recognition result, thereby achieving the protection of the human voice and / or music sound while suppressing the howling, avoiding the loss of important information, and ensuring the sound quality.
[0242] The following specifically introduces the process of how to adjust the volume according to the detection result of the target sound and the screening result of the howling frequency point in conjunction with the accompanying drawings.
[0243] For example, Figure 6 FIG. 1 is a schematic flow chart of another audio processing method based on howling detection provided in an embodiment of the present application. The flow chart includes the following steps:
[0244] S601, obtaining a screening result of howling frequency points, wherein when the screening result indicates that a howling frequency point exists within a preset time length, updating historical statistical information of the howling frequency points.
[0245] Among them, the preset duration here can correspond to the duration from the start of the timer to the end of the timer, and each preset duration can be used to perform each round of howling frequency point screening, target sound detection, and dynamic adjustment based on the screening results (of the howling frequency points) and the detection results (of the target sound).
[0246] Specifically, the electronic device can set a preset time, such as a periodic preset time, and the electronic device can screen the howling frequency points within each preset time. Specifically, the electronic device can set a timer for cyclic timing, and each time the timing is turned on, a round of howling frequency point screening is started, and when the timer ends, the corresponding screening result is obtained. Among them, the screening result can indicate the existence of a howling frequency point or can indicate the absence of a howling frequency point.
[0247] In some embodiments, when the screening result indicates that there is a howling frequency point, it can be recorded in the howling frequency point historical statistical information, for example, the number of howling frequency points in the howling frequency point historical statistical information is increased by 1, and the identification information corresponding to the howling frequency point is recorded.
[0248] S602, obtaining a detection result of the target sound, and dynamically adjusting the volume of the audio frame according to the detection result and the screening result.
[0249] It should be noted that whether there is a howling frequency point in the audio frame can correspond to different volume adjustment methods (volume up or volume down). For example, when the screening result indicates that there is a howling frequency point, the volume can be lowered according to the preset volume down level; if the screening result indicates that there is no howling frequency point, the volume can be increased according to the preset volume up level.
[0250] Furthermore, whether there is a target sound in the audio frame can correspond to different volume adjustment amplitudes (the minimum volume of attenuation or the maximum volume of increase. For example, in the case where there is a howling frequency point, if the detection result indicates that there is a target sound, then the amplitude of volume attenuation can be limited, and the corresponding minimum volume that can be lowered is recorded as the first volume threshold; if the detection result indicates that there is no target sound, the corresponding minimum volume that can be lowered is recorded as the second volume threshold, and the first volume threshold can be higher than the second volume threshold, so as to suppress the howling while ensuring that the sound information is not lost.
[0251] For another example, in the absence of a howling frequency point, if the detection result indicates that the audio frame contains a target sound, the volume can be increased according to a preset volume level. At this time, the corresponding maximum volume that can be increased is recorded as the third volume threshold; the third volume threshold can be higher than the first volume threshold and the second volume threshold, so that the audio quality is improved when howling is not suppressed.
[0252] It should be understood that this volume adjustment method can limit the maximum volume attenuation when the target sound is identified in the audio frame, thereby avoiding the loss of important information due to excessive volume attenuation.
[0253] Optionally, both the volume attenuation process and the volume recovery process may be performed within a preset timing duration, and the volume reduction and volume recovery processes may use unequal timing.
[0254] The volume attenuation includes but is not limited to operations such as amplitude scaling of the time domain waveform signal, and can be accelerated by shifting, etc. The volume attenuation is adjusted in a step-by-step manner.
[0255] In some embodiments, when the volume is lowered, each time the volume level is lowered, the timer can be reset for another round of timing. If there is still a howling frequency point after the round of timing, the volume level is further lowered. After that, the process can be repeated until it is detected that there is no howling frequency point, or the volume level reaches the preset minimum volume level.
[0256] In some embodiments, when the volume is increased, each time a volume level is increased, the timer can be reset for another round of timing. If no howling frequency point is detected after the end of the round of timing, the volume level can be increased. After that, the process can be repeated until a howling frequency point is detected, or the volume level reaches the preset maximum volume level, or the initial (or default) setting volume is restored. Among them, if the howling frequency point is screened out during the re-detection after the volume level is increased, the volume can be gradually reduced according to the preset volume reduction level.
[0257] It should be noted that due to the use of a stepped volume adjustment control, when howling is detected, the volume level will be lowered to attenuate the volume by a certain number of decibels. Since howling will continue to exist periodically until it exists continuously, if howling is continuously detected, the volume level will continue to be lowered. Therefore, the volume can be quickly lowered until the set minimum volume is reached, and the howling is completely suppressed and eliminated. Conversely, when no howling is detected, the volume level will be increased to restore the volume to a certain number of decibels. When the howling disappears, the volume level will continue to increase until the normal volume is restored. Therefore, the volume can be quickly restored after the howling disappears. If the timer ends, the human voice and music detection results within the timing time are counted. If there is human voice or music, the maximum volume attenuation is limited. If the protection level is high, the volume level is increased to protect the human voice and music. This volume adjustment method has a small amount of calculation and is stable. It does not require filtering operations, and the amount of calculation will not increase suddenly due to the increase in the howling frequency.
[0258] S603, performing windowing, overlap-addition, and storage on the audio frames after volume adjustment in a buffer area, and outputting corresponding audio signals.
[0259] In some embodiments, after the volume of the audio frame is adjusted, the overlapping parts of the previous and next frames can be windowed and overlapped and added and put into an output buffer, and then the audio data can be taken out from the output buffer for output.
[0260] According to the audio processing method based on howling detection provided in the embodiment of the present application, by using a variety of criteria to screen the howling frequency points, and when there are howling frequency points, by dynamically adjusting the volume level based on the howling frequency point screening results, it is possible to efficiently and flexibly suppress howling while ensuring sound quality and improve user experience. The audio processing method based on howling detection provided in the embodiment of the present application is widely applicable and is still effective even when the overall loop gain is large. The effect is not limited by the number of howling frequencies, nor is it limited by the effective frequency range. It can also arbitrarily divide the frequency bands, and set different parameters or thresholds for different frequency bands to adapt to different scenarios. It can be specifically targeted at the howling frequency bands in fixed scenarios for more efficient detection and suppression, etc. It can also be applied to network communication situations and is also effective for periodic howling.
[0261] In addition, according to the audio processing method based on howling detection provided by the embodiment of the present application, it is also possible to achieve high accuracy of howling detection and few false detections. Even if a false detection occurs, the negative impact of the false detection is very small. The false detection will only cause a small fluctuation in volume, which is basically imperceptible to the human ear and will quickly return to normal volume; and it can protect human voice and music at the same time, avoid the loss of important information, and ensure the sound quality; and the method has a small and stable calculation amount, does not require filtering operations, and will not increase the calculation amount suddenly due to the increase in the howling frequency.
[0262] For example, Figure 7 As shown, it is a hardware structure diagram of an electronic device for howling suppression provided in an embodiment of the present application. The electronic device 700 may include at least one processor 701 and at least one memory 702, wherein the memory stores computer-readable program instructions, and the at least one processor 701 and the at least one memory 702 may be communicatively connected via a universal serial bus 703. When the processor 701 runs the computer-readable program instructions, the electronic device 700 for howling suppression performs the audio processing method based on howling detection provided in an embodiment of the present application.
[0263] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes computer instructions. When the computer instructions are executed in a computer, the above method is implemented.
[0264] Based on the same technical concept, an embodiment of the present application further provides a computer product, which includes computer instructions. When the computer instructions are executed in a computer, the above method is implemented.
[0265] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer commands. When the computer program command is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer command may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer command may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
[0266] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0267] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.
Claims
1. An audio processing method based on howling detection, characterized in that: Applied to electronic equipment, the method comprises: Acquire an audio signal, and acquire an audio frame in a frequency domain space according to the audio signal, wherein the audio frame includes a plurality of frequency points; screening the multiple frequency points for howling frequency points, and obtaining corresponding screening results; and, Performing target sound detection on the audio frame and obtaining a corresponding detection result, wherein the detection result is used to indicate whether the audio frame has the target sound, wherein the target sound includes a human voice and / or a musical sound; Dynamically adjusting the volume of the audio frame according to the screening result and the detection result; wherein, when the screening result indicates that the howling frequency point exists, comprising: If the detection result indicates that the target sound exists, the volume of the audio frame is lowered according to a preset volume reduction level, and the above steps are repeated until the volume reaches a preset first volume threshold; or, If the detection result indicates that the target sound does not exist, the volume of the audio frame is lowered according to a preset volume reduction level, and the above steps are repeated until the volume reaches a preset second volume threshold, and the volume corresponding to the second volume threshold is lower than the volume corresponding to the first volume threshold.
2. The method according to claim 1, characterized in that: When the screening result indicates that the howling frequency point does not exist, the method further includes: Increase the volume of the audio frame according to a preset volume increase level, and repeat the above steps until the volume reaches a preset third volume threshold; or, The volume of the audio frame is directly increased to a third volume threshold.
3. The method according to claim 1 or 2, characterized in that: The step of screening the multiple frequency points for howling frequencies and obtaining corresponding screening results specifically includes: Acquire power spectrum energy corresponding to the multiple frequency points according to the audio frame; Selecting at least one first candidate frequency point having the highest power spectrum energy from the multiple frequency points; The howling frequency point is screened from the at least one candidate frequency point according to a peak threshold power ratio PTPR, a peak to average power ratio PAPR, a peak harmonic power ratio PHPR, and a short-time autocorrelation function STACF.
4. The method according to claim 1 or 2, characterized in that: The performing target sound detection on the audio signal and obtaining a corresponding detection result specifically includes: When the howling frequency points are screened for the multiple frequency points, counting the number of harmonics in the audio frame; The detection result of the target sound is obtained according to the power spectrum energy corresponding to the multiple frequency points and the number of harmonics.
5. The method according to claim 4, characterized in that The acquiring the detection result of the target sound according to the power spectrum energy and the number of harmonics corresponding to the multiple frequency points specifically includes: Calculating the identification feature corresponding to the target sound according to the power spectrum energy corresponding to the multiple frequency points, the identification feature including at least one of a harmonicity feature, a spectrum flux feature, and a sub-band energy proportion balance feature; Performing historical smoothing processing on the identification features to obtain target identification features; The detection result of the target sound is obtained according to the target identification feature and the number of harmonics.
6. The method according to claim 1 or 2, characterized in that: The step of acquiring an audio signal and acquiring an audio frame in a frequency domain space according to the audio signal specifically includes: Acquire the audio signal from a buffer area, wherein the buffer area stores the audio signal received by the electronic device; According to a preset sampling rate and a number of samples corresponding to an audio frame length, the audio signal is subjected to frame processing to obtain the audio frame; Performing windowing processing on the audio frame according to a window function to obtain the audio frame after the windowing processing; Perform Fourier transform on the audio frame after the windowing process to obtain the audio frame in the frequency domain space.
7. The method according to claim 3, characterized in that The step of selecting the howling frequency point from the at least one candidate frequency point according to the peak threshold power ratio PTPR, the peak to average power ratio PAPR, the peak harmonic power ratio PHPR, and the short-time autocorrelation function STACF specifically includes: The first candidate frequency point is screened once using a peak threshold power ratio criterion PTPR and a peak to average power ratio criterion PAPR to obtain a second candidate frequency point; Performing a secondary screening on the second candidate frequency point by using the peak harmonic power ratio PHPR to obtain a third candidate frequency point; The third candidate frequency point is screened three times using a short-time autocorrelation function STACF to obtain the howling frequency point.
8. The method according to claim 1 or 2, characterized in that: The method further comprises: Performing a periodic timing operation by a timer, wherein the timing operation includes a timing start and a timing end; When each timing ends, the screening result and the detection result corresponding to the current timing period are obtained.
9. The method according to claim 8, characterized in that The method further comprises: When the timing ends, if the detection result corresponding to the current timing period indicates that the target sound does not exist, and the screening result indicates that the howling frequency point exists, the volume level of the audio frame is lowered by one level according to the preset volume reduction level; or, When the timing ends and the screening result indicates that the howling frequency point does not exist, the volume level of the audio frame is increased according to the preset volume increase level.
10. An electronic device for howling suppression, characterized in that: include: one or more processors; one or more memories; The memory stores computer-readable program instructions. When the processor runs the computer-readable program instructions, the electronic device executes the audio processing method based on howling detection as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer instructions. When the computer instructions are executed, the audio processing method based on howling detection according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Howling suppression method and device in intercom system
CN107979705A
Voice call data processing method and device, memory medium and mobile terminal
CN108449493A
