Audio gain method, electronic device and computer readable storage medium

By updating the voice level and noise level of the processed audio signal and determining the audio gain based on these levels, the problem of unstable gain effect in the prior art is solved, and a more stable communication quality is achieved.

CN119229886BActive Publication Date: 2025-03-21ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411726023.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-21
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The prior art uses unstable gain effects when processing audio signals that are constantly changing in real life, resulting in insufficient communication quality.

Method used

By updating the historical voice level and historical noise level according to the signal type in the current audio signal to be gained, the current voice level and current noise level of the current audio signal are obtained, the audio gain is determined based on these levels, and the current audio signal is gained.

Benefits of technology

The audio gain determined based on the current voice level and current noise level of the current audio signal is realized. Compared with the fixed gain value, the stable gain effect is more suitable for the ever-changing current audio signal, ensuring a stable gain effect, thereby improving the stability of communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229886B_ABST
    Figure CN119229886B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of audio processing technology, and in particular to an audio gain method, electronic device and computer-readable storage medium, comprising: updating and processing the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, obtaining the current voice level and the current noise level of the current audio signal, and then determining the audio gain of the current audio signal based on the current voice level and the current noise level of the current audio signal; and then performing gain processing on the current audio signal according to the audio gain to obtain a target audio signal. Thus, the stability of communication quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio processing, and in particular to an audio gain method, electronic equipment and a computer-readable storage medium. Background Art

[0002] Communication is a common way of communication in today's society. Communication is almost everywhere, so improving communication quality is of great significance. In real life, communication quality may be affected by many factors, such as the characteristics of microphones or speakers, and ambient noise. Therefore, it is necessary to process audio signals to improve speech clarity and thus improve communication quality.

[0003] At present, the processing method of audio signals is usually to use a preset fixed gain value to perform gain processing on each signal sample point in the audio signal. However, this method of using a fixed gain value to gain the audio signal is unstable when dealing with the constantly changing audio signals in real life, resulting in unstable communication quality. Summary of the invention

[0004] The main technical problem solved by the present application is to provide an audio gain method, an electronic device and a computer-readable storage medium, which can improve the stability of communication quality.

[0005] To solve the above technical problems, the present application provides an audio gain method.

[0006] In one embodiment, an audio gain method includes: updating a historical voice level and a historical noise level according to a signal type in a current audio signal to be gained, so as to obtain a current voice level and a current noise level of the current audio signal, wherein the acquisition time of the historical voice level is earlier than the acquisition time of the current voice level, and the acquisition time of the historical noise level is earlier than the acquisition time of the current noise level; determining an audio gain of the current audio signal based on the current voice level and the current noise level of the current audio signal; and performing gain processing on the current audio signal according to the audio gain to obtain a target audio signal.

[0007] In one embodiment, the step of updating the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained to obtain the current voice level and the current noise level of the current audio signal includes: in response to the signal type in the current audio signal being voice, updating the historical voice level using a preset voice update algorithm to obtain the current voice level; in response to the signal type in the current audio signal being steady-state noise, updating the historical noise level using a preset noise update algorithm to obtain the current noise level; in response to the signal type in the current audio signal being transient noise, updating the historical noise level using the preset noise update algorithm to obtain the current noise level, and / or updating the historical voice level using the preset voice update algorithm to obtain the current voice level.

[0008] In one embodiment, the step of determining the audio gain of the current audio signal based on the current voice level and the current noise level of the current audio signal includes: taking the difference between a preset voice level threshold and the current voice level as a first alternative gain; taking the difference between a preset noise level threshold and the current noise level as a second alternative gain; and taking the minimum value among a preset audio gain maximum value, the first alternative gain and the second alternative gain as the audio gain of the current audio signal.

[0009] In one embodiment, the method further includes: obtaining a speech probability according to the current audio signal; the speech probability represents the probability of a speech signal existing in the current audio signal; and determining a signal type in the current audio signal according to a probability range in which the speech probability lies.

[0010] In one embodiment, the step of obtaining the speech probability based on the current audio signal includes: obtaining a first probability based on a signal-to-noise ratio of the current audio signal; obtaining a second probability based on an audio feature of the current audio signal; and performing linear weighted processing on the first probability and the second probability to obtain the speech probability.

[0011] In one embodiment, the probability range includes a first preset probability range and a second preset probability range, the first preset probability range is larger than the second preset probability range, and the step of determining the signal type in the current audio signal according to the probability range in which the speech probability is located includes: in response to the speech probability being in the first preset probability range, acquiring the signal state of the current audio signal; determining the signal type of the current audio signal according to the signal state; in response to the speech probability being in the second preset probability range, determining the signal type in the current audio signal according to the sampling standard deviation of the current audio signal.

[0012] In one embodiment, the step of obtaining the signal state of the current audio signal includes: obtaining a signal change characteristic of the current audio signal; comparing the signal change characteristic with a preset characteristic threshold to obtain a comparison result; in response to the comparison result indicating that the signal change characteristic is equal to the preset characteristic threshold, determining that the signal state of the current audio signal is a steady state; in response to the comparison result indicating that the signal change characteristic is greater than or less than the preset characteristic threshold, determining that the signal state of the current audio signal is a non-steady state.

[0013] In one embodiment, the signal change characteristics include an amplitude change, and the step of obtaining the signal change characteristics of the current audio signal includes: using a first preset sliding window to sample the current audio signal to obtain a first sampling value; using a second preset sliding window to sample the current audio signal to obtain a second sampling value; the length of the first preset sliding window is greater than the length of the second preset sliding window; obtaining a sampling standard deviation based on the first sampling value and the second sampling value; in response to the sampling standard deviation being less than a preset standard deviation threshold, determining the amplitude change based on a preset statistical window length; in response to the sampling standard deviation being greater than or equal to the preset standard deviation threshold, using the preset statistical window length as the amplitude change.

[0014] In order to solve the above technical problem, the present application provides an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above audio gain method.

[0015] In order to solve the above technical problems, the present application provides a computer-readable storage medium, including: storing program data, and the program data is used to implement the above audio gain method when executed by a processor.

[0016] The beneficial effects of the present application are as follows: the historical voice level and the historical noise level are updated and processed according to the signal type in the current audio signal to be gained, so as to obtain the current voice level and the current noise level of the current audio signal, and then the audio gain of the current audio signal is determined based on the current voice level and the current noise level of the current audio signal; and the current audio signal is gain-processed according to the audio gain to obtain the target audio signal. In this way, the audio gain determined based on the current voice level and the current noise level of the current audio signal is more in line with the constantly changing current audio signal than the fixed gain value, so as to ensure a stable gain effect, and thus the target audio signal obtained by gain-processing the current audio signal according to the audio gain can ensure stable clarity, thereby improving the stability of communication quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0018] Figure 1 is a flowchart of an exemplary embodiment of an audio gain method shown in the present application;

[0019] Figure 2 yes Figure 1 A flowchart of an exemplary embodiment of step S110 in the audio gain method is shown;

[0020] Figure 3 yes Figure 1 A flow chart of an exemplary embodiment of step S120 in the audio gain method shown;

[0021] Figure 4 is a flowchart of another exemplary embodiment of the audio gain method shown in the present application;

[0022] Figure 5 is a block diagram of an audio gain device shown in an exemplary embodiment of the present application;

[0023] Figure 6 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;

[0024] Figure 7 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.

[0026] First of all, it should be noted that communication is a common way of communication in today's society. Communication is almost everywhere, so improving communication quality is of great significance. In real life, communication quality may be affected by many factors, such as the characteristics of microphones or speakers, and ambient noise. Therefore, it is necessary to process audio signals to improve the clarity of speech and thus improve communication quality.

[0027] At present, the processing method of audio signals is usually to use a preset fixed gain value to perform gain processing on each signal sample point in the audio signal. However, this method of using a fixed gain value to gain the audio signal is unstable when dealing with the constantly changing audio signals in real life, resulting in unstable communication quality.

[0028] Based on this, the present application provides an audio gain method, an electronic device and a computer-readable storage medium. Figure 1 , Figure 1 It is a flowchart of an exemplary embodiment of the audio gain method shown in the present application.

[0029] The execution subject of the audio gain method may be a terminal device or a server or other processing device, wherein the terminal device may be a computer, a mobile device, a terminal, a computing device, a vehicle-mounted device, etc. The execution subject of the audio gain method may also be an audio gain device. In some possible implementations, the audio gain method may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0030] Specifically, the audio gain method provided in this application includes the following steps:

[0031] Step S110: updating the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, and obtaining the current voice level and the current noise level of the current audio signal, wherein the acquisition time of the historical voice level is earlier than the acquisition time of the current voice level, and the acquisition time of the historical noise level is earlier than the acquisition time of the current noise level.

[0032] The current audio signal is an electrical signal carrying sound information. The current audio signal may be an audio signal segment obtained most recently in a segment of audio signals. The current audio signal may also be an audio signal segment obtained most recently in multiple segments of audio signals.

[0033] The signal type is the type of noise and / or speech in the audio signal. The signal type may be transient noise, stable noise, speech, etc. Specifically, the audio gain device performs component analysis on the current audio signal to be gained, obtains the signal component of the current audio signal to be gained, and uses the signal type to which the signal component belongs as the signal type in the current audio signal to be gained.

[0034] The current speech level is the level of speech in the current audio signal.

[0035] The current noise level is the level of noise in the current audio signal.

[0036] The historical voice level is the level of the voice in the historical audio signal. The historical audio signal may be other audio signal segments in a segment of audio signal except the current audio signal. The historical audio signal may also be other audio signals in multiple segments of audio signal except the current audio signal.

[0037] The historical noise level is the level of noise in the historical audio signal.

[0038] The current audio signal to be gained is an audio signal obtained by preprocessing the current audio signal. As an example, the audio gain device performs noise reduction processing on the current audio signal to obtain the current audio signal to be gained. For example, the audio gain device inputs the current audio signal into a Wiener filter to obtain the current audio signal to be gained. As another example, the audio gain device performs pre-emphasis processing on the current audio signal to obtain the current audio signal to be gained. As another example, the audio gain device performs frame processing on the current audio signal to obtain a time-domain frame signal, performs noise reduction processing on the time-domain frame signal to obtain the current audio signal to be gained. For example, the audio gain device inputs the current audio signal into a Wiener filter to obtain the current audio signal to be gained. Per frame The samples are divided into Frame, get the time domain frame signal ,in, Indicates the sample index, represents the frame index; substitute the time domain frame signal into the following formula to obtain the current audio signal to be gained:

[0039]

[0040] in, Indicates the current audio signal to be gained, Represents the time domain framed signal, Represents the prior signal-to-noise ratio obtained based on the DD (Decision Directed) decision solution.

[0041] It can be seen that by performing noise reduction processing on the current audio signal, the noise is preliminarily removed, and the current audio signal to be gained is obtained. Then, according to the signal type in the current audio signal to be gained, the current voice level and the current noise level of the current audio signal are obtained, and the residual noise can be further distinguished, so that the gain of the residual noise can be reduced, and the residual noise can be controlled within a certain range, thereby improving the overall ability to prevent noise mis-amplification.

[0042] The audio gain device updates the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, and obtains the current voice level and the current noise level of the current audio signal. Specifically, the audio gain device performs a matching operation in a preset level coefficient table according to the signal type in the current audio signal to be gained, obtains the matched voice level coefficient and the noise level coefficient, and the preset level coefficient table stores the corresponding relationship between the preset signal type and the preset voice level coefficient and the preset noise level coefficient; the product of the matched voice level coefficient and the historical voice level is used as the current voice level, and the product of the matched noise level coefficient and the historical noise level is used as the current noise level.

[0043] Step S120: Determine an audio gain of the current audio signal based on the current speech level and the current noise level of the current audio signal.

[0044] Audio gain is data for adjusting the intensity or volume of an audio signal.

[0045] The audio gain device determines the audio gain of the current audio signal based on the current voice level and the current noise level of the current audio signal. Specifically, the audio gain device performs a matching operation in a preset audio gain table according to the current voice level and the current noise level of the current audio signal to obtain an audio gain corresponding to the current voice level and the current noise level; the preset audio gain table stores the corresponding relationship between the preset voice level, the preset noise level and the preset audio gain.

[0046] Step S130: Perform gain processing on the current audio signal according to the audio gain to obtain a target audio signal.

[0047] The target audio signal is an audio signal obtained after the audio gain device performs gain processing on the current audio signal. As an example, the audio gain device uses the product of the audio gain and the current audio signal as the target audio signal. As another example, the audio gain device uses the product of the audio gain and the current audio signal to be gained as the target audio signal.

[0048] In one embodiment, the audio gain and the target audio signal satisfy the following formula:

[0049]

[0050] in, represents the target audio signal of the kth sample point of the nth frame, Indicates the audio gain, represents the signal of the Kth sample point in the nth frame of the current audio signal to be gained, Represents the target audio signal of the Kth sample point of the n-1th frame.

[0051] Furthermore, the audio gain device uses a limiter or a stretcher to adjust the envelope of the target audio signal, thereby preventing the clipping problem caused by insufficient gain or excessive gain, making the target audio signal more natural.

[0052] It can be seen that the historical voice level and the historical noise level are updated and processed according to the signal type in the current audio signal to be gained, and the current voice level and the current noise level of the current audio signal are obtained, and then the audio gain of the current audio signal is determined based on the current voice level and the current noise level of the current audio signal; and then the current audio signal is gain-processed according to the audio gain to obtain the target audio signal. In this way, the audio gain determined based on the current voice level and the current noise level of the current audio signal is more in line with the constantly changing current audio signal than the fixed gain value, and can ensure a stable gain effect. Therefore, the target audio signal obtained by gain-processing the current audio signal according to the audio gain can ensure stable clarity, thereby improving the stability of communication quality.

[0053] Based on the above examples, please continue to refer to Figure 2 , Figure 2 yes Figure 1 The flowchart of an exemplary embodiment of step S110 in the audio gain method is shown. Specifically, step S110 updates the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, and the process of obtaining the current voice level and the current noise level of the current audio signal includes the following steps:

[0054] Step S210: In response to the signal type in the current audio signal being speech, a preset speech update algorithm is used to update the historical speech level to obtain a current speech level.

[0055] In response to the signal type in the current audio signal being speech, the audio gain device uses a preset speech update algorithm to update the historical speech level to obtain the current speech level. Specifically, the audio gain device uses the preset speech update algorithm to obtain a new speech level, and replaces the historical speech level with the new speech level to become the current speech level.

[0056] In one embodiment, the preset voice update algorithm may be as follows:

[0057]

[0058] In the above formula, Indicates the current voice level. Indicates the preset voice level weighted value, Indicates that all k values ​​are obtained The maximum value in represents the energy of the audio signal of the nth frame, where Satisfy the equation , represents the preset weighting factor, Represents the energy of the audio signal of the n-1th frame; represents the recursive weighting factor of the n-th frame audio signal, where: Satisfy the equation ; Represents the weighting factor of the n-1th frame of audio signal.

[0059] Furthermore, in response to the signal type in the current audio signal being speech, the audio gain device uses the preset noise level as the current noise level. as the current noise level.

[0060] Step S220: In response to the signal type in the current audio signal being steady-state noise, a preset noise update algorithm is used to update the historical noise level to obtain a current noise level.

[0061] In response to the signal type in the current audio signal being steady-state noise, the audio gain device uses a preset noise update algorithm to update the historical noise level to obtain the current noise level. Specifically, the audio gain device uses the preset noise update algorithm to obtain a new noise level, and replaces the historical noise level with the new noise level to become the current noise level.

[0062] In one embodiment, the preset noise update algorithm may be as follows:

[0063]

[0064] In the above formula, Indicates the current noise level. represents the historical noise level, where is the preset noise level weighting value, represents the audio signal and, Satisfy the equation .

[0065] Step S230: In response to the signal type in the current audio signal being transient noise, a preset noise update algorithm is used to update the historical noise level to obtain a current noise level, and / or a preset voice update algorithm is used to update the historical voice level to obtain a current voice level.

[0066] The preset voice update algorithm in step S230 may refer to the preset voice update algorithm in step S210, and will not be repeated here.

[0067] In one embodiment, the preset noise update algorithm may be as follows:

[0068]

[0069] In one embodiment, the audio gain device responds to the signal type in the current audio signal being transient noise, and uses a preset noise update algorithm to update the historical noise level to obtain the current noise level. In another embodiment, the audio gain device responds to the signal type in the current audio signal being transient noise, and uses a preset voice update algorithm to update the historical voice level to obtain the current voice level. In another embodiment, the audio gain device responds to the signal type in the current audio signal being transient noise, and uses a preset noise update algorithm to update the historical noise level to obtain the current noise level, and uses a preset voice update algorithm to update the historical voice level to obtain the current voice level.

[0070] It can be seen that the signal type in the current audio signal is speech, and the preset speech update algorithm is used to update the historical speech level to obtain the current speech level; the signal type in the current audio signal is steady-state noise, and the preset noise update algorithm is used to update the historical noise level to obtain the current noise level; the signal type in the current audio signal is transient noise, and the preset noise update algorithm is used to update the historical noise level to obtain the current noise level, and / or, the preset speech update algorithm is used to update the historical speech level to obtain the current speech level. Therefore, if the current audio signal only contains steady-state noise, the noise level is updated to enhance the noise level and reduce the speech level; if the current audio signal contains transient noise, the speech level and noise level are updated to enhance the speech level and noise level; if the current audio signal contains speech, the speech level and noise level are updated to enhance the signal level and reduce the noise level.

[0071] Based on the above examples, please continue to refer to Figure 3 , Figure 3 yes Figure 1 The flowchart of an exemplary embodiment of step S120 in the audio gain method is shown. Specifically, the process of determining the audio gain of the current audio signal based on the current speech level and the current noise level of the current audio signal in step S120 includes the following steps:

[0072] Step S310: taking the difference between the preset speech level threshold and the current speech level as the first candidate gain.

[0073] The preset voice level threshold is a pre-set voice level threshold.

[0074] The first candidate gain is a difference between a preset speech level threshold and a current speech level.

[0075] The audio gain device uses the difference between the preset voice level threshold and the current voice level as the first candidate gain.

[0076] Step S320: taking the difference between the preset noise level threshold and the current noise level as the second candidate gain.

[0077] The preset noise level threshold is a preset noise level threshold.

[0078] The second candidate gain is the difference between the preset noise level threshold and the current noise level.

[0079] The audio gain device uses the difference between the preset noise level threshold and the current noise level as the second candidate gain.

[0080] Step S330: taking the minimum value among the preset maximum audio gain, the first candidate gain and the second candidate gain as the audio gain of the current audio signal.

[0081] The preset audio gain maximum value is a preset maximum value of the audio gain.

[0082] The audio gain device uses the minimum value among the preset audio gain maximum value, the first candidate gain and the second candidate gain as the audio gain of the current audio signal.

[0083] In one embodiment, the audio gain satisfies the following formula:

[0084]

[0085] In the above formula, Indicates the audio gain, Indicates the preset maximum audio gain. Indicates the preset voice level threshold. Indicates the current voice level. Indicates the preset noise level threshold, Indicates the current noise level.

[0086] In another embodiment, the audio gain satisfies the following formula:

[0087] , , .

[0088] It can be seen that the difference between the preset voice level threshold and the current voice level is used as the first candidate gain, the difference between the preset noise level threshold and the current noise level is used as the second candidate gain, and the minimum value among the preset audio gain maximum value, the first candidate gain and the second candidate gain is used as the audio gain of the current audio signal. Thus, the audio gain is determined according to the current noise level and the current voice level. Thus, the gain and noise of the voice can be controlled by applying the audio gain, which is conducive to achieving the desired volume of the voice after applying the audio gain, while the volume of the noise is controlled within a certain range.

[0089] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of another exemplary embodiment of the audio gain method shown in the present application. Specifically, the audio gain method of this embodiment includes the following steps:

[0090] Step S410: Acquire speech probability according to the current audio signal; the speech probability represents the probability of a speech signal existing in the current audio signal.

[0091] Speech probability refers to the possibility that a speech signal exists in the current audio signal.

[0092] The audio gain device obtains the speech probability according to the current audio signal. Specifically, the audio gain device obtains the first probability based on the signal-to-noise ratio of the current audio signal; obtains the second probability according to the audio features of the current audio signal to be gained; and performs linear weighted processing on the first probability and the second probability to obtain the speech probability. As a result, the speech probability takes into account the current audio signal and the current audio signal to be gained, avoids the damage of noise reduction to the speech and affects the accuracy of the analysis, making the gain control more flexible and robust.

[0093] The signal-to-noise ratio refers to the ratio of speech to noise in the current audio signal. As an example, the audio gain device can use a direct decision algorithm, a convex combination (CC) algorithm, etc. to calculate the signal-to-noise ratio corresponding to the current audio signal according to the noise signal spectrum.

[0094] The audio gain device obtains the first probability based on the signal-to-noise ratio of the current audio signal. Specifically, the audio gain device uses the ratio of the speech ratio in the signal-to-noise ratio to the sum of the signal-to-noise ratio ratios as the first probability.

[0095] The audio feature is a signal feature of the audio signal, which may be fundamental tone and harmonic wave features.

[0096] The audio gain device obtains the second probability according to the audio feature of the current audio signal to be gained. Specifically, the audio gain device obtains the mean square error of the audio feature of the current audio signal to be gained, and then performs weighted processing on the mean square error to obtain the second probability.

[0097] As an example, the audio gain device uses a linear predictor to extract genes and harmonics to obtain gene cycles and harmonic cycles, and uses the gene cycles and harmonic cycles as audio features of the current audio signal. The prediction error sequence of the linear predictor satisfies the following formula:

[0098]

[0099] in, Represents the kth prediction error sequence result of the nth frame signal, represents the coefficients of the linear predictor, It can be solved by the Levins-Dubin recursive algorithm. represents the k sample point signal of the nth frame in the current audio signal to be gained, q represents the order of the linear predictor, i Indicates i values, Indicates the nth frame of the current audio signal to be gained ki A sample signal.

[0100] The autocorrelation function of the linear predictor satisfies the following formula:

[0101]

[0102] in, Indicates j The autocorrelation function results are: Indicates kj The correlation curve formed by the autocorrelation function obtains the peak position , and the gene cycle , harmonic period ,in is the preset minimum gene cycle, Indicates integer multiple relationship.

[0103] As an example, the second probability satisfies the following formula:

[0104]

[0105] in, represents the second probability, represents the location of the audio feature, represents the location set of audio features, represents the gene cycle, represents the harmonic period, is the preset feature weight value, Indicates the preset maximum value of the gene cycle, Indicates delay, , Indicates j- The forecast error series results are: Indicates j The forecast error series results.

[0106] As an example, the first probability, the second probability and the speech probability satisfy the following formula:

[0107]

[0108] in, represents the probability of speech, a Indicates the preset linear weighting value.

[0109] As another example, the first probability, the second probability and the speech probability satisfy the following formula:

[0110]

[0111] in, express and is the independent variable, is the function relationship of the dependent variable, It can be a linear weighting function or a nonlinear classification function. The closer it is to 1, the greater the possibility of the presence of speech.

[0112] Step S420: Determine the signal type in the current audio signal according to the probability range of the speech probability.

[0113] The probability range refers to the numerical value in which the probability can exist. The probability range includes a first preset probability range and a second preset probability range, and the first preset probability range is larger than the second preset probability range.

[0114] The step of the audio gain device determining the signal type in the current audio signal according to the probability range in which the speech probability is located. Specifically, in response to the speech probability being in a first preset probability range, the audio gain device obtains the signal state of the current audio signal; determines the signal type of the current audio signal according to the signal state; and in response to the speech probability being in a second preset probability range, determines the signal type in the current audio signal according to the sampling standard deviation of the current audio signal.

[0115] The audio gain device obtains the signal state of the current audio signal. Specifically, the audio gain device obtains the signal change characteristics of the current audio signal; compares the signal change characteristics with a preset characteristic threshold to obtain a comparison result; in response to the comparison result indicating that the signal change characteristics are equal to the preset characteristic threshold, the signal state of the current audio signal is determined to be a steady state; in response to the comparison result indicating that the signal change characteristics are greater than or less than the preset characteristic threshold, the signal state of the current audio signal is determined to be a non-steady state.

[0116] The signal change feature refers to a feature that reflects the change of the audio signal. The signal change feature may be an amplitude change.

[0117] The audio gain device obtains the signal change characteristics of the current audio signal. Specifically, the audio gain device uses a first preset sliding window to sample the current audio signal to obtain a first sampling value; uses a second preset sliding window to sample the current audio signal to obtain a second sampling value; the length of the first preset sliding window is greater than the length of the second preset sliding window; obtains the sampling standard deviation according to the first sampling value and the second sampling value; in response to the sampling standard deviation being less than a preset standard deviation threshold, determines the amplitude change based on the preset statistical window length; in response to the sampling standard deviation being greater than or equal to the preset standard deviation threshold, uses the preset statistical window length as the amplitude change. Thus, using sliding windows of different lengths for sampling avoids the interference of transient noise on gain control, thereby making gain control more flexible and robust.

[0118] As an example, the first sampling value or the second sampling value satisfies the following formula:

[0119]

[0120] in, represents the sample value, Indicates the preset sampling weight value, Indicates the preset sliding window length, represents the first preset sliding window length, represents the second preset sliding window length, , Indicates the nth -i Frame k A sample signal.

[0121] As an example, the first sampling value, the second sampling value and the sampling standard deviation satisfy the following formula:

[0122]

[0123] in, represents the sampling standard deviation, Indicates the preset weight value, represents the first sample value, Represents the second sample value.

[0124] As an example, the amplitude change satisfies the following formula:

[0125]

[0126] in, represents the amplitude change, represents the preset standard deviation threshold, represents the preset statistical window length. As an example, in response to is equal to 0, the signal state of the current audio signal is steady state; in response to If it is greater than or less than 0, the signal state of the current audio signal is unstable.

[0127] The audio gain device determines the signal type of the current audio signal according to the signal state. Specifically, in response to the signal state of the current audio signal being steady, the audio gain device determines the signal type in the current audio signal as steady-state noise; in response to the signal state of the current audio signal being non-steady, the audio gain device determines the signal type in the current audio signal as transient noise.

[0128] The audio gain device determines the signal type in the current audio signal according to the sampling standard deviation of the current audio signal. Specifically, in response to the sampling standard deviation being within a first preset standard deviation range, the audio gain device determines that the signal type in the current audio signal is transient noise; in response to the sampling standard deviation being within a second preset standard deviation range, the audio gain device determines that the signal type in the current audio signal is speech.

[0129] As an example, , it is determined that the signal type in the current audio signal is transient noise; , it is determined that the signal type in the current audio signal is speech; wherein, represents the sampling standard deviation, Indicates the preset standard deviation range threshold. Sampling standard deviation Satisfy the following formula:

[0130]

[0131] Step S430: Update the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, and obtain the current voice level and the current noise level of the current audio signal, wherein the acquisition time of the historical voice level is earlier than the acquisition time of the current voice level, and the acquisition time of the historical noise level is earlier than the acquisition time of the current noise level.

[0132] Step S440: Determine an audio gain of the current audio signal based on the current speech level and the current noise level of the current audio signal.

[0133] Step S450: Perform gain processing on the current audio signal according to the audio gain to obtain a target audio signal.

[0134] The detailed description of steps S430 to S450 in the embodiment of the present application can refer to steps S110 to S130 in the above embodiment, which will not be repeated here.

[0135] It can be seen that the speech probability is obtained according to the current audio signal; the signal type in the current audio signal is determined according to the probability range of the speech probability; then the historical speech level and the historical noise level are updated according to the signal type in the current audio signal to be gained, and the current speech level and the current noise level of the current audio signal are obtained; the audio gain of the current audio signal is determined based on the current speech level and the current noise level of the current audio signal; the current audio signal is gain-processed according to the audio gain to obtain the target audio signal. On the one hand, the signal type is determined according to the probability range of the speech probability, and then the historical speech level and the historical noise level are updated, so that the update process is more efficient; on the other hand, the audio gain of the current audio signal is determined based on the current speech level and the current noise level of the current audio signal, so that the gain control is more accurate, the problem of voice volume is solved, and the stability of communication quality is improved.

[0136] Figure 5 FIG. 1 is a block diagram of an audio gain device shown in an exemplary embodiment of the present application. Figure 5 As shown, the exemplary audio gain device 500 includes: an updating module 510, an audio gain determination module 520 and a gain processing module 530. Specifically:

[0137] The updating module 510 is used to update the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, so as to obtain the current voice level and the current noise level of the current audio signal, wherein the acquisition time of the historical voice level is earlier than the acquisition time of the current voice level, and the acquisition time of the historical noise level is earlier than the acquisition time of the current noise level.

[0138] The audio gain determination module 520 is configured to determine the audio gain of the current audio signal based on the current speech level and the current noise level of the current audio signal.

[0139] The gain processing module 530 is used to perform gain processing on the current audio signal according to the audio gain to obtain a target audio signal.

[0140] In this exemplary audio gain device, the historical voice level and the historical noise level are updated according to the signal type in the current audio signal to be gained, and the current voice level and the current noise level of the current audio signal are obtained. Then, the audio gain of the current audio signal is determined based on the current voice level and the current noise level of the current audio signal; and then the current audio signal is gain-processed according to the audio gain to obtain the target audio signal. In this way, the audio gain determined based on the current voice level and the current noise level of the current audio signal is more in line with the constantly changing current audio signal than the fixed gain value, and can ensure a stable gain effect. Therefore, the target audio signal obtained by gain-processing the current audio signal according to the audio gain can ensure stable clarity, thereby improving the stability of communication quality.

[0141] The functions of each module can be found in the audio gain method embodiment, which will not be described in detail here.

[0142] In order to implement the audio gain method of the above embodiment, the present application proposes another electronic device, for details, please refer to Figure 6 , Figure 6 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application.

[0143] The electronic device 600 includes a memory 601 and a processor 602 , wherein the memory 601 and the processor 602 are coupled.

[0144] The memory 601 is used to store program data, and the processor 602 is used to execute the program data to implement the audio gain method of the above embodiment.

[0145] In this embodiment, the processor 602 may also be referred to as a CPU (Central Processing Unit). The processor 602 may be an integrated circuit chip having signal processing capabilities. The processor 602 may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. A general-purpose processor may be a microprocessor or the processor 602 may also be any conventional processor, etc.

[0146] The present application also provides a computer-readable storage medium, such as Figure 7 As shown, the computer-readable storage medium 700 is used to store program data 701. When the program data 701 is executed by the processor, it is used to implement the audio gain method in the method embodiment of the present application.

[0147] The method involved in the audio gain method embodiment of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0148] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An audio gain method, characterized in that: The method comprises: updating the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained, so as to obtain the current voice level and the current noise level of the current audio signal, wherein the acquisition time of the historical voice level is earlier than the acquisition time of the current voice level, and the acquisition time of the historical noise level is earlier than the acquisition time of the current noise level; determining an audio gain of the current audio signal based on a current speech level and a current noise level of the current audio signal; Performing gain processing on the current audio signal according to the audio gain to obtain a target audio signal; The step of determining the audio gain of the current audio signal based on the current speech level and the current noise level of the current audio signal comprises: taking the difference between the preset voice level threshold and the current voice level as a first candidate gain; taking the difference between the preset noise level threshold and the current noise level as a second candidate gain; The minimum value among the preset audio gain maximum value, the first candidate gain and the second candidate gain is used as the audio gain of the current audio signal.

2. The audio gain method according to claim 1, characterized in that: The step of updating the historical voice level and the historical noise level according to the signal type in the current audio signal to be gained to obtain the current voice level and the current noise level of the current audio signal comprises: In response to the signal type in the current audio signal being speech, using a preset speech update algorithm to update the historical speech level to obtain the current speech level; In response to the signal type in the current audio signal being steady-state noise, using a preset noise update algorithm to update the historical noise level to obtain the current noise level; In response to the signal type in the current audio signal being transient noise, the preset noise update algorithm is used to update the historical noise level to obtain the current noise level, and / or the preset voice update algorithm is used to update the historical voice level to obtain the current voice level.

3. The audio gain method according to claim 1, characterized in that: The method further comprises: Acquire a speech probability according to the current audio signal; the speech probability represents the probability that a speech signal exists in the current audio signal; The signal type in the current audio signal is determined according to the probability range in which the speech probability lies.

4. The audio gain method according to claim 3, characterized in that: The step of acquiring the speech probability according to the current audio signal comprises: Acquire a first probability based on a signal-to-noise ratio of the current audio signal; Acquire a second probability according to the audio feature of the current audio signal; Perform linear weighted processing on the first probability and the second probability to obtain the speech probability.

5. The audio gain method according to claim 3, characterized in that: The probability range includes a first preset probability range and a second preset probability range, the first preset probability range is larger than the second preset probability range, and the step of determining the signal type in the current audio signal according to the probability range in which the speech probability is located includes: In response to the speech probability being within a first preset probability range, acquiring a signal state of the current audio signal; Determining a signal type of the current audio signal according to the signal state; In response to the speech probability being within a second preset probability range, determining a signal type in the current audio signal according to a sampling standard deviation of the current audio signal.

6. The audio gain method according to claim 5, characterized in that: The step of obtaining the signal state of the current audio signal comprises: Acquire a signal change characteristic of the current audio signal; Comparing the signal change characteristic with a preset characteristic threshold to obtain a comparison result; In response to the comparison result indicating that the signal change characteristic is equal to the preset characteristic threshold, determining that the signal state of the current audio signal is a steady state; In response to the comparison result indicating that the signal change characteristic is greater than or less than the preset characteristic threshold, it is determined that the signal state of the current audio signal is non-steady state.

7. The audio gain method according to claim 6, characterized in that: The signal change feature includes an amplitude change amount, and the step of obtaining the signal change feature of the current audio signal includes: Using a first preset sliding window to sample the current audio signal to obtain a first sampling value; The current audio signal is sampled using a second preset sliding window to obtain a second sampling value; the length of the first preset sliding window is greater than the length of the second preset sliding window; Obtaining a sampling standard deviation according to the first sampling value and the second sampling value; In response to the sampling standard deviation being less than a preset standard deviation threshold, determining an amplitude change amount based on a preset statistical window length; In response to the sampling standard deviation being greater than or equal to the preset standard deviation threshold, the preset statistical window length is used as the amplitude change amount.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: include: Program data is stored, and when the program data is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Audio processing method and device, terminal equipment and storage medium

    CN115811591A

  • Audio gain adjustment method and device, storage medium and electronic equipment

    CN116486833A