CN107566950B - Audio signal processing method and device - Google Patents

Audio signal processing method and device Download PDF

Info

Publication number
CN107566950B
CN107566950B CN201610513548.5A CN201610513548A CN107566950B CN 107566950 B CN107566950 B CN 107566950B CN 201610513548 A CN201610513548 A CN 201610513548A CN 107566950 B CN107566950 B CN 107566950B
Authority
CN
China
Prior art keywords
audio signal
volume value
value
audio signals
attenuator
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
CN201610513548.5A
Other languages
Chinese (zh)
Other versions
CN107566950A (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 CN201610513548.5A priority Critical patent/CN107566950B/en
Publication of CN107566950A publication Critical patent/CN107566950A/en
Application granted granted Critical
Publication of CN107566950B publication Critical patent/CN107566950B/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: acquiring a first audio signal by a configured microphone; adjusting the first audio signal according to preset adjustment coefficients through N configured amplification/attenuators to obtain N paths of second audio signals, wherein the preset adjustment coefficients of the amplification/attenuators are different; respectively carrying out analog-to-digital conversion on the N paths of second audio signals through N configured analog-to-digital converters (ADC) to obtain N paths of third audio signals; and selecting the third audio signal with the minimum difference value between the statistical volume value and the preset threshold value and outputting the third audio signal. This is disclosed through adjusting audio signal according to the different preset adjustment coefficient, selects the audio signal output that the difference between statistics volume value and the preset threshold value is minimum, has guaranteed no matter record the sound that the volume is big or the sound that the volume is little, and the audio signal that the homoenergetic is suitable according to the preset threshold value output volume has avoided the problem of plosive and distortion.

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:
acquiring a first audio signal by a configured microphone;
adjusting the first audio signal according to preset adjustment coefficients through N configured amplification/attenuators to obtain N paths of second audio signals, wherein the preset adjustment coefficients of the amplification/attenuators are different, and N is an integer greater than 1;
respectively carrying out analog-to-digital conversion on the N paths of second audio signals through N configured analog-to-digital converters (ADC) to obtain N paths of third audio signals;
selecting a third audio signal with the minimum difference value between the statistical volume value and a preset threshold value from the N paths of third audio signals;
and outputting the selected third audio signal.
In another embodiment, the method comprises:
obtaining a preset adjusting coefficient of the ith amplifying/attenuator in the N amplifying/attenuators by applying the following formula:
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of said microphonemic_lFor indicating the minimum recordable volume value, D, of said microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
In another embodiment, the adjusting the first audio signal by the configured N amplification/attenuation devices respectively includes:
according to the preset adjusting coefficient of the ith amplifying/attenuator, the following formula is applied to adjust the first audio signal to obtain the ith path of second audio signal:
Figure BDA0001039260400000022
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
In another embodiment, the method further comprises:
and for each path of third audio signal, sampling the third audio signal, and determining a statistical volume value of the third audio signal according to the volume values of a plurality of sampling points.
In another embodiment, the determining a statistical loudness value of the third audio signal from loudness values of a plurality of sample points comprises:
taking the maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; alternatively, the first and second electrodes may be,
and taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the preset threshold from the N paths of third audio signals includes:
if the N paths of third audio signals comprise third audio signals of which the statistical volume value is not greater than the preset threshold, selecting the third audio signal of which the difference value between the statistical volume value and the preset threshold is minimum from the third audio signals of which the statistical volume value is not greater than the preset threshold; alternatively, the first and second electrodes may be,
and if the statistical volume values of the N paths of third audio signals are all larger than the preset threshold, selecting a third audio signal with the minimum difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the preset threshold from the N paths of third audio signals includes:
sequencing the N paths of third audio signals according to the sequence of the statistical volume values from large to small;
traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
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, N amplification/attenuators and N analog-to-digital converters (ADC), wherein N is an integer greater than 1;
the output end of the microphone is connected with the input ends of the N amplification/attenuation devices, the output ends of the N amplification/attenuation devices are respectively connected with the input ends of the N ADCs, and the output ends of the N ADCs are connected with the signal selection module;
the microphone is used for acquiring a first audio signal and outputting the first audio signal to the N amplification/attenuation units;
each amplification/attenuator is used for adjusting the first audio signal according to a preset adjustment coefficient to obtain a path of second audio signal, and outputting the path of second audio signal to a connected ADC (analog to digital converter), wherein the preset adjustment coefficients of the amplification/attenuators are different;
each ADC is used for carrying out analog-to-digital conversion on the received second audio signal to obtain a path of third audio signal, and outputting the path of third audio signal to the signal selection module;
and the signal selection module is used for selecting the third audio signal with the minimum difference value between the statistical volume value and the preset threshold value from the N paths of received third audio signals and outputting the selected third audio signal.
In another embodiment, the apparatus further comprises: a calculation module;
the calculation module is configured to obtain a preset adjustment coefficient of an ith amplification/attenuator in the N amplification/attenuators by applying the following formula, and output the preset adjustment coefficient to the ith amplification/attenuator:
Figure BDA0001039260400000041
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of said microphonemic_lFor indicating the minimum recordable volume value, D, of said microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
In another embodiment, the ith amplification/attenuator is configured to adjust the first audio signal according to a preset adjustment coefficient of the ith amplification/attenuator by applying the following formula, so as to obtain an ith second audio signal:
Figure BDA0001039260400000042
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
In another embodiment, the signal selecting module is configured to sample each path of third audio signal, and determine the statistical volume value of the third audio signal according to the volume values of multiple sampling points.
In another embodiment, the signal selecting module is configured to use a maximum value of the volume values of the plurality of sampling points as a statistical volume value of the third audio signal; or, taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
In another embodiment, the signal selecting module is configured to select, if the N paths of third audio signals include third audio signals whose statistical volume value is not greater than the preset threshold, a third audio signal whose difference between the statistical volume value and the preset threshold is the smallest from the third audio signals whose statistical volume value is not greater than the preset threshold; alternatively, the first and second electrodes may be,
the signal selection module is further configured to select, if the statistical volume values of the N paths of third audio signals are all greater than the preset threshold, a third audio signal with a smallest difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
In another embodiment, the signal selection module is configured to sort the N paths of third audio signals according to a sequence from a large statistical volume value to a small statistical volume value; traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
In another embodiment, the signal selecting module comprises: the device comprises a cache region, a selection unit and a switching unit;
the buffer area is used for buffering the received N paths of third audio signals;
the selecting unit is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold value from N paths of third audio signals cached in the cache region, and send a serial number of the selected third audio signal to the switching unit;
and the switching unit is used for outputting the corresponding third audio signal from the N paths of third audio signals cached in the cache region according to the serial number sent by the selecting unit.
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 first audio signal is respectively adjusted through the N amplification/attenuation units according to different preset adjustment coefficients, analog-to-digital conversion is carried out through the N ADCs to obtain N paths of third audio signals, the third audio signal with the smallest difference value between the statistical volume value and the preset threshold value is selected from the N paths of third audio signals to be output, the audio signals with the proper volume can be output according to the preset threshold value no matter the sound with the large volume is recorded or the sound with the small volume is recorded, the audio signals with the overlarge or undersize volume value are screened, and the problems of sound explosion 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;
fig. 5 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, as shown in fig. 1, which is used in an audio signal processing apparatus including a microphone, N amplifiers/attenuators, and N ADCs, N being an integer greater than 1, the method including the steps of:
in step 101, a first audio signal is acquired by a configured microphone.
In step 102, the first audio signal is adjusted according to preset adjustment coefficients by N configured amplification/attenuators, respectively, to obtain N paths of second audio signals, where the preset adjustment coefficients of the amplification/attenuators are different.
In step 103, the N channels of second audio signals are respectively analog-to-digital converted by the configured N analog-to-digital converters ADC, so as to obtain N channels of third audio signals.
In step 104, a third audio signal with the smallest difference between the statistical volume value and the preset threshold is selected from the N paths of third audio signals.
In step 105, the selected third audio signal is output.
In this embodiment, the first audio signal and the second audio signal are analog audio signals, and the third audio signal is a digital audio signal. And adjusting the collected first audio signals according to different preset adjustment coefficients to further obtain N paths of third audio signals, selecting audio signals with volume values close to a preset threshold value from the N paths of third audio signals, and screening out audio signals with too large or too small volume values. Then, when recording sound with large volume, the audio signal with explosive sound can be screened out, the audio signal with small volume after attenuation is selected, and when recording sound with small volume, the audio signal with distortion can be screened out, and the audio signal with large volume after amplification is selected.
According to the method provided by the embodiment, the first audio signals are respectively adjusted through the N amplification/attenuation devices according to different preset adjustment coefficients, analog-to-digital conversion is performed through the N ADCs to obtain N paths of third audio signals, the third audio signal with the minimum difference between the statistical volume value and the preset threshold value is selected from the N paths of third audio signals to be output, it is guaranteed that no matter sound with large volume or sound with small volume is recorded, the audio signals with proper volume can be output according to the preset threshold value, the audio signals with too large or too small volume values are screened out, and the problems of popping and distortion are avoided.
In another embodiment, the method comprises:
obtaining the preset adjusting coefficient of the ith amplifying/attenuator in the N amplifying/attenuators by applying the following formula:
Figure BDA0001039260400000071
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of the microphonemic_lFor indicating the minimum recordable volume value, D, of the microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
In another embodiment, the adjusting the first audio signal by the configured N amplifiers/attenuators respectively includes:
according to the preset adjusting coefficient of the ith amplifying/attenuator, the following formula is applied to adjust the first audio signal to obtain the ith path of second audio signal:
Figure BDA0001039260400000072
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
In another embodiment, the method further comprises:
and for each path of third audio signal, sampling the third audio signal, and determining the statistical volume value of the third audio signal according to the volume values of a plurality of sampling points.
In another embodiment, the determining the statistical volume value of the third audio signal according to the volume values of the plurality of sample points comprises:
taking the maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; alternatively, the first and second electrodes may be,
and taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the predetermined threshold from the N third audio signals includes:
if the N paths of third audio signals comprise third audio signals of which the statistical volume value is not greater than the preset threshold, selecting the third audio signal of which the difference value between the statistical volume value and the preset threshold is minimum from the third audio signals of which the statistical volume value is not greater than the preset threshold; alternatively, the first and second electrodes may be,
and if the statistical volume values of the N paths of third audio signals are all larger than the preset threshold, selecting the third audio signal with the minimum difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the predetermined threshold from the N third audio signals includes:
sequencing the N paths of third audio signals according to the sequence of the statistical volume values from large to small;
traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
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 collecting module and a signal selecting module, wherein the signal collecting module comprises a microphone, N amplification/attenuation devices and N ADCs, and N is an integer larger than 1. 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 configured with a microphone, and the microphone can collect sounds of the surrounding environment, and convert the collected sounds into analog audio signals, which are the first audio signals.
In step 202, the first audio signal is adjusted according to preset adjustment coefficients by N configured amplifiers/attenuators, respectively, to obtain N paths of second audio signals.
In this embodiment, in order to avoid pop sound caused by too large collected volume and distortion caused by too small collected volume, N amplification/attenuation units may be configured, and the amplification/attenuation units are configured to adjust the first audio signal according to a preset adjustment coefficient. When the preset adjusting coefficient of the amplifying/attenuating device is larger than the preset coefficient, the amplifying/attenuating device is embodied as an amplifying characteristic and is used for amplifying the first audio signal, and when the preset adjusting coefficient of the amplifying/attenuating device is smaller than or equal to the preset coefficient, the amplifying/attenuating device is embodied as an attenuating characteristic and is used for attenuating the first audio signal. The preset coefficient may be 0 or 1, and is specifically determined according to an adjustment manner of the amplifier/attenuator, which is not limited in this embodiment.
In this embodiment, different amplification/attenuation units have different preset adjustment coefficients, and when the collected first audio signal is adjusted according to the preset adjustment coefficients through the N amplification/attenuation units, a plurality of different audio signals can be obtained, and an audio signal with an appropriate volume is selected from the plurality of audio signals in the subsequent process, so that it is ensured that the volume of the finally output audio signal is not too large or too small.
This step 202 may include: according to the preset adjusting coefficient of the ith amplifying/attenuator, the following formula is applied to adjust the first audio signal to obtain the ith path of second audio signal:
Figure BDA0001039260400000091
wherein, Auamp(i) For representing the ith audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
The N amplifying/attenuating devices can all obtain one path of second audio signals by applying the formula, so that N paths of second audio signals are obtained.
Prior to step 202, the method may include: and acquiring a preset adjusting coefficient of each amplification/attenuator. The method specifically comprises the following steps: acquiring the maximum volume value and the minimum volume value of the microphone and the ADC, and the maximum adjusting coefficient and the minimum adjusting coefficient of the amplification/attenuation device, and acquiring the preset adjusting coefficient of the ith amplification/attenuation device in the N amplification/attenuation devices by applying the following formula:
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of the microphonemic_lFor indicating the minimum recordable volume value, D, of the microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
Difference D between maximum and minimum volume values convertible per ADCadcThe same and the different ADC switchable volume ranges may be the same or different. Assume the sound pressure range of ADC1 is (-96dBV,0 dBV); the sound pressure range of ADC2 is (-120dBV, -24dBV), the sound volume ranges of ADC1 and ADC2 are different, but the difference D between the maximum sound volume value and the minimum sound volume value can be convertedadcThe same, 96dB each.
In the process of processing the audio signal, the microphone, the amplifier/attenuator and the ADC are used to process the audio signal, so the volume ranges of the microphone and the ADC and the preset adjustment coefficients of the amplifier/attenuator may affect the audio signal, and the preset adjustment coefficients of each amplifier/attenuator need to be determined by comprehensively considering the capabilities of the microphone, the ADC and the preset adjustment coefficients of the amplifier/attenuator.
Maximum recordable volume value D of microphonemic_hAnd a minimum volume value Dmic_lDifference D betweenmicI.e. the recordable volume span of the microphone, ADC is convertibleMaximum volume value Dadc_hAnd a minimum volume value Dadc_lDifference D betweenadcI.e. volume span convertible by ADC, generally DmicIs greater than Dadc. Thus, the theoretical volume span when adjusted using the amplifier/attenuator is Dmic-DadcAnd, in practice, the adjustment coefficient span of the amplifier/attenuator is practically the maximum adjustment coefficient Kamp_hAnd the minimum adjustment coefficient Kamp_lThe difference between the two signals can represent the amplification/attenuation capability of the amplification/attenuator.
Thus, the volume span when adjusted by the amplification/attenuation unit can be selected to be Dfin=min(Kamp_h-Kamp_l,Dmic-Dadc). According to the determined volume span, when different preset adjustment coefficients are obtained by adopting the formula, the preset adjustment coefficients of the N paths of audio signals can be ensured to be Kamp_lTo Kamp_l+DfinAre uniformly distributed within the range of (1).
That is, at Kamp_h-Kamp_l≤Dmic-Dadc,Dfin=Kamp_h-Kamp_lWhen the preset adjusting coefficient of the N paths of audio signals is Kamp_lTo Kamp_hAre uniformly distributed within the range of (1). At Kamp_h-Kamp_l>Dmic-Dadc,Dfin=Dmic-DadcWhen the preset adjusting coefficient of the N paths of audio signals is Kamp_lTo Kamp_l+Dmic-DadcIn the range of (1), wherein K isamp_l+Dmic-Dadc<Kamp_h
By adopting the formula, N preset adjustment coefficients which are uniformly distributed can be obtained, and the accuracy can be improved when the output audio signals are selected from N paths of audio signals. Certainly, the preset adjustment coefficients of the N amplification/attenuation units may also be determined in other manners, where the N preset adjustment coefficients may be uniformly distributed or non-uniformly distributed.
The obtained N different preset adjustment coefficients include both a preset adjustment coefficient smaller than the preset coefficient and a preset adjustment coefficient larger than the preset coefficient, so that when the N amplification/attenuation units are used for adjusting the first audio signal, the first audio signal is amplified and attenuated, and different second audio signals are obtained.
In step 203, the N channels of second audio signals are respectively analog-to-digital converted by the configured N analog-to-digital converters ADC, so as to obtain N channels of third audio signals.
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, and the obtained third audio signal is a digital audio signal.
In step 204, for each of the N channels of third audio signals, the third audio signal is sampled, and a statistical volume value of the third audio signal is determined according to the volume values of a plurality of sampling points.
After the N paths of third audio signals are obtained, one path of suitable third audio signal can be selected from the N paths of third audio signals to be output. The selection process may be performed according to the volume value of each third audio signal.
For example, for each path of the third audio signal, the audio signal processing apparatus may sample the third audio signal, determine a plurality of sampling points, and thereby obtain the volume values of the plurality of sampling points, at this time, may perform statistics on the volume values of the plurality of sampling points to obtain a statistical volume value, where the statistical volume value may represent the volume of the third audio signal. And repeatedly executing the operation to obtain the statistical volume value of the N paths of third audio signals, and selecting and outputting a proper third audio signal according to the statistical volume value of the N paths of third audio signals.
The statistical volume value may be a maximum value or an average value of the volume values of the plurality of sampling points, and may also be other types of statistical values, which is not limited in this embodiment.
Before step 204, in order to obtain the volume value of the sufficient sampling point, when obtaining N channels of third audio signals, the audio signal processing apparatus may buffer the N channels of third audio signals in a buffer, and when the sampling point that can be provided by each channel of buffered third audio signals is sufficient, sample and count each channel of third audio signals, to obtain the statistical volume value respectively. Or, when the N paths of third audio signals are obtained, the volume values of the sampling points selected from the N paths of third audio signals may be cached in the cache region until the sufficient volume values of the sampling points are cached, and then the volume values of the multiple sampling points of each path of third audio signal are counted to obtain the counted volume values respectively.
Wherein, the format of the volume value of the buffered sampling point in the buffer area can be
Figure BDA0001039260400000111
That is, N paths of third audio signals are separately buffered, and the volume values of M sampling points are buffered for each path of third audio signals, Dau(N)MThe sound volume value is used for representing the sound volume value of the Mth sampling point in the Nth path of third audio signal.
In step 205, a third audio signal with the smallest difference between the statistical volume value and the predetermined threshold is selected from the N paths of third audio signals, and the selected third audio signal is output.
The preset threshold 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 preset threshold value is, the closer the volume of the corresponding third audio signal is to the required volume is. Therefore, the audio signal processing apparatus selects the third audio signal with the smallest difference between the statistical volume value and the preset threshold value from the N paths of third audio signals, that is, the audio signal with the proper volume, and then may screen out other third audio signals and output the selected third audio signal.
When the statistical volume values of the N paths of third audio signals are different, the mode for selecting the third audio signals is also different. If the statistical volume value of some third audio signals is greater than the preset threshold value and the statistical volume value of some third audio signals is less than the preset threshold value in the N paths of third audio signals, the audio signal processing apparatus may select the third audio signals in the following two ways:
in the method 1, the third audio signal with the smallest difference between the statistical volume value and the preset threshold value, that is, the third audio signal with the smallest statistical volume value, is selected from the third audio signals with the statistical volume value larger than the preset threshold value.
In the method 2, the third audio signal with the smallest difference between the statistical volume value and the preset threshold value, that is, the third audio signal with the largest statistical volume value, is selected from the third audio signals with the statistical volume value not greater than the preset threshold value.
Or, in order to select the audio signal with the larger volume as much as possible, when the N paths of third audio signals include the third audio signal whose statistical volume value is not greater than the preset threshold, the third audio signal is selected in the above manner 2, and only when the N paths of third audio signals do not include the third audio signal whose statistical volume value is not greater than the preset threshold, that is, when the statistical volume value of each path of third audio signal is greater than the preset threshold, the third audio signal is selected in the above manner 1.
For example, this step 205 may include the step 2051:
2051. the audio signal processing device may further sort the N paths of third audio signals according to a sequence of statistical volume values from large to small, traverse the N paths of third audio signals according to the sort, determine whether the statistical volume value of each path of third audio signal is not greater than the preset threshold, select the currently traversed third audio signal until the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold, or select the last path of currently traversed third audio signal, that is, the third audio signal with the smallest statistical volume value, until the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold.
Due to Kamp(i) Increases with the increase of i, so the statistical volume value also increases with the increase of i, and the Nth pathAnd the third audio signal starts to carry out reverse order judgment, and the currently traversed third audio signal is selected until the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value or the currently traversed third audio signal is the 1 st path of third audio signal.
The pseudo code for this step 2051 may be as follows:
Figure BDA0001039260400000131
in fact, the selecting process and the outputting process in step 205 may be implemented by different modules, for example, N paths of the third audio signals are cached in the cache region, the selecting unit is configured to analyze the N paths of the third audio signals, determine a serial number of the selected third audio signal, and send the serial number to the switching unit, and the switching unit may output the corresponding third audio signal according to the serial number sent by the selecting unit from the N paths of the third audio signals cached in the cache region.
It should be noted that, this embodiment is only described with respect to one signal collection module as an example, and actually, a plurality of signal collection modules may be included in one device, and a plurality of signal collection modules are used to record multi-channel audio signals.
The signal collection modules may be connected to different signal selection modules, or the signal collection modules may be connected to the same signal selection module, for example, taking the device includes X signal collection modules as an example, X · N ADCs are all connected to the signal selection module, the output third audio signal is sent to the signal selection module, and then the signal selection module adopts a multitask mode to synchronously process the audio signals of the X signal collection modules, and selects an audio signal for each signal collection module to output.
According to the method provided by the embodiment, the first audio signals are respectively adjusted through the N amplification/attenuation devices according to different preset adjustment coefficients, analog-to-digital conversion is performed through the N ADCs to obtain N paths of third audio signals, the third audio signal with the minimum difference between the statistical volume value and the preset threshold value is selected from the N paths of third audio signals to be output, it is guaranteed that no matter sound with large volume or sound with small volume is recorded, the audio signals with proper volume can be output according to the preset threshold value, the audio signals with too large or too small volume values are screened out, and the problems of popping and distortion are avoided. Moreover, a plurality of preset adjusting coefficients which are uniformly distributed are adopted, so that the accuracy is improved.
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 selection module 302, where the signal collection module 301 includes a microphone 3011, N amplification/attenuators 3012 and N analog-to-digital converters ADC3013, where N is an integer greater than 1.
The output end of the microphone 3011 is connected to the input ends of the N amplification/attenuation units 3012, the output ends of the N amplification/attenuation units 3012 are connected to the input ends of the N ADCs 3013, and the output ends of the N ADCs 3013 are connected to the signal selection module 302;
the microphone 3011 is configured to collect a first audio signal and output the first audio signal to the N amplification/attenuation units 3012;
each amplification/attenuator 3012 is configured to adjust the first audio signal according to a preset adjustment coefficient to obtain a path of second audio signal, and output the path of second audio signal to the connected ADC3013, where the preset adjustment coefficients of each amplification/attenuator 3012 are different;
each ADC3013 is configured to perform analog-to-digital conversion on the received second audio signal to obtain a path of third audio signal, and output the path of third audio signal to the signal selection module 302;
the signal selecting module 302 is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold from the N received third audio signals, and output the selected third audio signal.
The device provided by the embodiment adjusts the first audio signal according to different preset adjustment coefficients through the N amplification/attenuation units, performs analog-to-digital conversion through the N ADCs to obtain N paths of third audio signals, selects the third audio signal with the minimum difference value between the statistical volume value and the preset threshold value from the N paths of third audio signals to output, ensures that the audio signals with the appropriate volume can be output according to the preset threshold value no matter the sound with the large volume or the sound with the small volume is recorded, screens out the audio signals with the too large or too small volume value, and avoids the problems of plosive and distortion.
Referring to fig. 4, in another embodiment, the apparatus further comprises: a calculation module 303;
the calculating module 303 is configured to obtain a preset adjustment coefficient of the ith amplification/attenuator 3012 of the N amplification/attenuators 3012 by applying the following formula, and output the preset adjustment coefficient to the ith amplification/attenuator 3012:
Figure BDA0001039260400000141
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating a preset adjustment coefficient, K, of the i-th amplifier/attenuator 3012amp_lFor indicating the minimum adjustment coefficient, K, of the amplifier/attenuator 3012amp_hFor indicating the maximum adjustment coefficient, D, of the amplifier/attenuator 3012mic_hFor indicating the maximum recordable volume value, D, of the microphone 3011mic_lFor indicating the minimum recordable volume value, D, of the microphone 3011adc_hFor indicating the maximum volume value, D, that the ADC3013 can convertadc_lWhich represents the minimum volume value that the ADC3013 can convert.
In another embodiment, the ith amplification/attenuation unit 3012 is configured to adjust the first audio signal according to a preset adjustment coefficient of the ith amplification/attenuation unit 3012 by applying the following formula, so as to obtain an ith second audio signal:
Figure BDA0001039260400000151
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating presets of the ith amplifier/attenuator 3012And adjusting the coefficient.
In another embodiment, the signal selecting module 302 is configured to sample each path of the third audio signal, and determine the statistical volume value of the third audio signal according to the volume values of a plurality of sampling points.
In another embodiment, the signal selecting module 302 is configured to use a maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; or, taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
In another embodiment, the signal selecting module 302 is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold from the third audio signals with the statistical volume value not greater than the preset threshold if the N paths of third audio signals include third audio signals with the statistical volume value not greater than the preset threshold; alternatively, the first and second electrodes may be,
the signal selecting module 302 is further configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold from the N paths of third audio signals if the statistical volume values of the N paths of third audio signals are all greater than the preset threshold.
In another embodiment, the signal selecting module 302 is configured to sort the N paths of third audio signals according to a sequence from large to small of the statistical volume value; traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
Referring to fig. 4, in another embodiment, the signal selecting module 302 includes: a buffer area 3021, a selecting unit 3022, and a switching unit 3023;
the buffer area 3021 is configured to buffer the received N channels of third audio signals;
the selecting unit 3022 is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold from the N paths of third audio signals cached in the cache region, and send a serial number of the selected third audio signal to the switching unit;
the switching unit 3023 is configured to output a corresponding third audio signal from the N paths of third audio signals buffered in the buffer according to the serial number sent by the selecting unit.
It should be noted that this embodiment is only described with respect to one signal collection module 301 as an example, and actually, a plurality of signal collection modules 301 may be included in one device, and a plurality of signal collection modules 301 are used to record multi-channel audio signals.
The plurality of signal collection modules 301 may be connected to different signal selection modules 302, and each signal selection module 302 is configured to process N paths of third audio signals of the connected signal collection modules 301. Alternatively, the multiple signal collection modules 301 may be connected to the same signal selection module 302, for example, taking the apparatus includes X signal collection modules 301 as an example, X · N ADCs are all connected to the signal selection module 302, and the output third audio signals are all sent to the signal selection module 302, so that the signal selection module 302 synchronously processes N audio signals of the X signal collection modules 301 in a multitasking manner, selects one audio signal for each signal collection module 301 to output, and finally outputs X audio signals.
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. 5 is a block diagram illustrating an audio signal processing apparatus 500 according to an exemplary embodiment. For example, the apparatus 500 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. 5, the apparatus 500 may include one or more of the following components: processing component 502, memory 504, power component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor component 514, and communication component 516.
The processing component 502 generally controls overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 502 may include one or more processors 520 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to store various types of data to support operations at the apparatus 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 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.
The power supply component 506 provides power to the various components of the device 500. The power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 500.
The multimedia component 508 includes a screen that provides an output interface between the device 500 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 508 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 device 500 is in an operating mode, such as a shooting 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 510 is configured to output and/or input audio signals. For example, audio component 510 includes a Microphone (MIC) configured to receive external audio signals when apparatus 500 is in an operating 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 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 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 assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 may detect an open/closed state of the apparatus 500, the relative positioning of the components, such as a display and keypad of the apparatus 500, the sensor assembly 514 may also detect a change in the position of the apparatus 500 or a component of the apparatus 500, the presence or absence of user contact with the apparatus 500, orientation or acceleration/deceleration of the apparatus 500, and a change in the temperature of the apparatus 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 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 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to facilitate communication between the apparatus 500 and other devices in a wired or wireless manner. The apparatus 500 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 516 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 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 500 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 504 comprising instructions, executable by the processor 520 of the apparatus 500 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:
acquiring a first audio signal by a configured microphone;
adjusting the first audio signal according to preset adjustment coefficients through N configured amplification/attenuators to obtain N paths of second audio signals, wherein the preset adjustment coefficients of the amplification/attenuators are different, and N is an integer greater than 1;
respectively carrying out analog-to-digital conversion on the N paths of second audio signals through N configured analog-to-digital converters (ADC) to obtain N paths of third audio signals;
selecting a third audio signal with the minimum difference value between the statistical volume value and a preset threshold value from the N paths of third audio signals;
and outputting the selected third audio signal.
In another embodiment, the method comprises:
obtaining the preset adjusting coefficient of the ith amplifying/attenuator in the N amplifying/attenuators by applying the following formula:
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of the microphonemic_lFor indicating the minimum recordable volume value, D, of the microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
In another embodiment, the adjusting the first audio signal by the configured N amplifiers/attenuators respectively includes:
according to the preset adjusting coefficient of the ith amplifying/attenuator, the following formula is applied to adjust the first audio signal to obtain the ith path of second audio signal:
Figure BDA0001039260400000192
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
In another embodiment, the method further comprises:
and for each path of third audio signal, sampling the third audio signal, and determining the statistical volume value of the third audio signal according to the volume values of a plurality of sampling points.
In another embodiment, the determining the statistical volume value of the third audio signal according to the volume values of the plurality of sample points comprises:
taking the maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; alternatively, the first and second electrodes may be,
and taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the predetermined threshold from the N third audio signals includes:
if the N paths of third audio signals comprise third audio signals of which the statistical volume value is not greater than the preset threshold, selecting the third audio signal of which the difference value between the statistical volume value and the preset threshold is minimum from the third audio signals of which the statistical volume value is not greater than the preset threshold; alternatively, the first and second electrodes may be,
and if the statistical volume values of the N paths of third audio signals are all larger than the preset threshold, selecting the third audio signal with the minimum difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
In another embodiment, the selecting the third audio signal with the smallest difference between the statistical volume value and the predetermined threshold from the N third audio signals includes:
sequencing the N paths of third audio signals according to the sequence of the statistical volume values from large to small;
traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
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 (17)

1. A method of audio signal processing, the method comprising:
acquiring a first audio signal by a configured microphone;
adjusting the first audio signal according to a preset adjustment coefficient through N configured amplification/attenuators to obtain N paths of second audio signals, wherein the preset adjustment coefficient of each amplification/attenuator is different, N is an integer greater than 1, and when the preset adjustment coefficient of each amplification/attenuator is greater than the preset coefficient, the amplification/attenuator is embodied as an amplification characteristic and is used for amplifying the first audio signal; when the preset adjusting coefficient of the amplification/attenuator is not greater than the preset coefficient, the amplification/attenuator is embodied as an attenuation characteristic and is used for attenuating the first audio signal;
respectively carrying out analog-to-digital conversion on the N paths of second audio signals through N configured analog-to-digital converters (ADC) to obtain N paths of third audio signals;
selecting a third audio signal with the minimum difference value between the statistical volume value and a preset threshold value from the N paths of third audio signals;
and outputting the selected third audio signal.
2. The method according to claim 1, characterized in that it comprises:
obtaining a preset adjusting coefficient of the ith amplifying/attenuator in the N amplifying/attenuators by applying the following formula:
Figure FDA0002206080350000011
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of said microphonemic_lFor indicating the minimum recordable volume value, D, of said microphoneadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
3. The method of claim 1, wherein the adjusting the first audio signal by the configured N amplifiers/attenuators respectively comprises:
according to the preset adjusting coefficient of the ith amplifying/attenuator, the following formula is applied to adjust the first audio signal to obtain the ith path of second audio signal:
Figure FDA0002206080350000021
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
4. The method of claim 1, further comprising:
and for each path of third audio signal, sampling the third audio signal, and determining a statistical volume value of the third audio signal according to the volume values of a plurality of sampling points.
5. The method of claim 4, wherein determining the statistical loudness value of the third audio signal from loudness values of a plurality of sample points comprises:
taking the maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; alternatively, the first and second electrodes may be,
and taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
6. The method according to claim 1, wherein said selecting the third audio signal with the smallest difference between the statistical volume value and the preset threshold value from the N third audio signals comprises:
if the N paths of third audio signals comprise third audio signals of which the statistical volume value is not greater than the preset threshold, selecting the third audio signal of which the difference value between the statistical volume value and the preset threshold is minimum from the third audio signals of which the statistical volume value is not greater than the preset threshold; alternatively, the first and second electrodes may be,
and if the statistical volume values of the N paths of third audio signals are all larger than the preset threshold, selecting a third audio signal with the minimum difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
7. The method according to claim 6, wherein said selecting the third audio signal with the smallest difference between the statistical volume value and the preset threshold value from the N third audio signals comprises:
sequencing the N paths of third audio signals according to the sequence of the statistical volume values from large to small;
traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
8. An audio signal processing apparatus, characterized in that the apparatus comprises: the signal acquisition module comprises a microphone, N amplification/attenuators and N analog-to-digital converters (ADC), wherein N is an integer greater than 1;
the output end of the microphone is connected with the input ends of the N amplification/attenuation devices, the output ends of the N amplification/attenuation devices are respectively connected with the input ends of the N ADCs, and the output ends of the N ADCs are connected with the signal selection module;
the microphone is used for acquiring a first audio signal and outputting the first audio signal to the N amplification/attenuation units;
each amplification/attenuator is used for adjusting the first audio signal according to a preset adjustment coefficient to obtain a path of second audio signal, and outputting the path of second audio signal to a connected ADC (analog to digital converter), wherein the preset adjustment coefficient of each amplification/attenuator is different, N is an integer greater than 1, and when the preset adjustment coefficient of each amplification/attenuator is greater than the preset coefficient, the amplification/attenuator is embodied as an amplification characteristic and is used for amplifying the first audio signal; when the preset adjusting coefficient of the amplification/attenuator is not greater than the preset coefficient, the amplification/attenuator is embodied as an attenuation characteristic and is used for attenuating the first audio signal;
each ADC is used for carrying out analog-to-digital conversion on the received second audio signal to obtain a path of third audio signal, and outputting the path of third audio signal to the signal selection module;
and the signal selection module is used for selecting the third audio signal with the minimum difference value between the statistical volume value and the preset threshold value from the N paths of received third audio signals and outputting the selected third audio signal.
9. The apparatus of claim 8, further comprising: a calculation module;
the calculation module is configured to obtain a preset adjustment coefficient of an ith amplification/attenuator in the N amplification/attenuators by applying the following formula, and output the preset adjustment coefficient to the ith amplification/attenuator:
Figure FDA0002206080350000031
wherein D isfin=min(Kamp_h-Kamp_l,Dmic-Dadc),Dmic=Dmic_h-Dmic_l,Dadc=Dadc_h-Dadc_l;Kamp(i) For indicating the preset adjustment factor, K, of the ith amplifier/attenuatoramp_lFor indicating the minimum adjustment factor, K, of the amplifier/attenuatoramp_hFor indicating the maximum adjustment coefficient of the amplifier/attenuator, Dmic_hFor indicating the maximum recordable volume value, D, of said microphonemic_lFor representing the microphoneMinimum recordable volume value, Dadc_hFor indicating the maximum volume value, D, convertible by the ADCadc_lFor representing the minimum volume value that the ADC can switch.
10. The apparatus of claim 8, wherein the ith amplifier/attenuator is configured to adjust the first audio signal according to a preset adjustment coefficient of the ith amplifier/attenuator by applying the following formula to obtain the ith second audio signal:
Figure FDA0002206080350000041
wherein, Auamp(i) For representing the ith second audio signal, Au for representing the first audio signal, Kamp(i) For indicating the preset adjustment factor of the ith amplifier/attenuator.
11. The apparatus of claim 8, wherein the signal selecting module is configured to sample each third audio signal, and determine the statistical volume value of the third audio signal according to the volume values of the plurality of sampling points.
12. The apparatus according to claim 11, wherein the signal selecting module is configured to take a maximum value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal; or, taking the average value of the volume values of the plurality of sampling points as the statistical volume value of the third audio signal.
13. The apparatus according to claim 8, wherein the signal selecting module is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold from the third audio signals with the statistical volume value not greater than the preset threshold if the N third audio signals include a third audio signal with a statistical volume value not greater than the preset threshold; alternatively, the first and second electrodes may be,
the signal selection module is further configured to select, if the statistical volume values of the N paths of third audio signals are all greater than the preset threshold, a third audio signal with a smallest difference value between the statistical volume value and the preset threshold from the N paths of third audio signals.
14. The apparatus according to claim 8, wherein the signal selecting module is configured to sort the N third audio signals according to a descending order of the statistical volume values; traversing the N paths of third audio signals according to the sequence, judging whether the statistical volume value of each path of third audio signal is not greater than the preset threshold value, and selecting the currently traversed third audio signal when the statistical volume value of the currently traversed third audio signal is not greater than the preset threshold value, or selecting the third audio signal with the minimum statistical volume value when the statistical volume values of the traversed N paths of third audio signals are all greater than the preset threshold value.
15. The apparatus of claim 8, wherein the signal selection module comprises: the device comprises a cache region, a selection unit and a switching unit;
the buffer area is used for buffering the received N paths of third audio signals;
the selecting unit is configured to select a third audio signal with a smallest difference between the statistical volume value and the preset threshold value from N paths of third audio signals cached in the cache region, and send a serial number of the selected third audio signal to the switching unit;
and the switching unit is used for outputting the corresponding third audio signal from the N paths of third audio signals cached in the cache region according to the serial number sent by the selecting unit.
16. Audio signal processing apparatus, characterized in that the audio signal processor comprises a processor and a memory, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, which is loaded and executed by the processor to implement the audio signal processing method according to any of claims 1-7.
17. A computer-readable storage medium storing at least one instruction thereon, the instruction being loaded and executed by a processor to implement the operations performed in the audio signal processing method according to any one of claims 1 to 7.
CN201610513548.5A 2016-07-01 2016-07-01 Audio signal processing method and device Active CN107566950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610513548.5A CN107566950B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610513548.5A CN107566950B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Publications (2)

Publication Number Publication Date
CN107566950A CN107566950A (en) 2018-01-09
CN107566950B true CN107566950B (en) 2020-02-04

Family

ID=60969580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610513548.5A Active CN107566950B (en) 2016-07-01 2016-07-01 Audio signal processing method and device

Country Status (1)

Country Link
CN (1) CN107566950B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108513212B (en) * 2018-02-12 2020-12-04 深圳易科声光科技股份有限公司 Method and device for switching audio channels in operation process
CN108446094B (en) * 2018-03-27 2021-04-13 北京小米移动软件有限公司 Audio acquisition circuit, terminal equipment, audio acquisition method and device
CN111145792B (en) * 2018-11-02 2022-06-14 北京微播视界科技有限公司 Audio processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079265A (en) * 2007-07-11 2007-11-28 北京中星微电子有限公司 Voice signal processing system
CN201336723Y (en) * 2008-12-12 2009-10-28 青岛海信电器股份有限公司 Audio-output device capable of automatically controlling volume
CN102711006A (en) * 2012-05-30 2012-10-03 蒋憧 Sound acquisition system
CN104066036A (en) * 2014-06-19 2014-09-24 华为技术有限公司 Pick-up device and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8687823B2 (en) * 2009-09-16 2014-04-01 Knowles Electronics, Llc. Microphone interface and method of operation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079265A (en) * 2007-07-11 2007-11-28 北京中星微电子有限公司 Voice signal processing system
CN201336723Y (en) * 2008-12-12 2009-10-28 青岛海信电器股份有限公司 Audio-output device capable of automatically controlling volume
CN102711006A (en) * 2012-05-30 2012-10-03 蒋憧 Sound acquisition system
CN104066036A (en) * 2014-06-19 2014-09-24 华为技术有限公司 Pick-up device and method

Also Published As

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

Similar Documents

Publication Publication Date Title
EP3163748B1 (en) Method, device and terminal for adjusting volume
RU2628473C2 (en) Method and device for sound signal optimisation
US10129161B2 (en) Method and apparatus for handling network jitter
KR20110002630A (en) Operation method for camera of portable device and apparatus using the same
CN113452836B (en) Method and device for controlling vibration of terminal
CN107566950B (en) Audio signal processing method and device
CN111128253B (en) Audio editing method and device
CN111883164B (en) Model training method and device, electronic equipment and storage medium
JP2021509963A (en) Multi-beam selection method and equipment
KR102475586B1 (en) Method and device for pickup volume control, and storage medium
CN106060707B (en) Reverberation processing method and device
CN111294711A (en) Signal processing method and device
CN106502623A (en) Audio output device and method
CN111988704B (en) Sound signal processing method, device and storage medium
CN107566952B (en) Audio signal processing method and device
CN107566951B (en) Audio signal processing method and device
CN115065921A (en) Method and device for preventing hearing aid from howling
WO2018090343A1 (en) Microphone, and method and device for audio processing
CN112637416A (en) Volume adjusting method and device and storage medium
CN112511686A (en) Recording method and earphone equipment
CN114442990A (en) Volume adjusting method and device and storage medium
CN111354356A (en) Voice data processing method and device
CN111524505A (en) Voice processing method and device and electronic equipment
CN111383648B (en) Echo cancellation method and device
KR20140117885A (en) Method for voice activity detection and communication device implementing the same

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