CN115623384A - Audio dynamic range control method and device, storage medium and audio equipment - Google Patents

Audio dynamic range control method and device, storage medium and audio equipment Download PDF

Info

Publication number
CN115623384A
CN115623384A CN202110788717.7A CN202110788717A CN115623384A CN 115623384 A CN115623384 A CN 115623384A CN 202110788717 A CN202110788717 A CN 202110788717A CN 115623384 A CN115623384 A CN 115623384A
Authority
CN
China
Prior art keywords
value
gain
gain parameter
audio
values
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.)
Pending
Application number
CN202110788717.7A
Other languages
Chinese (zh)
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.)
Zhuhai Jieli Technology Co Ltd
Original Assignee
Zhuhai Jieli Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Jieli Technology Co Ltd filed Critical Zhuhai Jieli Technology Co Ltd
Priority to CN202110788717.7A priority Critical patent/CN115623384A/en
Publication of CN115623384A publication Critical patent/CN115623384A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Control Of Amplification And Gain Control (AREA)

Abstract

The invention provides a method and a device for controlling audio dynamic range, a storage medium and audio equipment, wherein the method comprises the following steps: preprocessing linear domain sampling data of a current sampling point in the audio to be processed, wherein the preprocessing comprises absolute value solving processing; comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value; if the preprocessed data is smaller than the first threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a first gain parameter, if the preprocessed data is between the first threshold and a second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a second gain parameter, and if the preprocessed data is larger than the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a third gain parameter. The invention is beneficial to reducing the complexity of DRC realization.

Description

Audio dynamic range control method and device, storage medium and audio equipment
Technical Field
The present invention relates to the field of audio technologies, and in particular, to a method and an apparatus for controlling an audio dynamic range, a storage medium, and an audio device.
Background
The ratio of the maximum loudness that a human can tolerate to the quietest loudness that can be perceived is up to 1000000. However, due to the characteristic limitations of electronic devices such as a sound amplification system and a sound recording system, the dynamic range of sound reproduction or voice recording is much smaller than that of human ears, which results in: small effective sound signals are buried in noise and cannot be heard, large effective sounds are clipped, and a large number of harmonics are generated after the signals are clipped, thereby easily damaging speaker units (especially tweeters). In order to solve the above problems, the audio signal is mainly processed by a Dynamic Range Control (DRC) technique, which is to map the Dynamic Range of the input audio signal to a specific Dynamic Range, so that a quiet small signal can be made louder, a high-amplitude spike signal can be made smaller, and no signal clipping is generated, thereby protecting a speaker, a power amplifier, and the like from being impacted and damaged.
The conventional DRC scheme is shown in fig. 1, in which the gain is calculated in the dB domain, and the original signal needs to be converted from the linear domain to the dB domain, i.e. there is x dB =20 log10 (x), after the gain calculation, the calculated gain needs to be converted from dB domain to linear domain, i.e. g exists linear =10^(g m And/20), in the above process, although the cost of performing gain calculation, gain smoothing and gain compensation in the dB domain is small, the complexity of hardware implementation is large when performing conversion between the linear domain and the dB domain, on the other hand, when performing gain calculation and compensation, the energy calculation of the signal usually needs to use Fast Fourier Transform (FFT) and Root Mean Square (RMS) algorithm, i.e. when performing hardware implementation, addition, multiplication, division and evolution need to be called, while two calculator units, namely multiplier and divider, need large hardware implementation cost, and when performing evolution algorithm, usually use look-up table (LUT), which occupies relatively large storage resources.
Disclosure of Invention
Based on the above situation, the present invention is directed to providing a method and an apparatus for controlling an audio dynamic range, a storage medium, and an audio device, which are beneficial to reducing implementation complexity.
In order to achieve the above object, the technical solution of the present invention provides an audio dynamic range control method, including:
preprocessing linear domain sampling data of a current sampling point in audio to be processed, wherein the preprocessing comprises the step of solving an absolute value of the linear domain sampling data of the current sampling point;
comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
if the preprocessed data is smaller than the first threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a first gain parameter, if the preprocessed data is between the first threshold and the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a second gain parameter, and if the preprocessed data is larger than the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a third gain parameter; the gain processing comprises multiplying the value of the corresponding gain parameter by the current sampling data to control the audio dynamic range.
Further, the value of the first gain parameter, the value of the second gain parameter, and the value of the third gain parameter are fixed values, the value of the second gain parameter is greater than the value of the third gain parameter, and the value of the third gain parameter is a positive number less than 1.
Further, the values of the second gain parameter and the third gain parameter are variable values, and if the preprocessed data is larger than the second threshold, the method further includes:
if the values of the second gain parameter and the third gain parameter are both default first values, when the positive and negative opposite of the sampling data of two adjacent sampling points in the audio to be processed is detected, updating the values of the second gain parameter and the third gain parameter from the first values to second values, so as to perform gain processing on linear domain sampling data of the sampling points of which the preprocessing data are not less than the first threshold value from zero-crossing points in the audio to be processed by adopting the second values, wherein the first values are greater than the second values, and the second values are positive numbers less than 1.
Further, if the data obtained by preprocessing the current sampling point is greater than the second threshold, the method includes:
setting the current value of a state parameter as a preset state value to record the event that the preprocessed data of the current sampling point subjected to preprocessing is larger than the second threshold value;
if the values of the second gain parameter and the third gain parameter are both default first values, updating the values of the second gain parameter and the third gain parameter from the first values to the second values when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current values of the state parameters are the preset state values.
Further, the preprocessing the linear domain sampling data of the current sampling point in the audio to be processed includes:
and after the linear domain sampling data of the current sampling point is subjected to absolute value solving, filtering and smoothing are performed on the data obtained by the absolute value solving.
Further, the value of the first gain parameter is 0.
Further, the value of the first gain parameter is greater than 1.
In order to achieve the above object, the present invention further provides an audio dynamic range control apparatus, including:
the device comprises a preprocessing module, a processing module and a processing module, wherein the preprocessing module is used for preprocessing the linear domain sampling data of a current sampling point in the audio to be processed, and the preprocessing comprises the absolute value solving processing of the linear domain sampling data of the current sampling point;
the comparison processing module is used for comparing the preprocessed data of the current sampling point obtained through the preprocessing with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
a first gain processing module, configured to perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a first gain parameter if the preprocessed data is smaller than the first threshold, perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a second gain parameter if the preprocessed data is between the first threshold and the second threshold, and perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a third gain parameter if the preprocessed data is greater than the second threshold; wherein the gain processing comprises multiplying the value of the corresponding gain parameter with the current sample data to control the audio dynamic range.
Further, the value of the first gain parameter, the value of the second gain parameter, and the value of the third gain parameter are fixed values, the value of the second gain parameter is greater than the value of the third gain parameter, and the value of the third gain parameter is a positive number less than 1.
Further, the value of the second gain parameter and the value of the third gain parameter are variable values, and the apparatus further includes:
and if the preprocessed data is larger than the second threshold value and the values of the second gain parameter and the third gain parameter are both default first values, when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are positive and negative, updating the values of the second gain parameter and the third gain parameter from the first values to second values, so as to perform gain processing on linear domain sampled data of sampling points, of which the preprocessed data is not smaller than the first threshold value, starting from a zero-crossing point position in the audio to be processed by using the second values, wherein the first values are larger than the second values, and the second values are positive numbers smaller than 1.
Further, the second gain processing module comprises:
the recording unit is used for enabling the current value of a state parameter to be a preset state value so as to record an event that the preprocessed data of the current sampling point, which is obtained through preprocessing, is larger than the second threshold value;
and the updating unit is used for updating the values of the second gain parameter and the third gain parameter from the first value to the second value when the conditions that the sampling data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current value of the state parameter is the preset state value are detected if the values of the second gain parameter and the third gain parameter are both the default first values.
Further, the preprocessing module includes:
the absolute value processing unit is used for solving the absolute value of the linear domain sampling data of the current sampling point;
and the filtering and smoothing processing unit is used for carrying out filtering and smoothing processing on the data obtained by the absolute value calculation processing.
In order to achieve the above object, the present invention further provides an audio dynamic range control apparatus, which includes a processor and a memory coupled to the processor, wherein the memory stores instructions for the processor to execute, and when the processor executes the instructions, the audio dynamic range control method can be implemented.
In order to achieve the above object, the present invention further provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the above audio dynamic range control method.
In order to achieve the above object, the present invention further provides an audio device, including the above audio dynamic range control apparatus.
Further, the audio device is a bluetooth headset.
The audio dynamic range control method provided by the invention can achieve the effect similar to the RMS algorithm in the prior art by carrying out the absolute value (ABS) processing on the sampling data of the audio to be processed, and the realization of the absolute value is simpler (usually only one comparator is needed), furthermore, after the RMS calculation mode is replaced by the ABS calculation mode, the relative calculation advantages after the linear domain is converted into the dB domain are not so significant, therefore, the audio dynamic range control method can directly carry out the gain calculation in the linear domain, and does not need to convert the audio signal from the linear domain into the dB domain, thereby greatly reducing the realization complexity and the hardware resource consumption during the hardware realization.
Drawings
Preferred embodiments according to the present application will be described below with reference to the accompanying drawings. In the figure:
FIG. 1 is a schematic representation of a DRC according to the prior art;
FIG. 2 is a flowchart of an audio dynamic range control method according to an embodiment of the present invention;
FIGS. 3 and 4 are schematic diagrams of DRC static target curves provided by the present invention;
FIG. 5 is a graphical illustration of a DRC static target curve according to the prior art;
FIG. 6 is a flowchart of a method for controlling audio dynamic range according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an audio amplitude waveform provided by the present invention;
fig. 8 is a schematic diagram of a bluetooth headset according to an embodiment of the present invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth in order to avoid obscuring the nature of the present invention, well-known methods, procedures, and components have not been described in detail.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
It should be noted that step numbers (letter or number numbers) are used to refer to some specific method steps in the present invention only for the purpose of convenience and brevity of description, and the order of the method steps is not limited by letters or numbers in any way. It will be clear to a person skilled in the art that the order of the steps of the method in question, as determined by the technology itself, should not be unduly limited by the presence of step numbers.
Referring to fig. 2, fig. 2 is a flowchart of an audio dynamic range control method provided in an embodiment of the present invention, where the method includes:
step S110: preprocessing linear domain sampling data of a current sampling point in audio to be processed, wherein the preprocessing comprises the step of solving an absolute value (ABS) of the linear domain sampling data of the current sampling point;
when ABS is realized in detail, the ABS is simple, only one comparator is needed, namely whether the sign bit of the sampled data is 1 or not is judged, and if the sign bit of the sampled data is 1, the opposite value is 0; if the value is 0, the original value is reserved; compared with the existing RMS solving mode, the method can greatly simplify the specific implementation;
step S120: comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
step S130: if the preprocessed data is smaller than the first threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a first gain parameter, if the preprocessed data is between the first threshold and the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a second gain parameter, and if the preprocessed data is larger than the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a third gain parameter; wherein the gain processing comprises multiplying the value of the corresponding gain parameter with the current sample data to control the audio dynamic range.
In this embodiment, the values of the first GAIN parameter, the second GAIN parameter, and the third GAIN parameter are fixed values, the value of the second GAIN parameter is greater than the value of the third GAIN parameter, and the value of the third GAIN parameter is a positive number smaller than 1, for example, the value of the first GAIN parameter is L _ GAIN, the value of the second GAIN parameter is NOR _ GAIN, the value of the third GAIN parameter is H _ GAIN, the first threshold is L _ THR, and the second threshold is H _ THR.
The audio dynamic range control method provided by the embodiment of the invention can achieve the effect similar to the RMS algorithm of the existing mode by carrying out the absolute value (ABS) processing on the sampling data of the audio to be processed, and the hardware realization of the absolute value is simpler (generally only one comparator is needed for realization), furthermore, after the RMS calculation mode is replaced by the ABS calculation mode, the relative calculation advantage after the linear domain is converted into the dB domain is not so significant, therefore, the audio dynamic range control method can directly carry out the gain calculation in the linear domain, and does not need to convert the audio signal from the linear domain into the dB domain, thereby greatly reducing the realization complexity and the hardware resource consumption when the hardware is realized.
The invention is inspired from the basic principle of RMS calculation, selects the method of ABS calculation to replace the traditional method of RMS calculation to indirectly obtain the energy (or power) information of MIC signals, omits a large-bit-width multiplier, a divider and an LUT (hardware operation for realizing evolution) which are needed when the traditional DRC hardware realizes RMS, and only needs one comparator (namely, whether the sign bit is 1 is judged, if the sign bit is 1, the opposite value is 0, if the sign bit is 0, the original value is 0, and other bits are kept unchanged) to complete ABS operation.
For example, in an embodiment, L _ GAIN is greater than 1, H _gainis a positive number less than 1, NOR _ GAIN is greater than H _ GAIN, so that amplification of a small signal can be achieved, and the method is suitable for some audio recording application scenarios with small energy, where L _ THR can be set to a required range (generally 200 or more and less than several thousand), and then L _ GAIN is set to a corresponding appropriate GAIN (if data 1024 represents normalized 1 (GAIN value is 1), the data of the GAIN value can be set to be greater than 1024), and the small signal is amplified, and the DRC static target curve achieved by the method is shown in fig. 3, it can be understood that, in this embodiment, if the preprocessed data is less than the first threshold L _ THR, the GAIN processing includes multiplying the value L _ GAIN of the first GAIN parameter by the linear domain sampling data of the current sampling point, and the obtained result is a dynamic range control result; if the preprocessed data is between the first threshold value L _ THR and the second threshold value H _ THR, the GAIN processing includes multiplying the value NOR _ GAIN of the second GAIN parameter by the linear domain sampling data of the current sampling point, and then performing signal compensation of L _ THR (L _ GAIN-NOR _ GAIN) on the result of the multiplication (i.e., adding the result of the multiplication to L _ THR (L _ GAIN-NOR _ GAIN)), and the obtained result is a dynamic range control result; if the preprocessed data is larger than the second threshold value H _ THR, the GAIN processing includes multiplying the value H _ GAIN of the third GAIN parameter by the linear domain sampling data of the current sampling point, and then performing signal compensation (i.e., adding the two) of L _ THR × L _ GAIN + NOR _ GAIN (H _ THR-L _ THR) -H _ GAIN × H _ THR on the result of the multiplication, wherein the obtained result is a dynamic range control result;
for example, in another embodiment, L _ GAIN is 0, h _gainis a positive number less than 1, NOR _ GAIN is 1, so that a noise gate or expander can be implemented to use, so that the above-mentioned audio dynamic range control method can be applied to an audio denoising application scenario, and can be applied in an ANC (active noise reduction) system, where the implemented DRC static target curve is as shown in fig. 4, it can be understood that, in this embodiment, if the preprocessed data is less than the first threshold L _ THR, the GAIN processing includes multiplying the value L _ GAIN of the first GAIN parameter by the linear domain sampling data of the current sampling point, and the obtained result is a dynamic range control result; if the preprocessed data is between the first threshold value L _ THR and the second threshold value H _ THR, the GAIN processing comprises multiplying the value NOR _ GAIN of the second GAIN parameter by the linear domain sampling data of the current sampling point to obtain a dynamic range control result; if the preprocessed data is larger than the second threshold value H _ THR, the GAIN processing comprises multiplying the value H _ GAIN of the third GAIN parameter by the linear domain sampling data of the current sampling point, and then performing signal compensation (namely adding the value H _ THR and the value NOR _ GAIN-H _ GAIN) on the result of the multiplication, wherein the obtained result is a dynamic range control result;
referring to fig. 5, in the conventional DRC scheme, it is common to perform five-segment sub-band dynamic range control, which divides a complete audio input dynamic range into five segments, namely, a Noise Gate (Noise Gate), an Expander (Expander), a Follower (Follower), a Compressor (Compressor), and a Limiter (Limiter), and then compares the amplitude (peak value peak) or energy (root-mean-square RMS algorithm) of an input signal with thresholds of each sub-band to automatically divide the input signal into corresponding sub-band interval ranges for closing, expanding, compressing, or limiting, where the number of sub-bands in this manner is too large, and the processing complexity of the input dynamic range is large, resulting in large hardware resource consumption;
the audio dynamic range control method of the embodiment of the present invention can realize the integration and simplification of subbands, and can solve the problem of High complexity of arithmetic processing caused by excessive subband numbers in the conventional DRC, in which the technical scheme of the present invention simplifies the conventional five-segment subband intervals into three-segment subband intervals, and the five-segment subband intervals are respectively marked as Low Gain intervals (LGA), normal Gain intervals (Normal Gain Area, NGA) and High Gain intervals (High Gain Area, HGA) in the order from small to large in the amplitude of input signals, the Gain values of the corresponding intervals are respectively marked as L _ Gain, NOR _ Gain and H _ Gain, and the Threshold values of the interval boundaries are respectively marked as Low Gain thresholds (L _ THR, i.e. the first Threshold), and High Gain thresholds (High Gain Threshold, H _ THR, i.e. the second Threshold);
the gain value and the threshold value of the three sections of sub-band intervals can be independently and freely adjusted;
for example, for the low GAIN section in the present invention, it can be used as a noise gate or an expander according to different application occasions, for example, when it is applied to an ANC system, L _ THR can be set to about 0-200 (a specific value can be set according to the actual background noise range of MIC at the time of test), L _ GAIN is set to 0, and this time, it is used as a noise gate, and the output of the digital signal below 200 is 0 after its GAIN processing;
for example, in fig. 4, NOR _ GAIN =1, which indicates that the input MIC signal is directly output without any processing in the normal GAIN range; h _ GAIN is greater than 0 and less than 1, i.e., in the high GAIN region, for input audio (e.g., MIC signals) greater than H _ THR, compression and clipping processing is performed so that clipping does not occur.
In another embodiment provided by the present invention, the value of the second gain parameter is the same as the value of the third gain parameter and is a variable value;
referring to fig. 6, fig. 6 is a flowchart of an audio dynamic range control method according to an embodiment of the present invention, where the audio dynamic range control method includes:
step 210: preprocessing linear domain sampling data of a current sampling point in audio to be processed, wherein the preprocessing comprises the step of carrying out absolute value (ABS) processing on the linear domain sampling data of the current sampling point
When ABS is realized in detail, the ABS is simple, only one comparator is needed, namely whether the sign bit of the sampled data is 1 or not is judged, and if the sign bit of the sampled data is 1, the opposite value is 0; if the value is 0, the original value is reserved as 0; compared with the existing RMS solving mode, the method can greatly simplify the specific implementation;
step 220: comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold and a second threshold, wherein the first threshold is smaller than the second threshold, if the first threshold is smaller than the second threshold, executing step 230, if the first threshold is between the first threshold and the second threshold, executing step 240, and if the first threshold is not smaller than the second threshold, executing step 250;
step 230: performing gain processing on the linear domain sampling data of the current sampling point in the audio to be processed by adopting a first gain parameter, wherein the gain processing is to perform multiplication operation on the linear domain sampling data of the current sampling point and the value of the first gain parameter, and the obtained result is a dynamic range control result;
for example, the value of the first GAIN parameter is a fixed value L _ GAIN;
step 240: performing gain processing on the linear domain sampling data of the current sampling point in the audio to be processed by adopting a second gain parameter, wherein the gain processing is to perform multiplication operation on the linear domain sampling data of the current sampling point and the value of the second gain parameter, and the obtained result is a dynamic range control result;
step 250: performing gain processing on the linear domain sampling data of the current sampling point in the audio to be processed by using a third gain parameter, wherein the gain processing is to perform multiplication operation on the linear domain sampling data of the current sampling point and the value of the third gain parameter to obtain a dynamic range control result, and then executing step 260;
the second GAIN parameter and the third GAIN parameter have the same value, and are both the first value NOR _ GAIN under the default condition;
the second gain parameter and the third gain parameter may be the same parameter or different parameters;
step 260: if the values of the second GAIN parameter and the third GAIN parameter are both the default first value NOR _ GAIN, when it is detected that the positive and negative of the sampling data of two adjacent sampling points in the audio to be processed are opposite, the values of the second GAIN parameter and the third GAIN parameter are updated to a second value H _ GAIN from the first value NOR _ GAIN, and if the values of the second GAIN parameter and the third GAIN parameter are updated to a second value H _ GAIN, the values can be kept unchanged, wherein the first value NOR _ GAIN is greater than the second value H _ GAIN, and the second value H _ GAIN is a positive number less than 1.
The audio dynamic range control method of the present invention includes preprocessing a current sampling point in an audio to be processed, then comparing the preprocessed data with a first threshold and a second threshold, if the preprocessed data are smaller than the first threshold, performing GAIN processing on the current sampling point by using a first GAIN parameter, if the preprocessed data are not smaller than the first threshold, performing GAIN processing on the current sampling point by using a second GAIN parameter and a third GAIN parameter, wherein default values of the second GAIN parameter and the third GAIN parameter are a first value NOR _ GAIN, and when the default values are the first value NOR _ GAIN, the method of the present invention determines whether the preprocessed data of the current sampling point need to be updated to a second value H _ GAIN according to a comparison result between the preprocessed data of the current sampling point and the second threshold, and if the preprocessed data are determined to be updated to the second value H _ GAIN, then, performing an operation of updating to the second value H _ GAIN when a next zero-crossing point position in the audio to be processed is detected, and then keeping the second value H _ GAIN after the preprocessing of each sampling point, and performing GAIN processing on each sampling point by using the first value H _ GAIN;
the audio dynamic range control method provided by the embodiment of the invention can achieve the effect similar to the RMS algorithm of the existing mode by carrying out the absolute value (ABS) processing on the sampling data of the audio to be processed, and the specific implementation of the absolute value is simpler (usually only one comparator is needed), further, after the RMS mode is replaced by the ABS mode, the relative calculation advantage after the linear domain is converted into the dB domain is not so great, therefore, the audio dynamic range control method can directly carry out the gain calculation in the linear domain, and does not need to convert the audio signal from the linear domain into the dB domain, so that the complexity and the hardware resource consumption can be greatly reduced during the hardware implementation, and meanwhile, by detecting the zero-crossing point position of the audio, when a sampling point with larger energy in the audio is detected, the gain value is updated at the later zero-crossing point position, so that the nonlinearity of the output signal can be greatly improved, the discomfort on the listening feeling can be eliminated, and the audio quality can be effectively improved.
In the present invention, the first threshold, the second threshold, L _ GAIN, NOR _ GAIN, and H _ GAIN may be set as required by a specific application scenario, for example, NOR _ GAIN is 1 (i.e., the signal amplitude does not change after the GAIN), H _ GAIN is a positive number smaller than 1 (i.e., the signal amplitude becomes smaller after the GAIN, so as to achieve signal expansion and compression), see fig. 7 (where the abscissa is time and the ordinate is the signal amplitude), where curve b is updated to H _ GAIN at a non-zero-crossing point position, and curve c is updated to H _ GAIN at a zero-crossing point position, it is obvious that compared with curve b, the waveform of curve c can naturally transition to appear smooth, so that the audio is more comfortable in listening feeling.
In this embodiment of the present invention, the preprocessing in step 210 may only include processing for obtaining an absolute value;
preferably, in another embodiment, step 210 of the audio dynamic range control method of the present invention may specifically include:
and after the absolute value of the linear domain sampling data of the current sampling point is solved, filtering and smoothing are carried out on the data obtained by solving the absolute value, wherein the data obtained by solving the absolute value can be filtered and smoothed through a low-pass filter, the filter is a first-order IIR filter with adjustable cut-off frequency, and through the filter, on one hand, the data can be smoothed, and on the other hand, uninteresting signal components outside a high-frequency band can be filtered.
For example, in an embodiment of the present invention, to implement step 260, the method provided by the present invention may specifically include:
step 261: setting a current value of a state parameter as a preset state value to record an event that the preprocessed data of the current sampling point obtained through the preprocessing is larger than the second threshold value, for example, the event may be recorded through a D trigger, a default storage value of the D trigger is 0, which indicates that the event that the data of the current sampling point obtained through the preprocessing is larger than the second threshold value does not occur, and when it is detected that the data of the current sampling point obtained through the preprocessing is larger than the second threshold value, the storage value of the D trigger may be updated to 1 and then maintained to 1;
step 262: if the values of the second GAIN parameter and the third GAIN parameter are both default first values, when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current values of the state parameters are the preset state values, the values of the second GAIN parameter and the third GAIN parameter are updated from the first values to the second values, for example, when the stored value of the D flip-flop is 1, when a zero-crossing point position is detected (i.e., when the sampled data of two adjacent sampling points are opposite in positive and negative), the values of the second GAIN parameter and the third GAIN parameter are updated from the first values NOR _ GAIN to the second values H _ GAIN.
For example, in the above embodiment of the present invention, L _ GAIN is greater than 1, the first value NOR _ GAIN is 1, and the second value H _ GAIN is a positive number less than 1, so that amplification of a smaller signal can be achieved, and the method is suitable for a recording application scenario of a signal with smaller energy.
For example, in the above embodiment of the present invention, L _ GAIN is 0, the first value NOR _ GAIN is 1, and the second value H _ GAIN is a positive number less than 1, so that the noise gate or expander can be implemented for use in an audio denoising application scenario, which can be applied in an ANC system.
An embodiment of the present invention further provides an audio dynamic range control device, where the audio dynamic range control device includes:
the device comprises a preprocessing module, a processing module and a processing module, wherein the preprocessing module is used for preprocessing the linear domain sampling data of a current sampling point in the audio to be processed, and the preprocessing comprises the absolute value solving processing of the linear domain sampling data of the current sampling point;
the comparison processing module is used for comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
a first gain processing module, configured to perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a first gain parameter if the preprocessed data is smaller than the first threshold, perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a second gain parameter if the preprocessed data is between the first threshold and the second threshold, and perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a third gain parameter if the preprocessed data is greater than the second threshold; the gain processing comprises multiplying the value of the corresponding gain parameter by the current sampling data to control the audio dynamic range.
Preferably, in an embodiment, the values of the first gain parameter, the second gain parameter, and the third gain parameter are fixed values, the value of the second gain parameter is greater than the value of the third gain parameter, and the value of the third gain parameter is a positive number less than 1.
Preferably, in another embodiment, the values of the second gain parameter and the third gain parameter are variable values, the apparatus further comprising:
and if the preprocessed data are larger than the second threshold and the values of the second gain parameter and the third gain parameter are both default first values, when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are opposite, updating the values of the second gain parameter and the third gain parameter from the first values to second values, so as to perform gain processing on linear domain sampled data of the sampling points of which the preprocessed data are not smaller than the first threshold from zero-crossing points in the audio to be processed by adopting the second values, wherein the first values are larger than the second values, and the second values are positive numbers smaller than 1.
Preferably, in another embodiment, the second gain processing module includes:
the recording unit is used for setting the current value of a state parameter as a preset state value so as to record an event that the preprocessed data of the current sampling point subjected to the preprocessing is larger than the second threshold value;
and the updating unit is used for updating the values of the second gain parameter and the third gain parameter from the first value to the second value when the conditions that the sampling data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current value of the state parameter is the preset state value are detected if the values of the second gain parameter and the third gain parameter are both the default first values.
Preferably, in another embodiment, the preprocessing module includes:
the absolute value processing unit is used for solving the absolute value of the linear domain sampling data of the current sampling point;
and the filtering and smoothing processing unit is used for carrying out filtering and smoothing processing on the data obtained by the absolute value calculation processing.
The embodiment of the present invention further provides an audio dynamic range control device, which includes a processor and a memory coupled to the processor, wherein the memory stores instructions for the processor to execute, and when the processor executes the instructions, the audio dynamic range control device can implement the audio dynamic range control method of the present invention.
An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the above-mentioned audio dynamic range control method according to the present invention.
The embodiment of the invention also provides audio equipment which comprises the audio dynamic range control device.
For example, the audio device may be a bluetooth headset. Referring to fig. 8, the bluetooth headset includes a reference microphone 10, an error microphone 20, an active noise reduction module 40, a speaker 30, and the above-mentioned audio dynamic range control device 50, where audio collected by the reference microphone 10 and/or the error microphone 20 is subjected to audio dynamic range processing by the audio dynamic range control device 50, and a processed signal is input to the active noise reduction module 40, where L _ GAIN may be 0.
For example, in some current bluetooth headsets with active noise reduction function, a Reference Microphone (Reference Microphone, ref-mic) collects external ambient noise, an Error Microphone (Error Microphone, error-mic) collects sound played by an internal headset speaker, the sound is processed by an Analog-to-Digital Converter (ADC) and a down-sampling Filter (DSF) to obtain 16-bit PCM audio data, and then the data is sent to an ANC system for adaptive filtering processing, and finally the data is converted by a Digital-to-Analog Converter (DAC) and played by a speaker.
In an actual earphone using scene, due to the random, variable and complex environmental noise, the limitation of the hardware characteristic of the loudspeaker itself, or the divergence of the adaptive algorithm of the ANC system, the sound played by the loudspeaker is distorted, mixed and even howling. Although the conventional DRC can alleviate or solve the noise and howling problems in most cases, the hardware cost is high due to the fact that the number of subband levels is large, the algorithm is complex (processing needs to be performed in a dB domain, and the required processing clock frequency is high), and the like. In addition, for some rapidly changing external noises, after conventional DRC processing, ANC processing, and finally playing out at the speaker end of the earphone, the noises are heard harsher, distorted or mixed with a sound similar to the fast paragraph feeling of "when … …" in the middle, which makes the ears extremely uncomfortable.
The audio dynamic range control device provided by the embodiment of the invention can reduce the traditional DRC hardware cost and the algorithm complexity problem of linear domain and dB domain conversion, simultaneously improve the processing capacity, save a module for converting the linear domain into the dB domain and a module for converting the dB domain into the linear domain, and effectively reduce the calculation complexity and the hardware realization difficulty by the saved modules; meanwhile, the number of stages of sub-band processing is reduced, the conversion efficiency of the audio DRC device is improved, and the gain is updated at the zero crossing point of the audio signal, so that the problems of unnatural connection, sudden waveform change, tone scale and noise and the like of the input signal which changes rapidly after the DRC processing can be avoided, and the audio quality of the Bluetooth headset can be effectively improved.
It will be appreciated by those skilled in the art that the above-described preferred embodiments may be freely combined, superimposed, without conflict.
It will be understood that the embodiments described above are illustrative only and not restrictive, and that various obvious or equivalent modifications and substitutions for details shown and described herein may be made by those skilled in the art without departing from the basic principles of the present invention.

Claims (16)

1. A method for audio dynamic range control, comprising:
preprocessing linear domain sampling data of a current sampling point in audio to be processed, wherein the preprocessing comprises the step of solving an absolute value of the linear domain sampling data of the current sampling point;
comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
if the preprocessed data is smaller than the first threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a first gain parameter, if the preprocessed data is between the first threshold and the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a second gain parameter, and if the preprocessed data is larger than the second threshold, performing gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by adopting a third gain parameter; the gain processing comprises multiplying the value of the corresponding gain parameter by the current sampling data to control the audio dynamic range.
2. The method of claim 1, wherein the value of the first gain parameter, the value of the second gain parameter, and the value of the third gain parameter are fixed values, and wherein the value of the second gain parameter is greater than the value of the third gain parameter, and wherein the value of the third gain parameter is a positive number less than 1.
3. The method of claim 1, wherein the values of the second gain parameter and the third gain parameter are variable values, and wherein if the pre-processed data is greater than the second threshold value, the method further comprises:
if the values of the second gain parameter and the third gain parameter are both default first values, when the positive and negative opposite of the sampling data of two adjacent sampling points in the audio to be processed is detected, updating the values of the second gain parameter and the third gain parameter from the first values to second values, so as to perform gain processing on linear domain sampling data of the sampling points of which the preprocessing data are not less than the first threshold value from zero-crossing points in the audio to be processed by adopting the second values, wherein the first values are greater than the second values, and the second values are positive numbers less than 1.
4. The method of claim 3, wherein if the data obtained by the preprocessing of the current sample point is greater than the second threshold, the method comprises:
setting the current value of a state parameter as a preset state value so as to record an event that the preprocessed data of the current sampling point subjected to preprocessing is larger than the second threshold value;
if the values of the second gain parameter and the third gain parameter are both default first values, updating the values of the second gain parameter and the third gain parameter from the first values to the second values when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current values of the state parameters are the preset state values.
5. The method according to claim 3 or 4, wherein the preprocessing of the linear domain sample data of the current sample point in the audio to be processed comprises:
and after the absolute value of the linear domain sampling data of the current sampling point is calculated, filtering and smoothing the data obtained by calculating the absolute value.
6. The method according to any of claims 1-5, wherein the value of the first gain parameter is 0.
7. The method according to any of claims 1-5, wherein the value of the first gain parameter is greater than 1.
8. An audio dynamic range control apparatus, comprising:
the device comprises a preprocessing module, a processing module and a processing module, wherein the preprocessing module is used for preprocessing the linear domain sampling data of a current sampling point in the audio to be processed, and the preprocessing comprises the absolute value solving processing of the linear domain sampling data of the current sampling point;
the comparison processing module is used for comparing the preprocessed data obtained by preprocessing the current sampling point with a first threshold value and a second threshold value, wherein the first threshold value is smaller than the second threshold value;
a first gain processing module, configured to perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a first gain parameter if the preprocessed data is smaller than the first threshold, perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a second gain parameter if the preprocessed data is between the first threshold and the second threshold, and perform gain processing on the linear domain sampled data of the current sampling point in the audio to be processed by using a third gain parameter if the preprocessed data is greater than the second threshold; the gain processing comprises multiplying the value of the corresponding gain parameter by the current sampling data to control the audio dynamic range.
9. The apparatus of claim 8, wherein the value of the first gain parameter, the value of the second gain parameter, and the value of the third gain parameter are fixed values, and wherein the value of the second gain parameter is greater than the value of the third gain parameter, and wherein the value of the third gain parameter is a positive number less than 1.
10. The apparatus of claim 8, wherein the value of the second gain parameter and the value of the third gain parameter are variable values, the apparatus further comprising:
and if the preprocessed data is larger than the second threshold value and the values of the second gain parameter and the third gain parameter are both default first values, when it is detected that the sampled data of two adjacent sampling points in the audio to be processed are positive and negative, updating the values of the second gain parameter and the third gain parameter from the first values to second values, so as to perform gain processing on linear domain sampled data of sampling points, of which the preprocessed data is not smaller than the first threshold value, starting from a zero-crossing point position in the audio to be processed by using the second values, wherein the first values are larger than the second values, and the second values are positive numbers smaller than 1.
11. The apparatus of claim 10, wherein the second gain processing module comprises:
the recording unit is used for enabling the current value of a state parameter to be a preset state value so as to record an event that the preprocessed data of the current sampling point, which is obtained through preprocessing, is larger than the second threshold value;
and the updating unit is used for updating the values of the second gain parameter and the third gain parameter from the first value to the second value when the conditions that the sample data of two adjacent sampling points in the audio to be processed are opposite in positive and negative and the current value of the state parameter is the preset state value are detected if the values of the second gain parameter and the third gain parameter are both the default first values.
12. The apparatus of claim 10 or 11, wherein the pre-processing module comprises:
the absolute value processing unit is used for solving the absolute value of the linear domain sampling data of the current sampling point;
and the filtering and smoothing processing unit is used for carrying out filtering and smoothing processing on the data obtained by the absolute value calculation processing.
13. An audio dynamic range control device comprising a processor, a memory coupled to the processor, wherein the memory has stored therein instructions for execution by the processor, wherein the instructions when executed by the processor enable the method of any one of claims 1-7 to be performed.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
15. Audio device, characterized in that it comprises an audio dynamic range control apparatus according to any of claims 8-13.
16. The audio device of claim 15, wherein the audio device is a bluetooth headset.
CN202110788717.7A 2021-07-13 2021-07-13 Audio dynamic range control method and device, storage medium and audio equipment Pending CN115623384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110788717.7A CN115623384A (en) 2021-07-13 2021-07-13 Audio dynamic range control method and device, storage medium and audio equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110788717.7A CN115623384A (en) 2021-07-13 2021-07-13 Audio dynamic range control method and device, storage medium and audio equipment

Publications (1)

Publication Number Publication Date
CN115623384A true CN115623384A (en) 2023-01-17

Family

ID=84854818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110788717.7A Pending CN115623384A (en) 2021-07-13 2021-07-13 Audio dynamic range control method and device, storage medium and audio equipment

Country Status (1)

Country Link
CN (1) CN115623384A (en)

Similar Documents

Publication Publication Date Title
US10299040B2 (en) System for increasing perceived loudness of speakers
EP2465200B1 (en) System for increasing perceived loudness of speakers
EP2695394B1 (en) Integrated psychoacoustic bass enhancement (pbe) for improved audio
JP2004214843A (en) Digital amplifier and gain adjustment method thereof
EP1709734A1 (en) System for audio signal processing
CN103152668A (en) Adjusting method of output audio and system thereof
US10380989B1 (en) Methods and apparatus for processing stereophonic audio content
KR101855969B1 (en) A digital compressor for compressing an audio signal
KR20120064105A (en) System for adaptive voice intelligibility processing
WO2016059878A1 (en) Signal processing device, signal processing method, and computer program
EP3691124B1 (en) Audio system and method for controlling same
CN102576560B (en) electronic audio device
CN115623384A (en) Audio dynamic range control method and device, storage medium and audio equipment
CN116405822A (en) Bass enhancement system and method applied to open Bluetooth headset
CN115623385A (en) Audio dynamic range control circuit and audio equipment
CN112153533B (en) Method and device for eliminating sound breaking of audio signal, storage medium and terminal
CN113194388B (en) Signal processing method, device, equipment, medium and chip system
JP5535428B2 (en) Audio signal output method, speaker system, portable device, and computer program
CN115914971A (en) Wind noise detection method and device, earphone and storage medium
CN118018935A (en) Wide dynamic range compression optimization method, device and computer readable storage medium
Chen et al. Research and Optimization of Multichannel Wide Dynamic Compression Algorithm in Hearing Aids
CN117789735A (en) Voice wide dynamic range compression method, device, equipment and storage medium
CN115202605A (en) Audio processing method and device, terminal equipment and storage medium
CN109862470A (en) To method, earphone and its computer readable storage medium of otopathy patient broadcast
CN116778949A (en) Personalized loudness compensation method, device, computer equipment and storage medium

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