WO2018072325A1 - 一种音频信号的自动增益控制方法和装置 - Google Patents

一种音频信号的自动增益控制方法和装置 Download PDF

Info

Publication number
WO2018072325A1
WO2018072325A1 PCT/CN2016/113273 CN2016113273W WO2018072325A1 WO 2018072325 A1 WO2018072325 A1 WO 2018072325A1 CN 2016113273 W CN2016113273 W CN 2016113273W WO 2018072325 A1 WO2018072325 A1 WO 2018072325A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio signal
gain
interval
zero
adjustment
Prior art date
Application number
PCT/CN2016/113273
Other languages
English (en)
French (fr)
Inventor
程雪峰
Original Assignee
广州视源电子科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州视源电子科技股份有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2018072325A1 publication Critical patent/WO2018072325A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction
    • G11B20/10027Improvement or modification of read or write signals analog processing for digital recording or reproduction adjusting the signal strength during recording or reproduction, e.g. variable gain amplifiers
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control
    • H03G3/30Automatic control in amplifiers having semiconductor devices
    • H03G3/3005Automatic control in amplifiers having semiconductor devices in amplifiers suitable for low-frequencies, e.g. audio amplifiers
    • H03G3/301Automatic control in amplifiers having semiconductor devices in amplifiers suitable for low-frequencies, e.g. audio amplifiers the gain being continuously variable

Definitions

  • Embodiments of the present invention relate to audio data processing technologies, and in particular, to an automatic gain control method and apparatus for an audio signal.
  • voice real-time communication has been widely used.
  • voice communication not only can communication between the two parties be realized, but also multi-party communication can be further realized.
  • audio data processing technology has also been improved to some extent.
  • the audio signal is generally processed by an automatic gain control method (AGC).
  • AGC automatic gain control method
  • the automatic gain control method can be as follows: (1) Based on the analysis of the data frame, calculate the average amplitude of the absolute value of each sample point in the current frame, and divide the target amplitude in the current frame by the average. After the amplitude, the gain value of the current frame is obtained, and then the output amplitude of the current frame audio signal is adjusted based on the gain value, thereby realizing the volume adjustment. (2) Based on the analysis of the data frame, the gain values of the two frames before and after the audio signal are respectively calculated, and the gain values of each frame are equally distributed to the respective sampling points.
  • the gain value of the last sample point of the previous frame is generally used as the gain value of the first sample point of the current frame, and the amplitude of each frame of the audio signal is adjusted based on the determined frame gain value.
  • FIG. 1 provides the prior art.
  • FIG. 2 is a schematic diagram of simulations before and after adjustment of audio signal gain provided by the prior art.
  • the audio signal will have a “de-topping” distortion phenomenon, that is, when the amplitude of the audio signal is amplified by the gain, in order to prevent exceeding the maximum allowed.
  • FIG. 3 is a schematic diagram of the prior art before and after adjusting the gain of the audio signal.
  • FIG. 4 is a schematic diagram of simulations before and after adjusting the gain of the audio signal provided by the prior art. As shown in FIG. 3 and FIG. 4, if the gain adjustment is performed by using the above scheme (2), the slope after the gain adjustment is changed, and the audio signal in the frequency domain is distorted. At the same time, because the human ear is very sensitive to changes in the signal in the frequency domain, the user can distinguish it with a slight difference, and thus, it may bring a bad user experience.
  • Embodiments of the present invention provide an automatic gain control method and apparatus for an audio signal, which can reduce the distortion of an audio signal in a frequency domain to a large extent while improving the gain of the audio signal in the time domain, thereby improving the user.
  • the effect of the experience is not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to reduce the distortion of an audio signal in a frequency domain to a large extent while improving the gain of the audio signal in the time domain, thereby improving the user. The effect of the experience.
  • an embodiment of the present invention provides an automatic gain control method for an audio signal, including:
  • an embodiment of the present invention further provides an automatic gain control apparatus for an audio signal, including:
  • a zero-crossing interval determining module configured to identify a zero-crossing point of the amplitude in the audio signal to be processed, and determine a zero-crossing interval between adjacent zero-crossing points;
  • An adjustment interval determining module configured to determine at least one gain adjustment interval according to the zero-crossing interval
  • a smoothing processing module configured to perform smoothing on the peak of the audio signal in the current gain adjustment interval according to the amplitude of the audio signal in the historical gain adjustment interval
  • Adjusting a gain determining module configured to determine an adjustment gain of the current gain adjustment interval according to the peak value of the smoothed audio signal
  • an amplitude adjustment module configured to adjust and output the amplitude of the current gain adjustment interval audio signal according to the adjustment gain.
  • the automatic gain control scheme of the audio signal identifies the amplitude zero-crossing point in the audio signal to be processed, determines the zero-crossing interval between adjacent zero-crossing points, and then determines at least one gain adjustment according to the zero-crossing interval. Interval. Then, according to the audio signal amplitude of the historical gain adjustment interval, the peak of the audio signal in the current gain adjustment interval is smoothed, and then the adjustment gain of the current gain adjustment interval is determined according to the peak value of the smoothed audio signal. Finally, the amplitude of the current gain adjustment interval audio signal is adjusted and output according to the adjustment gain.
  • the adjustment gain is determined by using the peak value, the adjustment gain can effectively match the adjustment of the audio signal of the maximum amplitude, thereby avoiding the phenomenon of the topping distortion.
  • each gain adjustment interval can separately determine the adjustment gain, which improves the gain accuracy and greatly reduces the distortion of the audio signal in the frequency domain.
  • smoothing the peak of the audio signal in the current gain adjustment interval a smooth transition of the audio signal can be realized when the active state of the audio signal is abrupt, thereby improving the user experience.
  • FIG. 1 is a schematic diagram of a prior art before and after adjustment of an audio signal gain
  • FIG. 2 is a schematic diagram of simulations before and after adjustment of an audio signal gain provided by the prior art
  • FIG. 3 is a schematic diagram of the prior art before and after adjusting the gain of the audio signal
  • FIG. 4 is a schematic diagram of simulations before and after adjusting the gain of the audio signal provided by the prior art.
  • FIG. 5 is a schematic flowchart diagram of an automatic gain control method for an audio signal according to Embodiment 1 of the present invention.
  • FIG. 6 is a schematic diagram of front and rear adjustment of a sampling point gain according to Embodiment 1 of the present invention.
  • FIG. 7 is a schematic flowchart diagram of an automatic gain control method for an audio signal according to Embodiment 2 of the present invention.
  • FIG. 8 is a schematic flowchart diagram of an automatic gain control method for an audio signal according to Embodiment 3 of the present invention.
  • FIG. 9 is a schematic flowchart diagram of a preferred automatic gain control method for an audio signal according to Embodiment 3 of the present invention.
  • FIG. 10 is a structural block diagram of an automatic gain control apparatus for an audio signal according to Embodiment 4 of the present invention.
  • FIG. 5 is a schematic flowchart of an automatic gain control method for an audio signal according to Embodiment 1 of the present invention.
  • the method may be performed by an automatic gain control apparatus for an audio signal, and specifically includes the following steps:
  • Step 101 Identify a zero-crossing point of the amplitude in the audio signal to be processed, and determine a zero-crossing interval between adjacent zero-crossing points.
  • the automatic gain control method is a control method for adjusting the output volume of the audio signal, and the method dynamically adjusts the output audio signal by using an effective combination of linear amplification and compression.
  • the intensity of the output audio signal can be ensured by increasing the gain of the audio signal; when the input audio signal reaches a certain intensity, the amplitude of the output audio signal can be lowered by reducing the gain of the audio signal. That is to say, the automatic gain control can automatically adjust the amplitude of the output audio signal by changing the compression ratio of the input and output amplitudes of the audio signal.
  • the automatic gain control method provided by this embodiment is also realized by adjusting the amplitude of the audio signal.
  • the audio signal in this embodiment may be an audio signal in a voice real-time communication process, or may be an audio signal played through a multimedia.
  • the audio signal to be processed may include an effective audio signal, that is, an audio signal sent by the voice transmitting end that the voice receiving end can receive.
  • the audio signal to be processed may also include a noise audio signal, that is, all audio signals except the voice receiving end may receive the valid audio signal sent by the transmitting end.
  • the audio signal in the process of processing the audio signal, can be generally divided into a plurality of audio frames according to a fixed duration, wherein the fixed duration is also set in advance.
  • the audio signal includes a number of sample points, each having its own amplitude value.
  • the sample collected in 10 ms can be used as one frame, and the frame length can be set by the user. For example, if the sampling frequency is 16 kHz, 160 samples can be acquired in one frame of 10 ms.
  • the process of identifying the audio signal to be processed is actually the process of identifying each sample point in several audio frames. For example, one frame may be captured from the data stream of the audio signal sent by the voice transmitting end as the current audio frame to be processed, and consecutive frames in the data stream of the audio signal may be used as the current audio frame to be processed.
  • the identifying the zero-crossing of the amplitude in the audio signal to be processed may include: determining, in the audio signal to be processed, whether the product of the amplitude of the current sampling point and the amplitude of any adjacent sampling point is 0, or Whether the amplitudes of the two sampling points adjacent to the current sampling point are different; if yes, determining that the current sampling point is the zero-crossing of the amplitude in the to-be-processed audio signal.
  • the sampling points whose amplitudes cross zero in the audio frame can be identified, and then the interval between the adjacent two zero points is determined as the zero-crossing interval.
  • multiple zero crossing intervals can be determined. It is worth noting that in the process of determining the zero-crossing interval, it is necessary to ensure the integrity of the zero-crossing interval. For example, for two sampling points, if the amplitude of one of the sampling points is zero and the amplitude of the other sampling point is not zero, the interval formed by the two sampling points cannot be determined as a zero-crossing interval.
  • the detection of the zero-crossing point can be realized by writing the C code of the zero-crossing detection, and the code can be called in the process of recognizing the zero-crossing of the amplitude of the audio signal.
  • the C code can be specifically in the following form:
  • the length of the array Data is 2N, and i represents the i-th sampling point.
  • Step 102 Determine at least one gain adjustment interval according to the zero-crossing interval.
  • each zero-crossing interval may be determined as one gain adjustment interval, or at least two consecutive zero-crossing intervals may be determined as one gain adjustment interval. It can be understood that the smaller the range of the gain adjustment interval determined, the more accurate the subsequent adjustment of the amplitude of the sampling points in the gain adjustment interval.
  • Step 103 Smoothing the peak of the audio signal in the current gain adjustment interval according to the amplitude of the audio signal in the historical gain adjustment interval.
  • the peak value of the audio signal is the maximum value of the absolute value of the amplitude of all the sampling points in the current gain adjustment interval.
  • the peak value of the audio signal can be set by default by the automatic gain control device of the audio signal.
  • the peak value of the audio signal is not fixed, and it may vary with the current state of the voice transmitting end or according to the environment in which the voice transmitting end is located. A sudden volume increase may occur during a voice call, or the volume may fluctuate greatly. In this case, if the peak value is still used in each zero-crossing interval to determine the adjustment gain, there may be a case where the gain difference between adjacent zero-crossing intervals is large, giving a bad feeling of sudden change in volume. Therefore, in this embodiment, the peak of the current audio signal is smoothed according to the peak value of the historical audio signal, so that the peak of the sudden change under certain conditions does not have to be too abrupt, thereby achieving a smooth transition of the audio signal of each gain adjustment interval.
  • the audio signal in the interval can generally be regarded as noise audio.
  • the peak value of the audio signal in the interval can be increased, and a smooth transition can be achieved with the original effective audio.
  • the noise audio may also have a sudden situation (a sudden increase in volume), after smoothing, the sudden noise can be restored to the original state without being amplified.
  • the manner of smoothing the peak of the audio signal in the current gain adjustment interval according to the amplitude of the audio signal of the historical gain adjustment interval may include: correcting the current gain according to the peak of the smoothed audio signal of the previous gain adjustment interval according to the following formula Adjust the peak of the audio signal in the interval for smoothing:
  • Peak1 ⁇ *Peak+(1- ⁇ )*Peak0;
  • Peak0 is the peak of the smoothed audio signal in the previous gain adjustment interval
  • Peak is the peak of the audio signal in the current gain adjustment interval
  • Peak1 is the peak of the smoothed audio signal in the current gain adjustment interval
  • is a constant less than 1.
  • Step 104 Determine an adjustment gain of the current gain adjustment interval according to the peak value of the smoothed audio signal.
  • each zero-crossing interval is determined as a gain adjustment interval
  • the adjustment of the zero-crossing interval gain of the audio signal is actually an adjustment of the amplitude of the sampling point in the zero-crossing interval, and thus may be processed according to the smoothing process.
  • the maximum value of the absolute value of the amplitude of the sampling point in the current zero-crossing interval determines the adjustment gain of the current zero-crossing interval. It is worth noting that adjusting the gain difference will directly affect the output of the audio signal. For example, if the determined adjustment gain is greater than 1, it indicates that the current audio signal needs to be amplified; if the determined adjustment gain is less than 1, it indicates that the current audio signal needs to be compressed.
  • the adjustment gain determined based on the peak value of the smoothed audio signal is only applicable to the current zero-crossing interval.
  • the advantage of this setting is that the adjustment gain of the current zero-crossing interval can be determined by calculating the peak value of the audio signal of each zero-crossing interval, thereby making the adjustment of the automatic gain of the audio signal more specific and improving the gain precision.
  • the maximum value of the absolute value of the amplitude of the sampling point which is not specifically limited in this embodiment.
  • the amplitude value of all sampling points in the zero-crossing interval can be obtained by writing the C code, and then the absolute value of the amplitude values of all the sampling points can be calculated, and the absolute value maximum value is obtained from all the absolute values.
  • the specific operations are as follows:
  • Peak is the maximum value of the absolute value of the sampling point amplitude
  • i is the i-th zero-crossing interval.
  • Step 105 Adjust and output the amplitude of the current gain adjustment interval audio signal according to the adjustment gain.
  • the amplitudes of the sampling points in the current gain adjustment interval may be multiplied by the adjustment gain so that the amplitude of the sampling point is as large as possible.
  • the target amplitude is reached to achieve the effect of adjusting the volume.
  • the following C code can be used to execute:
  • the determined adjustment gain of the current zero-crossing interval is greater than 1, the magnitude of all the sampling points in the current zero-crossing interval is multiplied by the adjustment gain, and the amplitude is increased, so the output audio signal will be It will be magnified and the volume that the user can hear will increase accordingly.
  • the determined adjustment gain of the current zero-crossing interval is less than 1, the amplitude of all the sampling points in the current zero-crossing interval is multiplied by the adjustment gain, and then The value will decrease, so the output audio signal will be compressed and the volume that the user can hear will be reduced accordingly. Therefore, the volume required by the user can be achieved by adjusting the amplitude of the current zero-crossing interval audio signal.
  • FIG. 6 is a schematic diagram of the front and rear adjustment of the sampling point gain according to the first embodiment of the present invention.
  • the amplitude of the sampling point larger than the target amplitude (TargetLevel) may be decreased, or may be
  • the amplitude of the sampling point of the effective audio that is greater than the noise threshold (NoiseGate) and smaller than the target level (TargetLevel) is increased (as far as possible to reach the target volume), and noise noise less than the noise threshold (NoiseGate) can also be used.
  • the amplitude of the signal sampling point is reduced (the noise signal is suppressed).
  • the audio signal received by the voice receiving end can not only reach the required volume in the time domain, but also ensure that the audio signal in the frequency domain is as Less distortion, improving the user experience.
  • the automatic gain control method for the audio signal provided in the embodiment of the present invention adopts the above technical solution, and the adjustment gain is determined by using the peak value, so the adjustment gain can effectively match the adjustment of the maximum amplitude audio signal, thereby avoiding the phenomenon of the topping distortion.
  • each gain adjustment interval can separately determine the adjustment gain, which improves the gain accuracy and greatly reduces the distortion of the audio signal in the frequency domain.
  • smoothing the peak of the audio signal in the current gain adjustment interval the smooth transition of the audio signal can be realized when the active state of the audio signal is abrupt, thereby improving the user experience.
  • FIG. 7 is a flow chart showing an automatic gain control method for an audio signal according to Embodiment 2 of the present invention; intention.
  • the embodiment is optimized based on the above embodiment.
  • the step of “determining the adjustment gain of the current gain adjustment interval according to the peak of the smoothed audio signal” is optimized to “if the sound is processed according to the smoothing process”.
  • the signal peak value is determined as the effective audio
  • the adjustment gain of the current gain adjustment interval is determined according to the smoothed audio signal peak value
  • the noise signal is determined as the noise audio according to the smoothed audio signal peak
  • the current gain adjustment interval is determined
  • the adjustment gain is set to the set noise suppression gain”.
  • the process after determining the noise audio and the effective audio is refined. Referring to FIG. 7, the method of the embodiment includes the following steps:
  • Step 201 Identify a zero-crossing point of the amplitude in the audio signal to be processed, and determine a zero-crossing interval between adjacent zero-crossing points.
  • Step 202 Determine at least one gain adjustment interval according to the zero-crossing interval.
  • Step 203 Smooth the peak of the audio signal in the current gain adjustment interval according to the amplitude of the audio signal in the historical gain adjustment interval.
  • Step 204 Determine whether the valid state of the audio signal is valid audio according to the peak value of the smoothed audio signal. If yes, execute step 205; if no, execute step 206.
  • the active state of the audio signal can include valid audio and noisy audio.
  • the effective audio may be an audio signal sent by the voice transmitting end that can be received by the voice receiving end.
  • the noise audio may be that the voice receiving end can receive all the audio signals (such as ambient sounds, etc.) other than the valid audio signal sent by the transmitting end.
  • the effective state of the audio signal can be determined in various manners, and the embodiment is not specifically limited herein.
  • the voice activity detection algorithm VAD
  • VAD voice activity detection algorithm
  • the effective state of the audio signal is determined by averaging the current gain adjustment interval.
  • the peak value of the audio signal after the slip processing is compared with the noise threshold value, and if it is greater than the noise threshold value, it is determined as valid audio; if it is less than or equal to the noise threshold value, it is determined as noise audio.
  • the noise threshold is the empirical value obtained after a large amount of experimental statistics during actual operation. Effective audio and noise audio can be effectively distinguished by setting the noise threshold.
  • the noise threshold can also be set by other tests or calculation methods, and the present embodiment is not specifically limited herein.
  • Step 205 dividing the set target amplitude by the smoothed audio signal peak value as the adjustment gain of the current gain adjustment interval.
  • the target amplitude is similar to the noise threshold, and is also the empirical value obtained after a large number of experimental statistics in the actual operation.
  • the audio signal plays the best under the target amplitude.
  • the peak of the smoothed effective audio signal (the maximum value of the absolute value of the amplitude) may be compared with the target amplitude of the audio signal, thereby further
  • the adjustment gain of the current gain adjustment interval (current zero-crossing interval) is determined.
  • the adjustment gain of the current gain adjustment interval can be obtained by dividing the target amplitude by the effective audio signal peak within the smoothed current gain adjustment interval.
  • the advantage of the above processing method is that by comparing the difference between the maximum value of the absolute value of the amplitude of the audio signal in the current gain adjustment interval and the target amplitude, the amplitude of the sampling point in the current gain adjustment interval can be adjusted in a targeted manner, so that the current The amplitudes of all the sampling points in the zero interval can be adjusted to reach the target amplitude as much as possible. Therefore, the volume of the audio signal can reach the volume required by the user after the output, thereby improving the user experience.
  • Step 206 Set the adjustment gain of the current gain adjustment interval to the set noise suppression gain.
  • the volume of the noise audio is generally lower than the volume of the effective audio, so the noise of the low-volume noise can be suppressed by a certain method, so that the volume is minimized as much as possible without affecting the normal voice. Communication.
  • the way to suppress the noise audio may be to set the adjustment gain of the current gain adjustment interval to the set noise suppression gain.
  • the set noise suppression gain is an empirical value obtained after a large amount of experimental statistics during actual operation, and the empirical value is greater than 0 and less than 1, indicating a compression ratio to the noise audio. By using this empirical value, the compression effect of the noise audio is best.
  • the suppression of the noise audio can be realized, thereby improving the quality of the voice communication and improving the user experience.
  • Step 207 Adjust and output the amplitude of the current gain adjustment interval audio signal according to the adjustment gain.
  • the adjustment gain of the current gain adjustment interval may be determined correspondingly according to the effective state thereof.
  • the determined adjustment gain is more targeted and accurate.
  • FIG. 8 is a schematic flowchart diagram of an automatic gain control method for an audio signal according to Embodiment 3 of the present invention.
  • the process of identifying the zero-crossing point of the amplitude in the audio signal to be processed and determining the zero-crossing interval between adjacent zero-crossing points is refined. Referring to FIG. 8, the method in this embodiment is used. Including the following steps:
  • Step 301 Combine the previous frame audio signal in the audio signal data stream with the current frame audio signal into a to-be-processed audio signal.
  • the audio signal of the previous frame in the audio signal data stream represents the audio signal currently to be processed and played.
  • the current frame audio signal represents the audio signal to be processed.
  • Step 302 Identify a zero-crossing point of the amplitude in the audio signal to be processed until the first zero-crossing point of the audio signal of the current frame.
  • the last zero crossing of the previous frame audio signal can be used as the first zero crossing of the current frame audio signal.
  • the last zero-crossing interval of the previous frame of the audio signal can also be used as the first zero-crossing interval of the current audio signal. The integrity of the zero crossing interval can also be ensured by combining the previous frame audio signal with the current frame audio signal.
  • Step 303 Determine a zero crossing interval between adjacent zero crossings.
  • Step 304 Determine at least one gain adjustment interval according to the zero-crossing interval.
  • Step 305 Smoothing the peak value of the audio signal in the current gain adjustment interval according to the amplitude of the audio signal in the historical gain adjustment interval;
  • Step 306 Determine whether the valid state of the audio signal is valid audio according to the peak value of the smoothed audio signal. If yes, execute step 307; if no, execute step 308.
  • Step 307 dividing the set target amplitude by the smoothed audio signal peak value as the adjustment gain of the current gain adjustment interval.
  • Step 308 Set the adjustment gain of the current gain adjustment interval to the set noise suppression gain.
  • Step 309 Adjust and output the amplitude of the current gain adjustment interval audio signal according to the adjustment gain.
  • FIG. 9 is a schematic flowchart diagram of a preferred automatic gain control method for an audio signal according to Embodiment 3 of the present invention.
  • Peak1 where Peak represents the peak of the audio signal in the current gain adjustment interval, and ⁇ is a constant less than one. Then, the smoothed peak Pake1 is compared with the noise threshold NoiseGate. If Pake1>NoiseGate, the current audio can be determined as valid audio, and the peak value is compared with the target amplitude TargetLevel to obtain the gain adjustment of the current zero-crossing interval. Difference Gain: If Pake1 ⁇ NoiseGate, it can be determined that the current audio is noise audio. Therefore, the noise audio needs to be suppressed by setting the adjustment gain Gain of the current zero-crossing interval to the set noise suppression gain Gain_NG, where Gain_NG ⁇ 1.
  • the amplitude of the current zero-crossing interval audio signal can be adjusted according to the adjustment gain, and the adjustment manner thereof To: Multiply all samples between zero crossings by the gain difference Gain. Finally, the amplitude-adjusted audio signal can be output.
  • the integrity of the zero-crossing interval in the audio signal to be processed can be ensured, and A smooth transition from the previous frame of the audio signal to the current frame of the audio signal.
  • FIG. 10 is a schematic diagram of an automatic gain control apparatus for an audio signal according to Embodiment 4 of the present invention; block diagram.
  • the apparatus can be implemented by software and/or hardware to perform an automatic gain control method of the audio signal.
  • the apparatus includes: a zero-crossing interval determining module 401, an adjustment interval determining module 402, a smoothing processing module 403, an adjustment gain determining module 404, and an adjustment gain determining module 405.
  • the zero-crossing interval determining module 401 is configured to identify an amplitude zero-crossing point in the audio signal to be processed, and determine a zero-crossing interval between adjacent zero-crossing points; and an adjustment interval determining module 402, configured to use the zero-crossing interval according to the zero-crossing interval Determining at least one gain adjustment interval; the smoothing processing module 403 is configured to perform smoothing on the peak of the audio signal in the current gain adjustment interval according to the audio signal amplitude of the historical gain adjustment interval; and adjust the gain determination module 404 to perform the smoothing process The audio signal peak value determines the adjustment gain of the current gain adjustment interval; the amplitude adjustment module 405 is configured to adjust and output the amplitude of the current gain adjustment interval audio signal according to the adjustment gain.
  • the automatic gain control device for an audio signal provided in the embodiment of the present invention adopts the above technical solution, and the adjustment gain is determined by using a peak value, so the adjustment gain can effectively match the adjustment of the maximum amplitude audio signal, thereby avoiding the topping distortion. phenomenon.
  • each gain adjustment interval can separately determine the adjustment gain, which improves the gain accuracy and greatly reduces the distortion of the audio signal in the frequency domain.
  • smoothing the peak of the audio signal in the current gain adjustment interval a smooth transition of the audio signal can be realized when the active state of the audio signal is abrupt, thereby improving the user experience.
  • the adjustment interval determining module is specifically configured to: determine each zero-crossing interval as one gain adjustment interval; or determine consecutive at least two zero-crossing intervals as one gain adjustment interval.
  • the smoothing processing module is specifically configured to: according to the peak of the smoothed audio signal of the previous gain adjustment interval, the audio signal in the current gain adjustment interval according to the following formula
  • the adjusting gain determination includes:
  • a first adjustment gain unit configured to determine an adjustment gain of the current gain adjustment interval according to the peak value of the smoothed audio signal if the peak value of the audio signal after the smoothing is determined to be effective audio
  • a second adjustment gain unit For setting the adjustment gain of the current gain adjustment section to the set noise suppression gain if it is determined to be noise audio based on the smoothed audio signal peak value.
  • the first adjustment gain unit is specifically configured to: divide the set target amplitude by the smoothed audio signal peak value as the adjustment gain of the current gain adjustment interval.
  • the zero-crossing interval determining module is specifically configured to: combine the previous frame audio signal in the audio signal data stream and the current frame audio signal into a to-be-processed audio signal; and identify in the to-be-processed audio signal. The amplitude crosses the zero point until the first zero crossing of the current frame audio signal; the adjacent zero crossing is determined as the zero crossing interval.
  • the automatic gain control apparatus for the audio signal provided in the above embodiments may perform the automatic gain control method of the audio signal provided by any embodiment of the present invention, and has a corresponding functional module and a beneficial effect of performing the method.
  • the automatic gain control method of the audio signal provided by any embodiment of the present invention may perform the automatic gain control method of the audio signal provided by any embodiment of the present invention, and has a corresponding functional module and a beneficial effect of performing the method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

一种音频信号的自动增益控制方法和装置,方法包括:在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间(101);根据过零区间确定至少一个增益调整区间(102);根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理(103);根据平滑处理后的音频信号峰值确定当前增益调整区间的调整增益(104);根据调整增益对当前增益调整区间音频信号的幅值进行调整并输出(105)。可以在时域中对音频信号进行增益调整的同时,极大程度上降低频域中音频信号的失真度,达到提升用户体验的效果。

Description

一种音频信号的自动增益控制方法和装置 技术领域
本发明实施例涉及音频数据处理技术,尤其涉及一种音频信号的自动增益控制方法和装置。
背景技术
当前,语音实时通信已经得到了十分广泛的应用,利用语音通信,不仅可以实现双方通信,还可以进一步实现多方通信。随着语音通信的不断发展,音频数据处理技术在一定程度上也得到了相应的提高。
在现有技术中,为了减小音频信号的不连续性,提升语音通信的服务质量,一般采用自动增益控制方法(Automatic Gain Control,AGC)对音频信号进行处理。其中,自动增益控制方法可以下两种方案包括:(1)以数据帧为分析基础,计算当前帧中各个采样点振幅值绝对值的平均幅值,将当前帧中的目标幅值除以平均幅值后得到当前帧的增益值,然后基于该增益值调整当前帧音频信号的输出幅值,从而实现音量的调整。(2)同样以数据帧为分析基础,分别计算音频信号前后两帧的增益值,并将各帧的增益值平均分配到各采样点中。为了实现前后两帧增益的平滑过渡,通常将前一帧最后一个采样点的增益值作为当前帧第一个采样点的增益值,基于确定的帧增益值调整各帧音频信号的幅值。
现有自动增益控制方法仅是从音频信号在时域中的平滑度进行考虑,虽然可以对音频信号的处理达到了良好的效果,但由于该方法忽略了对信号频域的影响,将会使得频域中的音频信号产生失真现象。例如,图1为现有技术提供 的对音频信号增益调整前后示意图。图2为现有技术提供的对音频信号增益调整前后的仿真示意图。如图1和图2所示,若采用上述方案(1)进行增益调整后,音频信号会出现“消顶”失真现象,即当音频信号的幅值经增益放大时,为了防止超出允许的最大音量,会将超出设定幅值的音频信号强制调整幅值为设定值,使其不会继续增长,所以会出现消顶失真现象。再比如,图3为现有技术提供的对音频信号增益调整前后示意图。图4为现有技术提供的对音频信号增益调整前后的仿真示意图。如图3和图4所示,若采用上述方案(2)进行增益调整后,会使得增益调整后的斜率发生改变,进而使得在频域中的音频信号发生失真现象。同时由于人耳对频域中信号的变化非常敏感,稍有差异用户即可分辨出来,因此,将可能带来不好的用户体验。
发明内容
本发明实施例提供一种音频信号的自动增益控制方法和装置,在时域中对音频信号进行增益调整的同时,也能在极大程度上降低频域中音频信号的失真度,达到提升用户体验的效果。
第一方面,本发明实施例提供了一种音频信号的自动增益控制方法,包括:
在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间;
根据所述过零区间确定至少一个增益调整区间;
根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;
根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;
根据所述调整增益对所述当前增益调整区间音频信号的幅值进行调整并输 出。
第二方面,本发明实施例还提供一种音频信号的自动增益控制装置,包括:
过零区间确定模块,用于在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间;
调整区间确定模块,用于根据所述过零区间确定至少一个增益调整区间;
平滑处理模块,用于根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;
调整增益确定模块,用于根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;
幅值调整模块,用于根据所述调整增益对所述当前增益调整区间音频信号的幅值进行调整并输出。
本发明实施例中提供的音频信号的自动增益控制方案,在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间,然后根据过零区间确定至少一个增益调整区间。接着根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理后,根据平滑处理后的音频信号峰值确定当前增益调整区间的调整增益。最后根据调整增益对当前增益调整区间音频信号的幅值进行调整并输出。通过采用上述技术方案,由于采用峰值来确定调整增益,因此调整增益可有效匹配最大幅值的音频信号调整,避免了消顶失真现象。同时,每个增益调整区间可单独确定调整增益,使得增益精度提高,也极大程度上降低频域中音频信号的失真度。此外,通过对当前增益调整区间内的音频信号峰值进行平滑处理,可以在音频信号的有效状态发生突变时实现音频信号的平滑过渡,达到提升用户体验的效果。
附图说明
图1为现有技术提供的对音频信号增益调整前后示意图;
图2为现有技术提供的对音频信号增益调整前后的仿真示意图;
图3为现有技术提供的对音频信号增益调整前后示意图;
图4为现有技术提供的对音频信号增益调整前后的仿真示意图。
图5为本发明实施例一提供的一种音频信号的自动增益控制方法的流程示意图;
图6为本发明实施例一提供的对采样点增益调整前后示意图;
图7为本发明实施例二提供的一种音频信号的自动增益控制方法的流程示意图;
图8为本发明实施例三提供的一种音频信号的自动增益控制方法的流程示意图;
图9为本发明实施例三提供的一种优选的音频信号的自动增益控制方法的流程示意图;
图10为本发明实施例四提供的一种音频信号的自动增益控制装置的结构框图。
具体实施方式
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。
实施例一
图5为本发明实施例一提供的一种音频信号的自动增益控制方法的流程示意图,该方法可以由音频信号的自动增益控制装置来执行,具体包括如下步骤:
步骤101、在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间。
其中,自动增益控制方法是对音频信号输出音量进行调整的一种控制方法,该方法利用线性放大和压缩的有效组合对输出的音频信号进行动态调整。当弱音频信号输入时,通过增大音频信号的增益可以保证输出音频信号的强度;当所输入的音频信号达到一定强度时,通过减小音频信号的增益可以使输出的音频信号的幅值降低。也就是说,自动增益控制可以通过改变音频信号输入输出幅值的压缩比例来自动调整输出音频信号的幅值。本实施例所提供的自动增益控制方法也是通过调整音频信号幅值的形式实现。
示例性的,本实施例中的音频信号可以为语音实时通信过程中的音频信号,也可以为通过多媒体播放出的音频信号。其中,待处理音频信号可包括有效音频信号,即语音接收端能够接收到的语音发送端所发送的音频信号。示例性的,待处理音频信号也可包括噪音音频信号,即除语音接收端可以接收到发送端所发送的有效音频信号之外的其他所有音频信号。
示例性的,在对音频信号进行处理的过程中,一般可将音频信号按照固定时长分为若干音频帧,其中,固定时长也预先进行设定。对于若干音频帧中的每一帧音频信号都包括若干个采样点,每个采样点分别具有各自的振幅值。具体的,可以将10ms内所采集的样点作为一帧,帧长可由用户自行设定。例如,若在采样频率为16KHz的情况下,一帧10ms可以采集160个样点。在本实施 例中,对待处理音频信号的识别过程实际上也就是对若干个音频帧中的各个采样点进行识别的过程。例如,可以从语音发送端所发送的音频信号的数据流中抓取一帧作为当前待处理的音频帧,也可以将音频信号的数据流中的连续几帧作为当前待处理的音频帧。
其中,在待处理音频信号中识别幅值过零点可包括:在所述待处理音频信号中,判断当前采样点幅值与任一相邻的采样点幅值的乘积是否为0,或与所述当前采样点相邻的两个采样点的幅值是否异号;若是,则确定当前采样点为所述待处理音频信号中的幅值过零点。
在本实施例中,在确定出待处理的音频帧后,可以识别出音频帧中幅值过零的采样点,然后将相邻两个零点之间的区间确定为过零区间。对于当前待处理的音频帧,可以确定多个过零区间。值得注意的是,在过零区间确定的过程中,需要保证过零区间的完整性。例如,对于两个采样点,若其中一个采样点的幅值为零,而另一个采样点的幅值不为零,则这两个采样点所形成的区间不能确定为过零区间。示例性的,可以通过编写过零检测的C代码实现对过零点的检测,在识别音频信号幅值过零点的过程中调用该代码即可。通过采用软件编程的方式实现过零点的检测,可以达到降低成本的效果。具体的,C代码可以具体为以下形式:
Figure PCTCN2016113273-appb-000001
Figure PCTCN2016113273-appb-000002
其中,数组Data的长度为2N,i表示第i个采样点。
步骤102、根据过零区间确定至少一个增益调整区间。
示例性的,在对各个采样点进行增益调整之前,可以首先确定需要进行增益调整的增益调整区间。具体的,可以将每个过零区间确定为一个增益调整区间,也可以将连续的至少两个过零区间确定为一个增益调整区间。可以理解的是,所确定的增益调整区间范围越小,后续对增益调整区间内采样点的幅值调整将越准确。
步骤103、根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理。
其中,音频信号峰值为在当前增益调整区间内,所有采样点振幅绝对值的最大值。音频信号的峰值可由音频信号的自动增益控制装置默认设定。
音频信号的峰值并不是固定不变的,其可随语音发送端当前的状态或者根据语音发送端所处环境的改变而发生变化。在语音通话过程中有可能出现突然的音量增大,或者的音量起伏较大。这种情况下,若每个过零区间内仍然采用峰值来确定调整增益,则可能出现相邻过零区间的增益差别较大的情况,给人带来音量突变的不佳感受。所以本实施例根据历史音频信号的峰值对当前音频信号峰值进行平滑处理,可以使得在一定情况下发生突变的峰值不必过于突兀,进而实现各个增益调整区间的音频信号的平滑过渡。例如,在实时语音通信的过程中,讲话用户(语音发送端)所发出的字与字之间存在一定的时间间隔。由于该间隔区间内音频信号的峰值较小,一般可将该间隔区间内的音频信号看作噪音音频一类。通过对音频信号峰值进行平滑处理,可以使得间隔区间内音频信号的峰值增大,并且与原有有效音频实现平滑过渡。再比如,噪音音频也可能会存在突发情况(音量突然提升),经过平滑处理后,可以使得突发的噪声恢复到原有状态,而不会被放大。
示例性的,根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理的方式可包括:根据上一个增益调整区间的平滑后音频信号峰值按照如下公式对当前增益调整区间内的音频信号峰值进行平滑处理:
Peak1=α*Peak+(1-α)*Peak0;
其中,Peak0为上一个增益调整区间的平滑后音频信号峰值,Peak为当前增益调整区间内的音频信号峰值,Peak1为当前增益调整区间内经过平滑处理后的音频信号峰值,α为小于1的常数。由于上一个增益调整区间是与当前增益调整区间最接近的一个区间,因此,采用上一个增益调整区间的平滑后音频 信号峰值可以实现当前增益调整区间音频信号的有效状态在发生突变情况下的平滑过渡,达到提升用户体验的效果。
步骤104、根据平滑处理后的音频信号峰值确定当前增益调整区间的调整增益。
示例性的,若将每个过零区间确定为一个增益调整区间,则对音频信号过零区间增益的调整实际上是对该过零区间内采样点幅值的调整,因此可以根据平滑处理后当前过零区间中采样点的振幅绝对值的最大值确定出当前过零区间的调整增益。值得注意的是,调整增益的不同将直接影响音频信号的输出效果。例如,如果确定出的调整增益大于1,表示当前音频信号需要被放大;如果确定出的调整增益小于1,表示当前音频信号需要被压缩。需要说明的是,由于每个过零区间内音频信号的峰值不一定完全相同,因此,基于平滑处理后的音频信号峰值所确定的调整增益只适用于当前过零区间。这样设置的好处在于可以通过计算每个过零区间的音频信号的峰值后,确定出当前过零区间的调整增益,进而可以使得音频信号自动增益的调整更加具有针对性,并且可以提高增益精度。
本领域技术人员可以理解的是,统计采样点振幅绝对值的最大值的实现方式可以有很多种,本实施例不作具体限定。优选的,可通过编写C代码来获取过零区间内所有采样点的振幅值,然后可以计算所有采样点振幅值的绝对值,并从所有绝对值中获取到绝对值最大值。具体操作如下:
Figure PCTCN2016113273-appb-000003
Figure PCTCN2016113273-appb-000004
其中,Peak为采样点振幅绝对值的最大值,i表示第i个过零区间。
步骤105、根据调整增益对当前增益调整区间音频信号的幅值进行调整并输出。
示例性的,在确定出当前增益调整区间(当前过零区间)的调整增益后,可以将当前增益调整区间内的采样点的幅值均乘以调整增益进而使得采样点的幅值尽可能地达到目标幅值,从而达到调整音量的效果。在具体实施过程中,可采用如下C代码执行:
FOR j=1:Index[i+1]-Index[i]
Data[Index[i]+j]=Data[Index[i]+j]*Gain;
END
示例性的,若所确定的当前过零区间的调整增益大于1,则当前过零区间中所有采样点的幅值乘以该调整增益后,幅值均会增大,因此输出的音频信号将会被放大,用户所能听到的音量也会相应增大。若所确定的当前过零区间的调整增益小于1,则当前过零区间中所有采样点的幅值乘以该调整增益后,幅 值均会减小,因此输出的音频信号将会被压缩,用户所能听到的音量也会相应降低。因此,通过对当前过零区间音频信号的幅值的调整可以达到用户所需要的音量。图6为本发明实施例一提供的对采样点增益调整前后示意图。如图6所示,根据步骤104中所确定的调整增益对当前增益调整区间采样点的幅值进行调整后,可以将大于目标幅值(TargetLevel)的采样点的幅值减小,也可以将大于噪音门限值(NoiseGate)且小于目标幅值(TargetLevel)的有效音频的采样点的幅值增大(尽可能达到目标音量),同时也可将小于噪音门限值(NoiseGate)的噪音音频信号采样点幅值减小(对噪音信号进行抑制)。值得注意的是,在对各个采样点的幅值进行增益调整后,各个采样点之间的斜率未发生很大的改变,因此可以表明,在频域中音频信号未发生明显的失真现象所以,通过采用上述方式对当前增益调整区间音频信号的幅值经过调整输出后,语音接收端接收到的音频信号不仅在时域中可以达到所需要的音量,同时也可保证频域中音频信号尽可能少的失真,提升了用户体验。
本发明实施例中提供的音频信号的自动增益控制方法,通过采用上述技术方案,由于采用峰值来确定调整增益,因此调整增益可有效匹配最大幅值的音频信号调整,避免了消顶失真现象。同时,每个增益调整区间可单独确定调整增益,使得增益精度提高,也极大程度上降低频域中音频信号的失真度。此外,通过对当前增益调整区间内的音频信号峰值进行平滑处理后,可以在音频信号的有效状态发生突变时实现音频信号的平滑过渡,达到提升用户体验的效果。
实施例二
图7为本发明实施例二提供的一种音频信号的自动增益控制方法的流程示 意图。本实施例以上述实施例为基础进行优化,在本实施例中,将步骤“根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益”优化为“如果根据平滑处理后的音频信号峰值确定为有效音频,则根据所述平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;如果根据平滑处理后的音频信号峰值确定为噪音音频,将所述当前增益调整区间的调整增益设置为设定的噪音抑制增益”。同时,将确定为噪音音频和有效音频之后的过程进行了细化,参照图7,本实施例的方法包括如下步骤:
步骤201、在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间。
步骤202、根据过零区间确定至少一个增益调整区间。
步骤203、根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理。
步骤204、根据平滑处理后的音频信号峰值判断音频信号的有效状态是否为有效音频,若是,则执行步骤205;若否,则执行步骤206。
示例性的,音频信号的有效状态可包括有效音频和噪音音频。其中,有效音频可以为语音接收端能够接收到的语音发送端所发送的音频信号。噪音音频可以为语音接收端可以接收到发送端所发送的有效音频信号之外的其他所有音频信号(例如环境声音等)。
示例性的,音频信号的有效状态的确定方式可以有多种,本实施例在此不做具体限定。例如,可以通过语音活动检测算法(VoiceActivity Detection,VAD)来确定音频信号的有效状态,以区分有效音频和噪音音频。
优选的,音频信号有效状态的确定方式也可以为将当前增益调整区间内平 滑处理后的音频信号峰值与噪音门限值进行比较,如果大于噪音门限值,则确定为有效音频;如果小于或等于噪音门限值,则确定为噪音音频。其中,噪音门限值为实际操作过程中,经过大量实验统计后所得到的经验值。通过噪音门限值的设置可以将有效音频和噪音音频进行有效区分。示例性的,噪音门限值也可通过其他测验或者计算方法进行设置,本实施在此不做具体限定。
步骤205、将设定目标幅值除以平滑处理后的音频信号峰值,作为当前增益调整区间的调整增益。
其中,目标幅值与噪音门限值的确定方式类似,也为在实际操作过程中,经过大量实验统计后所得到的经验值。在目标幅值下音频信号的播放效果最好。
示例性的,在确定出音频信号的有效状态为有效音频时,可以将经平滑处理后的该有效音频信号的峰值(幅值绝对值的最大值)与音频信号的目标幅值作比较,进而确定出当前增益调整区间(当前过零区间)的调整增益。示例性的,当前增益调整区间的调整增益可通过将目标幅值与平滑处理后的当前增益调整区间内的有效音频信号峰值相除获得。上述处理方式的好处在于,通过比较当前增益调整区间内音频信号幅值绝对值的最大值与目标幅值的差异,可以有针对性地调整当前增益调整区间内采样点的幅值,使得当前过零区间内所有的采样点的幅值经调整后可以尽可能地达到目标幅值。从而使得音频信号在输出后音量可以达到用户所需要的音量,提升用户体验。
步骤206、将当前增益调整区间的调整增益设置为设定的噪音抑制增益。
在实时语音通信过程中,噪音音频的音量一般会低于有效音频的音量,因此可以通过采用一定方法对低音量的噪音音频进行抑制,使其音量尽可能降到最低而不会影响正常的语音通信。
示例性的,对噪音音频进行抑制的方式可以为将当前增益调整区间的调整增益设置为设定的噪音抑制增益。其中,设定的噪音抑制增益为在实际操作过程中,经过大量实验统计后所得到的经验值,该经验值大于0且小于1,表示对噪音音频的压缩比例。通过采用该经验值可以使得噪音音频的压缩效果最好。通过采用上述设置方式,可以实现对噪音音频的抑制,进而可以提高语音通信的质量,提升用户体验。
步骤207、根据调整增益对所述当前增益调整区间音频信号的幅值进行调整并输出。
本实施例在上述实施例的基础上,通过根据平滑处理后的音频信号峰值确定出音频信号的有效状态后,可根据其有效状态的不同相应地确定出当前增益调整区间的调整增益,使得所确定的调整增益更具针对性和准确性。
实施例三
图8为本发明实施例三提供的一种音频信号的自动增益控制方法的流程示意图。本实施例三对上述实施例“在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间”的过程进行了细化,参照图8,本实施例的方法包括如下步骤:
步骤301、将音频信号数据流中的上一帧音频信号与当前帧音频信号拼合为待处理音频信号。
其中,音频信号数据流中上一帧音频信号表示当前要处理并播放的音频信号。当前帧音频信号表示即将要处理的音频信号。将上一帧音频信号与当前帧音频信号拼合后作为待处理音频信号,可以保证接收端所接收到音频信号的平 滑性。由于上一帧音频信号与当前帧音频信号的拼合,将导致待处理的音频信号的帧长度增大。示例性的,若上一帧音频信号和当前帧音频信号的帧长度都为N,则将上一帧音频信号与当前帧音频信号拼合后,当前待处理音频信号的帧长度为N+N=2N。
步骤302、在待处理音频信号中识别幅值过零点,直至当前帧音频信号的第一个过零点。
将上一帧音频信号与当前帧音频信号的拼合后,上一帧音频信号最后一个过零点可以作为当前帧音频信号的第一个过零点。同时,上一帧音频信号的最后一个过零区间也可以作为当前音频信号的第一个过零区间。通过将上一帧音频信号与当前帧音频信号的拼合,也可以保证过零区间的完整性。
步骤303、将相邻过零点之间确定为过零区间。
步骤304、根据过零区间确定至少一个增益调整区间。
步骤305、根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;
步骤306、、根据平滑处理后的音频信号峰值判断音频信号的有效状态是否为有效音频,若是,则执行步骤307;若否,则执行步骤308。
步骤307、将设定目标幅值除以平滑处理后的音频信号峰值,作为当前增益调整区间的调整增益。
步骤308、将当前增益调整区间的调整增益设置为设定的噪音抑制增益。
步骤309、根据调整增益对当前增益调整区间音频信号的幅值进行调整并输出。
示例性的,图9为本发明实施例三提供的一种优选的音频信号的自动增益 控制方法的流程示意图。如图9所示,在当前获取到一帧音频数据并且与前一帧音频数据进行拼接后,首先需要统计前一帧数据中过零点的个数,并且将前一帧数据中最后一个过零点作为当前帧中第一个过零点。然后统计过零点之间的采样点振幅绝对值的最大值Peak0,并对Peak0按照公式Peak1=α*Peak+(1-α)*Peak0进行平滑处理后得到当前增益调整区间内平滑后的音频信号峰值Peak1,其中,Peak表示当前增益调整区间内的音频信号峰值,α为小于1的常数。接着将平滑后的峰值Pake1与噪音门限值NoiseGate进行比较,如果Pake1>NoiseGate时,则可以确定当前音频为有效音频,并将峰值与目标幅值TargetLevel相比得到当前过零区间的增益调整的差值Gain:
Figure PCTCN2016113273-appb-000005
如果Pake1≤NoiseGate时,则可以确定当前音频为噪音音频,因此,需要对该噪音音频进行抑制,其抑制方法为将当前过零区间的调整增益Gain设置为设定的噪音抑制增益Gain_NG,其中Gain_NG<1。在确定出经平滑处理后有效音频信号当前过零区间的调整增益和噪音音频信号当前过零区间的调整增益后,根据调整增益可对当前过零区间音频信号的幅值进行调整,其调整方式为:将过零点之间的所有样点均乘以增益差值Gain。最后,可以输出经过幅值调整后的音频信号。
本实施例三在上述实施例的基础上,通过将音频信号数据流中的上一帧音频信号与当前帧音频信号拼合后,可以保证待处理音频信号中过零区间的完整性,同时也可以实现上一帧音频信号到当前帧音频信号的平滑过渡。
实施例四
图10为本发明实施例四提供的一种音频信号的自动增益控制装置的结构 框图。该装置可由软件和/或硬件实现,可执行音频信号的自动增益控制方法。如图10所示,该装置包括:过零区间确定模块401、调整区间确定模块402、平滑处理模块403、调整增益确定模块404和调整增益确定模块405。
其中,过零区间确定模块401,用于在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间;调整区间确定模块402,用于根据所述过零区间确定至少一个增益调整区间;平滑处理模块403,用于根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;调整增益确定模块404,用于根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;幅值调整模块405,用于根据所述调整增益对所述当前增益调整区间音频信号的幅值进行调整并输出。
本发明实施例中提供的一种音频信号的自动增益控制装置,通过采用上述技术方案,由于采用峰值来确定调整增益,因此调整增益可有效匹配最大幅值的音频信号调整,避免了消顶失真现象。同时,每个增益调整区间可单独确定调整增益,使得增益精度提高,也极大程度上降低频域中音频信号的失真度。此外,通过对当前增益调整区间内的音频信号峰值进行平滑处理,可以在音频信号的有效状态发生突变时实现音频信号的平滑过渡,达到提升用户体验的效果。
在上述实施例的基础上,所述调整区间确定模块具体用于:将每个过零区间确定为一个增益调整区间;或将连续的至少两个过零区间确定为一个增益调整区间。
在上述实施例的基础上,所述平滑处理模块具体用于:根据上一个增益调整区间的平滑后音频信号峰值按照如下公式对当前增益调整区间内的音频信号 峰值进行平滑处理:Peak1=α*Peak+(1-α)*Peak0;其中,Peak0为上一个增益调整区间的平滑后音频信号峰值,Peak为当前增益调整区间内的音频信号峰值,Peak1为当前增益调整区间内经过平滑处理后的音频信号峰值,α为小于1的常数。
在上述实施例的基础上,所述调整增益确定包括:
第一调整增益单元,用于如果根据平滑处理后的音频信号峰值确定为有效音频,则根据所述平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;第二调整增益单元,用于如果根据平滑处理后的音频信号峰值确定为噪音音频,将所述当前增益调整区间的调整增益设置为设定的噪音抑制增益。
在上述实施例的基础上,所述第一调整增益单元具体用于:将设定目标幅值除以所述平滑处理后的音频信号峰值,作为所述当前增益调整区间的调整增益。
在上述实施例的基础上,所述过零区间确定模块具体用于:将音频信号数据流中的上一帧音频信号与当前帧音频信号拼合为待处理音频信号;在待处理音频信号中识别幅值过零点,直至当前帧音频信号的第一个过零点;将相邻过零点之间确定为过零区间。
上述实施例中提供的音频信号的自动增益控制装置可执行本发明任意实施例所提供的音频信号的自动增益控制方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本发明任意实施例所提供的音频信号的自动增益控制方法。
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。

Claims (10)

  1. 一种音频信号的自动增益控制方法,其特征在于,包括:
    在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间;
    根据所述过零区间确定至少一个增益调整区间;
    根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;
    根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;
    根据所述调整增益对所述当前增益调整区间音频信号的幅值进行调整并输出。
  2. 根据权利要求1所述的方法,其特征在于,根据所述过零区间确定至少一个增益调整区间包括:
    将每个过零区间确定为一个增益调整区间;或
    将连续的至少两个过零区间确定为一个增益调整区间。
  3. 根据权利要求2所述的方法,其特征在于,根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理包括:
    根据上一个增益调整区间的平滑后音频信号峰值按照如下公式对当前增益调整区间内的音频信号峰值进行平滑处理:
    Peak1=α*Peak+(1-α)*Peak0;
    其中,Peak0为上一个增益调整区间的平滑后音频信号峰值,Peak为当前增益调整区间内的音频信号峰值,Peak1为当前增益调整区间内经过平滑处理后的音频信号峰值,α为小于1的常数。
  4. 根据权利要求2或3所述的方法,其特征在于,根据平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益包括:
    如果根据平滑处理后的音频信号峰值确定为有效音频,则根据所述平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;
    如果根据平滑处理后的音频信号峰值确定为噪音音频,将所述当前增益调整区间的调整增益设置为设定的噪音抑制增益。
  5. 根据权利要求4所述的方法,其特征在于,则根据所述平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益包括:
    将设定目标幅值除以所述平滑处理后的音频信号峰值,作为所述当前增益调整区间的调整增益。
  6. 根据权利要求1所述的方法,其特征在于,在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间包括:
    将音频信号数据流中的上一帧音频信号与当前帧音频信号拼合为待处理音频信号;
    在待处理音频信号中识别幅值过零点,直至当前帧音频信号的第一个过零点;
    将相邻过零点之间确定为过零区间。
  7. 一种音频信号的自动增益控制装置,其特征在于,包括:
    过零区间确定模块,用于在待处理音频信号中识别幅值过零点,将相邻过零点之间确定为过零区间;
    调整区间确定模块,用于根据所述过零区间确定至少一个增益调整区间;
    平滑处理模块,用于根据历史增益调整区间的音频信号幅值对当前增益调整区间内的音频信号峰值进行平滑处理;
    调整增益确定模块,用于根据平滑处理后的音频信号峰值确定所述当前增 益调整区间的调整增益;
    幅值调整模块,用于根据所述调整增益对所述当前增益调整区间音频信号的幅值进行调整并输出。
  8. 根据权利要求7所述的装置,其特征在于,所述调整区间确定模块具体用于:
    将每个过零区间确定为一个增益调整区间;或
    将连续的至少两个过零区间确定为一个增益调整区间。
  9. 根据权利要求8所述的装置,其特征在于,所述平滑处理模块具体用于:
    根据上一个增益调整区间的平滑后音频信号峰值按照如下公式对当前增益调整区间内的音频信号峰值进行平滑处理:
    Peak1=α*Peak+(1-α)*Peak0;
    其中,Peak0为上一个增益调整区间的平滑后音频信号峰值,Peak为当前增益调整区间内的音频信号峰值,Peak1为当前增益调整区间内经过平滑处理后的音频信号峰值,α为小于1的常数。
  10. 根据权利要求8或9所述的装置,其特征在于,所述调整增益确定包括:
    第一调整增益单元,用于如果根据平滑处理后的音频信号峰值确定为有效音频,则根据所述平滑处理后的音频信号峰值确定所述当前增益调整区间的调整增益;
    第二调整增益单元,用于如果根据平滑处理后的音频信号峰值确定为噪音音频,将所述当前增益调整区间的调整增益设置为设定的噪音抑制增益。
PCT/CN2016/113273 2016-10-20 2016-12-29 一种音频信号的自动增益控制方法和装置 WO2018072325A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610914976.9A CN106448712B (zh) 2016-10-20 2016-10-20 一种音频信号的自动增益控制方法和装置
CN201610914976.9 2016-10-20

Publications (1)

Publication Number Publication Date
WO2018072325A1 true WO2018072325A1 (zh) 2018-04-26

Family

ID=58176910

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113273 WO2018072325A1 (zh) 2016-10-20 2016-12-29 一种音频信号的自动增益控制方法和装置

Country Status (2)

Country Link
CN (1) CN106448712B (zh)
WO (1) WO2018072325A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111179947A (zh) * 2020-01-06 2020-05-19 广州欢聊网络科技有限公司 一种音频信号处理的方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107659279B (zh) * 2017-09-30 2023-10-27 浙江芯劢微电子股份有限公司 一种音频自动增益控制方法及装置
CN108231088B (zh) * 2018-01-08 2021-04-06 北京小鱼在家科技有限公司 一种应用于语音数字信号的快速自动增益控制方法和装置
WO2020107385A1 (zh) * 2018-11-30 2020-06-04 深圳市汇顶科技股份有限公司 增益处理方法及其装置、电子设备、信号采集方法及其系统
CN109963235B (zh) * 2019-03-15 2021-12-28 维沃移动通信有限公司 一种声音信号处理方法及移动终端
CN111243631B (zh) * 2020-01-14 2021-12-14 北京声智科技有限公司 一种自动增益控制方法及电子设备
CN113542863B (zh) * 2020-04-14 2023-05-23 深圳Tcl数字技术有限公司 一种声音处理方法、存储介质以及智能电视

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110002481A1 (en) * 2009-07-02 2011-01-06 Oki Semiconductor Co., Ltd. Audio signal amplitude adjusting device and method
US20110068867A1 (en) * 2009-08-14 2011-03-24 That Corporation System and method for interpolating digitally-controlled amplifier gain
CN102355214A (zh) * 2011-10-31 2012-02-15 四川和芯微电子股份有限公司 可调增益音频功率放大电路
CN203691617U (zh) * 2014-01-20 2014-07-02 无锡焺通微电子有限公司 具有过零检测的音频处理电路
CN104767498A (zh) * 2015-04-30 2015-07-08 上海艾为电子技术股份有限公司 增益控制方法及装置
CN204795562U (zh) * 2015-05-29 2015-11-18 上海芯望电子技术有限公司 一种音频信号增益调整电路
CN105282655A (zh) * 2014-06-26 2016-01-27 美国思睿逻辑有限公司 减少在用于增强音频信号路径的动态范围的系统中的音频人工噪声

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59221017A (ja) * 1983-05-31 1984-12-12 Nippon Hoso Kyokai <Nhk> 音声レベル圧縮器
CN100511983C (zh) * 2004-12-13 2009-07-08 腾讯科技(深圳)有限公司 一种自动增益控制方法
CN100589183C (zh) * 2007-01-26 2010-02-10 北京中星微电子有限公司 数字自动增益控制方法及装置
CN104242850A (zh) * 2014-09-09 2014-12-24 联想(北京)有限公司 一种音频信号处理方法及电子设备
CN105355197B (zh) * 2015-10-30 2020-01-07 百度在线网络技术(北京)有限公司 用于语音识别系统的增益处理方法及装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110002481A1 (en) * 2009-07-02 2011-01-06 Oki Semiconductor Co., Ltd. Audio signal amplitude adjusting device and method
US20110068867A1 (en) * 2009-08-14 2011-03-24 That Corporation System and method for interpolating digitally-controlled amplifier gain
CN102355214A (zh) * 2011-10-31 2012-02-15 四川和芯微电子股份有限公司 可调增益音频功率放大电路
CN203691617U (zh) * 2014-01-20 2014-07-02 无锡焺通微电子有限公司 具有过零检测的音频处理电路
CN105282655A (zh) * 2014-06-26 2016-01-27 美国思睿逻辑有限公司 减少在用于增强音频信号路径的动态范围的系统中的音频人工噪声
CN104767498A (zh) * 2015-04-30 2015-07-08 上海艾为电子技术股份有限公司 增益控制方法及装置
CN204795562U (zh) * 2015-05-29 2015-11-18 上海芯望电子技术有限公司 一种音频信号增益调整电路

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111179947A (zh) * 2020-01-06 2020-05-19 广州欢聊网络科技有限公司 一种音频信号处理的方法及装置

Also Published As

Publication number Publication date
CN106448712B (zh) 2019-06-25
CN106448712A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
WO2018072325A1 (zh) 一种音频信号的自动增益控制方法和装置
CN106504765B (zh) 一种音频信号的自动增益控制方法和装置
WO2010131470A1 (ja) ゲイン制御装置及びゲイン制御方法、音声出力装置
GB2577824A (en) Earbud speech estimation
KR20210020751A (ko) 복수의 소비자 장치에 개인화된 오디오 재생 기능을 제공하기 위한 시스템 및 방법
TWI451770B (zh) 增加聽障者聽到聲音正確性之方法及助聽器
US9571055B2 (en) Level adjustment device and method
US9119007B2 (en) Method of and hearing aid for enhancing the accuracy of sounds heard by a hearing-impaired listener
CN106782586B (zh) 一种音频信号处理方法及装置
WO2015085946A1 (zh) 语音信号处理方法、装置及服务器
US20210065670A1 (en) Wind noise mitigation systems and methods
US9559658B2 (en) Filter coefficient group computation device and filter coefficient group computation method
CN106448690A (zh) 一种音频信号的自动增益控制方法和装置
CN111063363B (zh) 一种语音获取方法、音频设备和具有存储功能的装置
US20240088856A1 (en) Long-term signal estimation during automatic gain control
TWI451405B (zh) 增進語音即時輸出之方法及助聽器
CN106648525B (zh) 一种音频信号的自动增益控制方法和装置
TWI590236B (zh) 語音信號處理裝置及語音信號處理方法
Brons et al. Detection threshold for sound distortion resulting from noise reduction in normal-hearing and hearing-impaired listeners
US20200404419A1 (en) Audio system and method of controlling the same
US9514765B2 (en) Method for reducing noise and computer program thereof and electronic device
JP6942282B2 (ja) 補助信号を用いたオーディオデバイスの送信制御
Houben et al. The influence of noise type on the preferred setting of a noise reduction algorithm
JP4518817B2 (ja) 収音方法、収音装置、収音プログラム
US10897665B2 (en) Method of decreasing the effect of an interference sound and sound playback device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16919035

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.10.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16919035

Country of ref document: EP

Kind code of ref document: A1