CN112333606A - Microphone gain abnormity adjusting method and device - Google Patents

Microphone gain abnormity adjusting method and device Download PDF

Info

Publication number
CN112333606A
CN112333606A CN202011130151.0A CN202011130151A CN112333606A CN 112333606 A CN112333606 A CN 112333606A CN 202011130151 A CN202011130151 A CN 202011130151A CN 112333606 A CN112333606 A CN 112333606A
Authority
CN
China
Prior art keywords
microphone
gain
sampling
sampling points
value
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
CN202011130151.0A
Other languages
Chinese (zh)
Other versions
CN112333606B (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.)
Zhejiang Huachuang Video Signal Technology Co Ltd
Original Assignee
Zhejiang Huachuang Video Signal 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 Zhejiang Huachuang Video Signal Technology Co Ltd filed Critical Zhejiang Huachuang Video Signal Technology Co Ltd
Priority to CN202011130151.0A priority Critical patent/CN112333606B/en
Publication of CN112333606A publication Critical patent/CN112333606A/en
Application granted granted Critical
Publication of CN112333606B publication Critical patent/CN112333606B/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
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0208Noise filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • H04R29/004Monitoring arrangements; Testing arrangements for microphones
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0208Noise filtering
    • G10L2021/02082Noise filtering the noise being echo, reverberation of the speech
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2410/00Microphones
    • H04R2410/03Reduction of intrinsic noise in microphones

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a method and a device for adjusting microphone gain abnormity, which can timely determine the condition that the gain of a microphone is unreasonable according to the output signal of the microphone and timely adjust the gain of the microphone according to a preset mode, thereby improving the quality of the finally output audio. The method for adjusting the microphone gain abnormity comprises the following steps: the method comprises the steps that terminal equipment receives a first voice signal output by a microphone, the first voice signal is subjected to analog-to-digital conversion and then is composed of N sampling points, and N is a positive integer not less than 1; if the terminal equipment determines that the sampling value of any one of the N sampling points is greater than or equal to the preset threshold value, the terminal equipment resets the gain of the microphone based on the preset mode, and the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.

Description

Microphone gain abnormity adjusting method and device
Technical Field
The present invention relates to the field of signal detection technologies, and in particular, to a method and an apparatus for adjusting microphone gain anomalies.
Background
With the increasing maturity of video conference interaction technology, online conferences become more and more people to choose, and conference scenes are also diversified, for example, various conference rooms, offices, classrooms, command halls and the like, and different types of microphones, such as gooseneck microphones, interface microphones, omnidirectional microphones and the like with different gains, can be chosen during conferences according to the difference of the number of people participating in the conference, the size of conference space and other factors.
In the prior art, in the case of separating the microphone from the terminal device, although the microphone and the terminal device can adjust their gains to adjust the volume, even if the gain setting of the microphone at the front stage is not reasonable, the final output voice volume can still be in the normal range by adjusting the gain of the terminal device. However, because the gain of the microphone at the front stage is set unreasonably, clipping may occur to the sound collected by the microphone, and in this case, even if the final output volume of the terminal device is within a normal range, problems such as echo may be caused, thereby affecting the user experience.
Therefore, in the prior art, even though the terminal device can make the output volume in a normal range by adjusting its gain, if the gain setting of the microphone at the front stage is not reasonable, the output sound still has echo, thereby affecting the user experience.
Disclosure of Invention
The embodiment of the invention provides a method and a device for adjusting microphone gain abnormity, which can timely determine the condition that the gain of a microphone is unreasonable according to the output signal of the microphone and timely adjust the gain of the microphone according to a preset mode, thereby improving the quality of finally output audio.
In a first aspect, an embodiment of the present invention provides a method for adjusting microphone gain abnormality, where the method includes:
the method comprises the steps that terminal equipment receives a first voice signal output by a microphone, the first voice signal is subjected to analog-to-digital conversion and then is composed of N sampling points, and N is a positive integer not less than 1;
if the terminal equipment determines that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold value, the terminal equipment resets the gain of the microphone based on a preset mode, and the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.
In the embodiment of the present invention, it may be considered that the gain of the microphone is set to a certain specific value in the initial state, and then the sound of the user is collected by the microphone and output to the terminal device in the form of the first voice signal. In the terminal device, first, digital-to-analog conversion needs to be performed on a first voice signal (an analog-to-digital conversion process is a process of sampling a continuous analog signal to form a discrete digital signal), so that the continuous first voice signal is converted into discrete N sampling points, for example, a sampling bit width is 16 bits, a corresponding maximum sampling value is 32768, a preset threshold value may be an empirical value, for example, 32000, once a sampling value of any one of the N sampling points is greater than or equal to the preset threshold value, it is indicated that an amplitude of the first voice signal output by the microphone is too large, that is, a gain of the microphone in an initial state is abnormally set, which results in exceeding a maximum input voice signal amplitude allowed by the terminal device, and at this time, the gain of the microphone may be adjusted based on a preset mode. The method can timely determine the condition of the microphone with possible abnormal gain setting according to the output signal of the microphone, and timely adjust the gain of the microphone based on the preset mode, so that the final output audio of the terminal equipment can achieve a better effect.
Optionally, if the terminal device determines that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold, the terminal resets the gain of the microphone based on a preset mode, including:
the terminal equipment divides a voice signal formed by the N sampling points into M voice frames based on preset time length, wherein each voice frame in the M voice frames comprises N/M sampling points, and M is a positive integer not less than 1;
the terminal equipment determines a first sampling point with the largest sampling value from N/M sampling points included in each voice frame;
and if the terminal equipment determines that the sampling value of any one of the M first sampling points is greater than or equal to the preset threshold value, resetting the gain of the microphone by the terminal equipment based on the preset mode.
In the embodiment of the present invention, a speech signal (i.e., a discrete digital signal) composed of N sampling points is divided into M speech frames according to a preset duration, and each speech frame includes N/M sampling points. Firstly, judging the sampling point with the largest sampling value in N/M sampling points contained in each voice frame, for example, the first sampling point, and determining M first sampling points due to the existence of M voice frames. If the sampling value of any one of the M first sampling points is greater than or equal to the preset threshold value, it indicates that the gain setting of the microphone is abnormal, and at this time, the terminal device may adjust the gain of the microphone in time based on the preset mode. In the method, the sampling point with the largest sampling value in each voice frame is compared with the preset threshold value, rather than comparing each sampling point in the N sampling points with the preset threshold value, so that the comparison times are greatly reduced, and the comparison efficiency is improved, thereby more timely detecting the possible gain setting abnormity of the microphone.
Optionally, the method further includes:
if the terminal equipment determines that the sampling value of any sampling point in the N sampling points is smaller than the preset threshold value, the terminal equipment determines whether the variable quantity of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is zero;
and if the gain is zero, resetting the gain of the microphone by the terminal based on the preset mode.
In the embodiment of the present invention, if the sampling value of any one of the N sampling points is smaller than the preset threshold, it is further necessary to further determine whether the variation of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is zero. If the amplitude value is zero, it indicates that the amplitude value of the first voice signal output by the microphone exceeds the allowable output range of the microphone due to abnormal microphone gain setting, so that part of the signal in the first voice signal is clipped, and at this time, the terminal device may adjust the gain of the microphone based on a preset mode, so as to avoid clipping of the voice signal output by the microphone as much as possible, and thus, the audio finally output by the terminal device can achieve a better effect.
Optionally, the resetting, by the terminal, the gain of the microphone based on a preset mode includes:
and the terminal equipment outputs a prompt message which is used for prompting a user to reset the gain of the microphone.
In the embodiment of the invention, if the terminal equipment determines that the microphone gain setting is abnormal, the terminal equipment can output a prompt message, and a user can manually reset the gain of the microphone through the prompt message. Because the user can adjust the gain of the microphone according to the experience of the user, the gain of the microphone can be adjusted accurately.
Optionally, the resetting, by the terminal, the gain of the microphone based on a preset mode includes:
and the terminal equipment sends a control instruction to the microphone so that the microphone adjusts the gain of the microphone based on a preset gain value.
In the embodiment of the invention, if the terminal equipment determines that the microphone gain setting is abnormal, the terminal equipment can send a control instruction to the microphone, so that the microphone automatically adjusts the gain of the microphone based on the preset gain value without manual adjustment of a user.
Optionally, the preset gain value is inversely related to the number of times of adjusting the microphone gain.
In the embodiment of the invention, in the process of adjusting the gain of the microphone based on the preset gain value, the preset gain value is gradually reduced along with the increase of the adjustment times, so that the adjusted gain value of the microphone is kept in a more reasonable range.
Optionally, the method further includes:
and if the terminal equipment determines that the variable quantities of the sampling values corresponding to a plurality of adjacent sampling points in the N sampling points are not zero, the terminal equipment performs digital automatic gain control processing on the first voice signal.
In the embodiment of the invention, when the terminal equipment determines that the sampling value of any one of the N sampling points is smaller than the preset threshold value and the variation of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is not zero, the gain setting of the microphone is reasonable, and at the moment, the terminal equipment can perform digital automatic gain control processing on the voice signal formed by the N sampling points so as to improve the effect of the finally output audio.
In a second aspect, an embodiment of the present invention provides an apparatus for adjusting microphone gain abnormality, where the apparatus includes:
the receiving unit is used for receiving a first voice signal output by a microphone, the first voice signal is formed by N sampling points after analog-to-digital conversion, and N is a positive integer not less than 1;
and the adjusting unit is used for resetting the gain of the microphone based on a preset mode when the sampling value of any one of the N sampling points is determined to be greater than or equal to a preset threshold value, wherein the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.
Optionally, the adjusting unit is specifically configured to:
dividing a voice signal formed by the N sampling points into M voice frames based on a preset time length, wherein each voice frame in the M voice frames comprises N/M sampling points, and M is a positive integer not less than 1;
determining a first sampling point with the largest sampling value from the N/M sampling points included in each voice frame;
and if the sampling value of any one of the M first sampling points is determined to be greater than or equal to the preset threshold value, resetting the gain of the microphone based on the preset mode.
Optionally, the adjusting unit is further specifically configured to:
if the sampling value of any sampling point in the N sampling points is smaller than the preset threshold value, determining whether the variable quantity of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is zero;
and if the gain is zero, resetting the gain of the microphone based on the preset mode.
Optionally, the adjusting unit is further specifically configured to:
and outputting a prompt message for prompting a user to reset the gain of the microphone.
Optionally, the adjusting unit is further specifically configured to:
and the terminal equipment sends a control instruction to the microphone so that the microphone adjusts the gain of the microphone based on a preset gain value.
Optionally, the preset gain value is inversely related to the number of times of adjusting the microphone gain.
Optionally, the method further includes:
and the processing unit is used for carrying out digital automatic gain control processing on the voice signal formed by the N sampling points when the variable quantities of the sampling values corresponding to a plurality of adjacent sampling points in the N sampling points are determined not to be zero.
In a third aspect, an embodiment of the present invention provides an apparatus for adjusting microphone gain abnormality, where the apparatus includes a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the steps of the method according to the embodiment of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method as described in the embodiment of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of a conference system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for adjusting microphone gain abnormality according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for adjusting microphone gain abnormality according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for adjusting microphone gain abnormality according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments.
Please refer to fig. 1, which is a schematic structural diagram of a conference system. Fig. 1 includes a microphone 101 at a front stage and a terminal apparatus 102 at a rear stage. The microphones 101 include a gooseneck microphone, an interface microphone, an omnidirectional microphone, and the like having different gains, and different types of microphones may be selected according to an actual conference scene, and the type of the microphone 101 is not particularly limited herein.
It should be understood. Once the type of the microphone 101 is determined, the adjustable range of the gain of the microphone 101 is determined accordingly, and the range of the amplitude of the voice signal which it allows to output is also determined accordingly. Theoretically, since the microphone 101 is mainly used for collecting the voice information input by the user, considering the speaking habits of different users, for example, the user a usually has a small speaking volume, that is, the amplitude of the collected voice signal is small; the volume of the speech of the user B is usually high, that is, the amplitude of the collected speech signal is large, and in order to take into account the usage habits of different users, the range of the allowed input volume of the microphone 101 may be considered to be large enough. Similarly, once the type of the terminal apparatus 102 is determined, the adjustable range of the gain of the terminal apparatus 102 is determined accordingly, and the range of the amplitude of the voice signal that it allows to input and output is determined.
Since the microphone 101 and the terminal device 102 can adjust their own gains independently, the purpose of adjusting the amplitude of the output voice signal can be achieved. It may happen that when the gain setting of the microphone 101 is abnormal, the amplitude of the finally output voice signal can still be made within the normal range by adjusting the gain of the terminal apparatus 102. However, due to the abnormal gain setting of the microphone 101 at the front stage, a clipping problem may occur in the process of collecting the user voice information and outputting the voice signal to the terminal device 102, that is, the amplitude of the voice signal actually output by the microphone 101 already exceeds the amplitude of the maximum voice signal that is allowed to be output by the microphone, and then a part of the voice signal that exceeds the maximum allowed output amplitude is clipped, so that the voice information described by the part of the voice signal is lost. Which in turn results in less effective audio that is ultimately output by the terminal device 102, such as echo may occur.
In view of this, an embodiment of the present invention provides a method for adjusting microphone gain abnormality, where the method determines a situation that a gain setting of a microphone is abnormal according to an output speech signal of the microphone, and adjusts the gain of the microphone in time based on a preset mode, so as to improve the quality of a finally output audio.
The technical solution provided by the embodiment of the present invention is described below with reference to the accompanying drawings. Referring to fig. 2, the present invention provides a method for adjusting microphone gain abnormality, the flow of the method is described as follows:
step 201: the terminal equipment receives a first voice signal output by a microphone, the first voice signal is formed by N sampling points after analog-to-digital conversion, and N is a positive integer not less than 1.
In the embodiment of the invention, in the initial state, if the microphone is used for the first time, namely the microphone is in a brand-new non-unpacked state before, the gain of the current microphone can be considered to be in a factory preset value; if the microphone was not used for the first time, then the current microphone gain may be considered to be at some particular value set by the user at the time of the last use. When the current user uses the microphone, the gain of the microphone can be adjusted only in an initial step through daily experience or is not adjusted directly, and whether the gain setting is reasonable or not is difficult to guarantee.
For example, the speaking volume of the user is large, and at the same time, the gain of the microphone is also set to be large, so that for the microphone, after the voice of the user is collected and amplified, the maximum amplitude of the voice signal allowed to be output by the microphone may be exceeded, and further, part of the voice information of the user cannot be normally output. Further, for the terminal device, the amplitude of the voice signal output by the microphone is too large, which may also exceed the maximum amplitude of the voice signal allowed to be input by the terminal device itself, and at this time, part of the voice information may be lost in the voice signal output by the microphone to the terminal device. In both cases, it is considered that the abnormal gain setting of the microphone at the front stage is caused.
In view of this, in the embodiment of the present invention, it may be determined whether the gain setting of the microphone is abnormal based on the voice signal actually output by the microphone, and it is inconvenient to determine considering that the signal collected by the microphone is an analog signal, that is, the output signal is a continuous signal. Therefore, the voice signal output by the microphone can be analog-to-digital converted, that is, the continuous signal is sampled according to a preset sampling rate and then converted into a discrete digital signal.
As a possible implementation, the terminal device may receive the first voice signal output by the microphone, and perform analog-to-digital conversion on the first voice signal, where the analog-to-digital converted voice signal may be considered to be composed of N sampling points, where N is a positive integer not less than 1.
Step 202: if the terminal equipment determines that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold value, the terminal equipment resets the gain of the microphone based on a preset mode, and the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.
In the embodiment of the invention, after the terminal equipment receives the first voice signal output by the microphone and performs analog-to-digital conversion, the first voice signal is converted into a discrete signal consisting of N sampling points. Each of the N sampling points corresponds to a sampling value, and the variation range of the sampling values is related to the sampling bit width in the sampling process. For example, if a 16bit sampling bit width is used in the analog-to-digital conversion process, the maximum sampling value is 32768 (2)16/2). Meanwhile, the maximum sampling value can also be regarded as the maximum amplitude of the voice signal allowed to be input by the terminal equipmentThe value is obtained. If the sampling value of any sampling point in the N sampling points is greater than the maximum amplitude value allowed to be input by the terminal equipment, the terminal equipment cannot receive all voice signals output by the microphone, that is, part of the voice signals with amplitude values exceeding the maximum allowed amplitude value of the terminal equipment are lost. At this time, the gain of the microphone at the front stage needs to be adjusted in time, otherwise the quality of the audio finally output by the terminal equipment is seriously affected.
As a possible implementation manner, if the terminal device determines that the sampling value of any one of the N sampling points is greater than or equal to the preset threshold, the terminal device may reset the gain of the microphone based on the preset manner. The preset threshold is associated with the sampling bit width corresponding to the N sampling points. Taking a sampling bit width of 16 bits as an example, the maximum sampling value is 32768 (2)16And/2), the preset threshold may be a maximum sampling value 32768, or may be a value 32000 according to practical experience, and the preset threshold is not particularly limited herein. The following describes a method for adjusting the microphone gain.
The first method, considering that a button for adjusting the gain is usually provided on the microphone, allows the user to manually adjust the gain of the microphone. Therefore, in the embodiment of the invention, when the terminal equipment determines that the gain of the microphone is abnormal, the user can be reminded to carry out manual adjustment. As a possible implementation, the terminal device may output a prompt message to the user, which may prompt the user that the gain of the microphone needs to be reset. For example, the user may be reminded by a more conspicuous color on a visual interface connected to the terminal device. The manner in which the prompting message is presented is not particularly limited herein.
In the second method, it is considered that if a button for adjusting the gain is not provided on the microphone, or if it is cumbersome to manually adjust the gain of the microphone, the gain of the microphone may be automatically reset when the terminal device determines that the gain of the microphone is abnormal. As a possible implementation manner, the terminal device may send a control instruction to the microphone, and after receiving the control instruction, the microphone may adjust its gain according to a preset gain value. For example, if the preset gain value is 5, the microphone decreases its own gain by 5, and at this time, if the terminal device determines that the microphone gain is still abnormal, the terminal device sends a control command to the microphone again, and the microphone decreases its own gain by 5 again until the microphone gain is within a more reasonable range.
In the third method, considering that the gain value preset in the second method is a fixed value, the gain of the microphone may be made smaller after the gain of the microphone is adjusted a plurality of times. That is to say, although the voice information output by the microphone and the terminal device is complete, the problem of losing part of the voice information does not occur, but because the gain of the microphone is too small, in order to enable the user to have better experience, the gain of the terminal device needs to be properly increased, so that the amplitude of the voice signal output by the terminal device can be larger, that is, the volume of the terminal device is larger, and thus the adjustment process is more complicated. Therefore, in the embodiment of the present invention, in the process of adjusting the gain of the microphone for multiple times based on the preset gain value, the preset gain value may be gradually reduced, so that the adjusted gain of the microphone can ensure that the output voice signal is not lost, and the amplitude of the voice signal output by the terminal device is within a reasonable range. As a possible implementation manner, the preset gain value is inversely related to the number of times of adjustment, that is, the larger the number of times of adjustment, the smaller the preset gain value is, which is equivalent to that the gain of the microphone is initially adjusted coarsely (the adjustment amplitude is larger), and then is adjusted finely (the adjustment amplitude is smaller), and finally the gain of the microphone is within a more reasonable range.
Considering that if the number of the N sampling points is large, if the sampling value of each sampling point is directly compared with the preset threshold value, the number of times of comparison is large, so that the efficiency of the terminal device for determining whether the microphone gain is abnormal is low.
In view of this, in the embodiment of the present invention, the discrete signal composed of N sampling points may be divided into a plurality of voice frames with equal length, and then the sampling point with the largest sampling value, for example, the first sampling point, is determined among the plurality of sampling points included in each voice frame. Since a plurality of voice frames are divided, a plurality of first sampling points equal to the number of the voice frames can be obtained, and whether the gain of the microphone is abnormal or not can be determined by comparing the plurality of first sampling points with a preset threshold value one by one. The method reduces the times of comparing the sampling value corresponding to the sampling point with the preset threshold value to a certain extent, thereby improving the efficiency of judging whether the microphone gain is abnormal by the terminal equipment.
As a possible implementation manner, the terminal device may divide the speech signal composed of N sampling points into M speech frames based on a preset time duration, for example, the preset time duration is 10ms, so that each speech frame includes N/M sampling points. Since the sampling values corresponding to the N/M sampling points included in each speech frame may be the same, may also be different, or may be partially the same, at this time, the terminal device only needs to determine the first sampling point with the largest sampling value in each speech frame. If a plurality of first sampling points with the same sampling value exist in a certain voice frame at the same time, then one of the first sampling points is randomly selected, and finally M first sampling points can be obtained. The terminal equipment compares the sampling value of any first-time sampling point in the M first sampling points with a preset threshold value, if the sampling value of a certain first sampling point is larger than or equal to the preset threshold value, the amplitude of the output signal of the microphone is larger and exceeds the maximum input amplitude allowed by the terminal equipment, and at the moment, the terminal equipment can reset the gain of the microphone based on any one of the preset modes.
In the embodiment of the present invention, when the terminal device determines that the sampling value of any one of the N sampling points is smaller than the preset threshold, it can only indicate that the amplitude of the voice signal output by the microphone is within the input amplitude range of the voice signal allowed by the terminal device, that is, a part of the voice signal is not lost due to exceeding the input amplitude range of the voice signal allowed by the terminal device. It is not yet fully certain that the gain setting of the microphone is within a reasonable range. This is because the amplitude of the voice signal finally output by the microphone may exceed the maximum amplitude range of the voice signal allowed to be output by the microphone itself, although the amplitude of the voice signal finally output by the microphone does not exceed the input amplitude range of the voice signal allowed by the terminal device. That is, if the microphone gain setting is abnormal, it may cause a part of the speech signal (i.e., a part of the speech signal exceeding the maximum amplitude) to be forcibly compressed to the maximum allowable output amplitude range, i.e., a part of the speech signal is clipped. It is considered that if a part of the voice signal in the first voice signal output by the microphone is truncated, the truncated part of the voice signal is converted into a discrete digital signal, and it is visually represented that the fluctuation of the sampling value of the adjacent sampling point is small.
In view of this, in the embodiment of the present invention, sampling values of a plurality of adjacent sampling points in the N sampling points may be obtained, and if the sampling values corresponding to the plurality of adjacent sampling points are relatively close to each other, it may be determined that a part of the voice signal in the first voice signal before the analog-to-digital conversion is truncated, so that it may be determined that the gain setting of the microphone is abnormal.
As a possible implementation manner, after determining that the sampling value of any one of the N sampling points is smaller than the preset threshold, the terminal device may further determine whether the variation of the sampling value corresponding to multiple adjacent sampling points in the N sampling points is zero. If the value is zero, the sampling values of a plurality of adjacent sampling points in the N sampling points are very close, and therefore it is determined that the gain setting of the microphone is possibly abnormal. At this time, the terminal device may reset the gain of the microphone based on any one of the preset manners.
For example, the terminal device may determine whether the variation of the sampling values of a plurality of adjacent sampling points among the N sampling points is zero, based on a way that a sobel (able) operator calculates a first order difference. The manner of calculating the variation amount of the sample value of the plurality of adjacent sample points is not particularly limited herein.
In the embodiment of the invention, if the terminal device determines that the sampling value of any one of the N sampling points is smaller than the preset threshold value and the variation of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is not zero, it indicates that the gain of the microphone is set reasonably, and at this time, the terminal device can further process the first voice signal after analog-to-digital conversion, thereby improving the quality of the finally output audio.
As a possible implementation manner, after the terminal device determines that the sampling value of any one of the N sampling points is smaller than the preset threshold, and the variation of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is not zero, the terminal device may perform digital automatic gain control processing on the first voice signal. Meanwhile, the terminal device may perform other processing on the first speech signal, such as noise reduction processing and echo cancellation processing, where the subsequent optimization process is not particularly limited.
Referring to fig. 3, based on the same inventive concept, an embodiment of the present invention provides an apparatus for adjusting microphone gain abnormality, including: a receiving unit 301 and an adjusting unit 302.
The receiving unit 301 is configured to receive a first voice signal output by a microphone, where the first voice signal is formed by N sampling points after analog-to-digital conversion, and N is a positive integer not less than 1;
the adjusting unit 302 is configured to reset the gain of the microphone based on a preset manner when it is determined that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold, where the preset threshold is associated with a sampling bit width corresponding to the N sampling points.
Optionally, the adjusting unit 302 is specifically configured to:
dividing a voice signal consisting of N sampling points into M voice frames based on preset duration, wherein each voice frame in the M voice frames comprises N/M sampling points, and M is a positive integer not less than 1;
determining a first sampling point with the largest sampling value from N/M sampling points included in each voice frame;
and if the sampling value of any one of the M first sampling points is determined to be greater than or equal to the preset threshold value, resetting the gain of the microphone based on a preset mode.
Optionally, the adjusting unit 302 is further specifically configured to:
if the sampling value of any sampling point in the N sampling points is smaller than the preset threshold value, determining whether the variable quantity of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is zero;
and if the gain is zero, resetting the gain of the microphone based on a preset mode.
Optionally, the adjusting unit 302 is further specifically configured to:
and outputting a prompt message for prompting the user to reset the gain of the microphone.
Optionally, the adjusting unit 302 is further specifically configured to:
and sending a control instruction to the microphone so that the microphone adjusts the self gain based on the preset gain value.
Optionally, the preset gain value is inversely related to the number of times the microphone gain is adjusted.
Optionally, the method further includes:
and the processing unit is used for carrying out digital automatic gain control processing on the voice signal consisting of the N sampling points when the variable quantities of the sampling values corresponding to a plurality of adjacent sampling points in the N sampling points are determined not to be zero.
Referring to fig. 4, based on the same inventive concept, an embodiment of the present invention provides an apparatus for adjusting a microphone gain abnormality, where the apparatus includes at least one processor 401, and the processor 401 is configured to execute a computer program stored in a memory to implement the steps of the method for adjusting a microphone gain abnormality shown in fig. 2 according to the embodiment of the present invention.
Optionally, the processor 401 may be specifically a central processing unit, a specific ASIC, and may be one or more integrated circuits for controlling the execution of the program.
Optionally, the apparatus for adjusting microphone gain abnormality may further include a memory 402 connected to the at least one processor 401, and the memory 402 may include a ROM, a RAM, and a disk memory. The memory 402 is used for storing data required by the processors 401 during operation, that is, storing instructions executable by the at least one processor 401, and the at least one processor 401 executes the instructions stored in the memory 402 to perform the method shown in fig. 2. The number of the memories 402 is one or more. The memory 402 is also shown in fig. 4, but it should be understood that the memory 402 is not an optional functional block, and is shown in fig. 4 by a dotted line.
The physical devices corresponding to the receiving unit 301 and the adjusting unit 302 may be the processor 401. The device for adjusting the microphone gain abnormality can be used for executing the method provided by the embodiment shown in fig. 2. Therefore, regarding the functions that can be realized by each functional module in the device, reference may be made to the corresponding description in the embodiment shown in fig. 2, which is not repeated herein.
Embodiments of the present invention also provide a computer storage medium, where the computer storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method as described in fig. 2.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for adjusting microphone gain anomaly, the method comprising:
the method comprises the steps that terminal equipment receives a first voice signal output by a microphone, the first voice signal is subjected to analog-to-digital conversion and then is composed of N sampling points, and N is a positive integer not less than 1;
if the terminal equipment determines that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold value, the terminal equipment resets the gain of the microphone based on a preset mode, and the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.
2. The method of claim 1, wherein the terminal device determines that the sampling value of any one of the N sampling points is greater than or equal to a preset threshold value, and then the terminal resets the gain of the microphone based on a preset manner, comprising:
the terminal equipment divides a voice signal formed by the N sampling points into M voice frames based on preset time length, wherein each voice frame in the M voice frames comprises N/M sampling points, and M is a positive integer not less than 1;
the terminal equipment determines a first sampling point with the largest sampling value from N/M sampling points included in each voice frame;
and if the terminal equipment determines that the sampling value of any one of the M first sampling points is greater than or equal to the preset threshold value, resetting the gain of the microphone by the terminal equipment based on the preset mode.
3. The method of claim 1, further comprising:
if the terminal equipment determines that the sampling value of any sampling point in the N sampling points is smaller than the preset threshold value, the terminal equipment determines whether the variable quantity of the sampling value corresponding to a plurality of adjacent sampling points in the N sampling points is zero;
and if the gain is zero, resetting the gain of the microphone by the terminal based on the preset mode.
4. The method of any of claims 1-3, wherein the terminal resetting the gain of the microphone based on a preset pattern comprises:
and the terminal equipment outputs a prompt message which is used for prompting a user to reset the gain of the microphone.
5. The method of any of claims 1-3, wherein the terminal resetting the gain of the microphone based on a preset pattern comprises:
and the terminal equipment sends a control instruction to the microphone so that the microphone adjusts the gain of the microphone based on a preset gain value.
6. The method of claim 5, wherein the preset gain value is inversely related to a number of times the microphone gain is adjusted.
7. The method of claim 3, further comprising:
and if the terminal equipment determines that the variable quantities of the sampling values corresponding to a plurality of adjacent sampling points in the N sampling points are not zero, the terminal equipment performs digital automatic gain control processing on the voice signal formed by the N sampling points.
8. An apparatus for adjusting microphone gain anomalies, the apparatus comprising:
the receiving unit is used for receiving a first voice signal output by a microphone, the first voice signal is formed by N sampling points after analog-to-digital conversion, and N is a positive integer not less than 1;
and the adjusting unit is used for resetting the gain of the microphone based on a preset mode when the sampling value of any one of the N sampling points is determined to be greater than or equal to a preset threshold value, wherein the preset threshold value is associated with the sampling bit width corresponding to the N sampling points.
9. An apparatus for adjusting microphone gain anomalies, the apparatus comprising at least one processor and a memory coupled to the at least one processor, the at least one processor being configured to implement the steps of the method according to any one of claims 1-7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the execution of the computer program by a processor is to realize the steps of the method according to any of the claims 1-7.
CN202011130151.0A 2020-10-21 2020-10-21 Microphone gain abnormity adjusting method and device Active CN112333606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011130151.0A CN112333606B (en) 2020-10-21 2020-10-21 Microphone gain abnormity adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011130151.0A CN112333606B (en) 2020-10-21 2020-10-21 Microphone gain abnormity adjusting method and device

Publications (2)

Publication Number Publication Date
CN112333606A true CN112333606A (en) 2021-02-05
CN112333606B CN112333606B (en) 2022-03-25

Family

ID=74311775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011130151.0A Active CN112333606B (en) 2020-10-21 2020-10-21 Microphone gain abnormity adjusting method and device

Country Status (1)

Country Link
CN (1) CN112333606B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726940A (en) * 2021-06-15 2021-11-30 荣耀终端有限公司 Recording method and device
CN114138131A (en) * 2021-11-04 2022-03-04 深圳市鸿合创新信息技术有限责任公司 Touch data acquisition gain adjustment method, device and circuit and touch equipment
CN114827821A (en) * 2022-04-25 2022-07-29 世邦通信股份有限公司 Pickup control method and system for pickup, pickup apparatus, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108389590A (en) * 2018-02-06 2018-08-10 广东电网有限责任公司惠州供电局 A kind of voice of time-frequency combination cuts top detection method
CN109104655A (en) * 2018-08-24 2018-12-28 歌尔科技有限公司 A kind of audio frequency apparatus and its microphone gain adjusting method, device, system
CN109360577A (en) * 2018-10-16 2019-02-19 广州酷狗计算机科技有限公司 The method, apparatus storage medium that audio is handled
CN109451415A (en) * 2018-12-17 2019-03-08 深圳Tcl新技术有限公司 Microphone array auto-collation, device, equipment and storage medium
CN109887522A (en) * 2019-01-24 2019-06-14 深圳市微纳感知计算技术有限公司 A kind of microphone array gain adjusting method therefore, device and terminal device
CN110611862A (en) * 2019-08-29 2019-12-24 恒大智慧科技有限公司 Microphone gain adjusting method, device, system and storage medium
CN110650410A (en) * 2019-09-11 2020-01-03 厦门亿联网络技术股份有限公司 Microphone automatic gain control method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108389590A (en) * 2018-02-06 2018-08-10 广东电网有限责任公司惠州供电局 A kind of voice of time-frequency combination cuts top detection method
CN109104655A (en) * 2018-08-24 2018-12-28 歌尔科技有限公司 A kind of audio frequency apparatus and its microphone gain adjusting method, device, system
CN109360577A (en) * 2018-10-16 2019-02-19 广州酷狗计算机科技有限公司 The method, apparatus storage medium that audio is handled
CN109451415A (en) * 2018-12-17 2019-03-08 深圳Tcl新技术有限公司 Microphone array auto-collation, device, equipment and storage medium
CN109887522A (en) * 2019-01-24 2019-06-14 深圳市微纳感知计算技术有限公司 A kind of microphone array gain adjusting method therefore, device and terminal device
CN110611862A (en) * 2019-08-29 2019-12-24 恒大智慧科技有限公司 Microphone gain adjusting method, device, system and storage medium
CN110650410A (en) * 2019-09-11 2020-01-03 厦门亿联网络技术股份有限公司 Microphone automatic gain control method, device and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726940A (en) * 2021-06-15 2021-11-30 荣耀终端有限公司 Recording method and device
CN113726940B (en) * 2021-06-15 2023-08-22 北京荣耀终端有限公司 Recording method and device
CN114138131A (en) * 2021-11-04 2022-03-04 深圳市鸿合创新信息技术有限责任公司 Touch data acquisition gain adjustment method, device and circuit and touch equipment
CN114138131B (en) * 2021-11-04 2024-04-09 深圳市鸿合创新信息技术有限责任公司 Touch data acquisition gain adjustment method, device, circuit and touch equipment
CN114827821A (en) * 2022-04-25 2022-07-29 世邦通信股份有限公司 Pickup control method and system for pickup, pickup apparatus, and storage medium
CN114827821B (en) * 2022-04-25 2024-06-11 世邦通信股份有限公司 Pickup control method and system, pickup device, and storage medium

Also Published As

Publication number Publication date
CN112333606B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN112333606B (en) Microphone gain abnormity adjusting method and device
CN102257728B (en) Audio signal adjustment device and audio signal adjustment method
JP5238713B2 (en) Hearing aid with user interface
US20090010453A1 (en) Intelligent gradient noise reduction system
US11109095B2 (en) Automatic activation of closed captioning for low volume periods
CN108573709B (en) Automatic gain control method and device
US20160173808A1 (en) System and method for level control at a receiver
CN110650410B (en) Microphone automatic gain control method, device and storage medium
US6298139B1 (en) Apparatus and method for maintaining a constant speech envelope using variable coefficient automatic gain control
US20110002481A1 (en) Audio signal amplitude adjusting device and method
EP3984031A1 (en) Automatic gain control based on machine learning level estimation of the desired signal
CN106448690A (en) Automatic gain control method and apparatus of audio signals
US9614486B1 (en) Adaptive gain control
WO2019128402A1 (en) Method, system and storage medium for solving echo cancellation failure
CN105305992A (en) Compressor limiter
CN112634925B (en) Audio debugging method and device and computer equipment
CN108307228B (en) Sound effect adjusting method and device, television and storage medium
CN205212792U (en) Compression clipper -limiter
CN115119111A (en) Digital conference implementation method and system, intelligent device and digital conference system
CN114915275A (en) Two-stage digital automatic gain control
CN113555033A (en) Automatic gain control method, device and system of voice interaction system
JP2005184154A (en) Unit and method for automatic gain control
CN205212793U (en) Compression clipper -limiter
US20240048901A1 (en) Processing method and device
CN112151047B (en) Real-time automatic gain control method applied to voice digital signal

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