CN107566952B - Audio signal processing method and device - Google Patents

Audio signal processing method and device Download PDF

Info

Publication number
CN107566952B
CN107566952B CN201610516139.0A CN201610516139A CN107566952B CN 107566952 B CN107566952 B CN 107566952B CN 201610516139 A CN201610516139 A CN 201610516139A CN 107566952 B CN107566952 B CN 107566952B
Authority
CN
China
Prior art keywords
audio signal
adjustment coefficient
coefficient
volume value
adjusting
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.)
Active
Application number
CN201610516139.0A
Other languages
Chinese (zh)
Other versions
CN107566952A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610516139.0A priority Critical patent/CN107566952B/en
Publication of CN107566952A publication Critical patent/CN107566952A/en
Application granted granted Critical
Publication of CN107566952B publication Critical patent/CN107566952B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Circuit For Audible Band Transducer (AREA)

Abstract

The disclosure relates to an audio signal processing method and device, and belongs to the technical field of computers. The method comprises the following steps: adjusting the first audio signal according to the first adjusting coefficient through an amplifying/attenuator to obtain a second audio signal; performing analog-to-digital conversion on the second audio signal through an analog-to-digital converter (ADC) to obtain a third audio signal; determining a second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal to represent the difference between the statistical volume value and the target volume value; and adjusting the collected audio signal according to the second adjusting coefficient through the amplifying/attenuator. The statistical volume value of the third audio signal is used as feedback, and the subsequent second adjusting coefficient of the amplifying/attenuating device is determined, so that the volume value of the output audio signal is as close to the target volume value as possible, the too large or too small volume of the output audio signal is avoided, and the problems of sound burst and distortion are avoided.

Description

Audio signal processing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an audio signal processing method and apparatus.
Background
Recording refers to a process of converting sound into an electrical signal, most of the existing devices have a recording function, and can collect sound by using a configured microphone and convert the sound into an audio signal.
The terminal may include a microphone and an ADC (Analog to Digital converter), where the microphone is configured to collect sound to obtain an Analog audio signal, and the ADC is configured to convert the Analog audio signal to obtain a Digital audio signal, where the Digital audio signal is a recording result.
The analog-to-digital conversion process is limited by the volume range convertible by the ADC, and the volume of the sound recorded by the terminal may be large or small, which may cause the converted digital audio signal to be loud if the volume of the sound exceeds the maximum volume value convertible by the ADC, and may cause the converted digital audio signal to be distorted if the volume of the sound is smaller than the minimum volume value convertible by the ADC.
Disclosure of Invention
In order to solve the problems in the related art, the present disclosure provides an audio signal processing method and apparatus. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided an audio signal processing method, the method comprising:
adjusting the first audio signal collected by the microphone according to the first adjusting coefficient through the configured amplifying/attenuator to obtain a second audio signal;
performing analog-to-digital conversion on the second audio signal through a configured analog-to-digital converter (ADC) to obtain a third audio signal;
determining a second adjustment coefficient of the amplification/attenuation device according to the statistical volume value and the target volume value of the third audio signal, wherein the second adjustment coefficient is used for representing the difference between the statistical volume value and the target volume value;
and adjusting the audio signal collected by the microphone according to the second adjusting coefficient through the amplifying/attenuator.
In another embodiment, the adjusting, by the configured amplifier/attenuator, the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal includes:
according to the first adjusting coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
Figure BDA0001039260490000021
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
In another embodiment, the method further comprises:
taking the maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
and solving the square of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal to obtain a statistical volume value.
In another embodiment, said determining a second adjustment coefficient of said amplifier/attenuator based on said statistical and target volume values of said third audio signal comprises:
calculating a candidate adjusting coefficient according to the statistical volume value and the target volume value of the third audio signal, wherein the candidate adjusting coefficient is used for representing the difference between the statistical volume value and the target volume value;
and determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to an adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
In another embodiment, said calculating a candidate adjustment coefficient based on the statistical loudness value and the target loudness value of the third audio signal comprises:
calculating a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal by applying the following formula:
Figure BDA0001039260490000022
wherein, Kamp' for representing said second adjustment factor, SPauFor representing said statistical volume value, SPtargetFor representing the target volume value.
In another embodiment, the determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient includes:
if the candidate adjustment coefficient is larger than a preset maximum adjustment coefficient, taking the preset maximum adjustment coefficient as the second adjustment coefficient;
if the candidate adjusting coefficient is smaller than a preset minimum adjusting coefficient, taking the preset minimum adjusting coefficient as the second adjusting coefficient;
and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
According to a second aspect of embodiments of the present disclosure, there is provided an audio signal processing apparatus, the apparatus comprising: the signal acquisition module comprises a microphone, an amplifier/attenuator and an analog-to-digital converter (ADC);
the output end of the microphone is connected with the input end of the amplification/attenuation device, the output end of the amplification/attenuation device is respectively connected with the input end of the ADC, and the output end of the ADC is connected with the signal feedback module;
the microphone is used for acquiring a first audio signal;
the amplification/attenuator is used for adjusting the first audio signal collected by the microphone according to a first adjustment coefficient to obtain a second audio signal;
the analog-to-digital converter ADC is used for performing analog-to-digital conversion on the second audio signal to obtain a third audio signal;
the signal feedback module is configured to determine a second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal, where the second adjustment coefficient is used to indicate a difference between the statistical volume value and the target volume value;
and the amplification/attenuator is also used for adjusting the audio signal collected by the microphone according to the second adjusting coefficient.
In another embodiment, the amplifier/attenuator is further configured to adjust the first audio signal according to the first adjustment coefficient by applying the following formula to obtain the second audio signal:
Figure BDA0001039260490000031
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
In another embodiment, the signal feedback module is further configured to take a maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; or, taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; or, the open square is obtained for the square sum of the volume values of the plurality of sampling points in the third audio signal, so as to obtain the statistical volume value.
In another embodiment, the signal feedback module is further configured to calculate a candidate adjustment coefficient according to a statistical volume value and a target volume value of the third audio signal, where the candidate adjustment coefficient is used to represent a difference between the statistical volume value and the target volume value; and determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to an adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
In another embodiment, the signal feedback module is further configured to calculate a candidate adjustment coefficient by applying the following formula according to the statistical volume value and the target volume value of the third audio signal:
Figure BDA0001039260490000041
wherein, Kamp' for representing said second adjustment factor, SPauFor representing said statistical volume value, SPtargetFor representing the target volume value.
In another embodiment, the signal feedback module is further configured to use the preset maximum adjustment coefficient as the second adjustment coefficient if the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient; if the candidate adjusting coefficient is smaller than a preset minimum adjusting coefficient, taking the preset minimum adjusting coefficient as the second adjusting coefficient; and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the method and the device provided by the embodiment, the configured amplification/attenuation unit is used for adjusting the audio signal collected by the microphone according to the first adjustment coefficient and then performing analog-to-digital conversion to obtain a third audio signal, the statistical volume value of the third audio signal is used as feedback, the second adjustment coefficient is determined according to the statistical volume value and the target volume value of the third audio signal, and the amplification/attenuation unit is used for adjusting the audio signal collected by the microphone subsequently according to the second adjustment coefficient to enable the volume value of the output audio signal to be close to the target volume value as much as possible, so that the problems of too large or too small volume of the output audio signal and popping and distortion are avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of audio signal processing according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of audio signal processing according to an exemplary embodiment;
FIG. 3 is a block diagram illustrating an audio signal processing apparatus according to an exemplary embodiment;
fig. 4 is a block diagram illustrating an audio signal processing apparatus according to an exemplary embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure is described in further detail below with reference to the embodiments and the accompanying drawings. The exemplary embodiments and descriptions of the present disclosure are provided herein for illustration of the present disclosure, but not for limitation of the present disclosure.
The embodiments of the present disclosure provide an audio signal processing method and apparatus, and the following describes the present disclosure in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating an audio signal processing method according to an exemplary embodiment, where the audio signal processing method is used in an audio signal processing apparatus as illustrated in fig. 1, and includes the steps of:
in step 101, a first audio signal collected by a microphone is adjusted according to a first adjustment coefficient by an configured amplifier/attenuator, so as to obtain a second audio signal.
In step 102, the second audio signal is analog-to-digital converted by the configured ADC to obtain a third audio signal.
In step 103, a second adjustment coefficient of the amplifier/attenuator is determined according to the statistical volume value and the target volume value of the third audio signal, and the second adjustment coefficient is used for indicating the difference between the statistical volume value and the target volume value.
In step 104, the audio signal collected by the microphone is adjusted by the amplifier/attenuator according to the second adjustment factor.
In the method provided by this embodiment, through the configured amplifier/attenuator, the audio signal collected by the microphone is adjusted according to the first adjustment coefficient and then analog-to-digital converted to obtain a third audio signal, and then the statistical volume value of the third audio signal is used as feedback, and a second adjustment coefficient is determined according to the statistical volume value and the target volume value of the third audio signal, where the second adjustment coefficient is used to represent the difference between the statistical volume value and the target volume value, and the amplifier/attenuator is used to adjust the audio signal collected by the microphone subsequently according to the second adjustment coefficient, so that the volume value of the output audio signal is as close to the target volume value as possible, thereby avoiding the volume of the output audio signal being too large or too small, and avoiding the problems of popping and distortion.
In another embodiment, the adjusting, by the configured amplifier/attenuator, the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal includes:
according to the first adjusting coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
Figure BDA0001039260490000061
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
In another embodiment, the method further comprises:
taking the maximum value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
and solving the square of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal to obtain a statistical volume value.
In another embodiment, the determining the second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal comprises:
calculating a candidate adjusting coefficient according to the statistical volume value and the target volume value of the third audio signal, wherein the candidate adjusting coefficient is used for representing the difference between the statistical volume value and the target volume value;
and determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
In another embodiment, the calculating the candidate adjustment coefficients according to the statistical volume value and the target volume value of the third audio signal comprises:
calculating a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal by applying the following formula:
Figure BDA0001039260490000071
wherein, Kamp' for indicating the second adjustment coefficient, SPauFor representing the statistical volume value, SPtargetFor representing the target volume value.
In another embodiment, the determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient includes:
if the candidate adjustment coefficient is larger than a preset maximum adjustment coefficient, taking the preset maximum adjustment coefficient as the second adjustment coefficient;
if the candidate adjustment coefficient is smaller than a preset minimum adjustment coefficient, taking the preset minimum adjustment coefficient as the second adjustment coefficient;
and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 2 is a flowchart illustrating an audio signal processing method according to an exemplary embodiment, and as shown in fig. 2, the audio signal processing method is used in an audio signal processing apparatus, which may be any device with a recording function, such as a mobile phone, a tablet computer, a recorder, and the like, which is not limited in this embodiment. The audio signal processing device comprises a signal collection module and a signal feedback module, wherein the signal collection module comprises a microphone, an amplifier/attenuator and an ADC. The method comprises the following steps:
in step 201, a first audio signal is acquired by a configured microphone.
In this embodiment, the audio signal processing apparatus is provided with a microphone, and the microphone can collect sounds of the surrounding environment and convert the collected sounds into analog audio signals. The embodiment takes the collection of the first audio signal as an example.
In step 202, the collected first audio signal is adjusted according to the first adjustment coefficient by the configured amplifier/attenuator, so as to obtain a second audio signal.
In this embodiment, in order to obtain an audio signal with a proper volume, an amplifier/attenuator may be configured to adjust the acquired audio signal, and according to the volume value of the output audio signal and the target volume value, the adjustment coefficient of the amplifier/attenuator is determined again, and the newly determined adjustment coefficient is applied to adjust the subsequent acquired audio signal. Through continuous adjustment, the volume value of the output audio signal can be close to the target volume value, and the condition that the volume of the audio signal is too large or too small is avoided. In this embodiment, only the first audio signal is collected for the first time, the third audio signal is obtained through the first adjustment coefficient of the amplifier/attenuator and the analog-to-digital conversion, and the second adjustment coefficient of the amplifier/attenuator is determined according to the third audio signal.
This step 202 may include: according to the first adjusting coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
Figure BDA0001039260490000081
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor. The first adjustment coefficient may be an adjustment coefficient adopted by the amplifier/attenuator when the audio signal processing apparatus first acquires the audio signal, and may be predetermined by the audio signal processing apparatus, or determined by user setting, for example, the first adjustment coefficient may be 0, and the embodiment does not limit the first adjustment coefficient.
In step 203, the second audio signal is analog-to-digital converted by the configured ADC to obtain a third audio signal, and the third audio signal is output.
The first audio signal and the second audio signal are both analog audio signals, the second audio signal is subjected to analog-to-digital conversion, the obtained third audio signal is a digital audio signal, and at the moment, the audio signal processing device can output the third audio signal. The output means to output the third audio signal to a memory for storage, or output the third audio signal to a processor for processing, and the specific output mode may be determined according to the requirement of the actual application, which is not limited in this embodiment.
In another embodiment, in order to avoid too large or too small volume of the acquired audio signal, the audio signal processing apparatus uses the third audio signal to determine the second adjustment coefficient without outputting the third audio signal when the first audio signal is acquired for the first time and the third audio signal is obtained.
For example, the audio signal processing apparatus may provide a sound test stage for a user, collect sound that the user tries to make, obtain a third audio signal, thereby obtain a second adjustment coefficient, then enter a formal recording stage, and record the sound that the user makes using the second adjustment coefficient.
In step 204, a second adjustment coefficient of the amplifier/attenuator is determined according to the statistical volume value and the target volume value of the third audio signal, wherein the second adjustment coefficient is used for indicating the difference between the statistical volume value and the target volume value.
The statistical volume value is obtained by performing statistics on the volume values of the plurality of sampling points of the third audio signal, and the statistical volume value can represent the volume of the third audio signal.
Obtaining the statistical volume value of the third audio signal may include: the audio signal processing device samples the third audio signal, determines a plurality of sampling points, and accordingly obtains the volume values of the plurality of sampling points, and at the moment, the volume values of the plurality of sampling points can be counted to obtain a counted volume value.
Further, counting the volume values of the plurality of sampling points to obtain a statistical volume value, which may include: taking the maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value, namely SPau=max(Dau(1),Dau(2),…,Dau(M)); wherein, SPauFor representing the statistical volume value, Dau(i) Representing the volume value of the ith sample point in the third audio signal.
Alternatively, the average value of the volume values of the plurality of sampling points in the third audio signal is used as the statistical volume value, that is, the statistical volume value
Figure BDA0001039260490000091
Or, the sum of the squares of the volume values of the plurality of sampling points in the third audio signal is squared to obtain a statistical volume value, that is, the statistical volume value
Figure BDA0001039260490000092
The target volume value may be determined according to a volume value of a general audio signal, or according to a volume value of an audio signal with a better processing effect, which is not limited in this embodiment.
The smaller the difference between the statistical volume value and the target volume value, the closer the volume of the third audio signal is to the target volume, and the larger the difference between the statistical volume value and the target volume value, the larger the difference between the volume of the third audio signal and the target volume, and the adjustment coefficient of the amplifier/attenuator needs to be determined again.
In practical applications, the amplifier/attenuator is limited by performance, and its adjustment coefficient cannot be increased infinitely or increased infinitely, and usually has an upper limit value and a lower limit value, so the audio signal processing apparatus can determine a preset maximum adjustment coefficient and a preset minimum adjustment coefficient according to the performance of the amplifier/attenuator, and determine the adjustment coefficient range of the amplifier/attenuator according to the preset maximum adjustment coefficient and the preset minimum adjustment coefficient, and when determining the adjustment coefficient, it is necessary to ensure that the determined adjustment coefficient cannot exceed the adjustment coefficient range. To this end, this step 204 may comprise the following steps 2041 and 2042:
2041. and calculating a candidate adjusting coefficient according to the statistical volume value and the target volume value of the third audio signal, wherein the candidate adjusting coefficient is used for representing the difference between the statistical volume value and the target volume value.
For example, the following formula is applied to calculate the candidate adjustment coefficients according to the statistical volume value and the target volume value of the third audio signal:
Figure BDA0001039260490000093
wherein, Kamp' for indicating the second adjustment coefficient, SPauFor representing the statistical volume value, SPtargetFor representing the target volume value.
By adopting the formula, the SP can ensure that when the volume of the recorded sound is too largeauGreater than SPtargetA calculated second adjustment coefficient Kamp' less than 0, the audio signal can be attenuated by the amplifier/attenuator according to the second adjustment coefficient, and SPauThe larger the second adjustment factor, the larger the degree to which the signal is attenuated by the amplifier/attenuator. When the volume of the recorded sound is too small, SPauLess than SPtargetA calculated second adjustment coefficient Kamp' greater than 0, the amplifier/attenuator amplifies the hard disk signal according to the second adjustment coefficient, and SPauThe smaller this second adjustment factor, the larger the degree to which the signal is amplified by the amplifier/attenuator.
2042. And determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
For example, if the candidate adjustment coefficient is larger than a preset maximum adjustment coefficient, the preset maximum adjustment coefficient is used as the second adjustment coefficient; if the candidate adjustment coefficient is smaller than a preset minimum adjustment coefficient, taking the preset minimum adjustment coefficient as the second adjustment coefficient; and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient. The pseudo code for determining the second adjustment factor may be as follows:
Figure BDA0001039260490000101
if(Kamp'>KampMAX)
Kamp=KampMAX
else if(Kamp'<KampMIN)
Kamp=KampMIN
else
Kamp=Kamp';
wherein, KampMAXAnd KampMINRespectively a preset maximum adjustment coefficient and a preset minimum adjustment coefficient of the amplification/attenuator.
In order to ensure that the finally determined second adjustment coefficient belongs to the adjustment coefficient range, the adjustment coefficient calculated according to the statistical volume value and the target volume value of the third audio signal is not directly used as the second adjustment coefficient, but is used as a candidate adjustment coefficient, and the candidate adjustment coefficient is compared with a preset maximum adjustment coefficient and a preset minimum adjustment coefficient to finally determine the second adjustment coefficient.
In step 205, when a fourth audio signal is collected by the microphone, the fourth audio signal is adjusted by the amplifier/attenuator according to the second adjustment coefficient, so as to obtain a fifth audio signal.
In step 206, the fifth audio signal is analog-to-digital converted by the configured ADC to obtain a sixth audio signal, and the sixth audio signal is output.
After determining the second adjustment coefficient, the second adjustment coefficient can be applied to the processing process of the audio signal collected next time, taking the fourth audio signal collected by the microphone as an example, the step 205-.
When the first audio signal is processed in the above step 201-.
Because the volume of the sound rarely changes suddenly when the sound is recorded in daily life, the volume difference of the continuously collected audio signals is not large, the method provided by the embodiment is adopted to determine the adjustment coefficient of the amplifier/attenuator according to the audio signal collected last time, and the adjustment coefficient is applied to the audio signal collected next time, so that the volume of the audio signal output next time can be ensured to be close to the target volume, the problem of too large or too small volume is avoided, and the pop sound or distortion cannot occur.
It should be noted that, this embodiment is only described with respect to an example in which one signal collection module includes one amplification/attenuation module and one ADC, and actually, a plurality of signal collection modules may be included in one device, and a multi-channel audio signal is recorded by the plurality of signal collection modules, and each signal collection module may include a plurality of amplification/attenuation modules, and correspondingly includes a plurality of ADCs, and each ADC is connected to the signal feedback module.
The signal collection modules may be connected to different signal feedback modules, or the signal collection modules may be connected to the same signal feedback module, for example, each signal collection module includes a plurality of amplifiers/attenuators and a plurality of ADCs, each ADC is connected to the same signal feedback module, the output audio signals are all sent to the signal feedback module, the signal feedback module adopts a multitask mode to process the audio signals sent by the ADCs synchronously, and after determining an adjustment coefficient according to each audio signal, the audio signals are sent to the amplifier/attenuator connected to the corresponding ADC, so as to re-determine the adjustment coefficient for the amplifier/attenuator.
According to the method provided by the embodiment, through the configured amplifier/attenuator, the audio signal collected by the microphone is adjusted according to the first adjustment coefficient and then subjected to analog-to-digital conversion to obtain a third audio signal, then the statistical volume value of the third audio signal is used as feedback, the second adjustment coefficient is determined according to the statistical volume value and the target volume value of the third audio signal, and the amplifier/attenuator is used for adjusting the audio signal collected by the microphone subsequently according to the second adjustment coefficient to enable the volume value of the output audio signal to be close to the target volume value as much as possible, so that the problems of too large or too small volume of the output audio signal and explosive sound and distortion are avoided.
Fig. 3 is a block diagram illustrating an audio signal processing apparatus according to an exemplary embodiment. Referring to fig. 3, the apparatus includes: a signal collection module 301 and a signal feedback module 302, wherein the signal collection module 301 comprises a microphone 3011, an amplifier/attenuator 3012 and an ADC 3013.
The output end of the microphone 3011 is connected to the input end of the amplifier/attenuator 3012, the output end of the amplifier/attenuator 3012 is connected to the input end of the ADC3013, and the output end of the ADC3013 is connected to the signal feedback module 302;
the microphone 3011 is used to collect a first audio signal;
the amplifier/attenuator 3012 is configured to adjust the first audio signal acquired by the microphone 3011 according to a first adjustment coefficient to obtain a second audio signal;
the ADC3013 is configured to perform analog-to-digital conversion on the second audio signal to obtain a third audio signal;
the signal feedback module 302 is configured to determine a second adjustment coefficient of the amplifier/attenuator 3012 according to the statistical volume value and the target volume value of the third audio signal;
the amplifier/attenuator 3012 is further configured to adjust the audio signal collected by the microphone 3011 according to the second adjustment coefficient.
In another embodiment, the amplifier/attenuator 3012 is further configured to adjust the first audio signal according to the first adjustment coefficient by applying the following formula to obtain the second audio signal:
Figure BDA0001039260490000121
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
In another embodiment, the signal feedback module 302 is further configured to use a maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; or, taking the average value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; or, the sum of squares of the volume values of the plurality of sampling points in the third audio signal is squared to obtain a statistical volume value.
In another embodiment, the signal feedback module 302 is further configured to calculate a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal, where the candidate adjustment coefficient is used to represent a difference between the statistical volume value and the target volume value; and determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
In another embodiment, the signal feedback module 302 is further configured to calculate a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal by applying the following formula:
Figure BDA0001039260490000131
wherein, Kamp' for indicating the second adjustment coefficient, SPauFor representing the statistical volume value, SPtargetFor representing the target volume value.
In another embodiment, the signal feedback module 302 is further configured to use the preset maximum adjustment coefficient as the second adjustment coefficient if the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient; if the candidate adjustment coefficient is smaller than a preset minimum adjustment coefficient, taking the preset minimum adjustment coefficient as the second adjustment coefficient; and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that: in the audio signal processing apparatus provided in the foregoing embodiment, when processing an audio signal, only the division of the functional modules is exemplified, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the audio signal processing apparatus and the audio signal processing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Fig. 4 is a block diagram illustrating an audio signal processing apparatus 400 according to an exemplary embodiment. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 400 may include one or more of the following components: processing components 402, memory 404, power components 406, multimedia components 408, audio components 410, input/output (I/O) interfaces 412, sensor components 414, and communication components 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the apparatus 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 400 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a Microphone (MIC) configured to receive external audio signals when apparatus 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor assembly 414 may detect an open/closed state of the apparatus 400, the relative positioning of the components, such as a display and keypad of the apparatus 400, the sensor assembly 414 may also detect a change in the position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in the temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer-readable storage medium in which instructions, when executed by a processor of a terminal, enable the terminal to perform an audio signal processing method, the method comprising:
adjusting the first audio signal collected by the microphone according to the first adjusting coefficient through the configured amplifying/attenuator to obtain a second audio signal;
performing analog-to-digital conversion on the second audio signal through a configured analog-to-digital converter (ADC) to obtain a third audio signal;
determining a second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal;
and adjusting the audio signal collected by the microphone according to the second adjusting coefficient through the amplifying/attenuator.
In another embodiment, the adjusting, by the configured amplifier/attenuator, the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal includes:
according to the first adjusting coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
Figure BDA0001039260490000161
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
In another embodiment, the method further comprises:
taking the maximum value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
and solving the square of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal to obtain a statistical volume value.
In another embodiment, the determining the second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal comprises:
calculating a candidate adjusting coefficient according to the statistical volume value and the target volume value of the third audio signal, wherein the candidate adjusting coefficient is used for representing the difference between the statistical volume value and the target volume value;
and determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
In another embodiment, the calculating the candidate adjustment coefficients according to the statistical volume value and the target volume value of the third audio signal comprises:
calculating a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal by applying the following formula:
Figure BDA0001039260490000162
wherein, Kamp' for indicating the second adjustment coefficient, SPauFor representing the statistical volume value, SPtargetFor representing the target volume value.
In another embodiment, the determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient includes:
if the candidate adjustment coefficient is larger than a preset maximum adjustment coefficient, taking the preset maximum adjustment coefficient as the second adjustment coefficient;
if the candidate adjustment coefficient is smaller than a preset minimum adjustment coefficient, taking the preset minimum adjustment coefficient as the second adjustment coefficient;
and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. An audio signal processing method, which is applied in a sound recording process, the method comprising:
adjusting the first audio signal collected by the microphone according to the first adjusting coefficient through the configured amplifying/attenuator to obtain a second audio signal;
performing analog-to-digital conversion on the second audio signal through a configured analog-to-digital converter (ADC) to obtain a third audio signal;
calculating a candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal by applying the following formula:
Figure FDA0002633612040000011
wherein, Kamp' for indicating a candidate adjustment coefficient, SPauFor representing said statistical volume value, SPtargetFor representing the target volume value;
the candidate adjustment coefficients are used to represent a difference between the statistical loudness value and the target loudness value;
determining a second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to an adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient;
and adjusting the audio signal collected by the microphone according to the second adjusting coefficient through the amplifying/attenuator.
2. The method of claim 1, wherein the adjusting, by the configured amplifier/attenuator, the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal comprises:
according to the first adjusting coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
Figure FDA0002633612040000012
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
3. The method of claim 1, further comprising:
taking the maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; alternatively, the first and second electrodes may be,
and solving the square of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal to obtain a statistical volume value.
4. The method according to claim 1, wherein determining the second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient comprises:
if the candidate adjustment coefficient is larger than a preset maximum adjustment coefficient, taking the preset maximum adjustment coefficient as the second adjustment coefficient;
if the candidate adjusting coefficient is smaller than a preset minimum adjusting coefficient, taking the preset minimum adjusting coefficient as the second adjusting coefficient;
and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
5. An audio signal processing apparatus, wherein the apparatus is used in a sound recording process, the apparatus comprising: the signal acquisition module comprises a microphone, an amplifier/attenuator and an analog-to-digital converter (ADC);
the output end of the microphone is connected with the input end of the amplification/attenuation device, the output end of the amplification/attenuation device is respectively connected with the input end of the ADC, and the output end of the ADC is connected with the signal feedback module;
the microphone is used for acquiring a first audio signal;
the amplification/attenuator is used for adjusting the first audio signal collected by the microphone according to a first adjustment coefficient to obtain a second audio signal;
the analog-to-digital converter ADC is used for performing analog-to-digital conversion on the second audio signal to obtain a third audio signal;
the signal feedback module is configured to calculate a candidate adjustment coefficient according to the statistical volume value and a target volume value of the third audio signal, where the candidate adjustment coefficient is used to represent a difference between the statistical volume value and the target volume value; determining a second adjustment coefficient according to the candidate adjustment coefficient, a preset maximum adjustment coefficient and a preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to an adjustment coefficient range determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient;
the amplification/attenuator is further used for adjusting the audio signal collected by the microphone according to the second adjustment coefficient;
the signal feedback module is further configured to calculate a candidate adjustment coefficient by applying the following formula according to the statistical volume value and the target volume value of the third audio signal:
Figure FDA0002633612040000031
wherein, Kamp' for representing said candidate adjustment coefficient, SPauFor representing said statistical volume value, SPtargetFor representing the target volume value.
6. The apparatus of claim 5, wherein the amplifier/attenuator is further configured to adjust the first audio signal according to the first adjustment coefficient by applying the following formula to obtain the second audio signal:
Figure FDA0002633612040000032
wherein, AuampFor representing the second audio signal, Au for representing the first audio signal, Kamp1For representing the first adjustment factor.
7. The apparatus of claim 5, wherein the signal feedback module is further configured to take a maximum value of the volume values of the plurality of sampling points in the third audio signal as a statistical volume value; or, taking the average value of the volume values of a plurality of sampling points in the third audio signal as a statistical volume value; or, the open square is obtained for the square sum of the volume values of the plurality of sampling points in the third audio signal, so as to obtain the statistical volume value.
8. The apparatus of claim 5, wherein the signal feedback module is further configured to use the preset maximum adjustment coefficient as the second adjustment coefficient if the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient; if the candidate adjusting coefficient is smaller than a preset minimum adjusting coefficient, taking the preset minimum adjusting coefficient as the second adjusting coefficient; and if the candidate adjusting coefficient is not larger than the preset maximum adjusting coefficient and not smaller than the preset minimum adjusting coefficient, taking the candidate adjusting coefficient as the second adjusting coefficient.
CN201610516139.0A 2016-07-01 2016-07-01 Audio signal processing method and device Active CN107566952B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610516139.0A CN107566952B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610516139.0A CN107566952B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Publications (2)

Publication Number Publication Date
CN107566952A CN107566952A (en) 2018-01-09
CN107566952B true CN107566952B (en) 2020-10-13

Family

ID=60969090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610516139.0A Active CN107566952B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Country Status (1)

Country Link
CN (1) CN107566952B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112185338B (en) * 2020-09-30 2024-01-23 北京大米科技有限公司 Audio processing method, device, readable storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1819452A (en) * 2006-03-30 2006-08-16 北京中星微电子有限公司 Method and device for adjusting to adapt speech inputting distance
US7222037B2 (en) * 2004-10-15 2007-05-22 Genesis Microchip Inc. Hybrid automatic gain control (AGC)
CN102457239A (en) * 2010-11-02 2012-05-16 安凯(广州)微电子技术有限公司 Gain control system and method
CN102857182A (en) * 2012-08-15 2013-01-02 泰州东睿信息技术有限公司 Gain control device of multimedia equipment
CN103428607A (en) * 2012-05-25 2013-12-04 华为技术有限公司 Audio signal playing system and electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7536022B2 (en) * 2002-10-02 2009-05-19 Phonak Ag Method to determine a feedback threshold in a hearing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7222037B2 (en) * 2004-10-15 2007-05-22 Genesis Microchip Inc. Hybrid automatic gain control (AGC)
CN1819452A (en) * 2006-03-30 2006-08-16 北京中星微电子有限公司 Method and device for adjusting to adapt speech inputting distance
CN102457239A (en) * 2010-11-02 2012-05-16 安凯(广州)微电子技术有限公司 Gain control system and method
CN103428607A (en) * 2012-05-25 2013-12-04 华为技术有限公司 Audio signal playing system and electronic device
CN102857182A (en) * 2012-08-15 2013-01-02 泰州东睿信息技术有限公司 Gain control device of multimedia equipment

Also Published As

Publication number Publication date
CN107566952A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
EP3163748B1 (en) Method, device and terminal for adjusting volume
WO2017020408A1 (en) Video recording method and device
CN108766457B (en) Audio signal processing method, audio signal processing device, electronic equipment and storage medium
CN107493500B (en) Multimedia resource playing method and device
CN113452835B (en) Method and device for controlling vibration of terminal
CN109087650B (en) Voice wake-up method and device
CN111883164B (en) Model training method and device, electronic equipment and storage medium
KR102475586B1 (en) Method and device for pickup volume control, and storage medium
CN110392334B (en) Microphone array audio signal self-adaptive processing method, device and medium
CN105721705B (en) Call quality control method and device and mobile terminal
CN106060707B (en) Reverberation processing method and device
CN107566950B (en) Audio signal processing method and device
CN113076075A (en) Audio signal adjusting method and device, terminal and storage medium
CN108600503B (en) Voice call control method and device
CN111294711A (en) Signal processing method and device
CN111988704B (en) Sound signal processing method, device and storage medium
CN107566952B (en) Audio signal processing method and device
CN111294704B (en) Audio processing method, device and storage medium
CN109194808B (en) Volume adjusting method and device
WO2018090343A1 (en) Microphone, and method and device for audio processing
CN107566951B (en) Audio signal processing method and device
CN112637416A (en) Volume adjusting method and device and storage medium
CN107665340B (en) Fingerprint identification method and device and electronic equipment
CN112511686A (en) Recording method and earphone equipment
CN106303775B (en) Mobile terminal and mobile terminal pickup optimization method

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