CN110650410A - Microphone automatic gain control method, device and storage medium - Google Patents

Microphone automatic gain control method, device and storage medium Download PDF

Info

Publication number
CN110650410A
CN110650410A CN201910860097.6A CN201910860097A CN110650410A CN 110650410 A CN110650410 A CN 110650410A CN 201910860097 A CN201910860097 A CN 201910860097A CN 110650410 A CN110650410 A CN 110650410A
Authority
CN
China
Prior art keywords
energy
microphone
agc
gain value
waiting time
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910860097.6A
Other languages
Chinese (zh)
Other versions
CN110650410B (en
Inventor
周建明
康元勋
冯万健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yealink Network Technology Co Ltd
Original Assignee
Xiamen Yealink Network Technology Co Ltd
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 Xiamen Yealink Network Technology Co Ltd filed Critical Xiamen Yealink Network Technology Co Ltd
Priority to CN201910860097.6A priority Critical patent/CN110650410B/en
Publication of CN110650410A publication Critical patent/CN110650410A/en
Application granted granted Critical
Publication of CN110650410B publication Critical patent/CN110650410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a microphone automatic gain control method and a device, which comprises applying analog AGC and digital AGC to a microphone, judging whether the voice frame energy of the current voice frame is in a target range continuously for a first waiting time when the voice collected by the microphone is determined to be a voice frame, and adjusting the gain value of the analog AGC if the voice collected by the microphone is determined to be the voice frame; and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC. The input volume of the microphone is adjusted in a self-adaptive mode by adjusting gain values of the analog AGC and the digital AGC, so that the sound collected by different input equipment is ensured to be in a certain range.

Description

Microphone automatic gain control method, device and storage medium
Technical Field
The invention relates to the field of microphone gain control, in particular to a microphone automatic gain control method, a microphone automatic gain control device and a storage medium.
Background
In windows soft phone products, because input devices at a computer end are various, when the same microphone volume is set and the same signal is input, the sound collected by different microphone devices has great difference. In addition, when a user uses a certain microphone, a volume capable of being normally used is set, but after the other microphone is replaced, the collected sound may become small or large, and the sound volume which is too large or too small causes discomfort of the user. Therefore, the smooth adjustment of the voice volume is controlled to a proper interval, and the comfort level of the user listening feeling can be greatly improved. Therefore, in many speech applications, the speech automatic gain control module is introduced to process the speech signal, and the amplitude of the speech is kept in a reasonable range through the adjustment control of the speech signal, so that the subjective listening feeling of a user can be greatly improved, and the speech quality is improved.
In the prior art, the method for automatic gain control of speech mainly includes two methods: one is hardware-based analog automatic gain control (analog AGC); one is software based digital automatic gain control (digital AGC). In addition, when processing voice, besides the voice automatic gain control module, some auxiliary modules, such as Voice Activity Detection (VAD) module, are added to prevent noise from being amplified as voice, thereby affecting subjective listening quality of audio signals. In practical applications, when an automatic gain control method is applied, one is to perform gain control on a current signal acquired by a microphone, and the other is to perform gain control on output voice through a speaker.
However, in the prior art, no automatic gain control method is available, which can effectively adjust the microphone input volume gain in a self-adaptive manner, so that the sound collected by different input devices can be kept within a reasonable range.
Disclosure of Invention
In order to adjust the input volume of the microphone in a self-adaptive manner to achieve a better experience effect, the invention provides a method for combining analog AGC and digital AGC, which can dynamically adjust the volume gain of the microphone to achieve the purpose that the size of input sound collected by different input equipment is kept within a certain range.
In a first aspect, an embodiment of the present application provides a microphone automatic gain control method, where the method includes applying analog AGC and digital AGC to a microphone, and specifically includes the following steps:
s1: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for the first waiting time, and if so, adjusting the gain value of the analog AGC; and
s2: and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
In some embodiments, the method further comprises the steps of: s3: performing VAD detection on the voice, and calculating the energy of a voice frame; s4: and judging whether the energy of the voice frame continuously exceeds the first threshold value for the third waiting time, if so, adjusting the gain value of the analog AGC to G0 and executing steps S1 and S2 again.
The voice signal is controlled within a certain range through VAD detection and sound breaking detection, and noise is prevented from being amplified.
In some embodiments, step S1 specifically includes:
judging whether the energy of the voice frame lasts for the first waiting time to be greater than a second upper limit, if so, adjusting the gain value of the analog AGC to G1; otherwise, judging whether the energy of the voice frame is continuously greater than the first upper limit and less than the second upper limit, if so, adjusting the gain value of the analog AGC to G2; otherwise, judging whether the energy of the voice frame is continuously smaller than the second lower limit for the first waiting time, if so, adjusting the gain value of the analog AGC to G3; otherwise, judging whether the voice frame energy is less than the first lower limit and greater than the second lower limit continuously for the first waiting time, if so, adjusting the gain value of the analog AGC to be G4, otherwise, if not, adjusting the gain value of the analog AGC when the voice frame energy is between the first upper limit and the first lower limit continuously for the first waiting time.
Under the condition of voice, the energy threshold of 4 voice frames is set to adjust the voice frame energy to be in the middle range, so that the self-adaptive gain control is realized.
In some embodiments, step S2 includes: when the echo energy continuous second waiting time is larger than a second threshold and the voice energy after the digital AGC is smaller than a third threshold, adjusting the maximum gain value of the digital AGC; and when only echo energy exists in the second waiting time and the voice energy after the digital AGC is zero, reducing the gain value of the digital AGC.
In the case of large echo energy, the analog AGC cannot adjust the volume to a reasonable volume value, so the maximum gain of the digital AGC needs to be adjusted to increase the near-end speech energy.
In a second aspect, an embodiment of the present application further provides a microphone automatic gain control apparatus, including:
the analog gain adjustment module is configured to judge whether the energy of the voice frame of the current frame is in a target range continuously for a first waiting time to adjust the gain value of the analog AGC when the sound collected by the microphone is the voice frame;
and the digital gain adjusting module is configured to adjust the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
In some embodiments, further comprising:
the preprocessing module is configured to perform VAD detection on the sound and calculate the energy of a voice frame;
and a sound breaking detection module configured to determine whether the energy of the speech frame continuously exceeds the first threshold for a third waiting time, if so, calculate and adjust the gain value of the analog AGC to G0, and re-execute steps S1 and S2.
In some embodiments, the analog gain adjustment module comprises:
the second upper limit detection module is configured to judge whether the energy of the voice frame is continuously greater than the second upper limit for the first waiting time, and if so, the gain value of the analog AGC is adjusted to be G1; otherwise
The first upper limit detection module is configured to judge whether the energy of the voice frame is continuously greater than a first upper limit and less than a second upper limit for a first waiting time, and if so, the gain value of the analog AGC is adjusted to be G2; otherwise
The second lower limit detection module is configured to judge whether the energy of the voice frame is continuously smaller than the second lower limit for the first waiting time, and if so, the gain value of the analog AGC is adjusted to be G3; otherwise
And the first lower limit detection module is configured to judge whether the energy of the voice frame is less than the first lower limit and greater than the second lower limit continuously for the first waiting time, if so, the gain value of the analog AGC is adjusted to be G4, otherwise, the energy of the voice frame is between the first upper limit and the first lower limit continuously for the first waiting time, and the gain value of the analog AGC is not adjusted.
In some embodiments, the digital gain adjustment module comprises:
a first digital gain adjustment module configured to adjust a maximum gain value of the digital AGC when the echo energy is greater than a second threshold value and the voice energy after the digital AGC is less than a third threshold value for a second waiting time;
and a second digital gain adjustment configured to last for a second waiting time for only echo energy, and if the voice energy after the digital AGC is zero, the gain value of the digital AGC is reduced.
In a third aspect, an embodiment of the present application further provides a microphone volume adjustment method, including:
adjusting the microphone volume and the microphone reinforcement according to any adjusted gain value of the analog AGC or the gain value of the digital AGC in the conversation process, if the gain value of the analog AGC or the gain value of the digital AGC is positive, firstly judging whether the microphone volume is increased only and the requirement of positive gain is met, if so, adjusting the microphone volume, if not, judging whether the microphone reinforcement can be adjusted, if so, adjusting the microphone volume and the microphone reinforcement simultaneously, and if so, not adjusting the microphone volume and the microphone reinforcement; if the gain value of the analog AGC or the gain value of the digital AGC is negative, firstly, whether the microphone volume is only reduced to meet the requirement of negative gain is judged, if yes, the microphone volume is adjusted, if not, whether the microphone enhancement can be adjusted is judged, if yes, the microphone volume and the microphone enhancement are adjusted at the same time, and if both the microphone volume and the microphone enhancement are adjusted to the minimum value, the adjustment is not carried out.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The embodiment of the application provides a microphone automatic gain control method and a device, wherein the method comprises the steps of applying analog AGC and digital AGC to a microphone, and specifically comprises the following steps: s1: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for the first waiting time, and if so, adjusting the gain value of the analog AGC; and S2: and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC. By adjusting the combination of the analog AGC and the digital AGC, the volume gain of the microphone can be dynamically adjusted, the volume of the microphone is controlled within a certain range, the volume of the voice collected by different input equipment can be kept within a certain range, and the collected voice is not suddenly increased or decreased due to the change of the input equipment.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
fig. 2 is a schematic flow chart i of an automatic gain control method of a microphone according to an embodiment of the present invention;
fig. 3 is a schematic flow chart ii of an automatic gain control method of a microphone according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating the step S1 of the automatic gain control method of the microphone according to the embodiment of the invention;
fig. 5 is a flowchart illustrating step S2 of the method for controlling automatic gain of a microphone according to an embodiment of the invention;
FIG. 6 is a schematic diagram of an automatic gain control apparatus for a microphone according to an embodiment of the present invention;
FIG. 7 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows an exemplary system architecture 100 to which the microphone automatic gain control method or the microphone automatic gain control apparatus of the embodiments of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications, such as data processing type applications, file processing type applications, etc., may be installed on the terminal apparatuses 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, 103. The background data processing server can process the acquired file or data to generate a processing result.
It should be noted that the microphone automatic gain control method provided in the embodiment of the present application may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, and accordingly, the microphone automatic gain control device may be disposed in the server 105, or may be disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. In the case where the processed data does not need to be acquired from a remote location, the system architecture described above may not include a network, but only a server or a terminal device.
With continuing reference to fig. 2, a method for microphone automatic gain control is presented according to an embodiment of the present application, the method including applying an analog AGC and a digital AGC to a microphone, including the following steps:
s1: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for the first waiting time, and if so, adjusting the gain value of the analog AGC.
In a specific embodiment, as shown in fig. 3, step S1 specifically includes:
s11: judging whether the energy of the voice frame lasts for the first waiting time to be greater than a second upper limit, if so, adjusting the gain value of the analog AGC to G1; otherwise
S12: judging whether the energy of the voice frame lasts for the first waiting time longer than a first upper limit and shorter than a second upper limit, if so, adjusting the gain value of the analog AGC to G2; otherwise
S13: judging whether the energy of the voice frame is continuously smaller than a second lower limit for the first waiting time, if so, adjusting the gain value of the analog AGC to G3; otherwise
S14: and judging whether the energy of the voice frame is less than the first lower limit and greater than the second lower limit continuously for the first waiting time, if so, adjusting the gain value of the analog AGC to be G4, otherwise, if not, adjusting the gain value of the analog AGC when the energy of the voice frame is between the first upper limit and the first lower limit continuously for the first waiting time.
When the voice collected by the microphone is judged to be a voice frame through VAD detection, the energy of the voice frame is adjusted in the middle range by setting the threshold of 4 voice frame energies, and self-adaptive gain control is realized. The gain value of the analog AGC is a preset fixed value, and is used as an adjustable parameter, and the range of the gain value is generally [ -6dB,6dB ], such as-4 dB for G1, -2dB for G2, 2dB for G3 and-4 dB for G4. And determining the adjustment of the gain value of the analog AGC according to the comparison result of the energy of the voice frame lasting for the first waiting time and the threshold value.
When the energy of the speech frame lasts for a first waiting time (e.g., 200ms) longer than the second upper limit (if the second upper limit is 4000), the gain value of the analog AGC is adjusted to-4 dB, and the speech gain is decreased by a larger amplitude value.
When the energy of the speech frame lasts for a first waiting time (e.g., 200ms) greater than the first upper limit and less than the second upper limit (if the first upper limit is 3000), the gain value of the analog AGC is adjusted to-2 dB, and the speech gain is reduced by a small amplitude value.
When the energy of the speech frame lasts for a first waiting time (e.g., 200ms) less than the second lower limit (if the second lower limit is 500), the gain value of the analog AGC is adjusted to 2dB, and the speech gain is increased by a smaller amplitude value.
When the energy of the speech frame is less than the first lower limit and greater than the second lower limit (if the first lower limit is 1000) for the first waiting time (e.g., 200ms), the gain of the analog AGC is adjusted to 4dB, and the speech gain is increased by a larger amplitude value.
Therefore, the energy of the speech frame can be adaptively controlled within a middle range (1000-3000) between the first lower limit and the first upper limit by adjusting the gain value of the analog AGC, so that the final volume is within a target range.
S2: and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
In a specific embodiment, as shown in fig. 4, step S2 includes:
s21: when the echo energy continuous second waiting time is larger than a second threshold and the voice energy after the digital AGC is smaller than a third threshold, adjusting the maximum gain value of the digital AGC;
s22: and when only echo energy exists in the second waiting time and the voice energy after the digital AGC is zero, reducing the gain value of the digital AGC.
In the case of large echo energy, the volume cannot be adjusted to a reasonable range by the analog AGC, so the maximum gain of the digital AGC needs to be adjusted to increase the near-end speech energy. However, when only echo energy exists and the near end does not speak, only gain reduction processing is performed, and gain increase processing cannot be performed, so that the echo energy is prevented from influencing the echo cancellation effect greatly.
In a particular embodiment, the method further comprises the steps of:
s3: the voice is VAD detected and the speech frame energy is calculated.
Firstly, voice signals are controlled within a certain range through VAD detection and sound breaking detection, and noise is prevented from being amplified. The data for VAD detection includes raw data collected from the microphone and speech frame data input to the AGC module (i.e., post-AEC data). Whether the current data is speech or non-speech can be determined by VAD detection.
The speech frame energy includes echo energy, near-end speech energy, and digital AGC-based speech energy. The echo energy and the near-end speech energy are the same energy in different states.
S4: and judging whether the energy of the voice frame continuously exceeds the first threshold value for the third waiting time, if so, adjusting the gain value of the analog AGC to G0 and executing steps S1 and S2 again.
The step is broken sound detection, whether the sound is too large is judged, the energy of a voice frame of the broken sound detection is echo energy or near-end voice energy, if the echo energy or the near-end voice energy is judged to be too large, the gain value of the analog AGC is adjusted, the first waiting time and the second waiting time are shortened by 100ms, at the moment, the step is used for controlling the sizes of the analog AGC and the digital AGC more accurately, and broken sound interference is eliminated.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an automatic gain control apparatus for a microphone, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
Another embodiment of the present application also provides a microphone automatic gain control apparatus, including:
and the analog gain adjusting module 1 is configured to, when the sound collected by the microphone is a speech frame, determine whether the energy of the speech frame of the current frame is within a target range for the first waiting time to adjust the gain value of the analog AGC.
In a specific embodiment, the analog gain adjustment module 1 includes:
the second upper limit detection module is configured to judge whether the energy of the voice frame is continuously greater than the second upper limit for the first waiting time, and if so, the gain value of the analog AGC is adjusted to be G1; otherwise
The first upper limit detection module is configured to judge whether the energy of the voice frame is continuously greater than a first upper limit and less than a second upper limit for a first waiting time, and if so, the gain value of the analog AGC is adjusted to be G2; otherwise
The second lower limit detection module is configured to judge whether the energy of the voice frame is continuously smaller than the second lower limit for the first waiting time, and if so, the gain value of the analog AGC is adjusted to be G3; otherwise
And the first lower limit detection module is configured to judge whether the energy of the voice frame is less than the first lower limit and greater than the second lower limit continuously for the first waiting time, if so, the gain value of the analog AGC is adjusted to be G4, otherwise, the energy of the voice frame is between the first upper limit and the first lower limit continuously for the first waiting time, and the gain value of the analog AGC is not adjusted.
The energy of the voice frame has 4 thresholds, if the energy of the voice frame is greater than a second upper limit or less than a second lower limit, the adjustment amplitude is larger, if the energy of the voice frame is greater than a first upper limit or less than a first lower limit, the adjustment amplitude is smaller, and if the energy of the voice frame is in the middle range of the first upper limit and the first lower limit, no adjustment is performed.
And the digital gain adjusting module 2 is configured to adjust the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
In a specific embodiment, the digital gain adjustment module 2 includes:
a first digital gain adjustment module configured to adjust a maximum gain value of the digital AGC when the echo energy is greater than a second threshold value and the voice energy after the digital AGC is less than a third threshold value for a second waiting time;
and a second digital gain adjustment configured to last for a second waiting time for only echo energy, and if the voice energy after the digital AGC is zero, the gain value of the digital AGC is reduced.
In a specific embodiment, the method further comprises:
the preprocessing module 3 is configured to perform VAD detection on the voice and calculate the energy of the voice frame;
and the sound breaking detection module 4 is configured to determine whether the energy of the speech frame continuously exceeds the first threshold for the third waiting time, if so, calculate and adjust the gain value of the analog AGC to G0, and re-execute steps S1 and S2.
Another embodiment of the present application further provides a method for adjusting a microphone volume, including:
and adjusting the microphone volume and the microphone enhancement according to the previously adjusted gain value of the analog AGC or the gain value of the digital AGC in the call process, if the gain value of the analog AGC or the gain value of the digital AGC is positive, increasing the microphone volume or simultaneously increasing the microphone volume and the microphone enhancement, and if the gain value of the analog AGC or the gain value of the digital AGC is negative, reducing the microphone volume or simultaneously reducing the microphone volume and the microphone enhancement.
For a Windows soft phone, the microphone volume and the microphone enhancement are mainly affected by the magnitude of the signal collected by the microphone, and the microphone volume is generally in the range of 0 to 100, and the microphone enhancement is in the range of 0 to 30dB, one cell per 10dB (or 0 to 36dB, 12 dB). The system thus automatically controls the microphone volume only in such a way that the microphone volume and the microphone boost can be controlled.
The specific flow of the microphone volume adjusting method comprises the following steps:
when equipment is switched through the process of just establishing or in a call, if the volume of the microphone is less than 30, the volume is set to be 30, and if the volume of the microphone is more than 30, the volume is not set; if the microphone boost is equal to the minimum value, the microphone boost is raised by one, if the microphone boost is not equal to the minimum value, the microphone boost is not adjusted.
In the process of communication, if the previously adjusted analog AGC or digital AGC is positive, whether the microphone volume is increased only can meet the requirement of positive gain is judged, and if so, the microphone volume is adjusted. If not, judging whether the microphone enhancement can be adjusted or not, if so, adjusting the microphone volume and the microphone enhancement simultaneously, and if the microphone volume and the microphone enhancement are adjusted to the maximum value (the maximum value of the microphone volume is 100, and the maximum value of the microphone enhancement is 2 lattices), not adjusting.
If the previously adjusted analog AGC or digital AGC is negative, firstly, whether the microphone volume is only reduced to meet the requirement of negative gain (the microphone volume cannot be reduced to 25% of the maximum volume) is judged, if so, the microphone volume is adjusted, if not, whether the microphone enhancement can be adjusted is judged, if so, the microphone volume and the microphone enhancement are adjusted at the same time, and if both the microphone volume and the microphone enhancement are adjusted to the minimum value (the minimum value of the microphone volume is 25%, and the minimum value of the microphone enhancement is the acquired minimum value), the adjustment is not carried out.
The embodiment of the application provides a microphone automatic gain control method and a device, wherein the method comprises the steps of applying analog AGC and digital AGC to a microphone, and specifically comprises the following steps: s1: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for the first waiting time, and if so, adjusting the gain value of the analog AGC; and S2: and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC. By adjusting the combination of the analog AGC and the digital AGC, the volume gain of the microphone can be dynamically adjusted, the volume of the microphone is controlled within a certain range, the volume of the voice collected by different input equipment can be kept within a certain range, and the collected voice is not suddenly increased or decreased due to the change of the input equipment.
Referring now to FIG. 7, a block diagram of a computer system 700 suitable for use in implementing an electronic device (e.g., the server or terminal device shown in FIG. 1) of an embodiment of the present application is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 may also be connected to the I/O interface 705 as desired. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable medium or any combination of the two. A computer readable medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The modules described may also be provided in a processor.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for the first waiting time, and if so, adjusting the gain value of the analog AGC; and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. An automatic gain control method for a microphone, the method being used for applying an analog AGC and a digital AGC to the microphone, comprising the steps of:
s1: when the sound collected by the microphone is determined to be a voice frame, judging whether the voice frame energy of the current voice frame is in a target range continuously for a first waiting time, and if so, adjusting the gain value of the analog AGC; and
s2: and adjusting the gain value of the digital AGC according to the echo energy of the speech frame energy in the second waiting time and the speech energy after the digital AGC.
2. The microphone automatic gain control method of claim 1, further comprising the steps of:
s3: performing VAD detection on the voice, and calculating the energy of the voice frame;
s4: and judging whether the energy of the voice frame continuously exceeds a first threshold value for a third waiting time, if so, adjusting the gain value of the analog AGC to G0 and executing the steps S1 and S2 again.
3. The method according to claim 1, wherein the step S1 specifically includes:
judging whether the energy of the voice frame is continuously larger than a second upper limit or not, if so, adjusting the gain value of the analog AGC to G1; otherwise
Judging whether the energy of the voice frame is continuously greater than a first upper limit and less than a second upper limit or not, if so, adjusting the gain value of the analog AGC to G2; otherwise
Judging whether the energy of the voice frame is continuously smaller than a second lower limit or not, if so, adjusting the gain value of the analog AGC to G3; otherwise
And judging whether the voice frame energy is less than a first lower limit and greater than a second lower limit continuously or not, if so, adjusting the gain value of the analog AGC to be G4, otherwise, keeping the voice frame energy between the first upper limit and the first lower limit continuously, and not adjusting the gain value of the analog AGC.
4. The microphone automatic gain control method according to claim 1, wherein the step S2 includes:
when the echo energy is continuously greater than a second threshold value for the second waiting time and the voice energy after the digital AGC is less than a third threshold value, adjusting the maximum gain value of the digital AGC;
and when only the echo energy exists in the second waiting time and the voice energy after the digital AGC is zero, reducing the gain value of the digital AGC.
5. An apparatus for automatic gain control of a microphone, comprising:
the analog gain adjustment module is configured to judge whether the energy of a voice frame of a current frame is in a target range continuously for a first waiting time to adjust the gain value of the analog AGC when the voice collected by the microphone is the voice frame;
a digital gain adjustment module configured to adjust a gain value of the digital AGC according to the magnitude of the echo energy of the speech frame energy and the magnitude of the speech energy after the digital AGC in the second waiting time.
6. The microphone automatic gain control device of claim 5, further comprising:
a preprocessing module configured to perform VAD detection on the sound and calculate the energy of the voice frame;
and a sound breaking detection module configured to determine whether the energy of the speech frame continuously exceeds a first threshold for a third waiting time, if so, calculate and adjust the gain value of the analog AGC to G0, and re-execute the steps S1 and S2.
7. The microphone automatic gain control device of claim 5, wherein the analog gain adjustment module comprises:
a second upper limit detection module, configured to determine whether the energy of the speech frame continues for the first waiting time to be greater than a second upper limit, and if so, adjust the gain value of the analog AGC to G1; otherwise
A first upper limit detection module, configured to determine whether the energy of the voice frame continues for the first waiting time to be greater than a first upper limit and less than a second upper limit, if so, adjust the gain value of the analog AGC to G2; otherwise
A second lower limit detection module, configured to determine whether the energy of the speech frame is continuously smaller than a second lower limit, if so, adjust the gain value of the analog AGC to G3; otherwise
And a first lower limit detection module configured to determine whether the energy of the voice frame is continuously less than a first lower limit and greater than a second lower limit for the first waiting time, if so, adjust the gain value of the analog AGC to G4, otherwise, the energy of the voice frame is continuously between the first upper limit and the first lower limit for the first waiting time, and the gain value of the analog AGC is not adjusted.
8. The microphone automatic gain control device of claim 5, wherein the digital gain adjustment module comprises:
a first digital gain adjustment module configured to adjust a maximum gain value of the digital AGC when the echo energy is greater than a second threshold and the voice energy after the digital AGC is less than a third threshold for the second waiting time;
and a second digital gain adjustment configured to only the echo energy for the second waiting time, and reduce the gain value of the digital AGC if the voice energy after the digital AGC is zero.
9. A method for adjusting the volume of a microphone, comprising:
adjusting the microphone volume and the microphone enhancement according to the adjusted gain value of the analog AGC or the gain value of the digital AGC according to any one of claims 1 to 4 in the conversation process, if the gain value of the analog AGC or the gain value of the digital AGC is positive, firstly judging whether the microphone volume is increased only and the positive gain requirement is met, if so, adjusting the microphone volume, if not, judging whether the microphone enhancement can be adjusted, if so, adjusting the microphone volume and the microphone enhancement simultaneously, and if so, not adjusting the microphone volume and the microphone enhancement; if the gain value of the analog AGC or the gain value of the digital AGC is negative, firstly, whether the microphone volume is only reduced to meet the requirement of negative gain is judged, if yes, the microphone volume is adjusted, if not, whether the microphone reinforcement can be adjusted is judged, if yes, the microphone volume and the microphone reinforcement are adjusted at the same time, and if both the microphone volume and the microphone reinforcement are adjusted to the minimum value, the adjustment is not carried out.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201910860097.6A 2019-09-11 2019-09-11 Microphone automatic gain control method, device and storage medium Active CN110650410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910860097.6A CN110650410B (en) 2019-09-11 2019-09-11 Microphone automatic gain control method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910860097.6A CN110650410B (en) 2019-09-11 2019-09-11 Microphone automatic gain control method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110650410A true CN110650410A (en) 2020-01-03
CN110650410B CN110650410B (en) 2021-11-23

Family

ID=68991252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910860097.6A Active CN110650410B (en) 2019-09-11 2019-09-11 Microphone automatic gain control method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110650410B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111243616A (en) * 2020-01-09 2020-06-05 广西民族大学 Constant volume output method based on automatic gain
CN111245765A (en) * 2020-01-19 2020-06-05 西安云维智联科技有限公司 Wired carrier communication signal adaptive gain tracking and capturing method and device
CN112333606A (en) * 2020-10-21 2021-02-05 浙江华创视讯科技有限公司 Microphone gain abnormity adjusting method and device
CN113470691A (en) * 2021-07-08 2021-10-01 浙江大华技术股份有限公司 Automatic gain control method of voice signal and related device thereof
CN113808605A (en) * 2021-09-29 2021-12-17 睿云联(厦门)网络通讯技术有限公司 Building intercom system-based voice enhancement method, device and equipment
CN114582365A (en) * 2022-05-05 2022-06-03 阿里巴巴(中国)有限公司 Audio processing method and device, storage medium and electronic equipment
CN118102155A (en) * 2024-04-23 2024-05-28 深圳市万屏时代科技有限公司 Gain method and system of microphone

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070255436A1 (en) * 2006-04-21 2007-11-01 Hon Hai Precision Industry Co., Ltd. Audio processing apparatus for automatic gain control
CN101477816A (en) * 2008-12-25 2009-07-08 北京中星微电子有限公司 Sound recording mode conversion method and apparatus
CN101800520A (en) * 2010-02-25 2010-08-11 青岛海信移动通信技术股份有限公司 Realization method and realization system for automatic gain control
CN101859581A (en) * 2009-04-03 2010-10-13 索尼公司 Signal processing device, signal processing method, and computer program
CN102457239A (en) * 2010-11-02 2012-05-16 安凯(广州)微电子技术有限公司 Gain control system and method
CN203243288U (en) * 2013-04-17 2013-10-16 广东顶力视听科技有限公司 Automatic control device of volume
CN106060264A (en) * 2016-06-27 2016-10-26 广东欧珀移动通信有限公司 Volume adjustment method and apparatus, and mobile terminal
CN106101351A (en) * 2016-07-26 2016-11-09 哈尔滨理工大学 A kind of many MIC noise-reduction method for mobile terminal
CN108573709A (en) * 2017-03-09 2018-09-25 中移(杭州)信息技术有限公司 A kind of auto gain control method and device
CN108988811A (en) * 2018-08-20 2018-12-11 四川长虹电器股份有限公司 The input gain control method of analogue audio frequency

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070255436A1 (en) * 2006-04-21 2007-11-01 Hon Hai Precision Industry Co., Ltd. Audio processing apparatus for automatic gain control
CN101477816A (en) * 2008-12-25 2009-07-08 北京中星微电子有限公司 Sound recording mode conversion method and apparatus
CN101859581A (en) * 2009-04-03 2010-10-13 索尼公司 Signal processing device, signal processing method, and computer program
CN101800520A (en) * 2010-02-25 2010-08-11 青岛海信移动通信技术股份有限公司 Realization method and realization system for automatic gain control
CN102457239A (en) * 2010-11-02 2012-05-16 安凯(广州)微电子技术有限公司 Gain control system and method
CN203243288U (en) * 2013-04-17 2013-10-16 广东顶力视听科技有限公司 Automatic control device of volume
CN106060264A (en) * 2016-06-27 2016-10-26 广东欧珀移动通信有限公司 Volume adjustment method and apparatus, and mobile terminal
CN106101351A (en) * 2016-07-26 2016-11-09 哈尔滨理工大学 A kind of many MIC noise-reduction method for mobile terminal
CN108573709A (en) * 2017-03-09 2018-09-25 中移(杭州)信息技术有限公司 A kind of auto gain control method and device
CN108988811A (en) * 2018-08-20 2018-12-11 四川长虹电器股份有限公司 The input gain control method of analogue audio frequency

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111243616A (en) * 2020-01-09 2020-06-05 广西民族大学 Constant volume output method based on automatic gain
CN111245765A (en) * 2020-01-19 2020-06-05 西安云维智联科技有限公司 Wired carrier communication signal adaptive gain tracking and capturing method and device
CN112333606A (en) * 2020-10-21 2021-02-05 浙江华创视讯科技有限公司 Microphone gain abnormity adjusting method and device
CN113470691A (en) * 2021-07-08 2021-10-01 浙江大华技术股份有限公司 Automatic gain control method of voice signal and related device thereof
CN113808605A (en) * 2021-09-29 2021-12-17 睿云联(厦门)网络通讯技术有限公司 Building intercom system-based voice enhancement method, device and equipment
CN113808605B (en) * 2021-09-29 2023-09-12 睿云联(厦门)网络通讯技术有限公司 Voice enhancement method, device and equipment based on building intercom system
CN114582365A (en) * 2022-05-05 2022-06-03 阿里巴巴(中国)有限公司 Audio processing method and device, storage medium and electronic equipment
CN118102155A (en) * 2024-04-23 2024-05-28 深圳市万屏时代科技有限公司 Gain method and system of microphone

Also Published As

Publication number Publication date
CN110650410B (en) 2021-11-23

Similar Documents

Publication Publication Date Title
CN110650410B (en) Microphone automatic gain control method, device and storage medium
US10355658B1 (en) Automatic volume control and leveler
TW586303B (en) Enhancing the intelligibility of received speech in a noisy environment
KR101597375B1 (en) System for adjusting perceived loudness of audio signals
EP2453438B1 (en) Speech intelligibility control using ambient noise detection
CN108573709B (en) Automatic gain control method and device
US20170103774A1 (en) Audio Signal Processing
CN101689373A (en) Intelligent gradient noise reduction system
EP3792918B1 (en) Digital automatic gain control method and apparatus
US20040247110A1 (en) Methods and apparatus for improving voice quality in an environment with noise
JP2022530903A (en) Automatic gain control method and its device, readable recording medium
EP3389477A1 (en) Suppression of breath in audio signals
CN111383647B (en) Voice signal processing method and device and readable storage medium
US10602275B2 (en) Audio enhancement via beamforming and multichannel filtering of an input audio signal
US20090252347A1 (en) Method and Apparatus For Automatic Gain Control
CN113963716A (en) Volume balancing method, device and equipment for talking doorbell and readable storage medium
US10277183B2 (en) Volume-dependent automatic gain control
CN202068572U (en) Network sound effect processor
CN108804069B (en) Volume adjusting method and device, storage medium and electronic equipment
US9614486B1 (en) Adaptive gain control
WO2017196382A1 (en) Enhanced de-esser for in-car communication systems
CN112669878A (en) Method and device for calculating sound gain value and electronic equipment
US20210329389A1 (en) Personal communication device as a hearing aid with real-time interactive user interface
EP3274993B1 (en) An audio signal processing apparatus for processing an input earpiece audio signal upon the basis of a microphone audio signal
WO2006055354A2 (en) Adaptive time-based noise suppression

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant