Gain control method and device for audio processing, electronic equipment and medium
By processing the gain control speed of the audio signal in segments, the human ear's requirements for compression amplitude sensitivity and sound quality listening experience are met, and the gain control speed balance problem in audio processing is solved, the calculation overhead and miscompression are reduced, and the stable audio is achieved Processing effect.
Patent Information
- Application Number
- CN202411063385.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-26
AI Technical Summary
During audio processing, it is difficult to balance the compression speed and hearing sense by adjusting the gain control speed. The existing methods can easily lead to problems such as the sound head being unable to be suppressed or the sound is too loud and small, and the use of audio feature recognition algorithms will increase the calculation overhead.
By analyzing the waveform data and gain control speed of the audio signal, the multi-segment waveform data segments are generated in segments, and the gain control speed of each segment is adjusted separately to meet the human ear's requirements for compression amplitude sensitivity and sound quality listening, and avoid using audio Feature recognition algorithm.
The coordination of compression speed and hearing is achieved, which reduces calculation overhead and miscompression, saves calculation costs, and avoids the phenomenon of loud and small sounds.
Smart Images

Figure CN119030483A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of power supply technology, and in particular to a gain control method, device, electronic device, and medium for audio processing. Background Art
[0002] The process of using audio algorithms to process audio signals will affect the loudness and timbre of the sound. For example, too fast changes during processing will cause the hearing to deteriorate. Therefore, in order to avoid the impact on the hearing during the processing of audio signals, it is necessary to perform certain filtering and smoothing on the waveform data of the audio signal.
[0003] Filter smoothing is achieved by adjusting the gain control speed of the audio signal. However, the gain control speed adjustment will result in a slow compression speed, which will cause the sound head to be unable to be suppressed; and if the compression speed is set too fast, the sound will be loud and soft. Using the audio feature recognition algorithm, the adaptive control gain speed will have a certain effect improvement, but it will lead to a significant increase in the amount of calculation.
[0004] Therefore, how to adjust the gain control speed of the audio signal during the audio processing process has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, one of the technical problems solved by the embodiments of the present application is to provide a gain control method, device, electronic device, and medium for audio processing, which improves the contradiction between compression speed and hearing perception, reduces computing overhead, and saves computing cost.
[0006] In a first aspect, an embodiment of the present application provides a gain control method for audio processing, the method comprising: obtaining waveform data of an audio signal and a gain control speed for processing the audio signal; segmenting the waveform data according to waveform characteristics of the waveform data and the gain control speed to generate a plurality of waveform data segments; and adjusting the gain control speed of each waveform data segment respectively so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality auditory feedback.
[0007] In the second aspect, an embodiment of the present application provides a gain control device for audio processing, the device comprising: an acquisition module, used to obtain waveform data of an audio signal and a gain control speed for processing the audio signal; a generation module, used to segment the waveform data according to the waveform characteristics of the waveform data and the gain control speed, and generate a plurality of waveform data segments; an adjustment module, used to adjust the gain control speed of each waveform data segment respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality auditory feedback.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present application provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0010] The embodiment of the present application generates multiple waveform data segments according to the waveform characteristics of the waveform data of the obtained audio signal and the gain control speed of processing the audio signal, and adjusts the gain control speed of each waveform data segment respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality feedback. Therefore, the embodiment of the present application adjusts the gain control speed of each waveform data segment respectively, improving the contradiction between compression speed and hearing perception. The embodiment of the present application does not need to adopt an audio feature recognition algorithm, and adaptively controls the gain speed, reducing calculation overhead and saving calculation cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0012] Figure 1a A schematic diagram of the gain control waveform data of the overall audio signal;
[0013] Figure 1b It is a schematic diagram of gain control waveform data of a local audio signal;
[0014] Figure 2 This is a flow chart of a gain control method for audio processing according to an embodiment of the present application;
[0015] Figure 3 A schematic diagram of gain control waveform data of a segmented audio signal according to an embodiment of the present application;
[0016] Figure 4 This is a flowchart of step S3 of a gain control method for audio processing according to an embodiment of the present application;
[0017] Figure 5 This is a flowchart of step S32 of a gain control method for audio processing according to an embodiment of the present application;
[0018] Figure 6 This is a flowchart of step S3 of another audio processing gain control method according to an embodiment of the present application;
[0019] Figure 7 This is a flowchart of step S3 of another audio processing gain control method according to an embodiment of the present application;
[0020] Figure 8 A schematic diagram of another gain control waveform data of a segmented audio signal according to an embodiment of the present application;
[0021] Figure 9a and Figure 9b A schematic diagram of gain control waveform data of another segmented audio signal according to an embodiment of the present application;
[0022] Fig.10 This is a structural diagram of a gain control device for audio processing according to an embodiment of the present application;
[0023] Fig.11 A structural diagram of an electronic device used in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and in detail below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0025] Reference is made to the accompanying drawings in the following detailed description, which form a part of the detailed description and illustrate exemplary embodiments. In addition, it is to be understood that other embodiments may be utilized and structural and / or logical changes may be made without departing from the scope of the claimed subject matter. It should also be noted that directions and references (e.g., up, down, top, bottom, etc.) may be used merely to facilitate the description of features in the accompanying drawings. Therefore, the following detailed description is not to be understood in a limiting sense, and the scope of the claimed subject matter is limited only by the appended claims and their equivalents.
[0026] In the following description, numerous details are set forth. However, it will be apparent to those skilled in the art that the embodiments herein can be practiced without these specific details. In some cases, known methods and devices are shown in block diagram form, rather than in detail, to avoid blurring the embodiments herein. References to "embodiment" or "one embodiment" or "some embodiments" throughout this specification mean that the specific features, structures, functions or characteristics described in conjunction with the embodiment are included in at least one embodiment herein. Therefore, the phrases "in an embodiment" or "in one embodiment" or "some embodiments" appearing throughout this specification do not necessarily refer to the same embodiment. In addition, in one or more embodiments, specific features, structures, functions or characteristics may be combined in any suitable manner. For example, the first embodiment may be combined with the second embodiment in any case where the specific features, structures, functions or characteristics associated with the two embodiments are not mutually exclusive.
[0027] As used in the description and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0028] The terms "coupled" and "connected" together with their derivatives may be used in this article to describe the functional or structural relationship between components. It should be understood that these terms are not intended to be synonymous with each other. On the contrary, in a particular embodiment, "connected" can be used to indicate that two or more elements are in direct physical, optical or electrical contact with each other. "Coupled" can be used to indicate that two or more elements are in direct or indirect (with other intermediate elements between them) physical or electrical contact with each other, and / or that two or more elements cooperate or interact with each other (e.g., as in a cause-and-effect relationship).
[0029] As used herein, the terms "above," "below," "between," and "on" refer to the relative position of one component or material with respect to other components or materials where such physical relationship is noteworthy. For example, in the context of materials, a material or materials disposed above or below another material may be in direct contact, or may have one or more intervening materials. Also, a material disposed between two materials or materials may be in direct contact with both layers, or may have one or more intervening layers. In contrast, a first material or material "above" a second material or material is in direct contact with the second material / materials. Similar distinctions are made in the context of component assembly.
[0030] As used throughout the description herein and in the claims, a list of items connected by the term "at least one of" or "one or more of" may mean any combination of the listed items. For example, the phrase "at least one of A, B, or C" may mean A; B; C; A and B; A and C; B and C; or A, B, and C.
[0031] The term "circuit" or "module" may refer to one or more passive and / or active components that are arranged to cooperate with each other to provide a desired functionality. The term "signal" may refer to at least one current signal, voltage signal, or magnetic signal. The terms "substantially," "close," "approximately," "close to," and "approximately" generally refer to within + / - 10% of a target value.
[0032] The terms involved in the embodiments of the present application are explained below.
[0033] Attack Time: The time it takes for the audio signal to exceed the compression threshold and the gain to be reduced to the desired level.
[0034] Compression stage: The stage that reduces the gain to the desired level.
[0035] Release Time: The time it takes for the audio signal to fall below the compression threshold and for the gain to return to normal levels.
[0036] Release phase: The phase in which the gain returns to normal levels.
[0037] Compression Ratio: The compression ratio of the audio signal that exceeds the compression threshold.
[0038] When using audio algorithms to process audio signals, audio processing will affect the loudness and timbre of the sound. For example, if the change is too fast, the hearing experience will deteriorate. Therefore, in order to avoid the impact on the hearing experience during audio processing, filtering and smoothing processing is required during audio processing.
[0039] In order to make the compression and release processes smooth and prevent the human ear from feeling the changes in sound quality and volume after compression, a smoothing module is generally used in the compression process to smooth the compression value. The classic smoothing formula is: y[n]=αy[n-1]+(1-α)x[n], where y[n] is the audio signal after smoothing, y[n-1] is the audio signal before smoothing, and α is the smoothing parameter. Different gain control speeds can be set by adjusting the value of α.
[0040] Filter smoothing is achieved by adjusting the gain control speed of the audio signal. However, the gain control speed adjustment will result in slow compression, which will cause the sound head to be unable to be suppressed; and setting the compression speed too fast will cause the sound to fluctuate. Even if the compression speed and sound quality requirements can be basically met through parameter adjustment, the compression ratio may not be released in time during audio processing such as the piano noise suppression algorithm, causing the system to have a certain degree of miscompression for a long time during the frequent switching between compression and non-compression.
[0041] Using the audio feature recognition algorithm, the adaptive control gain speed will be improved to a certain extent, but it will lead to a significant increase in the amount of calculation.
[0042] The embodiments of the present application respond to these problems. By analyzing the algorithm features and the characteristics of the human ear, the waveform data is processed in segments to generate multiple waveform data segments, and the gain control speed of each waveform data segment is adjusted respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for sensitivity to compression amplitude and sound quality feedback. The embodiments of the present application achieve fast compression speed while avoiding the problem of affecting the hearing sense due to excessive compression speed, reducing the occurrence of the phenomenon of fluctuating sound, and ensuring the timely release of the compression ratio when the compression ratio is frequently switched by a large margin to reduce miscompression. The embodiments of the present application do not need to adopt an audio feature recognition algorithm, and adaptively control the gain speed, which reduces the calculation overhead and saves the calculation cost.
[0043] Using a 1000Hz sound signal as a standard, the lowest sound pressure that the human ear can feel is 2x10E-5Pa. This sound level is set as 0dB. When the sound level exceeds 130dB, the human ear will not be able to tolerate it. Therefore, the dynamic range of the sound level of the human ear is 0 to 130dB. The difference threshold (step limit) of the human ear for loudness changes is about 0.3dB, but generally it is about 0.5 to 1dB. This value is converted into a compression ratio of about 10%.
[0044] The human ear perceives sounds of equal intensity but different frequencies differently: the higher the sound pressure level, the flatter the human ear's hearing frequency characteristics; the lower the sound pressure level, the smaller the human hearing frequency range. The human ear's hearing frequency is 20Hz to 20KHz, and this frequency band is called audio or audio frequency. Regardless of the sound pressure level, the human ear is most sensitive to sounds with a frequency of 3KHz to 5KHz.
[0045] According to a large amount of data and actual test results, if the human ear is required to be unable to detect the change of the audio signal, that is, the sudden change of the sound level of the audio signal must meet the following conditions:
[0046] 1) The amplitude of the gain control speed adjustment of the burst audio signal is required to be less than about 3dB.
[0047] 2) When the gain control speed of the audio signal changes continuously, the speed of the amplitude increase in the release phase should be less than about 4dB / second, and the speed in the attack phase should not exceed 4 times the speed of the release phase, about 16dB / second. Since the volume of the audio signal itself is also changing at the same time in actual applications, a change speed slightly faster than the theoretical value will not cause a significant impact.
[0048] The requirements for gain control speed in the audio signal compression algorithm and piano noise algorithm must also meet the following conditions:
[0049] 1) The total compression time from 0% to 95% must be within the specified time to meet the speed requirements.
[0050] 2) The compression must be smooth enough, especially around the middle 50% compression ratio where the compression amplitude occurs most frequently and is most noticeable to the human ear.
[0051] Specifically, Figure 1a It is a schematic diagram of the gain control waveform data of the overall audio signal. Figure 1b It is a schematic diagram of the gain control waveform data of a local audio signal.
[0052] Figure 1a and Figure 1b The signal sampling rate is 10000Hz, and the attack time and release time are both set to 0.3s. Assuming that the compression ratio is 1, the corresponding compression amplitude is 10dB. Figure 1a At 0.3s, the compression amplitude suddenly changes from 0 to 10dB, and the waveform data of the audio signal is in the compression stage; at 1.3s, the compression amplitude suddenly changes from 10 to 0dB, and the waveform data of the audio signal is in the release stage. Figure 1a The compression speed in the first 0s-0.07s of the compression stage is relatively uniform but fast. Figure 1a The amplitude change rate of the simulation parameter calculation in the first 0.07s is
[0053] From the above, we can see that 86dB / s is far beyond the theoretical gain control speed that does not affect the hearing experience, and the 6dB amplitude of the gain control speed adjustment of the sudden audio signal is also far beyond the maximum amplitude that the human ear can distinguish. Similarly, the same result will occur in the release stage.
[0054] therefore, Figure 1a In the compression stage around 0s-0.07s, the compression speed must be within 0.3s. Compressing the signal by 10dB will most likely cause the sound to fluctuate.
[0055] In order to better meet the above conditions, the present application embodiment provides a gain control method for audio processing, see Figure 2 , the method comprising:
[0056] Step S1: Obtaining waveform data of an audio signal and a gain control speed for processing the audio signal.
[0057] Specifically, if the audio signal is in the compression stage, the gain control speed is the compression speed at which the gain is reduced to the desired level when the audio signal exceeds the compression threshold. If the audio signal is in the release stage, the gain control speed is the compression speed at which the gain is restored to the normal level when the audio signal is below the compression threshold.
[0058] Taking the compression stage of about 0s-0.07s in Figure 1 as an example, the waveform data of the audio signal needs to be compressed to 97% within 0.3s, which is the gain control speed for processing the audio signal, that is, the compression speed at which the audio signal exceeds the compression threshold and reduces the gain to the desired level.
[0059] Step S2: segmenting the waveform data according to the waveform characteristics of the waveform data and the gain control speed to generate a plurality of waveform data segments.
[0060] Specifically, the number of waveform data segments into which the embodiment of the present application is divided can be set as needed, and the present application does not limit this.
[0061] See also Figure 3 , the embodiment of the present application divides the waveform data into three segments, satisfying Figure 1a In the case of a compression speed of , the compression speed of the first waveform data segment is faster, the compression speed of the second waveform data segment is slower, and the compression speed of the third waveform data segment is moderate.
[0062] Step S3: respectively adjusting the gain control speed of each waveform data segment, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback.
[0063] The embodiment of the present application achieves fast compression speed while avoiding the problem of affecting the hearing sense caused by too fast compression speed, reduces the occurrence of the phenomenon of fluctuating sound, and ensures timely release of the compression ratio when the compression ratio is frequently switched drastically to reduce miscompression. The embodiment of the present application does not need to adopt an audio feature recognition algorithm, and adaptively controls the control gain speed, reduces calculation overhead, and saves calculation cost.
[0064] In the specific implementation of the first embodiment of the present application, see Figure 4 , the step S3 comprises:
[0065] Step S31: if the waveform data segment is in a compression phase and the compression ratio is less than a first threshold, adjusting the compression speed of the waveform data segment to a first speed.
[0066] Step S32: If the waveform data segment is in a compression stage and the compression ratio is greater than or equal to a first threshold, adjusting the compression speed of the waveform data segment to a second speed.
[0067] The first speed is greater than the original compression speed of the waveform data segment, the second speed is less than the original compression speed of the waveform data segment, and the first threshold is used to characterize the compression degree of the waveform data segment.
[0068] The first speed and the second speed are set according to the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback.
[0069] In the embodiment of the present application, if the waveform data segment is in the compression stage and the compression ratio is less than the first threshold, that is, the compression ratio of the waveform data segment is low, the compression speed of the waveform data segment is increased to stably suppress the sound head noise.
[0070] In the embodiment of the present application, when the waveform data segment is in the compression stage and the compression ratio is greater than or equal to the first threshold, that is, the compression ratio of the waveform data segment is high, the compression speed of the waveform data segment is lowered, thereby further reducing the occurrence of the sound phenomenon of intermittent sounds, and when the compression ratio is frequently switched drastically, it is ensured that the compression ratio is released in time to reduce erroneous compression.
[0071] Specifically, in order to better distinguish the compression ratios of the waveform data segments, the first threshold is set to 30%.
[0072] That is, during the compression stage, the embodiment of the present application regards the waveform data segments with a compression ratio lower than 30% as the waveform data segments with a lower compression ratio, and increases the compression speed of the waveform data segments; regards the waveform data segments with a compression ratio higher than 30% as the waveform data segments with a higher compression ratio, and lowers the compression speed of the waveform data segments, thereby further reducing the occurrence of the sound phenomenon of intermittent sounds and reducing erroneous compression.
[0073] In the specific implementation of the first embodiment of the present application, see Figure 5 , the step S32 comprises:
[0074] Step S321: if the waveform data segment is in a compression stage and the compression ratio is greater than or equal to a first threshold and less than a second threshold, adjusting the compression speed of the waveform data segment to a second speed.
[0075] Step S322: If the waveform data segment is in the compression stage and the compression ratio is greater than or equal to the second threshold, the original compression speed of the waveform data segment is maintained.
[0076] The second threshold is used to characterize the compression degree of the waveform data segment, and the second threshold is greater than the first threshold.
[0077] The embodiment of the present application further refines the waveform data segments that are in the compression stage and whose compression ratio is greater than or equal to the first threshold. The embodiment of the present application only adjusts the compression speed of the waveform data segments that are in the compression stage and whose compression ratio is greater than or equal to the first threshold and less than the second threshold to the second speed; and maintains the original compression speed of the waveform data segments that are in the compression stage and whose compression ratio is greater than or equal to the second threshold.
[0078] The embodiment of the present application will be in the compression stage but the compression ratio is greater than or equal to the second threshold, that is, the waveform data segment with a higher compression ratio maintains the original compression speed, which can make this part of the audio data meet the requirements of no distortion and no noise.
[0079] Specifically, in order to better distinguish waveform data segments with a higher compression ratio, the second threshold is set to 70%.
[0080] That is, during the compression stage, the embodiment of the present application lowers the compression speed of waveform data segments with a compression ratio greater than or equal to 30% and less than 70%; the embodiment of the present application maintains the compression speed of waveform data segments with a compression ratio higher than 70%, so that in extreme cases where the compression ratio is very high, the audio data can be compressed relatively quickly and significantly, thereby suppressing distortion and noise in the audio data.
[0081] Below through Figure 3 The specific waveform data fragments in the embodiment of the present application are further explained.
[0082] Figure 3 The compression ratio of the first waveform data segment (compression ratio is less than 30%) is low. The compression speed of the waveform data segment is increased. The waveform data of the audio signal suddenly changes by 3dB within 0.05s. Considering the human ear's sensitivity to compression amplitude and the requirements for sound quality feedback, a small loudness mutation of 3dB will not affect the hearing experience.
[0083] Figure 3 The compression ratio of the second waveform data segment in the audio signal is relatively high (the compression ratio is greater than or equal to 30% and less than 70%). The second waveform data segment is the segment that appears most frequently and accounts for the longest time in the audio signal. Considering the requirements of the human ear for the sensitivity of the compression amplitude and the feedback of the sound quality, the second waveform data segment has the greatest impact on the sound quality, so the requirements for the gain control speed setting for this segment are higher. The embodiment of the present application lowers the compression speed of the waveform data segment, and the attack time of the second waveform data segment is extended to 1s. The overall amplitude change speed of the second waveform data segment is:
[0084] contrast Figure 1a The excessively fast compression speed of 86dB / s in the example creates an auditory problem of the sound being louder and smaller. The compression speed of the second waveform data segment in the embodiment of the present application is more gradual, which meets the requirements of the human ear for sensitivity to compression amplitude and feedback on sound quality.
[0085] Figure 3 The compression ratio of the third waveform data segment in the video is higher (compression ratio is greater than 70%), maintaining the compression speed of the waveform data segment. Although the compression speed of the third waveform data segment is faster, due to the small number of scenes with this high compression ratio, fast and large compression is required to suppress the audio and achieve the requirements of no distortion and no noise.
[0086] For the release phase, the principle is basically the same as that of the compression phase. The compression speed adjustment in the release phase is different from that in the compression phase.
[0087] In the specific implementation of the first embodiment of the present application, see Figure 6 , the step S3 comprises:
[0088] Step S33: If the waveform data segment is in the release phase and the compression ratio is greater than or equal to the second threshold, or less than the first threshold, the compression speed of the waveform data segment is adjusted to a third speed.
[0089] Step S34: if the waveform data segment is in the release phase and the compression ratio is less than the second threshold and greater than or equal to the first threshold, adjusting the compression speed of the waveform data segment to a fourth speed.
[0090] The fourth speed is greater than the original compression speed of the waveform data segment, the third speed is less than the original compression speed of the waveform data segment, the first threshold and the second threshold are used to characterize the compression degree of the waveform data segment, and the second threshold is greater than the first threshold.
[0091] The third speed and the fourth speed are set according to the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback.
[0092] In the embodiment of the present application, when the waveform data segment is in the release stage and the compression ratio is greater than or equal to the second threshold, or less than the first threshold, that is, at the end of the waveform data in the release stage, the compression speed of the waveform data segment is lowered to ensure continuous and stable noise suppression.
[0093] In the embodiment of the present application, when the waveform data segment is in the release stage and the compression ratio is less than the second threshold but greater than or equal to the first threshold, that is, it is in the middle section of the waveform data in the release stage, the compression speed of the waveform data segment is increased to speed up the release of the waveform data, further reducing the occurrence of the sound phenomenon of intermittent sounds, and ensuring the timely release of the compression ratio when the compression ratio is frequently switched drastically to reduce erroneous compression.
[0094] Specifically, in order to better distinguish the compression ratios of the waveform data segments, the first threshold is set to 30% and the second threshold is set to 70%.
[0095] That is, in the release phase, the embodiment of the present application regards the waveform data segments with a compression ratio lower than 30% and the waveform data segments with a compression ratio greater than or equal to 70% as the end of the waveform data, and lowers the compression speed of the waveform data segments; regards the waveform data segments with a compression ratio greater than or equal to 30% and less than 70% as the middle of the waveform data, and increases the compression speed of the waveform data segments, thereby further reducing the occurrence of the phenomenon of fluctuating sound and reducing miscompression. In the audio processing process such as the piano noise suppression algorithm, it may also cause the compression ratio to be released untimely, causing the system to have a certain degree of miscompression for a long time during the frequent switching between compression and non-compression.
[0096] Specifically, in audio processing processes such as piano noise suppression algorithms, the compression speed of waveform data segments with high or low compression ratios may be slowed down to compress the noise cleanly; while the compression speed of the middle section of the waveform data may be increased to reduce the miscompression of vocals and drum sounds.
[0097] In the specific implementation of the first embodiment of the present application, see Figure 7 , step S3 further includes:
[0098] Step S35, adding a smoothed waveform data segment at the intersection of the waveform data segments, wherein the gain control speed of the smoothed waveform data segment is the average value of the gain control speeds of the two intersecting waveform data segments.
[0099] Since some obviously non-smooth inflection points appear in each segment of the waveform data, in order to make the waveform data transition smoother, the embodiment of the present application performs soft inflection point processing at the inflection point.
[0100] Specifically, in order to simplify the calculation, a smoothed waveform data segment is added at the intersection of each waveform data segment, and the gain control speed of the smoothed waveform data segment is the average value of the gain control speeds of the two intersecting waveform data segments. The actual smoothing effect is as follows: Figure 8 shown.
[0101] See also Figure 8, smooth waveform data segments are inserted into the intersections of the waveform data segments, so that the original hard inflection points are smoothed out, making the listening experience better.
[0102] The embodiment of the present application does not increase the computing overhead, but optimizes the compression process. After testing, it was found that the range of setting values of the attack time and the release time can be made larger, the compression speed can be set faster, and the phenomenon of fluctuating sounds can be reduced.
[0103] In the specific implementation of the first embodiment of the present application, step S2 is specifically as follows:
[0104] The waveform data is evenly divided to obtain a plurality of evenly divided waveform data segments.
[0105] Step S3 includes:
[0106] Step S36: Obtain the target compression speed or target compression speed of each waveform data segment according to the preset gain control parameter, and make corresponding adjustments to each waveform data segment according to the target compression speed or target compression speed.
[0107] Since the waveform data is segmented, algorithm developers and tuners need to individually adjust the compression speed of each waveform data segment, which increases the difficulty of tuning.
[0108] In order to simplify the difficulty of tuning, the embodiment of the present application divides the waveform data equally, and adjusts the compression speed of the multiple waveform data segments after the division in a linked manner.
[0109] For example, still using Figure 1a The waveform data in the waveform data is divided into five segments, and the target compression speed or target compression speed (compression speed in the compression stage and the release stage) of each segment of the waveform data is obtained by a preset gain control parameter. Figure 1a The attack time in is 0.3s as the overall parameter, then the attack time of the five waveform data segments can be directly calculated, and the final compressed waveform is as follows Figure 9a (waveform data attack time is 0.3s) and Figure 9b (The waveform data attack time is 0.6s) as shown.
[0110] See also Figure 9a and Figure 9b The tuner controls the gain control speed of each waveform data segment by setting one or a few sets of gain control parameters. In addition, in the process of changing the gain control speed, the gain control speed of each waveform data segment changes in the same proportion. Therefore, the embodiment of the present application simplifies the tuning difficulty of algorithm developers and tuners, and no additional learning is required.
[0111] Specifically, the attack time calculations of the five waveform data segments are:
[0112]
[0113]
[0114]
[0115]
[0116]
[0117] Among them, Attack1, Attack2, Attack3, Attack4, and Attack5 are the attack times of five waveform data segments, and Attack is the attack time of the waveform data.
[0118] For the above method, see Fig.10 The present application also provides a gain control device for audio processing, the device comprising:
[0119] The obtaining module 101 is used to obtain waveform data of an audio signal and a gain control speed for processing the audio signal.
[0120] The generating module 102 is used to perform segment processing on the waveform data according to the waveform characteristics of the waveform data and the gain control speed to generate a plurality of waveform data segments.
[0121] The adjustment module 103 is used to adjust the gain control speed of each waveform data segment respectively, so that the gain control speed of each waveform data segment meets the requirements of human ears for compression amplitude sensitivity and sound quality hearing feedback.
[0122] The embodiment of the present application generates multiple waveform data segments according to the waveform characteristics of the waveform data of the obtained audio signal and the gain control speed of processing the audio signal, and adjusts the gain control speed of each waveform data segment respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality feedback. Therefore, the embodiment of the present application adjusts the gain control speed of each waveform data segment respectively, improving the contradiction between compression speed and hearing perception. The embodiment of the present application does not need to adopt an audio feature recognition algorithm, and adaptively controls the gain speed, reducing calculation overhead and saving calculation cost.
[0123] Based on the method described above, the embodiment of the present application also provides an electronic device for executing the method described in the above embodiment, referring to Fig.11, shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0124] like Fig.11 As shown, the electronic device 110 may include: a processor (processor) 1102 , a communication interface (Communications Interface) 1104 , a memory (memory) 1106 , and a communication bus 1108 .
[0125] in:
[0126] The processor 1102 , the communication interface 1104 , and the memory 1106 communicate with each other via a communication bus 1108 .
[0127] The communication interface 1104 is used to communicate with other electronic devices or servers.
[0128] The processor 1102 is used to execute the program 1110, and specifically can execute the relevant steps in the above data processing method embodiment.
[0129] Specifically, the program 1110 may include program codes, which include computer operation instructions.
[0130] The processor 1102 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0131] The memory 1106 is used to store the program 1110. The memory 1106 includes an SRAM memory.
[0132] The program 1110 may be specifically used to enable the processor 1102 to execute to implement the steps described in any method in the above embodiments.
[0133] The specific implementation of each step in program 1110 can refer to the corresponding description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the aforementioned method embodiments and will not be repeated here.
[0135] Based on the method described in the above embodiment, an embodiment of the present application provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the above embodiment is implemented.
[0136] Based on the method described in the above embodiment, an embodiment of the present application provides a computer program product, which implements the method described in the above embodiment when executed by a processor.
[0137] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0138] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the navigation method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the navigation method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the navigation method shown herein.
[0139] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0140] The embodiments of the present application are described but not limited thereto. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be defined by the claims.
Claims
1. A gain control method for audio processing, characterized in that: The method comprises: Obtaining waveform data of an audio signal and a gain control speed for processing the audio signal; Segmentally process the waveform data according to the waveform characteristics of the waveform data and the gain control speed to generate multiple waveform data segments; The gain control speed of each waveform data segment is adjusted respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback.
2. The method according to claim 1, characterized in that The step of adjusting the gain control speed of each waveform data segment respectively so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback includes: If the waveform data segment is in a compression stage and the compression ratio is less than a first threshold, adjusting the compression speed of the waveform data segment to a first speed; If the waveform data segment is in a compression stage and the compression ratio is greater than or equal to a first threshold, adjusting the compression speed of the waveform data segment to a second speed; The first speed is greater than the original compression speed of the waveform data segment, the second speed is less than the original compression speed of the waveform data segment, and the first threshold is used to characterize the compression degree of the waveform data segment.
3. The method according to claim 2, characterized in that If the waveform data segment is in the compression stage and the compression ratio is greater than or equal to the first threshold, adjusting the compression speed of the waveform data segment to a second speed includes: If the waveform data segment is in a compression stage and the compression ratio is greater than or equal to a first threshold and less than a second threshold, adjusting the compression speed of the waveform data segment to a second speed; If the waveform data segment is in the compression stage and the compression ratio is greater than or equal to the second threshold, maintaining the original compression speed of the waveform data segment; The second threshold is used to characterize the compression degree of the waveform data segment, and the second threshold is greater than the first threshold.
4. The method according to any one of claims 1 to 3, characterized in that: The step of adjusting the gain control speed of each waveform data segment respectively so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback includes: If the waveform data segment is in the release phase and the compression ratio is greater than or equal to the second threshold, or less than the first threshold, adjusting the compression speed of the waveform data segment to a third speed; If the waveform data segment is in the release phase and the compression ratio is less than the second threshold and greater than or equal to the first threshold, adjusting the compression speed of the waveform data segment to a fourth speed; The fourth speed is greater than the original compression speed of the waveform data segment, the third speed is less than the original compression speed of the waveform data segment, the first threshold and the second threshold are used to characterize the compression degree of the waveform data segment, and the second threshold is greater than the first threshold.
5. The method according to claim 4, characterized in that The first threshold is 30%, and the second threshold is 70%.
6. The method according to claim 1, characterized in that The method of adjusting the gain control speed of each waveform data segment respectively so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback also includes: A smoothed waveform data segment is added at the intersection of the waveform data segments, and the gain control speed of the smoothed waveform data segment is the average value of the gain control speeds of the two intersecting waveform data segments.
7. The method according to claim 1, characterized in that The waveform data is segmented according to the waveform characteristics of the waveform data and the gain control speed to generate multiple waveform data segments, specifically: Dividing the waveform data equally to obtain a plurality of equally divided waveform data segments; The gain control speed of each waveform data segment is adjusted respectively, so that the gain control speed of each waveform data segment meets the requirements of human ear for compression amplitude sensitivity and sound quality hearing feedback, including: According to the preset gain control parameters, the target compression speed or the target compression speed of each waveform data segment is obtained, and the target compression speed or the target compression speed is used to adjust each waveform data segment accordingly.
8. A gain control device for audio processing, characterized in that: The device comprises: An acquisition module, used for acquiring waveform data of an audio signal and a gain control speed for processing the audio signal; A generating module, used for performing segment processing on the waveform data according to the waveform characteristics of the waveform data and the gain control speed, to generate a plurality of waveform data segments; The adjustment module is used to adjust the gain control speed of each waveform data segment respectively, so that the gain control speed of each waveform data segment meets the requirements of the human ear for compression amplitude sensitivity and sound quality hearing feedback.
9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 7.
