A method, system, device and medium for controlling dynamic range of digital sound signals
By setting the impact threshold and release threshold and using a counter to detect the proportion of the signal exceeding the threshold, the problems of excessive suppression and high computational complexity in the dynamic range control of digital sound signal energy are solved, and smooth signal changes and reduced computational complexity are achieved.
Patent Information
- Application Number
- CN202211030218.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The existing technology has the problems of excessive signal suppression and large amount of calculation in the control of the dynamic range of digital sound signal energy.
A digital sound signal dynamic range control method is adopted. By setting the impact threshold and release threshold, and using a counter to detect the proportion of the signal exceeding the threshold, dynamic range control is performed to avoid directly using the maximum value point as a reference and achieve smooth changes.
It effectively avoids excessive suppression, reduces the amount of calculation, retains the sound head, and achieves smooth signal changes.
Smart Images

Figure CN115394307B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of sound signal regulation, and in particular to a method, system, device and medium for controlling the dynamic range of a digital sound signal. Background Art
[0002] Dynamic range control (DRC) is a technology that manages the energy of digital audio signals. The energy of a sound signal varies constantly. We typically want to compress high-energy signals to avoid speaker damage, while leaving low-energy signals unaffected to maintain sound quality.
[0003] The engineer specifies several energy thresholds to determine which parts of the signal are compressed and which are retained. The current common practice is to first calculate the instantaneous energy of the signal. Based on the relative magnitude of this energy and the specified threshold, a gain value is calculated. This gain value undergoes a smoothing process controlled by the engineer based on the attack and release times, and is finally multiplied by the sampled value of the signal to produce the final result.
[0004] There are two common methods for calculating the instantaneous energy of a signal. One is based on the extreme value of the signal sampling, which uses the maximum value of the signal sampling over a period of time as the energy of the signal. The other is to calculate the root mean square (RMS) of the signal sampling over a period of time to represent the signal energy.
[0005] If you calculate the instantaneous energy of a signal based on the extreme sampling values, the resulting energy value will be biased upwards. Sometimes a sound signal has a high sampling value at just a moment, but the overall energy is very low. This method uses the maximum value at that moment to measure the energy. This can cause the dynamic range control to overly suppress the signal, severely suppressing the sound's initial impact, resulting in a poor listening experience.
[0006] Calculating the instantaneous energy of a signal based on the root mean square method is an accurate way to measure the energy of a digital signal. However, this method requires calculating the sum of the squares of the signal, which is computationally intensive. Summary of the Invention
[0007] To this end, embodiments of the present invention provide a method, system, device, and medium for controlling the dynamic range of digital sound signals to address the technical issues of the prior art in controlling the dynamic range of digital sound signal energy, such as excessive suppression of signals and sound heads, and high computational complexity.
[0008] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0009] According to a first aspect of an embodiment of the present invention, an embodiment of the present application provides a method for controlling a dynamic range of a digital sound signal, the method comprising:
[0010] Real-time collection of digital sound signals;
[0011] Calculate the absolute value of each sample to obtain the sample amplitude;
[0012] Setting an impact threshold and a release threshold, wherein the impact threshold is greater than or equal to the release threshold;
[0013] Comparing the obtained sampling amplitude with two set thresholds;
[0014] If the sampling amplitude is less than the release threshold, determining whether the count of the small sampling value counter reaches a set upper limit;
[0015] If the count of the small sampling value counter reaches the set upper limit, the release process flag is set to true;
[0016] Determine whether the release process flag is true;
[0017] If the release process flag is true, determining whether the gain value is less than 1;
[0018] If the gain value is less than 1, the ramp process counter is reduced by a release step;
[0019] Check whether the value of the slow-changing process counter is greater than the maximum value of the counter;
[0020] If the value of the slow-changing process counter is greater than the maximum value of the counter, a shock process is started to reduce the gain value by a first preset value, and the value of the slow-changing process counter is reduced by the maximum value of the counter;
[0021] Apply the new gain value to the acquired signal and output the final result.
[0022] Preferably, a digital sound signal dynamic range control method further includes:
[0023] If the value of the slow-changing process counter is less than or equal to the maximum value of the counter, then check whether the value of the slow-changing process counter is less than 0;
[0024] If the value of the slow-changing process counter is less than 0, then determine whether the gain value is less than 0;
[0025] If the gain value is less than 0, a release process is started, the gain value is increased by a second preset value, and the value of the slow change process counter is added to the maximum value of the counter;
[0026] Apply the new gain value to the acquired signal and output the final result.
[0027] Preferably, a digital sound signal dynamic range control method further includes:
[0028] If the sampling amplitude is greater than the impact threshold, the slow-changing process counter is incremented by an impact step length, and the count of the small sampling value counter is set to 0;
[0029] The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
[0030] Preferably, a digital sound signal dynamic range control method further includes:
[0031] If the sampling amplitude is less than or equal to the impact threshold, and the sampling amplitude is greater than or equal to the release threshold, the count of the slow-changing process counter remains unchanged, and the count of the small sampling value counter is set to 0;
[0032] The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
[0033] Preferably, a digital sound signal dynamic range control method further includes:
[0034] If the count of the small sampling value counter does not reach the set upper limit, the release process flag is set to false, and the count of the small sampling value counter is increased by 1;
[0035] Loop to determine whether the release process flag is true.
[0036] Preferably, a digital sound signal dynamic range control method further includes:
[0037] If the release process flag is not true, or the gain value is greater than or equal to 1, the digital sound signal at the next moment is collected.
[0038] Preferably, a digital sound signal dynamic range control method further includes:
[0039] If the value of the slow-changing process counter is greater than or equal to 0, or the gain value is greater than or equal to 0, the digital sound signal at the next moment is collected.
[0040] According to a second aspect of an embodiment of the present invention, an embodiment of the present application provides a digital sound signal dynamic range control system, the system comprising:
[0041] The acquisition module is used to collect digital sound signals in real time; the absolute value of each sample is calculated to obtain the sampling amplitude;
[0042] The sampling amplitude detection module is used to set an impact threshold and a release threshold, wherein the impact threshold is greater than or equal to the release threshold; and compare the obtained sampling amplitude with the two set thresholds;
[0043] a counter control module, configured to, if the sampling amplitude is less than the release threshold, determine whether the count of the small sampling value counter has reached a set upper limit; if the count of the small sampling value counter has reached the set upper limit, set a release process flag to true; determine whether the release process flag is true; if the release process flag is true, determine whether the gain value is less than 1; if the gain value is less than 1, decrement the slow change process counter by one release step;
[0044] A slow-changing process counter detection module is used to detect whether the value of the slow-changing process counter is greater than the maximum value of the counter;
[0045] A gain value adjustment module is used to start a shock process if the value of the slow-changing process counter is greater than the maximum value of the counter, reduce the gain value by a first preset value, and subtract the maximum value of the counter from the value of the slow-changing process counter;
[0046] The output module is used to apply the new gain value to the collected signal and output the final result.
[0047] Preferably, the gain value adjustment module is further used for:
[0048] If the value of the slow-changing process counter is less than or equal to the maximum value of the counter, then check whether the value of the slow-changing process counter is less than 0;
[0049] If the value of the slow-changing process counter is less than 0, then determine whether the gain value is less than 0;
[0050] If the gain value is less than 0, a release process is started, the gain value is increased by a second preset value, and the value of the slow change process counter is added to the maximum value of the counter;
[0051] Apply the new gain value to the acquired signal and output the final result.
[0052] Preferably, the counter control module is further configured to:
[0053] If the sampling amplitude is greater than the impact threshold, the slow-changing process counter is incremented by an impact step length, and the count of the small sampling value counter is set to 0;
[0054] The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
[0055] Preferably, the counter control module is further configured to:
[0056] If the sampling amplitude is less than or equal to the impact threshold, and the sampling amplitude is greater than or equal to the release threshold, the count of the slow-changing process counter remains unchanged, and the count of the small sampling value counter is set to 0;
[0057] The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
[0058] Preferably, the counter control module is further configured to:
[0059] If the count of the small sampling value counter does not reach the set upper limit, the release process flag is set to false, and the count of the small sampling value counter is increased by 1;
[0060] Loop to determine whether the release process flag is true.
[0061] Preferably, the counter control module is further configured to:
[0062] If the release process flag is not true, or the gain value is greater than or equal to 1, the digital sound signal at the next moment is collected.
[0063] Preferably, the gain value adjustment module is further used for:
[0064] If the value of the slow-changing process counter is greater than or equal to 0, or the gain value is greater than or equal to 0, the digital sound signal at the next moment is collected.
[0065] According to a third aspect of an embodiment of the present invention, there is provided a digital sound signal dynamic range control device, the device comprising: a processor and a memory;
[0066] The memory is used to store one or more program instructions;
[0067] The processor is configured to run one or more program instructions to execute the steps of any one of the above methods for controlling the dynamic range of a digital sound signal.
[0068] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a digital sound signal dynamic range control method as described in any one of the above items are implemented.
[0069] Compared with the prior art, the embodiments of the present application provide a method, system, device, and medium for controlling the dynamic range of a digital sound signal. This method uses a simple counting method to detect the proportion of the portion of the signal that exceeds the threshold in the entire signal segment to perform dynamic range control. The larger the proportion, the more the signal energy exceeds the threshold, and the faster it is suppressed; the smaller the proportion, the less the signal energy exceeds the threshold, and the slower it is suppressed. This method requires much less computation than the root mean square, and at the same time does not arbitrarily use the maximum point as a reference for control, thus avoiding excessive suppression, preserving the sound head, and achieving smooth signal changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.
[0071] The structures, proportions, sizes, etc. illustrated in this specification are intended only to complement the contents disclosed herein and to facilitate understanding and reading by persons familiar with the art. They are not intended to limit the conditions under which the present invention may be implemented and therefore have no substantive technical significance. Any structural modifications, changes in proportions, or adjustments in sizes, without affecting the efficacy and objectives of the present invention, shall still fall within the scope of the technical contents disclosed herein.
[0072] Figure 1 A schematic diagram of the logical structure of a digital sound signal dynamic range control system provided by an embodiment of the present invention;
[0073] Figure 2 A flowchart of a method for controlling the dynamic range of a digital sound signal provided by an embodiment of the present invention;
[0074] Figure 3 A schematic diagram of the waveform of a collected digital sound signal provided by an embodiment of the present invention;
[0075] Figure 4 A digital sound signal dynamic range control method provided by an embodiment of the present invention is Figure 3 Schematic diagram of digital sound signal processing is shown in FIG. DETAILED DESCRIPTION
[0076] The following describes the implementation of the present invention using specific embodiments. Those skilled in the art will readily understand the other advantages and benefits of the present invention from the disclosure herein. Obviously, the embodiments described are only a portion of the present invention, not all of it. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0077] The purpose of this application is to provide a method, system, device and medium for controlling the dynamic range of a digital sound signal in accordance with the embodiments of the present invention, which can reduce the amount of computation while releasing the sound head without excessively suppressing the signal.
[0078] Currently, for dynamic range control of digital sound signals, after obtaining the instantaneous energy value, the desired target energy value can be obtained based on the energy threshold specified by the tuner. The difference between the target energy value and the instantaneous energy value is the gain value that needs to be applied to the signal. However, this gain cannot be directly added to the signal. In reality, changes in sound energy always have a transition phase. Applying gain without any processing will cause a sudden change in the sound signal, resulting in sound distortion. Therefore, when artificially changing the sound energy, it is necessary to control it so that the change is smooth.
[0079] The usual practice is to simulate the energy change of sound based on the sound envelope model (ADSR). The sound envelope model divides sound control into four stages: attack process (Attack), decay process (Decay), sustain process (Sustain) and release process (Release). In the embodiment of the present invention, only the attack process and release process need to be paid attention to. The attack process describes the process of signal energy changing from small to large, and the release process describes the process of signal energy changing from large to small. The tuner sets the attack time (AttackTime) and release time (ReleaseTime) to control the duration of the corresponding change process respectively. The longer the time, the smoother the change, and vice versa. This transition process is achieved by changing the gain value.
[0080] In order to solve the above technical problems, Figure 1 As shown, an embodiment of the present application provides a digital sound signal dynamic range control system, which specifically includes: an acquisition module 1, a sampling amplitude detection module 2, a counter control module 3, a slow-changing process counter detection module 4, a gain value adjustment module 5, and an output module 6.
[0081] Furthermore, the acquisition module 1 is configured to acquire digital sound signals in real time; the absolute value of each sample is calculated to obtain a sample amplitude. The sample amplitude detection module 2 is configured to set an impact threshold and a release threshold, wherein the impact threshold is greater than or equal to the release threshold; and the obtained sample amplitude is compared with the two thresholds. The counter control module 3 is configured to determine whether the count of the small sample value counter has reached a set upper limit if the sample amplitude is less than the release threshold; if the count of the small sample value counter has reached the set upper limit, set a release process flag to true; determine whether the release process flag is true; if the release process flag is true, determine whether the gain value is less than 1; if the gain value is less than 1, decrement the release step from the slow-changing process counter. The slow-changing process counter detection module 4 is configured to detect whether the value of the slow-changing process counter is greater than the maximum value of the counter. The gain adjustment module 5 is configured to initiate a surge process if the value of the slow-changing process counter is greater than the maximum value of the counter, reduce the gain value by a first preset value, and decrement the maximum value of the slow-changing process counter from the value of the slow-changing process counter. The output module 6 is configured to apply the new gain value to the acquired signal and output the final result.
[0082] Compared with the prior art, the embodiment of the present application provides a digital sound signal dynamic range control system that uses a simple counting method to detect the proportion of the portion of the signal that exceeds the threshold in the entire signal segment to perform dynamic range control. The larger the proportion, the more the signal energy exceeds the threshold, and the faster it is suppressed; the smaller the proportion, the less the signal energy exceeds the threshold, and the slower it is suppressed. This method requires much less calculation than the root mean square, and at the same time does not arbitrarily use the maximum point as a reference for control, thus avoiding excessive suppression, preserving the sound head, and achieving smooth signal changes.
[0083] Corresponding to the aforementioned digital sound signal dynamic range control system, an embodiment of the present invention further discloses a digital sound signal dynamic range control method. The following describes in detail the digital sound signal dynamic range control method disclosed in an embodiment of the present invention in conjunction with the aforementioned digital sound signal dynamic range control system.
[0084] like Figure 2 As shown, the specific steps of a digital sound signal dynamic range control method provided by an embodiment of the present application are described in detail below.
[0085] The digital sound signal is collected in real time by the collection module 1; and the absolute value of each sample is calculated to obtain the sample amplitude.
[0086] The sampling amplitude detection module 2 sets an impact threshold and a release threshold, where the impact threshold is greater than or equal to the release threshold; the obtained sampling amplitude is compared with the two set thresholds. In the embodiment of the present invention, the comparison results are specifically divided into three cases, each of which is described in detail below.
[0087] If the sampling amplitude is greater than the attack threshold, the counter control module 3 will add an attack step to the slow-changing process counter and set the count of the small sampling value counter to 0; then the slow-changing process counter detection module 4 will directly detect whether the value of the slow-changing process counter is greater than the maximum value of the counter.
[0088] If the sampling amplitude is less than or equal to the impact threshold, and the sampling amplitude is greater than or equal to the release threshold, the counter control module 3 will keep the count of the slow-changing process counter unchanged and set the count of the small sampling value counter to 0; then the slow-changing process counter detection module 4 will directly detect whether the value of the slow-changing process counter is greater than the maximum value of the counter.
[0089] If the sampling amplitude is smaller than the release threshold, the counter control module 3 directly determines whether the count of the small sampling value counter reaches the set upper limit.
[0090] In the embodiment of the present invention, processing is performed based on three comparison results between the sampling amplitude and the two set thresholds, which can ensure that the small sampling value counter only records a continuous sampling value below the release threshold.
[0091] If the count of the small sampling value counter reaches the set upper limit, the counter control module 3 sets the release process flag to true; and determines whether the release process flag is true.
[0092] If the count of the small sampling value counter does not reach the set upper limit, the release process flag is set to false, and the count of the small sampling value counter is increased by 1; then it is determined whether the release process flag is true.
[0093] If the release process flag is not true, the digital sound signal at the next moment is collected.
[0094] If the release process flag is true, the counter control module 3 determines whether the gain value is less than 1.
[0095] If the gain value is greater than or equal to 1, the digital sound signal at the next moment is collected.
[0096] If the gain value is less than 1, the counter control module 3 subtracts a release step from the ramp process counter.
[0097] In the embodiment of the present invention, the above steps are all intended to control the value of the ramping process counter. Each time a sample is input, when the sample amplitude exceeds the ramp threshold, the ramping process counter increments by one ramp step. Conversely, the ramping process counter decrements by one ramp step only after a continuous period of sample amplitudes below the release threshold (controlled by the small sample value counter).
[0098] like Figure 3 As shown, this explains why a continuous period of sampled amplitudes must be below the release threshold. The signal is a sine wave with an amplitude of 1 in the first half and an amplitude of 0.5 in the second half. Assuming the threshold is set at 0.8 (the same value for the impact threshold and release threshold), we can observe that even for the sine wave with an amplitude of 1, many samples are still below the threshold. Just because a small number of sampled values in a signal are below the threshold doesn't mean its energy is low. Only when all sampled values are below the threshold, as shown by the sine wave with an amplitude of 0.5 in the second half, does the signal's energy truly remain low.
[0099] The slowly changing process counter detection module 4 detects whether the value of the slowly changing process counter is greater than the maximum value of the counter.
[0100] If the value of the ramp counter exceeds the maximum value, the gain adjustment module 5 initiates a surge process, reducing the gain by a first preset value (which can be specified by the engineer) and subtracting the maximum value from the ramp counter. The output module 6 then applies the new gain value to the acquired signal and outputs the final result.
[0101] If the value of the slow-changing process counter is less than or equal to the maximum value of the counter, the gain value adjustment module 5 detects whether the value of the slow-changing process counter is less than 0.
[0102] If the value of the slow-changing process counter is greater than or equal to 0, the digital sound signal at the next moment is collected.
[0103] If the value of the slow-changing process counter is less than 0, the gain value adjustment module 5 determines whether the gain value is less than 0.
[0104] If the gain value is greater than or equal to 0, the digital sound signal at the next moment is collected.
[0105] If the gain value is less than 0, the gain adjustment module 5 initiates a release process, increasing the gain value by a second preset value (which can be specified by the tuner) and adding the value of the ramp process counter to the maximum value of the counter. The output module 6 then applies the new gain value to the acquired signal and outputs the final result.
[0106] In practical applications, it is often not necessary to know the instantaneous energy accurately. We only need to know whether the signal energy is larger or smaller than the set threshold.
[0107] like Figure 4 As shown, the impact threshold is set to 0.5, and the bold part is the signal that exceeds the threshold. It can be clearly seen that the larger the signal, the more signals exceed the threshold. In this embodiment of the present invention, the slow-changing process counter will accumulate faster, triggering the impact process to reduce the gain more quickly.
[0108] Compared with the prior art, the embodiment of the present application provides a method for controlling the dynamic range of a digital sound signal. It uses a simple counting method to detect the proportion of the portion of the signal that exceeds the threshold in the entire signal segment to perform dynamic range control. The larger the proportion, the more the signal energy exceeds the threshold, and the faster it is suppressed; the smaller the proportion, the less the signal energy exceeds the threshold, and the slower it is suppressed. This method requires much less calculation than the root mean square, and at the same time does not arbitrarily use the maximum point as a reference for control, thus avoiding excessive suppression, preserving the sound head, and achieving smooth signal changes.
[0109] In addition, an embodiment of the present invention also provides a digital sound signal dynamic range control device, which includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a digital sound signal dynamic range control method as described in any one of the above items.
[0110] In addition, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for controlling the dynamic range of a digital sound signal as described in any one of the above items are implemented.
[0111] In the embodiments of the present invention, the processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0112] The methods, steps, and logic diagrams disclosed in the embodiments of the present invention can be implemented or executed. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software modules can be located in a storage medium well-established in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The processor reads the information from the storage medium and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0113] The storage medium may be a memory and may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0114] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0115] Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).
[0116] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0117] Those skilled in the art will appreciate that in one or more of the above examples, the functions described herein can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media includes any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0118] Although the present invention has been described in detail above using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made thereto. Therefore, such modifications and improvements, without departing from the spirit of the present invention, are intended to be within the scope of protection claimed herein.
Claims
1. A method for controlling the dynamic range of a digital sound signal, characterized in that: The method comprises: Real-time collection of digital sound signals; Calculate the absolute value of each sample to obtain the sample amplitude; Setting an impact threshold and a release threshold, wherein the impact threshold is greater than or equal to the release threshold; Comparing the obtained sampling amplitude with two set thresholds; If the sampling amplitude is less than the release threshold, determining whether the count of the small sampling value counter reaches a set upper limit; If the count of the small sampling value counter reaches the set upper limit, the release process flag is set to true; Determine whether the release process flag is true; If the release process flag is true, determining whether the gain value is less than 1; If the gain value is less than 1, the ramp process counter is reduced by one release step; Check whether the value of the slow-changing process counter is greater than the maximum value of the counter; If the value of the slow-changing process counter is greater than the maximum value of the counter, a shock process is started to reduce the gain value by a first preset value, and the value of the slow-changing process counter is reduced by the maximum value of the counter; Applying the new gain value to the collected signal and outputting the final result. The method further includes: If the value of the slow-changing process counter is less than or equal to the maximum value of the counter, then check whether the value of the slow-changing process counter is less than 0; If the value of the slow-changing process counter is less than 0, then determine whether the gain value is less than 0; If the gain value is less than 0, a release process is started, the gain value is increased by a second preset value, and the value of the slow change process counter is added to the maximum value of the counter; Apply the new gain value to the acquired signal and output the final result.
2. A method for controlling the dynamic range of a digital sound signal according to claim 1, characterized in that: The method further comprises: If the sampling amplitude is greater than the impact threshold, the slow-changing process counter is incremented by an impact step length, and the count of the small sampling value counter is set to 0; The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
3. A method for controlling the dynamic range of a digital sound signal according to claim 2, characterized in that: The method further comprises: If the sampling amplitude is less than or equal to the impact threshold, and the sampling amplitude is greater than or equal to the release threshold, the count of the slow-changing process counter remains unchanged, and the count of the small sampling value counter is set to 0; The loop detects whether the value of the ramp process counter is greater than the maximum value of the counter.
4. A method for controlling the dynamic range of a digital sound signal according to claim 3, characterized in that: The method further comprises: If the count of the small sampling value counter does not reach the set upper limit, the release process flag is set to false, and the count of the small sampling value counter is increased by 1; Loop to determine whether the release process flag is true.
5. The method for controlling the dynamic range of a digital sound signal according to claim 1, wherein: The method further comprises: If the release process flag is not true, or the gain value is greater than or equal to 1, the digital sound signal at the next moment is collected.
6. A method for controlling the dynamic range of a digital sound signal according to claim 1, wherein: The method further comprises: If the value of the slow-changing process counter is greater than or equal to 0, or the gain value is greater than or equal to 0, the digital sound signal at the next moment is collected.
7. A digital sound signal dynamic range control system, characterized in that: The system comprises: The acquisition module is used to collect digital sound signals in real time; the absolute value of each sample is calculated to obtain the sampling amplitude; The sampling amplitude detection module is used to set an impact threshold and a release threshold, wherein the impact threshold is greater than or equal to the release threshold; and compare the obtained sampling amplitude with the two set thresholds; a counter control module, configured to, if the sampling amplitude is less than the release threshold, determine whether the count of the small sampling value counter has reached a set upper limit; if the count of the small sampling value counter has reached the set upper limit, set a release process flag to true; determine whether the release process flag is true; if the release process flag is true, determine whether the gain value is less than 1; if the gain value is less than 1, decrement a release step from the ramp process counter; A slow-changing process counter detection module is used to detect whether the value of the slow-changing process counter is greater than the maximum value of the counter; A gain value adjustment module is used to start a shock process if the value of the slow-changing process counter is greater than the maximum value of the counter, reduce the gain value by a first preset value, and subtract the maximum value of the counter from the value of the slow-changing process counter; The output module is used to apply the new gain value to the collected signal and output the final result; The system further comprises: If the value of the slow-changing process counter is less than or equal to the maximum value of the counter, then check whether the value of the slow-changing process counter is less than 0; If the value of the slow-changing process counter is less than 0, then determine whether the gain value is less than 0; If the gain value is less than 0, a release process is started, the gain value is increased by a second preset value, and the value of the slow change process counter is added to the maximum value of the counter; Apply the new gain value to the acquired signal and output the final result.
8. A digital sound signal dynamic range control device, characterized in that: The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to execute the steps of the method for controlling the dynamic range of a digital sound signal according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for controlling the dynamic range of a digital sound signal according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Dynamic volume control and multi-spatial processing protection
US20100128904A1