CN107566952B - Audio signal processing method and device - Google Patents
Audio signal processing method and device Download PDFInfo
- 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
- candidate
- 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
Links
Images
Landscapes
- Circuit For Audible Band Transducer (AREA)
Abstract
Description
技术领域technical field
本公开是关于计算机技术领域,具体来说是关于一种音频信号处理方法及装置。The present disclosure relates to the field of computer technology, and in particular, to an audio signal processing method and apparatus.
背景技术Background technique
录音是指将声音转换为电信号的过程,目前的大部分设备均具有录音功能,能够利用配置的麦克风对声音进行采集,并将声音转换为音频信号。Recording refers to the process of converting sound into electrical signals. Most of the current devices have a recording function, which can use the configured microphone to collect the sound and convert the sound into an audio signal.
终端可以包括麦克风和ADC(Analog to Digital Convertor,模拟/数字转换器),麦克风用于对声音进行采集,得到模拟音频信号,ADC用于对模拟音频信号进行转换,得到数字音频信号,该数字音频信号即为录音结果。The terminal may include a microphone and an ADC (Analog to Digital Converter, analog/digital converter). The microphone is used to collect sound to obtain an analog audio signal, and the ADC is used to convert the analog audio signal to obtain a digital audio signal. The signal is the recording result.
上述模数转换过程会受到ADC可转换的音量范围的限制,而终端录制声音的音量可能时大时小,如果声音的音量超过ADC可转换的最大音量值时,会导致转换得到的数字音频信号出现爆音,而如果声音的音量小于ADC可转换的最小音量值时,会导致转换得到的数字音频信号失真。The above analog-to-digital conversion process is limited by the volume range that can be converted by the ADC, and the volume of the recorded sound at the terminal may vary from time to time. Popping sound occurs, and if the volume of the sound is less than the minimum volume value that the ADC can convert, it will cause the converted digital audio signal to be distorted.
发明内容SUMMARY OF THE INVENTION
为了解决相关技术中存在的问题,本公开提供了一种音频信号处理方法及装置。所述技术方案如下:In order to solve the problems existing in the related art, the present disclosure provides an audio signal processing method and apparatus. The technical solution is as follows:
根据本公开实施例的第一方面,提供了一种音频信号处理方法,所述方法包括:According to a first aspect of the embodiments of the present disclosure, an audio signal processing method is provided, the method comprising:
通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号;Through the configured amplifier/attenuator, adjust the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal;
通过配置的模数转换器ADC,对所述第二音频信号进行模数转换,得到第三音频信号;Perform analog-to-digital conversion on the second audio signal by using the configured analog-to-digital converter ADC to obtain a third audio signal;
根据所述第三音频信号的统计音量值和目标音量值,确定所述放大/衰减器的第二调整系数,所述第二调整系数用于表示所述统计音量值与所述目标音量值之间的差异大小;According to the statistical volume value and the target volume value of the third audio signal, a second adjustment coefficient of the amplifier/attenuator is determined, and the second adjustment coefficient is used to represent the difference between the statistical volume value and the target volume value the size of the difference;
通过所述放大/衰减器,根据所述第二调整系数对通过所述麦克风采集到的音频信号进行调整。Through the amplifier/attenuator, the audio signal collected by the microphone is adjusted according to the second adjustment coefficient.
在另一实施例中,所述通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号,包括:In another embodiment, the first audio signal collected by the microphone is adjusted according to the first adjustment coefficient through the configured amplifier/attenuator to obtain the second audio signal, including:
根据所述第一调整系数,应用以下公式,对所述第一音频信号进行调整,得到所述第二音频信号:According to the first adjustment coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
其中,Auamp用于表示所述第二音频信号,Au用于表示所述第一音频信号,Kamp1用于表示所述第一调整系数。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient.
在另一实施例中,所述方法还包括:In another embodiment, the method further includes:
将所述第三音频信号中多个采样点的音量值的最大值作为统计音量值;或者,Taking the maximum value of the volume values of multiple sampling points in the third audio signal as the statistical volume value; or,
将所述第三音频信号中多个采样点的音量值的平均值作为统计音量值;或者,Taking the average value of the volume values of multiple sampling points in the third audio signal as the statistical volume value; or,
对所述第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值。The square root of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal is obtained 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 includes:
根据所述第三音频信号的统计音量值和目标音量值,计算候选调整系数,所述候选调整系数用于表示所述统计音量值与所述目标音量值之间的差异;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 the difference between the statistical volume value and the target volume value;
根据所述候选调整系数、预设最大调整系数和预设最小调整系数,确定所述第二调整系数,以使所述第二调整系数属于由所述预设最大调整系数和所述预设最小调整系数确定的调整系数范围。The second adjustment coefficient is determined according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the preset maximum adjustment coefficient and the preset minimum adjustment coefficient The adjustment factor range determined by the adjustment factor.
在另一实施例中,所述根据所述第三音频信号的统计音量值和目标音量值,计算候选调整系数,包括:In another embodiment, calculating the candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal includes:
根据所述第三音频信号的统计音量值和目标音量值,应用以下公式,计算候选调整系数:According to the statistical volume value and the target volume value of the third audio signal, apply the following formula to calculate the candidate adjustment coefficient:
其中,Kamp'用于表示所述第二调整系数,SPau用于表示所述统计音量值,SPtarget用于表示所述目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent the target volume value.
在另一实施例中,所述根据所述候选调整系数、预设最大调整系数和预设最小调整系数,确定所述第二调整系数,包括:In another embodiment, the determining the second adjustment coefficient according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient includes:
如果所述候选调整系数大于预设最大调整系数,则将所述预设最大调整系数作为所述第二调整系数;If the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient, the preset maximum adjustment coefficient is used as the second adjustment coefficient;
如果所述候选调整系数小于预设最小调整系数,则将所述预设最小调整系数作为所述第二调整系数;If the candidate adjustment coefficient is smaller than the preset minimum adjustment coefficient, the preset minimum adjustment coefficient is used as the second adjustment coefficient;
如果所述候选调整系数不大于所述预设最大调整系数且不小于所述预设最小调整系数,则将所述候选调整系数作为所述第二调整系数。If the candidate adjustment coefficient is not larger than the preset maximum adjustment coefficient and not smaller than the preset minimum adjustment coefficient, the candidate adjustment coefficient is used as the second adjustment coefficient.
根据本公开实施例的第二方面,提供了一种音频信号处理装置,所述装置包括:信号收集模块和信号反馈模块,所述信号收集模块包括麦克风、放大/衰减器和模数转换器ADC;According to a second aspect of the embodiments of the present disclosure, there is provided an audio signal processing apparatus, the apparatus includes: a signal collection module and a signal feedback module, the signal collection module includes a microphone, an amplifier/attenuator and an analog-to-digital converter ADC ;
所述麦克风的输出端与所述放大/衰减器的输入端连接,所述放大/衰减器的输出端分别与所述ADC的输入端连接,所述ADC的输出端与所述信号反馈模块连接;The output end of the microphone is connected to the input end of the amplifier/attenuator, the output end of the amplifier/attenuator is respectively connected to the input end of the ADC, and the output end of the ADC is connected to the signal feedback module ;
所述麦克风,用于采集第一音频信号;the microphone for collecting the first audio signal;
所述放大/衰减器,用于根据第一调整系数对所述麦克风采集到的第一音频信号进行调整,得到第二音频信号;the amplifier/attenuator, configured to adjust the first audio signal collected by the microphone according to the first adjustment coefficient to obtain a second audio signal;
所述模数转换器ADC,用于对所述第二音频信号进行模数转换,得到第三音频信号;the analog-to-digital converter ADC, 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 the 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 represent the statistical volume the magnitude of the difference between the value and the target volume value;
所述放大/衰减器,还用于根据所述第二调整系数对所述麦克风采集到的音频信号进行调整。The amplifier/attenuator is further configured to adjust the audio signal collected by the microphone according to the second adjustment coefficient.
在另一实施例中,所述放大/衰减器,还用于根据所述第一调整系数,应用以下公式,对所述第一音频信号进行调整,得到所述第二音频信号:In another embodiment, the amplifier/attenuator is further configured to apply the following formula to adjust the first audio signal according to the first adjustment coefficient to obtain the second audio signal:
其中,Auamp用于表示所述第二音频信号,Au用于表示所述第一音频信号,Kamp1用于表示所述第一调整系数。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient.
在另一实施例中,所述信号反馈模块,还用于将所述第三音频信号中多个采样点的音量值的最大值作为统计音量值;或者,将所述第三音频信号中多个采样点的音量值的平均值作为统计音量值;或者,对所述第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值。In another embodiment, the signal feedback module is further configured to use the maximum value of the volume values of multiple sampling points in the third audio signal as the statistical volume value; The average value of the volume values of the sampling points is used as the statistical volume value; or, the square root of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal is obtained to obtain the statistical volume value.
在另一实施例中,所述信号反馈模块,还用于根据所述第三音频信号的统计音量值和目标音量值,计算候选调整系数,所述候选调整系数用于表示所述统计音量值与所述目标音量值之间的差异;根据所述候选调整系数、预设最大调整系数和预设最小调整系数,确定所述第二调整系数,以使所述第二调整系数属于由所述预设最大调整系数和所述预设最小调整系数确定的调整系数范围。In another embodiment, the signal feedback module 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 the statistical volume value and the target volume value; determine the second adjustment coefficient according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the The range of adjustment coefficients 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 the candidate adjustment coefficient by applying the following formula according to the statistical volume value and the target volume value of the third audio signal:
其中,Kamp'用于表示所述第二调整系数,SPau用于表示所述统计音量值,SPtarget用于表示所述目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent 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 a preset maximum adjustment coefficient; If the adjustment coefficient is smaller than the preset minimum adjustment coefficient, the preset minimum adjustment coefficient is used as the second adjustment coefficient; if the candidate adjustment coefficient is not greater than the preset maximum adjustment coefficient and not smaller than the preset minimum adjustment coefficient, the candidate adjustment coefficient is used as the second adjustment coefficient.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
本实施例提供的方法及装置,通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的音频信号进行调整后进行模数转换,得到第三音频信号,再以该第三音频信号的统计音量值作为反馈,根据该第三音频信号的统计音量值和目标音量值确定第二调整系数,通过放大/衰减器根据第二调整系数对后续通过麦克风采集到的音频信号进行调整,使输出的音频信号的音量值尽可能地接近于目标音量值,避免了输出音频信号的音量过大或过小,避免了爆音和失真的问题。In the method and device provided in this embodiment, the audio signal collected by the microphone is adjusted according to the first adjustment coefficient through the configured amplifier/attenuator, and then analog-to-digital conversion is performed to obtain a third audio signal, and then the third audio signal is used as the third audio signal. The statistical volume value of the signal is used as feedback, the second adjustment coefficient is determined according to the statistical volume value of the third audio signal and the target volume value, and the audio signal subsequently collected by the microphone is adjusted by the amplifier/attenuator according to the second adjustment coefficient, The volume value of the output audio signal is made as close to the target volume value as possible, so as to avoid the volume of the output audio signal being too large or too small, and avoid the problems of popping and distortion.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary only and do not limit the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
图1是根据一示例性实施例示出的一种音频信号处理方法的流程图;FIG. 1 is a flowchart of an audio signal processing method according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种音频信号处理方法的流程图;FIG. 2 is a flowchart of an audio signal processing method according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种音频信号处理装置的框图;3 is a block diagram of an audio signal processing apparatus according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种音频信号处理装置的框图。Fig. 4 is a block diagram of an audio signal processing apparatus according to an exemplary embodiment.
具体实施方式Detailed ways
为使本公开的目的、技术方案和优点更加清楚明白,下面结合实施方式和附图,对本公开做进一步详细说明。在此,本公开的示意性实施方式及其说明用于解释本公开,但并不作为对本公开的限定。In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the present disclosure will be further described in detail below with reference to the embodiments and the accompanying drawings. Here, the exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure, but not to limit the present disclosure.
本公开实施例提供一种音频信号处理方法及装置,以下结合附图对本公开进行详细说明。Embodiments of the present disclosure provide an audio signal processing method and apparatus, and the present disclosure will be described in detail below with reference to the accompanying drawings.
图1是根据一示例性实施例示出的一种音频信号处理方法的流程图,如图1所示,音频信号处理方法用于音频信号处理装置中,包括以下步骤:FIG. 1 is a flowchart of an audio signal processing method according to an exemplary embodiment. As shown in FIG. 1 , the audio signal processing method is used in an audio signal processing apparatus, and includes the following steps:
在步骤101中,通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号。In
在步骤102中,通过配置的ADC,对该第二音频信号进行模数转换,得到第三音频信号。In
在步骤103中,根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器的第二调整系数,该第二调整系数用于表示该统计音量值与该目标音量值之间的差异大小。In
在步骤104中,通过该放大/衰减器,根据该第二调整系数对通过该麦克风采集到的音频信号进行调整。In
本实施例提供的方法,通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的音频信号进行调整后进行模数转换,得到第三音频信号,再以该第三音频信号的统计音量值作为反馈,根据该第三音频信号的统计音量值和目标音量值确定第二调整系数,该第二调整系数用于表示该统计音量值与该目标音量值之间的差异大小,通过放大/衰减器根据第二调整系数对后续通过麦克风采集到的音频信号进行调整,使输出的音频信号的音量值尽可能地接近于目标音量值,避免了输出音频信号的音量过大或过小,避免了爆音和失真的问题。In the method provided in this embodiment, the audio signal collected by the microphone is adjusted according to the first adjustment coefficient by the configured amplifier/attenuator, and then analog-to-digital conversion is performed to obtain a third audio signal, and then the third audio signal is used as the third audio signal. The statistical volume value is used as feedback, and a second adjustment coefficient is determined according to the statistical volume value of the third audio signal and the target volume value. The second adjustment coefficient is used to represent the difference between the statistical volume value and the target volume value. The amplifier/attenuator adjusts the subsequent audio signal collected by the microphone 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, avoiding the volume of the output audio signal being too large or too small , to avoid popping and distortion problems.
在另一实施例中,该通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号,包括:In another embodiment, the configured amplifier/attenuator adjusts the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal, including:
根据该第一调整系数,应用以下公式,对该第一音频信号进行调整,得到该第二音频信号:According to the first adjustment coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
其中,Auamp用于表示该第二音频信号,Au用于表示该第一音频信号,Kamp1用于表示该第一调整系数。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient.
在另一实施例中,该方法还包括:In another embodiment, the method further includes:
将该第三音频信号中多个采样点的音量值的最大值作为统计音量值;或者,The maximum value of the volume values of multiple sampling points in the third audio signal is used as the statistical volume value; or,
将该第三音频信号中多个采样点的音量值的平均值作为统计音量值;或者,The average value of the volume values of multiple sampling points in the third audio signal is used as the statistical volume value; or,
对该第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值。The square root of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal is obtained to obtain the statistical volume value.
在另一实施例中,该根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器的第二调整系数,包括:In another embodiment, 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 includes:
根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,该候选调整系数用于表示该统计音量值与该目标音量值之间的差异;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 the difference between the statistical volume value and the target volume value;
根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,以使该第二调整系数属于由该预设最大调整系数和该预设最小调整系数确定的调整系数范围。The second adjustment coefficient is determined according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient Coefficient range.
在另一实施例中,该根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,包括:In another embodiment, calculating the candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal includes:
根据该第三音频信号的统计音量值和目标音量值,应用以下公式,计算候选调整系数:According to the statistical volume value and the target volume value of the third audio signal, the following formula is applied to calculate the candidate adjustment coefficient:
其中,Kamp'用于表示该第二调整系数,SPau用于表示该统计音量值,SPtarget用于表示该目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent the target volume value.
在另一实施例中,该根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,包括:In another embodiment, determining the second adjustment coefficient according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient includes:
如果该候选调整系数大于预设最大调整系数,则将该预设最大调整系数作为该第二调整系数;If the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient, the preset maximum adjustment coefficient is used as the second adjustment coefficient;
如果该候选调整系数小于预设最小调整系数,则将该预设最小调整系数作为该第二调整系数;If the candidate adjustment coefficient is smaller than the preset minimum adjustment coefficient, the preset minimum adjustment coefficient is used as the second adjustment coefficient;
如果该候选调整系数不大于该预设最大调整系数且不小于该预设最小调整系数,则将该候选调整系数作为该第二调整系数。If the candidate adjustment coefficient is not greater than the preset maximum adjustment coefficient and not smaller than the preset minimum adjustment coefficient, the candidate adjustment coefficient is used as the second adjustment coefficient.
上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。All the above-mentioned optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, which will not be repeated here.
图2是根据一示例性实施例示出的一种音频信号处理方法的流程图,如图2所示,音频信号处理方法用于音频信号处理装置中,该音频信号处理装置可以为具有录音功能的任一设备,如手机、平板电脑、录音器等,本实施例对此不做限定。该音频信号处理装置包括信号收集模块和信号反馈模块,信号采集模块包括麦克风、放大/衰减器和ADC。该方法包括以下步骤:FIG. 2 is a flowchart of an audio signal processing method according to an exemplary embodiment. As shown in FIG. 2 , the audio signal processing method is used in an audio signal processing apparatus, and the audio signal processing apparatus may be a recording function. Any device, such as a mobile phone, a tablet computer, a recorder, etc., is not limited in this embodiment. The audio signal processing device includes a signal collection module and a signal feedback module, and the signal collection module includes a microphone, an amplifier/attenuator and an ADC. The method includes the following steps:
在步骤201中,通过配置的麦克风采集第一音频信号。In
本实施例中,该音频信号处理装置配置有麦克风,通过该麦克风可以采集周围环境的声音,将采集到的声音转换为模拟音频信号。本实施例以采集到该第一音频信号为例。In this embodiment, the audio signal processing device is configured with a microphone, through which the sound of the surrounding environment can be collected, and the collected sound can be converted into an analog audio signal. This embodiment takes the collection of the first audio signal as an example.
在步骤202中,通过配置的放大/衰减器,根据第一调整系数对采集到的第一音频信号进行调整,得到第二音频信号。In
本实施例中,为了便于获取到音量合适的音频信号,可以配置放大/衰减器,对采集到的音频信号进行调整,并根据输出的音频信号的音量值和目标音量值,重新确定放大/衰减器的调整系数,应用新确定的调整系数对后续采集到的音频信号进行调整。通过不断的调整,使得输出的音频信号的音量值可以接近于目标音量值,避免了音频信号音量过大或过小。本实施例仅是以第一次采集到第一音频信号,通过放大/衰减器的第一调整系数和模数转换得到第三音频信号,根据第三音频信号来确定放大/衰减器的第二调整系数为例进行说明。In this embodiment, in order to facilitate obtaining an audio signal with a suitable volume, an amplifier/attenuator may be configured to adjust the collected audio signal, and re-determine the amplification/attenuation according to the volume value of the output audio signal and the target volume value The adjustment coefficient of the controller is used to adjust the subsequently collected audio signal by applying the newly determined adjustment coefficient. Through continuous adjustment, the volume value of the output audio signal can be close to the target volume value, thereby preventing the volume of the audio signal from being too large or too small. This embodiment only collects the first audio signal for the first time, obtains the third audio signal through the first adjustment coefficient of the amplifier/attenuator and analog-to-digital conversion, and determines the second audio signal of the amplifier/attenuator according to the third audio signal The adjustment coefficient is taken as an example for description.
该步骤202可以包括:根据该第一调整系数,应用以下公式,对该第一音频信号进行调整,得到该第二音频信号:Step 202 may include: according to the first adjustment coefficient, applying the following formula to adjust the first audio signal to obtain the second audio signal:
其中,Auamp用于表示该第二音频信号,Au用于表示该第一音频信号,Kamp1用于表示该第一调整系数。该第一调整系数可以为该音频信号处理装置第一次采集到音频信号时放大/衰减器所采用的调整系数,其可以由该音频信号处理装置预先确定,或者通过用户的设置确定,如该第一调整系数可以为0,本实施例对该第一调整系数不做限定。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient. The first adjustment coefficient may be the adjustment coefficient used by the amplifier/attenuator when the audio signal processing apparatus first collects the audio signal, which may be predetermined by the audio signal processing apparatus, or determined by the user's settings, such as the The first adjustment coefficient may be 0, which is not limited in this embodiment.
在步骤203中,通过配置的ADC,对该第二音频信号进行模数转换,得到第三音频信号,并输出该第三音频信号。In
该第一音频信号和该第二音频信号均为模拟音频信号,对第二音频信号进行模数转换,得到的第三音频信号即为数字音频信号,此时该音频信号处理装置可以输出该第三音频信号。该输出是指将该第三音频信号输出至存储器进行存储,或者输出至处理器进行处理,具体输出方式可以根据实际应用的需求确定,本实施例对此不做限定。The first audio signal and the second audio signal are both analog audio signals, and the second audio signal is subjected to analog-to-digital conversion to obtain a third audio signal that is a digital audio signal. At this time, the audio signal processing device can output the first audio signal. Three audio signals. The output refers to outputting the third audio signal to the memory for storage, or outputting the third audio signal to the processor for processing, and the specific output mode may be determined according to actual application requirements, which is not limited in this embodiment.
在另一实施例中,为了避免采集的音频信号的音量过大或过小,该音频信号处理装置在第一次采集到第一音频信号并得到第三音频信号时,将该第三音频信号用于确定第二调整系数,而不输出该第三音频信号。In another embodiment, in order to prevent the volume of the collected audio signal from being too large or too small, the audio signal processing apparatus first collects the first audio signal and obtains the third audio signal, and then processes the third audio signal. for determining the second adjustment coefficient without outputting the third audio signal.
例如,该音频信号处理装置可以为用户提供试音阶段,对用户尝试发出的声音进行采集,得到第三音频信号,从而得到第二调整系数,之后再进入正式录制阶段,应用第二调整系数对用户发出的声音进行录制。For example, the audio signal processing device can provide a sound audition stage for the user, collect the sound that the user tries to make, obtain a third audio signal, and then obtain a second adjustment coefficient, and then enter the formal recording stage, and apply the second adjustment coefficient to The user's voice is recorded.
在步骤204中,根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器的第二调整系数,该第二调整系数用于表示该统计音量值与该目标音量值之间的差异大小。In
其中,该统计音量值是指对该第三音频信号的多个采样点的音量值进行统计后得到的值,该统计音量值可以体现该第三音频信号的音量大小。The statistical volume value refers to a value obtained by performing statistics on the volume values of a plurality of sampling points of the third audio signal, and the statistical volume value may reflect the volume of the third audio signal.
获取该第三音频信号的统计音量值,可以包括:该音频信号处理装置对该第三音频信号进行采样,确定多个采样点,从而获取到多个采样点的音量值,此时可以对多个采样点的音量值进行统计,得到统计音量值。Acquiring the statistical volume value of the third audio signal may include: the audio signal processing device samples the third audio signal, and determines multiple sampling points, thereby acquiring the volume values of multiple sampling points. The volume value of each sampling point is counted to obtain the statistical volume value.
进一步地,对多个采样点的音量值进行统计,得到统计音量值,可以包括:将该第三音频信号中多个采样点的音量值的最大值作为统计音量值,即SPau=max(Dau(1),Dau(2),…,Dau(M));其中,SPau用于表示该统计音量值,Dau(i)表示该第三音频信号中第i个采样点的音量值。Further, performing statistics on the volume values of the multiple sampling points to obtain the statistical volume value, which may include: taking the maximum value of the volume values of the multiple sampling points in the third audio signal as the statistical volume value, that is, SP au =max( D au (1), D au (2),..., D au (M)); wherein, SP au is used to represent the statistical volume value, and D au (i) represents the ith sampling point in the third audio signal volume value.
或者,将该第三音频信号中多个采样点的音量值的平均值作为统计音量值,即 Alternatively, the average value of the volume values of multiple sampling points in the third audio signal is taken as the statistical volume value, that is,
或者,对该第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值,即 Or, take the square root of the sum of the squares of the volume values of multiple sampling points in the third audio signal to obtain the statistical volume value, that is,
其中,该目标音量值可以根据一般音频信号的音量值确定,或者根据处理效果较好的音频信号的音量值确定,本实施例对此不做限定。The target volume value may be determined according to the volume value of a general audio signal, or determined according to the 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 is, the closer the volume of the third audio signal is to the target volume, and the greater the difference between the statistical volume value and the target volume value is, it means that the volume of the third audio signal is similar to that of the target volume. The greater the difference in target volume, the need to re-determine the adjustment factor of the amplifier/attenuator.
在实际应用中,放大/衰减器受到性能的限制,其调整系数不能无限增大或者无限增效,通常具有上限值和下限值,因此,该音频信号处理装置可以根据放大/衰减器的性能确定预设最大调整系数和预设最小调整系数,由该预设最大调整系数和该预设最小调整系数即可确定放大/衰减器的调整系数范围,在确定调整系数时,需保证确定的调整系数不能超出该调整系数范围。为此,该步骤204可以包括以下步骤2041和2042:In practical applications, the amplifier/attenuator is limited by its performance, and its adjustment coefficient cannot be infinitely increased or infinitely enhanced, and usually has an upper limit and a lower limit. Therefore, the audio signal processing device can be based on the amplifier/attenuator. The performance determines the preset maximum adjustment coefficient and the preset minimum adjustment coefficient. The preset maximum adjustment coefficient and the preset minimum adjustment coefficient can determine the adjustment coefficient range of the amplifier/attenuator. When determining the adjustment coefficient, it is necessary to ensure that the determined The adjustment factor cannot exceed the adjustment factor range. To this end, this
2041、根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,该候选调整系数用于表示该统计音量值与该目标音量值之间的差异大小。2041. 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 the size of the difference between the statistical volume value and the target volume value.
例如,根据该第三音频信号的统计音量值和目标音量值,应用以下公式,计算候选调整系数:For example, according to the statistical volume value and the target volume value of the third audio signal, the following formula is applied to calculate the candidate adjustment coefficient:
其中,Kamp'用于表示该第二调整系数,SPau用于表示该统计音量值,SPtarget用于表示该目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent the target volume value.
采用上述公式可以保证,所录制声音的音量过大时,SPau大于SPtarget,计算出的第二调整系数Kamp'小于0,放大/衰减器根据该第二调整系数可以对音频信号进行衰减,且SPau越大,该第二调整系数越小,使得放大/衰减器对信号进行衰减的程度越大。而所录制声音的音量过小时,SPau小于SPtarget,计算出的第二调整系数Kamp'大于0,放大/衰减器根据该第二调整系数对硬盘信号进行放大,且SPau越小,该第二调整系数越大,使得放大/衰减器对信号进行放大的程度越大。Using the above formula can ensure that when the volume of the recorded sound is too large, SP au is greater than SP target , the calculated second adjustment coefficient K amp ' is less than 0, and the amplifier/attenuator can attenuate the audio signal according to the second adjustment coefficient , and the larger SP au is, the smaller the second adjustment coefficient is, so that the amplifier/attenuator attenuates the signal to a greater degree. And the volume of the recorded sound is too small, SP au is smaller than SP target , the calculated second adjustment coefficient K amp ' is greater than 0, the amplifier/attenuator amplifies the hard disk signal according to the second adjustment coefficient, and the smaller SP au is, The larger the second adjustment coefficient is, the greater the degree to which the amplifier/attenuator amplifies the signal.
2042、根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,以使该第二调整系数属于由该预设最大调整系数和该预设最小调整系数确定的调整系数范围。2042. Determine the second adjustment coefficient according to the candidate adjustment coefficient, the preset maximum adjustment coefficient, and the preset minimum adjustment coefficient, so that the second adjustment coefficient is determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient. range of adjustment factors.
例如,如果该候选调整系数大于预设最大调整系数,则将该预设最大调整系数作为该第二调整系数;如果该候选调整系数小于预设最小调整系数,则将该预设最小调整系数作为该第二调整系数;如果该候选调整系数不大于该预设最大调整系数且不小于该预设最小调整系数,则将该候选调整系数作为该第二调整系数。确定该第二调整系数的伪代码可以如下:For example, if the candidate adjustment coefficient is larger than the preset maximum adjustment coefficient, the preset maximum adjustment coefficient is used as the second adjustment coefficient; if the candidate adjustment coefficient is smaller than the preset minimum adjustment coefficient, the preset minimum adjustment coefficient is used as the second adjustment coefficient. the second adjustment coefficient; if the candidate adjustment coefficient is not greater than the preset maximum adjustment coefficient and not smaller than the preset minimum adjustment coefficient, the candidate adjustment coefficient is used as the second adjustment coefficient. Pseudocode for determining the second adjustment factor may be as follows:
if(Kamp'>KampMAX)if(K amp '>K ampMAX )
Kamp=KampMAX;K amp =K ampMAX ;
else if(Kamp'<KampMIN)else if(K amp '<K ampMIN )
Kamp=KampMIN;K amp =K ampMIN ;
elseelse
Kamp=Kamp';K amp = K amp ';
其中,KampMAX和KampMIN分别为放大/衰减器的预设最大调整系数和预设最小调整系数。Wherein, K ampMAX and K ampMIN are the preset maximum adjustment coefficient and the preset minimum adjustment coefficient of the amplifier/attenuator, respectively.
为了保证最终能确定的第二调整系数属于该调整系数范围内,根据该第三音频信号的统计音量值和目标音量值计算得到的调整系数并未直接作为第二调整系数,而是先作为一个候选调整系数,通过将该候选调整系数与预设最大调整系数以及预设最小调整系数进行比较,最终确定该第二调整系数。In order to ensure that the finally determined second adjustment coefficient falls within the range of the adjustment coefficient, 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 first used as a The candidate adjustment coefficient is finally determined by comparing the candidate adjustment coefficient with the preset maximum adjustment coefficient and the preset minimum adjustment coefficient.
在步骤205中,当通过该麦克风采集到第四音频信号时,通过该放大/衰减器,根据该第二调整系数对该第四音频信号进行调整,得到第五音频信号。In
在步骤206中,通过配置的ADC,对该第五音频信号进行模数转换,得到第六音频信号,并输出该第六音频信号。In
确定第二调整系数后,该第二调整系数即可应用于下一次采集的音频信号的处理过程中,以通过麦克风采集到第四音频信号为例,对第四音频信号进行处理的步骤205-206与上述步骤201-203类似,区别仅在于放大/衰减器所应用的调整系数发生了变化。After the second adjustment coefficient is determined, the second adjustment coefficient can be applied to the processing of the audio signal collected next time. Taking the fourth audio signal collected by the microphone as an example, the fourth audio signal is processed in step 205- 206 is similar to the above steps 201-203, except that the adjustment coefficient applied by the amplifier/attenuator is changed.
采用上述步骤201-203对第一音频信号进行处理时,得到的第三音频信号的统计音量值与目标音量值具有一定的差异,而后续采用上述205-206对采集到的第四音频信号进行处理,如果第四音频信号接近于第一音频信号,则输出的第六音频信号的音量值将解决于该目标音量值。When the first audio signal is processed by the above steps 201-203, the obtained statistical volume value of the third audio signal has a certain difference from the target volume value, and the subsequent steps 205-206 are used to process the collected fourth audio signal. Processing, if the fourth audio signal is close to the first audio signal, the volume value of the output sixth audio signal will be resolved at the target volume value.
由于日常生活中在录制声音时,声音的音量很少会发生突变,因此,连续采集到的音频信号的音量差别不大,采用本实施例提供的方法根据上一次采集到的音频信号确定放大/衰减器的调整系数,应用于下一次采集的音频信号,可以保证下一次输出的音频信号的音量接近于目标音量,避免了音量过大或过小的问题,也就不会出现爆音或者失真。Since the volume of the sound rarely changes abruptly when recording sound in daily life, the volume of the continuously collected audio signals is not much different, and the method provided in this embodiment is used to determine the amplification/ The adjustment coefficient of the attenuator is applied to the audio signal collected next time, which can ensure that the volume of the audio signal output next time is close to the target volume, avoiding the problem that the volume is too large or too small, and there will be no popping or distortion.
需要说明的是,本实施例仅是针对一个信号收集模块包括一个放大/衰减器和一个ADC为例进行说明,实际上,在一个设备中可以包括多个信号收集模块,通过多个信号收集模块录制多声道的音频信号,且每个信号收集模块中可以包括多个放大/衰减器,相应的包括多个ADC,每个ADC均与信号反馈模块连接。It should be noted that this embodiment is only described for an example where a signal collection module includes an amplifier/attenuator and an ADC. In fact, a device may include multiple signal collection modules, and through the multiple signal collection modules Multi-channel audio signals are recorded, and each signal collection module may include multiple amplifiers/attenuators, correspondingly including multiple ADCs, and each ADC is connected to the signal feedback module.
该多个信号收集模块可以与不同的信号反馈模块连接,或者,该多个信号收集模块可以与相同的信号反馈模块连接,例如,每个信号收集模块中包括多个放大/衰减器和多个ADC,每个ADC均与相同的信号反馈模块连接,输出的音频信号均会发送给该信号反馈模块,则信号反馈模块采用多任务的方式,同步处理多个ADC发送的音频信号,根据每个音频信号确定调整系数后,发送给对应ADC所连接的放大/衰减器,从而为放大/衰减器重新确定调整系数。The multiple signal collection modules may be connected to different signal feedback modules, or the multiple signal collection modules may be connected to the same signal feedback module, for example, each signal collection module includes multiple amplifiers/attenuators and multiple ADC, each ADC is connected to the same signal feedback module, and the output audio signal will be sent to the signal feedback module, then the signal feedback module adopts a multi-tasking method to synchronously process the audio signals sent by multiple ADCs. After the audio signal determines the adjustment coefficient, it is sent to the amplifier/attenuator connected to the corresponding ADC, so as to re-determine the adjustment coefficient for the amplifier/attenuator.
本实施例提供的方法,通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的音频信号进行调整后进行模数转换,得到第三音频信号,再以该第三音频信号的统计音量值作为反馈,根据该第三音频信号的统计音量值和目标音量值确定第二调整系数,通过放大/衰减器根据第二调整系数对后续通过麦克风采集到的音频信号进行调整,使输出的音频信号的音量值尽可能地接近于目标音量值,避免了输出音频信号的音量过大或过小,避免了爆音和失真的问题。In the method provided in this embodiment, the audio signal collected by the microphone is adjusted according to the first adjustment coefficient by the configured amplifier/attenuator, and then analog-to-digital conversion is performed to obtain a third audio signal, and then the third audio signal is used as the third audio signal. The statistical volume value is used as feedback, and the second adjustment coefficient is determined according to the statistical volume value and the target volume value of the third audio signal, and the audio signal collected by the microphone subsequently is adjusted by the amplifier/attenuator according to the second adjustment coefficient, so that the output The volume value of the audio signal is as close as possible to the target volume value, which avoids the volume of the output audio signal being too large or too small, and avoids the problems of popping and distortion.
图3是根据一示例性实施例示出的一种音频信号处理装置的框图。参见图3,该装置包括:信号收集模块301和信号反馈模块302,该信号收集模块301包括麦克风3011、放大/衰减器3012和ADC3013。Fig. 3 is a block diagram of an audio signal processing apparatus according to an exemplary embodiment. Referring to FIG. 3 , the apparatus includes: a
该麦克风3011的输出端与该放大/衰减器3012的输入端连接,该放大/衰减器3012的输出端与该ADC3013的输入端连接,该ADC3013的输出端与该信号反馈模块302连接;The output end of the
该麦克风3011,用于采集第一音频信号;The
该放大/衰减器3012,用于根据第一调整系数对该麦克风3011采集到的第一音频信号进行调整,得到第二音频信号;The amplifier/
该ADC3013,用于对该第二音频信号进行模数转换,得到第三音频信号;The ADC3013 is used to perform analog-to-digital conversion on the second audio signal to obtain a third audio signal;
该信号反馈模块302,用于根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器3012的第二调整系数;The
该放大/衰减器3012,还用于根据该第二调整系数对该麦克风3011采集到的音频信号进行调整。The amplifier/
在另一实施例中,该放大/衰减器3012,还用于根据该第一调整系数,应用以下公式,对该第一音频信号进行调整,得到该第二音频信号:In another embodiment, the amplifier/
其中,Auamp用于表示该第二音频信号,Au用于表示该第一音频信号,Kamp1用于表示该第一调整系数。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient.
在另一实施例中,该信号反馈模块302,还用于将该第三音频信号中多个采样点的音量值的最大值作为统计音量值;或者,将该第三音频信号中多个采样点的音量值的平均值作为统计音量值;或者,对该第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值。In another embodiment, the
在另一实施例中,该信号反馈模块302,还用于根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,该候选调整系数用于表示该统计音量值与该目标音量值之间的差异;根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,以使该第二调整系数属于由该预设最大调整系数和该预设最小调整系数确定的调整系数范围。In another embodiment, the
在另一实施例中,该信号反馈模块302,还用于根据该第三音频信号的统计音量值和目标音量值,应用以下公式,计算候选调整系数:In another embodiment, the
其中,Kamp'用于表示该第二调整系数,SPau用于表示该统计音量值,SPtarget用于表示该目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent the target volume value.
在另一实施例中,该信号反馈模块302,还用于如果该候选调整系数大于预设最大调整系数,则将该预设最大调整系数作为该第二调整系数;如果该候选调整系数小于预设最小调整系数,则将该预设最小调整系数作为该第二调整系数;如果该候选调整系数不大于该预设最大调整系数且不小于该预设最小调整系数,则将该候选调整系数作为该第二调整系数。In another embodiment, the
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
需要说明的是:上述实施例提供的音频信号处理装置在处理音频信号时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的音频信号处理装置与音频信号处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the audio signal processing apparatus provided in the above embodiments processes audio signals, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the audio signal processing apparatus and the audio signal processing method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
图4是根据一示例性实施例示出的一种音频信号处理装置400的框图。例如,装置400可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 4 is a block diagram of an audio
参照图4,装置400可以包括以下一个或多个组件:处理组件402,存储器404,电源组件406,多媒体组件408,音频组件410,输入/输出(I/O)的接口412,传感器组件414,以及通信组件416。4, the
处理组件402通常控制装置400的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件402可以包括一个或多个处理器420来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件402可以包括一个或多个模块,便于处理组件402和其他组件之间的交互。例如,处理组件402可以包括多媒体模块,以方便多媒体组件408和处理组件402之间的交互。The
存储器404被配置为存储各种类型的数据以支持在装置400的操作。这些数据的示例包括用于在装置400上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器404可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件406为装置400的各种组件提供电力。电源组件406可以包括电源管理系统,一个或多个电源,及其他与为装置400生成、管理和分配电力相关联的组件。
多媒体组件408包括在所述装置400和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件408包括一个前置摄像头和/或后置摄像头。当装置400处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件410被配置为输出和/或输入音频信号。例如,音频组件410包括一个麦克风(MIC),当装置400处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器404或经由通信组件416发送。在一些实施例中,音频组件410还包括一个扬声器,用于输出音频信号。
I/O接口412为处理组件402和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/
传感器组件414包括一个或多个传感器,用于为装置400提供各个方面的状态评估。例如,传感器组件414可以检测到装置400的打开/关闭状态,组件的相对定位,例如该组件为装置400的显示器和小键盘,传感器组件414还可以检测装置400或装置400一个组件的位置改变,用户与装置400接触的存在或不存在,装置400方位或加速/减速和装置400的温度变化。传感器组件414可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件414还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件414还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件416被配置为便于装置400和其他设备之间有线或无线方式的通信。装置400可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件416经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,该通信组件416还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置400可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment,
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器404,上述指令可由装置400的处理器420执行以完成上述方法。例如,该非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a
一种非临时性计算机可读存储介质,当该存储介质中的指令由终端的处理器执行时,使得终端能够执行一种音频信号处理方法,该方法包括:A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a terminal, the terminal can execute an audio signal processing method, the method comprising:
通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号;Through the configured amplifier/attenuator, adjust the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal;
通过配置的模数转换器ADC,对该第二音频信号进行模数转换,得到第三音频信号;Perform analog-to-digital conversion on the second audio signal through the configured analog-to-digital converter ADC to obtain a third audio signal;
根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器的第二调整系数;Determine the second adjustment coefficient of the amplifier/attenuator according to the statistical volume value and the target volume value of the third audio signal;
通过该放大/衰减器,根据该第二调整系数对通过该麦克风采集到的音频信号进行调整。Through the amplifier/attenuator, the audio signal collected by the microphone is adjusted according to the second adjustment coefficient.
在另一实施例中,该通过配置的放大/衰减器,根据第一调整系数对通过麦克风采集到的第一音频信号进行调整,得到第二音频信号,包括:In another embodiment, the configured amplifier/attenuator adjusts the first audio signal collected by the microphone according to the first adjustment coefficient to obtain the second audio signal, including:
根据该第一调整系数,应用以下公式,对该第一音频信号进行调整,得到该第二音频信号:According to the first adjustment coefficient, the following formula is applied to adjust the first audio signal to obtain the second audio signal:
其中,Auamp用于表示该第二音频信号,Au用于表示该第一音频信号,Kamp1用于表示该第一调整系数。Wherein, Au amp is used to represent the second audio signal, Au is used to represent the first audio signal, and K amp1 is used to represent the first adjustment coefficient.
在另一实施例中,该方法还包括:In another embodiment, the method further includes:
将该第三音频信号中多个采样点的音量值的最大值作为统计音量值;或者,The maximum value of the volume values of multiple sampling points in the third audio signal is used as the statistical volume value; or,
将该第三音频信号中多个采样点的音量值的平均值作为统计音量值;或者,The average value of the volume values of multiple sampling points in the third audio signal is used as the statistical volume value; or,
对该第三音频信号中多个采样点的音量值的平方和求取开平方,得到统计音量值。The square root of the sum of the squares of the volume values of the plurality of sampling points in the third audio signal is obtained to obtain the statistical volume value.
在另一实施例中,该根据该第三音频信号的统计音量值和目标音量值,确定该放大/衰减器的第二调整系数,包括:In another embodiment, 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 includes:
根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,该候选调整系数用于表示该统计音量值与该目标音量值之间的差异;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 the difference between the statistical volume value and the target volume value;
根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,以使该第二调整系数属于由该预设最大调整系数和该预设最小调整系数确定的调整系数范围。The second adjustment coefficient is determined according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient, so that the second adjustment coefficient belongs to the adjustment determined by the preset maximum adjustment coefficient and the preset minimum adjustment coefficient Coefficient range.
在另一实施例中,该根据该第三音频信号的统计音量值和目标音量值,计算候选调整系数,包括:In another embodiment, calculating the candidate adjustment coefficient according to the statistical volume value and the target volume value of the third audio signal includes:
根据该第三音频信号的统计音量值和目标音量值,应用以下公式,计算候选调整系数:According to the statistical volume value and the target volume value of the third audio signal, the following formula is applied to calculate the candidate adjustment coefficient:
其中,Kamp'用于表示该第二调整系数,SPau用于表示该统计音量值,SPtarget用于表示该目标音量值。Wherein, K amp ' is used to represent the second adjustment coefficient, SP au is used to represent the statistical volume value, and SP target is used to represent the target volume value.
在另一实施例中,该根据该候选调整系数、预设最大调整系数和预设最小调整系数,确定该第二调整系数,包括:In another embodiment, determining the second adjustment coefficient according to the candidate adjustment coefficient, the preset maximum adjustment coefficient and the preset minimum adjustment coefficient includes:
如果该候选调整系数大于预设最大调整系数,则将该预设最大调整系数作为该第二调整系数;If the candidate adjustment coefficient is greater than the preset maximum adjustment coefficient, the preset maximum adjustment coefficient is used as the second adjustment coefficient;
如果该候选调整系数小于预设最小调整系数,则将该预设最小调整系数作为该第二调整系数;If the candidate adjustment coefficient is smaller than the preset minimum adjustment coefficient, the preset minimum adjustment coefficient is used as the second adjustment coefficient;
如果该候选调整系数不大于该预设最大调整系数且不小于该预设最小调整系数,则将该候选调整系数作为该第二调整系数。If the candidate adjustment coefficient is not greater than the preset maximum adjustment coefficient and not smaller than the preset minimum adjustment coefficient, the candidate adjustment coefficient is used as the second adjustment coefficient.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or techniques in the technical field not disclosed by the present disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying 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)
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 (2)
| 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 |
| CN117612550A (en) * | 2023-11-17 | 2024-02-27 | 时擎智能科技(上海)有限公司 | Voice signal automatic gain control method, device, medium and equipment |
Citations (5)
| 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)
| 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 |
-
2016
- 2016-07-01 CN CN201610516139.0A patent/CN107566952B/en active Active
Patent Citations (5)
| 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 |
|---|---|---|
| US20170126192A1 (en) | Method, device, and computer-readable medium for adjusting volume | |
| EP3264332A1 (en) | Device and method for recognizing fingerprint | |
| CN113452836B (en) | Method and device for controlling vibration of terminal | |
| CN111417053B (en) | Sound pickup volume control method, sound pickup volume control device and storage medium | |
| US10798483B2 (en) | Audio signal processing method and device, electronic equipment and storage medium | |
| CN109085562B (en) | Laser sensor, background noise compensation method and electronic equipment | |
| CN106161781A (en) | Method for regulation of sound volume and device | |
| CN106331338A (en) | Volume adjustment method and device | |
| CN111294704B (en) | Audio processing method, device and storage medium | |
| CN106060707B (en) | Reverberation processing method and device | |
| CN107566952B (en) | Audio signal processing method and device | |
| CN107566950B (en) | Audio signal processing method and device | |
| CN105721705B (en) | Call quality control method, device and mobile terminal | |
| CN106502623A (en) | Audio output device and method | |
| JP2015510320A (en) | High dynamic microphone system | |
| CN108600503B (en) | Control method and device for voice call | |
| CN107566951B (en) | Audio signal processing method and device | |
| CN107665340B (en) | Fingerprint identification method, device and electronic device | |
| WO2018090343A1 (en) | Microphone, and method and device for audio processing | |
| CN112637416A (en) | Volume adjusting method and device and storage medium | |
| CN114495942B (en) | Speech recognition method, device, electronic device and readable storage medium | |
| CN114442990B (en) | Volume adjustment method, device and storage medium | |
| CN111736718A (en) | Touch screen control method and device | |
| CN106303775B (en) | Mobile terminal and mobile terminal pickup optimization method | |
| CN108632442A (en) | Audio broadcasting method and device, the electronic equipment of text information |
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 |