METHOD AND CIRCUIT FOR DYNAMIC RANGE CONTROL BASED ON PEAK LEVEL AND RMS LEVEL DOUBLE-LEVEL DETECTION
20240396513 ยท 2024-11-28
Assignee
Inventors
Cpc classification
H03G5/165
ELECTRICITY
H03G7/002
ELECTRICITY
International classification
Abstract
The present application relates to a method and a circuit for dynamic range control based on peak level and RMS level double-level detection. The method includes: processing an input signal by an equalizer, to obtain an equalized signal; detecting a signal peak level and a signal RMS level of the equalized signal, to obtain the signal peak level and the signal RMS level; adjusting a parameter configuration of a dynamic range controller according to the signal peak level and the signal RMS level; adjusting a dynamic gain of the dynamic range controller according to the parameter configuration, and adjusting the equalized signal by using the adjusted gain, and then outputting the adjusted equalized signal. The method can not only control the dynamic range of the signal but also improve the clipping distortion of the signal.
Claims
1. A method for dynamic range control based on peak level and effective level double-level detection, wherein the method comprises: processing an input audio digital signal by an equalizer, to obtain an equalized signal; detecting a signal peak level and a signal effective level of the equalized signal, to obtain the peak level and the signal effective level; adjusting a parameter configuration of a dynamic range controller according to the signal peak level and a weighted signal effective level; adjusting a dynamic gain of the dynamic range controller according to the parameter configuration, and adjusting the equalized signal by using the adjusted gain, and then outputting the adjusted equalized signal; wherein, the parameter configuration of the dynamic range controller comprises a first set of parameter configurations and a second set of parameter configurations, adjusting the dynamic gain of the dynamic range controller according to the parameter configuration, and adjusting the equalized signal by using the adjusted gain, and then outputting the adjusted equalized signal comprises: when the parameter configuration of the dynamic range controller is the first set of parameter configurations, adjusting the dynamic gain of the dynamic range controller according to the first set of parameter configurations, to obtain the dynamic gain of the dynamic range controller as:
2. The method according to claim 1, wherein detecting the signal peak level and the signal effective level of the equalized signal, to obtain the signal peak level and the signal effective level comprises: detecting a peak level of the equalized signal of each frame, to obtain the signal peak level as:
3. The method according to claim 2, wherein adjusting the parameter configuration of the dynamic range controller according to the signal peak level and the weighted signal effective level comprises: setting a weight coefficient of the signal logarithmic effective level, and weighting the signal logarithmic effective level according to the weight coefficient, to obtain a weighted signal logarithmic effective level as:
4. (canceled)
5. The method according to claim 3, wherein adjusting the equalized signal according to the dynamic gain and then outputting the adjusted equalized signal by using the dynamic range controller comprises: weighting the dynamic gain for all frames, adjusting the equalized signal according to the weighted dynamic gain for all frames and then outputting the adjusted equalized signal by the dynamic range controller.
6-8. (canceled)
9. A circuit for dynamic range control based on peak level and effective level double-level detection, wherein the circuit comprises: an equalizer, a peak level detection sub-circuit, an effective level detection sub-circuit, a dynamic range controller, and a parameter configuration sub-circuit; wherein, the equalizer is configured to process an input audio digital signal in real time to obtain an equalized signal, and output the equalized signal to the peak level detection sub-circuit, the effective level detection sub-circuit and the dynamic range controller; the peak level detection sub-circuit is configured to receive the equalized signal, continuously detect a peak level of the equalized signal of each frame to obtain a signal peak level, and transmit the signal peak level to the parameter configuration sub-circuit; the effective level detection sub-circuit is configured to receive the equalized signal, set level detecting time, calculate a signal effective level of the equalized signal according to the level detecting time and a sampling frequency of the input signal to obtain the signal effective level, and transmit the signal effective level to the parameter configuration sub-circuit; the parameter configuration sub-circuit is configured to adjust a parameter configuration-of the dynamic range controller according to the received signal peak level and signal effective level, and assign the parameter configuration to the dynamic range controller; the dynamic range controller comprises a dynamic range control sub-circuit which is configured to adjust the equalized signal according to the assigned parameter configuration- and then output the adjusted equalized signal; wherein, the parameter configuration of the dynamic range controller comprises a first set of parameter configurations and a second set of parameter configurations, the setting sub-circuit is further configured to: when the parameter configuration of the dynamic range controller is the first set of parameter configurations, adjust a dynamic gain of the dynamic range controller according to the first set of parameter configurations, to obtain the dynamic gain of the dynamic range controller as:
10. The circuit according to claim 9, wherein the parameter configuration sub-circuit comprises: a gain sub-circuit, a comparator and a setting sub-circuit; the gain sub-circuit is configured to weight the received signal effective level, and output the weighted signal effective level to the comparator; the comparator is configured to compare the received signal peak level with the weighted signal effective level to obtain a comparison result, and transmit the comparison result to the setting sub-circuit; the setting sub-circuit is configured to: set two sets of parameter configurations; when the comparison result is that the signal peak level is greater than the weighted signal effective level, set the parameter configuration of the dynamic range controller as a first set of parameter configurations; and when the comparison result is that the signal peak level is not greater than the weighted signal effective level, set the parameter configuration of the dynamic range controller as a second set of parameter configurations; wherein the parameter configuration comprises attack time, release time, and a threshold.
11. (canceled)
12. The circuit according to claim 10, wherein the dynamic range controller further comprises a gain weighting processing sub-circuit, the gain weighting processing sub-circuit is configured to weight the dynamic gain, and transmit the weighted dynamic gain to the dynamic range control sub-circuit.
13. The circuit according to claim 9, wherein the signal effective level detected by the effective level detection sub-circuit is:
14-19. (canceled)
Description
BRIEF DESCRIPTION OF DRAWINGS
[0061]
[0062]
[0063]
DESCRIPTION OF EMBODIMENTS
[0064] For clarity of the purpose, technical solutions, and advantages of the present application, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application and not to limit the present application.
[0065] In an embodiment, as shown in
[0070] In the above method for dynamic range control based on peak level and RMS level double-level detection, the method includes: processing an input audio digital signal by an equalizer, to obtain an equalized signal; detecting a signal peak level and a signal RMS level of the equalized signal, to obtain the signal peak level and the signal RMS level; adjusting a parameter configuration of a dynamic range controller according to the signal peak level and the signal RMS level; and adjusting a dynamic gain of the dynamic range controller according to the parameter configuration, and adjusting the equalized signal by using the adjusted gain, and then outputting the adjusted equalized signal. The method can not only control the dynamic range of the signal but also improve the clipping distortion of the signal.
[0071] In an embodiment, step 102 includes: [0072] detecting a peak level of the equalized signal of each frame, to obtain the signal peak level as:
where A[n] is a logarithmic peak level of a signal of a current frame, in dBV; and x[n] is the equalized signal; and [0073] setting level detecting time, and calculate the signal RMS level of the equalized signal according to the level detecting time and a sampling frequency of the input signal; where the signal RMS level is:
where y [n] is a signal RMS level of the current frame; n is a sequence number of a signal frame; y [n-1] is a signal RMS level of a previous frame; energyTime is the level detecting time; Fs is the sampling frequency of the input signal; B.sub.0[n] is a logarithmic RMS level of the signal of the current frame, in dBV; is a level detecting time coefficient.
[0074] In an embodiment, step 104 includes: [0075] setting a weight coefficient of the logarithmic RMS level of the signal, and weight the logarithmic RMS level of the signal according to the weight coefficient, to obtain a weighted logarithmic RMS level of the signal as:
where B[n] is the weighted logarithmic RMS level of the signal of the current frame, in dBV; B.sub.0[n] is the logarithmic RMS level of the signal of the current frame, in dBV; W.sub.0 is the weight coefficient; [0076] setting two sets of parameter configurations; the parameter configuration includes attack time, release time, and a threshold; and [0077] comparing the logarithmic peak level of the signal with the weighted logarithmic RMS level of the signal, to obtain a comparison result; [0078] when the comparison result is that the logarithmic peak level of the signal is greater than the weighted logarithmic RMS level of the signal, setting a parameter of the dynamic range controller as a first set of parameter configurations; [0079] when the comparison result is that the logarithmic peak level of the signal is not greater than the weighted logarithmic RMS level of the signal, setting the parameter of the dynamic range controller as a second set of parameter configurations.
[0080] In an embodiment, the step 106 includes: [0081] when the parameter of the dynamic range controller is the first set of parameter configurations, adjusting the dynamic gain of the dynamic range controller according to the parameter configuration, to obtain the dynamic gain of the dynamic range controller as:
where gain[n] is a dynamic gain of the current frame, gain[n-1] is a dynamic gain of the previous frame, attackTime1, releaseTime1, and threshold1 are the attack time, the release time and the threshold of the first set of parameter configurations respectively, A[n] is the logarithmic peak level of the signal of the current frame, deltaGain is an intermediate variable, and deltaGain is equal to a smaller value between the logarithmic peak level A[n] of the signal of the current frame and a DRC threshold threshold1 minus the logarithmic peak level A[n] of the signal of the current frame, in dBV; when A[n]=<threshold1, .sub.1 is a DRC release time coefficient; when A [n]>threshold1, .sub.1 is a DRC attack time coefficient; [0082] when the parameter of the dynamic range controller is the second set of parameter configurations, adjusting the dynamic gain of the dynamic range controller according to the parameter configuration, to obtain the dynamic gain of the dynamic range controller as:
where attackTime2, releaseTime2, and threshold2 are the attack time, the release time and the threshold of the second set of parameter configurations respectively, B[n] is the weighted logarithmic RMS level of the signal of the current frame, deltaGain is an intermediate variable, and deltaGain is equal to a smaller value between the weighted logarithmic RMS level B[n] of the signal of the current frame and a DRC threshold threshold2 minus the weighted logarithmic RMS level B[n] of the signal of the current frame; when B[n]threshold2, .sub.2 is a DRC release time coefficient; when B[n]>threshold2, .sub.2 is a DRC attack time coefficient; and [0083] adjusting the equalized signal according to the dynamic gain and then output the adjusted equalized signal by using the dynamic range controller.
[0084] In an embodiment, adjusting the equalized signal by according to the dynamic gain and then outputting the adjusted equalized signal using the dynamic range controller includes: weighting the dynamic gain for all frames, adjusting the equalized signal according to the weighted dynamic gain and then outputting the adjusted equalized signal by the dynamic range controller.
[0085] It should be understood that although various steps in the flowchart shown in
[0086] In an embodiment, as shown in
[0087] The equalizer 10 is configured to process an input audio digital signal in real time to obtain an equalized signal, and output the equalized signal to the peak level detection module 20, the RMS level detection module 30 and the dynamic range controller 50. Since the low-frequency cutoff frequency of the speaker system is relatively high, in order to obtain a better bass response at a low volume, the low-frequency signal is often boosted in the equalizer module. When a signal is input to the equalizer module at a high volume for gain amplification processing, clipping will often occur due to high overflow. The input audio digital signal X.sub.in[n] is processed by the equalizer and output as x[n] thereafter.
[0088] The peak level detection module 20 is configured to receive the equalized signal, continuously detect a peak level of the equalized signal of each frame to obtain a signal peak level, and transmit the signal peak level to the parameter configuration module 40. The peak detection module 20 is configured to continuously take an absolute value of the value x[n] (in V) of the equalized signal of each frame and convert the unit V into dBV, where a logarithmic peak level of the signal of a current frame is A[n]=20*log 10(abs(x[n])).
[0089] The RMS level detection module 30 is configured to receive the equalized signal, set level detecting time, calculate a signal RMS level of the equalized signal according to the level detecting time and a sampling frequency of the input signal to obtain the signal RMS level, and transmit the signal RMS level to the parameter configuration module 40.
[0090] The parameter configuration module 40 is configured to adjust a parameter configuration of the dynamic range controller according to the received signal peak level and signal RMS level, and assign it to the dynamic range controller 50. Adjusting the parameter configuration of the dynamic range controller according to the signal peak level and the weighted signal RMS level may also include using only one set of parameter configuration or using multiple sets of parameter configurations.
[0091] The dynamic range controller 50 includes a dynamic range control module which is configured to perform processing on the equalized signal, according to the assigned configuration parameter, and then output the processed equalized signal. The dynamic range controller includes three input parameters: attack time (attackTime), release time (releaseTime) and a threshold (threshold).
[0092] In an embodiment, as shown in
[0093] The gain module is configured to weight the received signal RMS level, and output the weighted signal RMS level to the comparator. Specifically, the gain module is configured to amplify or attenuate the signal RMS level calculated by the RMS level detection module, where the weighted logarithmic RMS level of the signal is: B[n]=w.sub.0*B.sub.0[n], where W.sub.0 is a real constant, which can be set by a user according to actual needs.
[0094] The comparator is configured to compare the received signal peak level with the weighted signal RMS level to obtain a comparison result, and transmit the comparison result to the setting module.
[0095] The setting module is configured to: set two sets of parameter configurations; when the comparison result is that the signal peak level is greater than the weighted signal RMS level, set a parameter of the dynamic range controller as a first set of parameter configurations; and when the comparison result is that the signal peak level is not greater than the weighted signal RMS level, set the parameter of the dynamic range controller as a second set of parameter configurations; where the parameter configuration includes attack time, release time, and a threshold.
[0096] Specifically, the first set of parameter configurations is parameter configuration C, including the attack time attackTime1, the release time releaseTime1 and the threshold threshold1. The second set of parameter configurations is parameter configuration D, including the attack time attackTime2, the release time releaseTime2, and the threshold threshold2. Users can set the values of the parameters themselves.
[0097] In an embodiment, the setting module is further configured to: [0098] when the parameter of the dynamic range controller is the first set of parameter configurations, adjust a dynamic gain of the dynamic range controller according to the parameter configuration, to obtain the dynamic gain of the dynamic range controller as:
where gain[n] is a dynamic gain of a current frame; gain[n-1] is a dynamic gain of a previous frame; attackTime1, releaseTime1, and threshold1 are the attack time, the release time, and the threshold of the first set of parameter configurations respectively; deltaGain is an intermediate variable; A [n] is a logarithmic peak level of the signal of the current frame; when A [n]=<threshold1, .sub.1 is a DRC release time coefficient; when A [n]>threshold1, .sub.1 is a DRC attack time coefficient. [0099] when the parameter of the dynamic range controller is the second set of parameter configurations, adjust the dynamic gain of the dynamic range controller according to the parameter configuration, to obtain the dynamic gain of the dynamic range controller as:
where attackTime2, releaseTime2, and threshold2 are the attack time, the release time, and the threshold of the second set of parameter configurations respectively; B[n] is a weighted logarithmic RMS level of the signal of the current frame; deltaGain is an intermediate variable; when B[n]threshold2, .sub.2 is the DRC release time coefficient; when B[n]>threshold2, 22 is the DRC attack time coefficient; [0100] adjust the equalized signal according to the dynamic gain and then output the adjusted equalized signal by using the dynamic range controller.
[0101] In an embodiment, the dynamic range controller further includes a gain weighting processing module. The gain weighting processing module is configured to weight the dynamic gain, and transmit the weighted dynamic gain to the dynamic range control module.
[0102] Specifically, the dynamic range controller can also weight the dynamic gain gain[n] through the gain weighting processing module to implement pass-through, amplification, compression, limitation and denoising of the signal x[n] output by the equalizer, that is: X.sub.out[n]=gainW[n]*x[n], where gainW[n]=w*10{circumflex over ()}(gain[n]/20), W is a real constant, the unit of gain[n] is dB, the unit of gainW[n] is 1; dB is converted into 1 by 10{circumflex over ()}(gain[n]/20), and then multiplication by W is executed for weighting processing. When gainW[n]=1, the signal x[n] output by the equalizer is output in a pass-through manner; when 0<gainW[n]<1, the signal x[n] output by the equalizer is output in an attenuated manner; when gainW[n]>1, the signal x[n] output by the equalizer is output in an amplified manner, when gainW[n]=0, X.sub.out[n]=0, the output of the signal x[n] output by the equalizer is blocked. Users can adjust the settings according to actual needs.
[0103] In an embodiment, the signal RMS level detected by the RMS level detection module is:
where y[n] is a signal RMS level of the current frame; n is a sequence number of a signal frame; y[n]n-1 is a signal RMS level of the previous frame; x[n] is the equalized signal; energyTime is the level detecting time; Fs is the sampling frequency of the input signal; B.sub.0[n] is a logarithmic RMS level of the signal of the current frame, is a level detecting time coefficient.
[0104] The functions of the circuit for dynamic range control described in the specification can be realized by a combination of a plurality of subcircuits, that is, the modules (e.g., the peak level detection module, the RMS level detection module, and the parameter configuration module and so on) described in the specification can be implemented as a sub-circuit or a combination of a plurality of sub-circuits.
[0105] The technical features of the embodiments mentioned above can be combined arbitrarily. To simplify the description, not all possible combinations of the technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope of this specification.
[0106] The embodiments mentioned above only express several implementations provided by the present application, and the descriptions are relatively specific and detailed, but should not be construed as limiting the scope of the invention patent. It should be noted that, for those of ordinary skilled in the art, several modifications and improvements can be made without deviating from the concept of the present application, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the appended claims.