Method, device, storage medium and electronic device for processing voice signal
By using a dual gain control structure, the gain value is determined by the previous frame of the speech signal and the second speech signal, which solves the problem of poor stability of automatic gain control for speech and achieves a balanced volume effect.
Patent Information
- Application Number
- CN202211698996.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-12-28
AI Technical Summary
Existing automatic gain control methods for voice have poor stability, leading to the failure of volume equalization.
A dual-gain control structure is adopted. Through two gain value calculations and feedback mechanisms, the first gain value is determined using the previous frame speech signal and the second speech signal of the current frame speech signal, and the second gain value is determined based on the characteristic value of the first amplified signal, so as to finally obtain the target speech signal.
The stability of automatic gain control for voice has been enhanced, avoiding inaccuracies in single gain calculations and achieving a balanced volume effect.
Smart Images

Figure CN116052708B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of electronics, and in particular, to a voice signal processing method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the increasing application of real-time voice calls and video calls, audio and video technologies are also increasingly valued. Voice automatic gain control (AGC) is an important link in audio processing in audio and video technologies. The main function of voice automatic gain control is to handle the problem of voice being too loud or too soft, so that the overall voice volume is relatively stable, thereby improving the listening experience of users. In recent years, many methods for voice automatic gain control have appeared, but the control method in the related technology only amplifies the voice signal through single gain, and the calculation of the gain may not be accurate, resulting in failure of volume equalization. In the related technology, the envelope value of the input voice signal is also calculated as the standard for gain updating, which is also difficult to achieve the purpose of equalizing the volume. It can be seen that the voice automatic gain control method in the related technology lacks stability.
[0003] In view of the poor stability of the voice automatic gain control method in the related technology, no effective solution has been proposed so far. SUMMARY
[0004] Embodiments of the present application provide a voice signal processing method and device, a storage medium and an electronic device to at least solve the problem of poor stability of the voice automatic gain control method in the related technology.
[0005] According to an embodiment of the present application, a voice signal processing method is provided, comprising: obtaining a current frame voice signal; performing a first amplification operation on the current frame voice signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame voice signal of the current frame voice signal and a second voice signal, and the second voice signal is obtained by performing the first amplification operation and a second amplification operation on the previous frame voice signal; determining a second gain value according to a first characteristic value of the first amplified signal, and performing the second amplification operation on the first amplified signal according to the second gain value to obtain a target voice signal.
[0006] In one example embodiment, the determining the second gain value according to the first characteristic value of the first amplified signal comprises: determining a first log-likelihood ratio LR1 of a signal energy of the first amplified signal, and determining a set of envelope values of the first amplified signal, wherein the set of envelope values comprises envelope values determined according to each of W sub-frames into which the first amplified signal is divided, and W is a positive integer greater than or equal to 1; and determining the second gain value according to the first log-likelihood ratio LR1 and the set of envelope values, wherein the first characteristic value comprises the first log-likelihood ratio LR1 and the set of envelope values.
[0007] In one example embodiment, the determining the second gain value according to the first log-likelihood ratio LR1 and the set of envelope values comprises: selecting a target envelope value from the set of envelope values; and determining the second gain value according to the first log-likelihood ratio LR1 and a relationship between the target envelope value and each envelope value in the set of envelope values.
[0008] In one example embodiment, the determining the second gain value according to the first log-likelihood ratio LR1 and the relationship between the target envelope value and each envelope value in the set of envelope values comprises: determining a gain value corresponding to an i-th sub-frame in the W sub-frames included in the second gain value according to the following steps, wherein i is a positive integer greater than or equal to 1 and less than W: in a case where a ratio of the target envelope value to an envelope value corresponding to the i-th sub-frame in the set of envelope values is greater than a predetermined proportion threshold r, determining the gain value corresponding to the i-th sub-frame to be equal to (r*LR1); and in a case where the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is less than or equal to the predetermined proportion threshold r, determining the gain value corresponding to the i-th sub-frame to be equal to (the first log-likelihood ratio LR1 * the target envelope value / the envelope value corresponding to the i-th sub-frame).
[0009] In one example embodiment, the determining the first log-likelihood ratio LR1 of the signal energy of the first amplified signal comprises: determining a first average energy value M1 of the first amplified signal; and calculating a first time average M_L1 and a first standard deviation D_L1 of the energy of the first amplified signal according to the following formulas: M_L1 = a*M1 + (1-a)*M_L1', According to the first average energy value M1, the first time average M_L1 and the first standard deviation value D_L1, the first log-likelihood ratio LR1 is determined according to the following formula: LR1=β*(M1-M_L1) / D_L1+(1-β)*LR1'; wherein, α is a preset first smoothing coefficient, β is a preset second smoothing coefficient, M_L1', D_L1' and LR1' are respectively used to represent a time average, a standard deviation value and a log-likelihood ratio of signal energy of an amplified signal obtained after the first amplification operation is performed on the previous frame of voice signal.
[0010] In one exemplary embodiment, after the target voice signal is obtained, the method further comprises: determining a third gain value according to the current frame of voice signal and the target voice signal, wherein the third gain value is a gain value used when the first amplification operation is performed on a next frame of voice signal of the current frame of voice signal.
[0011] In one exemplary embodiment, the determining a third gain value according to the current frame of voice signal and the target voice signal comprises: determining a second log-likelihood ratio LR0 of signal energy of the current frame of voice signal, and determining a subframe energy value E(j) of a jth subframe to obtain W subframe energy values wherein, the jth subframe is used to represent a jth subframe of the W subframes after the target voice signal is divided into W subframes, W is a positive integer greater than or equal to 1, and j is a positive integer greater than or equal to 1 and less than or equal to W; the second log-likelihood ratio LR0 and the W subframe energy values determining a gain value adjustment amount; and determining the third gain value according to the following formula: the third gain value=the first gain value+(the gain value adjustment amount / m), wherein m is a positive integer greater than or equal to 1.
[0012] In one exemplary embodiment, the determining a second log-likelihood ratio LR0 of signal energy of the current frame of voice signal comprises: determining a second average energy value M0 of the current frame of voice signal; and calculating a second time average M_L0 and a second standard deviation value D_L0 of energy of the current frame of voice signal according to the following formula: M_L0=α*M0+(1-α)*M_L0', According to the second average energy value M0, the second time average M_L0 and the second standard deviation value D_L0, and according to the following formula, the second log-likelihood ratio LR0 is determined: LR0=β*(M0-M_L0) / D_L0+(1-β)*LR0'; wherein, α is a first smoothing coefficient, β is a second smoothing coefficient, M_L0', D_L0' and LR0' are respectively used to represent a time average, a standard deviation value and a log-likelihood ratio of signal energy of the previous frame of voice signal.
[0013] In one example embodiment, the determining the subframe energy value E(j) of the jth subframe comprises: calculating the energy value of the jth subframe according to the following formula for the jth subframe in the W subframes: wherein x(n) represents the signal amplitude of the nth sample point in the target voice signal, and K is the number of sample points in the jth subframe.
[0014] According to another embodiment of the present application, there is also provided a voice signal processing apparatus, comprising: an obtaining module configured to obtain a current frame voice signal; a first processing module configured to perform a first amplification operation on the current frame voice signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame voice signal of the current frame voice signal and a second voice signal, and the second voice signal is obtained by performing the first amplification operation and a second amplification operation on the previous frame voice signal; and a second processing module configured to determine a second gain value according to a first characteristic value of the first amplified signal, and perform the second amplification operation on the first amplified signal according to the second gain value to obtain a target voice signal.
[0015] According to yet another embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0016] According to yet another embodiment of the present application, there is also provided an electronic device comprising a memory and a processor, wherein the memory has a computer program stored therein, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.
[0017] By the present application, the current frame speech signal is amplified by a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame speech signal of the current frame speech signal and a second speech signal, the second speech signal is obtained by amplifying the previous frame speech signal by a first amplification operation and a second amplification operation, a second gain value is determined according to a first characteristic value of the first amplified signal, and the first amplified signal is amplified by the second gain value to obtain a target speech signal. The current frame speech signal is amplified by twice gain to obtain the target speech signal, the first gain value is determined according to the previous frame speech signal and the second speech signal obtained by amplifying the previous frame speech signal twice, and the second gain value is determined according to the first characteristic value of the first amplified signal, that is, the gain control is compensated by the double gain control structure, and the problems of inaccurate gain calculation and poor robustness of automatic gain control in the related art are avoided. Therefore, the stability of the speech automatic gain control method in the related art is improved, and the stability of the speech automatic gain control is enhanced. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a mobile terminal hardware structure block diagram of the speech signal processing method of the embodiment of the present application;
[0019] Figure 2 is a flow chart of the speech signal processing method according to the embodiment of the present application;
[0020] Figure 3 is a speech automatic gain processing flow chart according to the embodiment of the present application;
[0021] Figure 4 is a structure block diagram of the speech signal processing device according to the embodiment of the present application. DETAILED DESCRIPTION
[0022] Hereinafter, the embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.
[0023] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence.
[0024] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the case of running on a mobile terminal, Figure 1 is a mobile terminal hardware structure block diagram of the speech signal processing method of the embodiment of the present application. As Figure 1As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0025] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the voice signal processing method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0026] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0027] This embodiment provides a method for processing speech signals. Figure 2 This is a flowchart of a speech signal processing method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0028] Step S202: Obtain the current frame audio signal;
[0029] In step S204, a first amplification operation is performed on the current frame voice signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame voice signal of the current frame voice signal and a second voice signal, and the second voice signal is obtained by performing the first amplification operation and a second amplification operation on the previous frame voice signal.
[0030] In step S206, a second gain value is determined according to a first characteristic value of the first amplified signal, and the second amplification operation is performed on the first amplified signal according to the second gain value to obtain a target voice signal.
[0031] Through the above steps, the first amplification operation is performed on the current frame voice signal according to the first gain value to obtain the first amplified signal, wherein the first gain value is determined according to the previous frame voice signal of the current frame voice signal and the second voice signal, and the second voice signal is obtained by performing the first amplification operation and the second amplification operation on the previous frame voice signal. The second gain value is determined according to the first characteristic value of the first amplified signal, and the second amplification operation is performed on the first amplified signal according to the second gain value to obtain the target voice signal. The purpose of amplifying the current frame voice signal by twice gain to obtain the target voice signal is achieved. The first gain value is determined according to the previous frame voice signal and the second voice signal obtained by performing twice amplification on the previous frame voice signal, and the second gain value is determined according to the first characteristic value of the first amplified signal. That is, through the double gain control structure, the effect of mutual compensation of gain control is achieved, and the problem that the volume balance may be invalid and the robustness of automatic gain control is poor due to the inaccurate calculation of single gain and gain in the related art is avoided. Therefore, the problem of poor stability of the voice automatic gain control method in the related art is solved, and the effect of enhancing the stability of the voice automatic gain control is achieved.
[0032] The execution subject of the above steps can be a processor, a controller, a voice processing device, or a processor with human-computer interaction ability configured on a storage device, or a processing device or a processing unit with similar processing capability, but is not limited thereto.
[0033] In the above embodiment, the current frame speech signal is obtained; a first amplification operation is performed on the current frame speech signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame speech signal of the current frame speech signal and a second speech signal, and the second speech signal is obtained after the first amplification operation and a second amplification operation are performed on the previous frame speech signal, for example, the current frame speech signal is the tthframe speech signal, and the first gain value can be determined according to the previous frame speech signal (such as the (t-1)thframe speech signal) and the second speech signal obtained after the two amplifications are performed on the previous frame speech signal, that is, the first gain value used for the first amplification of the current frame speech signal is obtained by the processing link of the previous frame speech signal (such as the (t-1)thframe speech signal) and is fed back to the processing link of the current frame speech signal; a second gain value is determined according to a first characteristic value of the first amplified signal, and a second amplification operation is performed on the first amplified signal according to the second gain value to obtain a target speech signal, that is, after the first amplification operation, the second gain value is determined according to the first characteristic value of the first amplified signal, for example, the second gain value can be regulated according to the characteristic value of the first amplified signal, and the above first characteristic value can be a log-likelihood ratio of a signal energy of the first amplified signal, and / or a group of envelope values of the first amplified signal, and then the second amplification operation is performed on the first amplified signal according to the second gain value to obtain the target speech signal. The current frame speech signal is amplified by two gain values to obtain the target speech signal, and the first gain value is determined according to the previous frame speech signal and the second speech signal obtained after the two amplifications are performed on the previous frame speech signal, and the second gain value is determined according to the first characteristic value of the first amplified signal, that is, through the double gain control structure, the effect of mutual compensation of gain regulation is achieved, and the problem that the volume balance may be invalid and the robustness of automatic gain control is poor due to inaccurate calculation of single gain in related technologies is avoided, and the robustness of speech automatic gain control is enhanced through feedback gain. Therefore, the problem of poor stability of the speech automatic gain control method in related technologies is solved, and the effect of enhancing the stability of speech automatic gain control is achieved.
[0034] In an optional embodiment, the determining the second gain value according to the first characteristic value of the first amplified signal comprises: determining a first log-likelihood ratio LR1 of signal energy of the first amplified signal, and determining a set of envelope values of the first amplified signal, wherein the set of envelope values comprises envelope values respectively determined according to each of W sub-frames after the first amplified signal is divided into the W sub-frames, W being a positive integer greater than or equal to 1; and the second gain value is determined according to the first log-likelihood ratio LR1 and the set of envelope values, wherein the first characteristic value comprises the first log-likelihood ratio LR1 and the set of envelope values. In this embodiment, the first characteristic value can comprise the first log-likelihood ratio LR1 of signal energy of the first amplified signal and / or the set of envelope values of the first amplified signal, and the set of envelope values can comprise envelope values respectively determined according to each of W sub-frames after the first amplified signal is divided into the W sub-frames, i.e., each sub-frame corresponds to one envelope value, and W sub-frames correspond to W envelope values, i.e., the set of envelope values comprises W envelope values. The second gain value is determined according to the first log-likelihood ratio LR1 and the set of envelope values. Through this embodiment, the second gain value of the second amplification is determined according to the first characteristic value of the first amplified signal, i.e., the effect of mutual compensation of gain control is achieved through the double gain structure, and the effect of enhancing the robustness of automatic gain control of speech is achieved.
[0035] In an optional embodiment, the determining the second gain value according to the first log-likelihood ratio LR1 and the set of envelope values comprises: selecting a target envelope value from the set of envelope values; and determining the second gain value according to the first log-likelihood ratio LR1 and a relationship between the target envelope value and each envelope value in the set of envelope values. In this embodiment, the target envelope value is selected from the set of envelope values, e.g., the target envelope value can be the largest envelope value in the set of envelope values. The second gain value is determined according to the first log-likelihood ratio LR1 and the relationship between the target envelope value and each envelope value, e.g., the gain value corresponding to each sub-frame is determined according to a ratio between the target envelope value and the envelope value corresponding to each sub-frame, and then the second gain value is obtained.
[0036] In an alternative embodiment, the determining the second gain value according to the first log-likelihood ratio LR1 and the relationship between the target envelope value and each envelope value in the set of envelope values comprises: determining a gain value corresponding to the i-th sub-frame in the W sub-frames included in the second gain value according to the following steps, where i is a positive integer greater than or equal to 1 and less than W: in the case that the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame in the set of envelope values is greater than a predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (r*LR1); in the case that the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is less than or equal to the predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (the first log-likelihood ratio LR1*the target envelope value / the envelope value corresponding to the i-th sub-frame). In this embodiment, when the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is greater than the predetermined proportion threshold r (such as r=3 or other values), the gain value corresponding to the i-th sub-frame is determined to be equal to r*LR1; when the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is less than or equal to the predetermined proportion threshold r (such as r=3 or other values), the gain value corresponding to the i-th sub-frame is determined to be equal to (LR1*the target envelope value / the envelope value corresponding to the i-th sub-frame), i.e. the gain value corresponding to the i-th sub-frame is equal to the product of the ratio between the target envelope value and the envelope value corresponding to the i-th sub-frame and LR1; by this embodiment, the gain value corresponding to each sub-frame is determined according to the relationship between the target envelope value and the envelope value corresponding to each sub-frame and the first log-likelihood ratio LR1 of the signal energy of the first amplified signal, and the second gain value is further determined.
[0037] In an alternative embodiment, the determining the first log-likelihood ratio LR1 of the signal energy of the first amplified signal comprises: determining a first average energy value M1 of the first amplified signal; calculating a first time average M_L1 and a first standard deviation D_L1 of the energy of the first amplified signal according to the following formulae: The first log-likelihood ratio LR1 is determined according to the first average energy value M1, the first time average M_L1 and the first standard deviation D_L1 according to the following formula: LR1=β*(M1-M_L1) / D_L1+(1-β)*LR1', where α is a preset first smoothing coefficient, β is a preset second smoothing coefficient, M_L1', D_L1' and LR1' represent respectively a time average, a standard deviation and a log-likelihood ratio of the signal energy of the amplified signal obtained after the first amplification operation on the previous frame of voice signal. In this embodiment, the first average energy value M1 of the first amplified signal can be calculated according to the formula Wherein, x1(n) is the signal amplitude of the n-th sample point in the first amplified signal, N is the number of sample points in the first amplified signal, and the first time average M_L1 and the first standard deviation D_L1 are sequentially calculated according to the above formula, and then the first log-likelihood ratio LR1 is determined. Through the embodiment, the purpose of determining the log-likelihood ratio characteristic of the signal energy of the first amplified signal is achieved.
[0038] In an optional embodiment, after obtaining the target speech signal, the method further comprises: determining a third gain value according to the current frame speech signal and the target speech signal, wherein the third gain value is a gain value used when performing the first amplification operation on a next frame speech signal of the current frame speech signal. In the embodiment, the target speech signal is obtained after the current frame speech signal is amplified twice (i.e., the first amplification operation and the second amplification operation), and the third gain value can be determined according to the current frame speech signal and the target speech signal. The third gain value can be used as a gain value used when performing the first amplification operation on the next frame speech signal. For example, when the current frame is the t-th frame speech signal, the gain value of the first amplification operation on the next frame speech signal (e.g., the t+1-th frame speech signal) can be determined according to the current frame speech signal and the target speech signal. The third gain value can be fed back to the next frame speech signal processing link, similar to the first gain value which is determined in the processing link of the previous frame speech signal (e.g., the t-1-th frame speech signal) and fed back to the current frame speech signal processing link, and used as the gain value of the first amplification operation on the current frame speech signal. Through the embodiment, the robustness of the double gain control structure can be enhanced by feeding back the gain, and the purpose of effectively controlling the gain is achieved.
[0039] In an optional embodiment, the determination of the third gain value according to the current frame speech signal and the target speech signal comprises: determining a second log-likelihood ratio LR0 of the signal energy of the current frame speech signal, and determining a subframe energy value E(j) of the j-th subframe to obtain W subframe energy values Wherein, the j-th subframe is used to represent the j-th subframe of the W subframes after the target speech signal is divided into W subframes, W is a positive integer greater than or equal to 1, and j is a positive integer greater than or equal to 1 and less than or equal to W; the second log-likelihood ratio LR0 and the W subframe energy values determining a gain value adjustment amount; and determining the third gain value according to the following formula: the third gain value = the first gain value + (the gain value adjustment amount / m), where m is a positive integer greater than or equal to 1. In the embodiment, the target speech signal can be divided into W subframes, and the subframe energy values of the W subframes can be determined. For example, the subframe energy value of the j-th subframe of the W subframes is E(j), and W subframe energy values are obtained. Then, based on the second log-likelihood ratio LR0 and Determine the gain adjustment amount (e.g., Δ), for example, the gain adjustment amount. This is the average energy value of W subframes. It should be noted that it can also be... The gain can be calculated as the average of the energy values of some subframes out of W subframes, or it can be the energy value of a single subframe out of W subframes. After determining the gain adjustment amount, to avoid over-adjustment of the gain, the third gain value can be set according to the formula: Third Gain Value = (First Gain Value + Gain Adjustment Amount / m), for example, m can be 3, 5, or other values. Through this embodiment, the purpose of determining the gain value for the first amplification operation of the next frame's speech signal based on the current frame's speech signal and the target speech signal is achieved, while also avoiding over-adjustment of the gain, thus achieving effective control of speech quality.
[0040] In an optional embodiment, determining the second log-likelihood ratio LR0 of the signal energy of the current frame speech signal includes: determining the second average energy value M0 of the current frame speech signal; and calculating the second time mean M_L0 and the second standard deviation D_L0 of the energy of the current frame speech signal according to the following formula: M_L0=α*M0+(1-α)*M_L0', Based on the second average energy value M0, the second time mean M_L0, and the second standard deviation D_L0, the second log-likelihood ratio LR0 is determined according to the following formula: LR0=β*(M0-M_L0) / D_L0+(1-β)*LR0'; where α is the first smoothing coefficient, β is the second smoothing coefficient, and M_L0', D_L0', and LR0' represent the time mean, standard deviation, and log-likelihood ratio of the signal energy of the previous frame of speech signal, respectively. In this embodiment, the second average energy value M0 of the current frame of speech signal can be determined according to the formula... Where x0(n) is the signal amplitude of the nth sample point in the current frame of speech signal, and N is the number of sample points in the current frame of speech signal. Then, the first time mean M_L0 and the first standard deviation D_L0 are calculated sequentially according to the above formula, and then the second log-likelihood ratio LR0 is determined. Through this embodiment, the purpose of determining the log-likelihood ratio characteristic of the signal energy of the current frame of speech signal is achieved.
[0041] In an optional embodiment, determining the subframe energy value E(j) of the j-th subframe includes: calculating the energy value of the j-th subframe among the W subframes according to the following formula: Wherein, x(n) represents signal amplitude of the n-th sample point in the target voice signal, and K is the number of sample points in the j-th sub-frame. In the embodiment, the sub-frame energy value of each sub-frame can be determined according to the above formula, and then the gain value adjustment amount can be determined according to the second logarithmic likelihood ratio LR0 of the signal energy of the W sub-frames and the current frame voice signal.
[0042] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail in combination with the embodiments.
[0043] The embodiment of the present application provides a method for improving the robustness of voice automatic gain control, Figure 3 is a voice automatic gain processing flowchart according to the embodiment of the present application, comprising:
[0044] S302, inputting a t-th frame to-be-processed signal x0(t) (corresponding to the aforementioned current frame voice signal);
[0045] S304, first performing non-overlapping framing on the t-th frame original signal x0(t), and calculating a feature value F0(t) of the original signal x0(t);
[0046] S306, obtaining a t-th frame gain value G1(t) (corresponding to the aforementioned first gain value) by using the gain value fed back from the t-1-th frame (corresponding to the aforementioned last frame voice signal), and performing a first amplification operation on the signal x0(t) by using G1(t), to obtain a first-amplified signal x1(t);
[0047] S308, calculating a feature value F1(t) (corresponding to the aforementioned first feature value) of the first-amplified signal x1(t);
[0048] S310, performing a second signal amplification operation according to F1(t), to obtain a second-amplified signal x2(t) (corresponding to the aforementioned target voice signal);
[0049] S312, calculating a feature value F2(t) of the second-amplified signal x2(t);
[0050] S314, adjusting the first-amplified gain value G1(t) according to F0(t) and F2(t) to obtain a new gain value G1(t+1) (corresponding to the aforementioned third gain value);
[0051] S316, feeding back the new gain value G1(t+1) to the step of the t+1-th frame first amplification operation (such as the step S306 described above), and outputting the automatic gain signal x2(t).
[0052] The above steps will be described in detail as follows:
[0053] 1. Frame x0(t) is divided into non-overlapping frames, and the eigenvalue F0(t) of the original signal x0(t) is calculated. The eigenvalue F0(t) can be various features, such as signal energy log-likelihood ratio feature or signal energy likelihood feature, which is calculated in the following three steps:
[0054] 1.1 Calculate the signal energy M0(t) of the t-th frame (corresponding to the second average energy value M0), which is calculated as follows
[0055]
[0056] where x0(n) represents the sample point of the current frame x0(t), and N represents the total number of sample points of the current frame.
[0057] 1.2 Calculate the long-term average M_L0(t) of the signal energy of the t-th frame (corresponding to the second time average M_L0) and the standard deviation D_L0(t) (corresponding to the second standard deviation value D_L0), which is calculated as follows
[0058] M_L0(t) = α * M0(t) + (1 - α) * M_L0(t-1)
[0059]
[0060] where α is the smoothing coefficient, (·) 2 represents the square operation.
[0061] 1.3 Calculate the signal energy log-likelihood ratio LR0(t) ∈ [0, 1] of the t-th frame of the original signal, which corresponds to the second log-likelihood ratio LR0, which is calculated as follows
[0062] LR0(t) = β * (M0(t) - M_L0(t)) / D_L0(t) + (1 - β) * LR0(t-1)
[0063] where β is the smoothing coefficient.
[0064] 2. Obtain the gain value G1(t) of the t-th frame using the gain value fed back from the t-1-th frame, and perform the first amplification operation on the signal x0(t) using G1(t) to obtain the first amplified signal x1(t), which has the following signal scaling operation:
[0065] x1(t) = G1(t) * x0(t).
[0066] 3. Calculate the eigenvalue F1(t) of the first amplified signal x1(t), such as signal energy log-likelihood ratio, and perform the second amplification operation according to F1(t) to obtain the second amplified signal x2(t):
[0067] 3.1 Since the method of calculating the signal energy log-likelihood ratio of the first amplified signal x1(t) is the same as that in the first step, the signal energy log-likelihood ratio of the first amplified signal x1(t) is directly given as LR1(t)∈[0,1] here;
[0068] 3.2 In addition, the envelope value Env1(t) of the first amplified signal x1(t) is also calculated as follows:
[0069] Env1(t) = max{(x1(n)) 2 |n = 1,...,L}
[0070] where x1(n) represents the sample point of the signal x1(t), and L (L < N) represents the signal length used for calculating the envelope value.
[0071] 3.3 After obtaining the envelope value Env1(t) of the first amplified signal x1(t), the second amplification gain value G2(t) (corresponding to the aforementioned second gain value) is obtained by combining the signal energy log-likelihood ratio LR1(t) of the first amplified signal x1(t), which can be represented as:
[0072] G2(t) = f1(Env1(t), LR1(t))
[0073] where f1(·) represents a function relationship, indicating that G2(t) can be obtained through Env1(t) and LR1(t) by appropriate strategies. For example, the function relationship represented by f1(·) can be:
[0074]
[0075] where Max_Env (corresponding to the aforementioned target envelope value) represents the maximum value that the envelope value can reach.
[0076] 3.4 The first amplified signal x1(t) is amplified according to the second amplification gain value G2(t) to obtain the second amplified signal x2(t):
[0077] x2(t) = G2(t) * x1(t)
[0078] 4. Calculate the feature value F2(t) of the second amplified signal x2(t), such as the signal sub-frame energy, and adjust the gain value G1(t) of the first amplification to obtain a new gain value G1(t+1) according to F0(t) and F2(t):
[0079] 4.1 First, calculate the signal sub-frame energy of the second amplified signal x2(t):
[0080] The second amplified signal x2(t) is equally divided into W sub-frames, each of length K, and N=W*K, and the energy value of each sub-frame is calculated
[0081]
[0082] where x2(n) represents a sample point of the signal x2(t).
[0083] 4.2 Then, according to the signal energy log-likelihood ratio LR0(t) of the original speech signal x0(t) and the sub-frame energy value of the second amplified signal x2(t) The gain value change amount Δ is solved, and a new gain value G1(t+1) is obtained:
[0084]
[0085] where f2(·) represents a function relationship, and Δ can be obtained by and LR0(t) through appropriate strategies.
[0086] 4.3 Preventing abnormal speech quality caused by excessive change amount Δ
[0087] It is set that, in each frame, G1(t+1) is increased by a fixed increment Δ0 compared with G1(t), that is, G1(t+1)=G1(t)+Δ0, (Δ=m*Δ0), until the increment of the gain value G1(t+1) reaches the set gain value change amount Δ.
[0088] 5, The adjusted gain value G1(t+1) is fed back to step 2 of the t+1 frame, which is used to obtain the gain value G1(t+1) of the first amplification processing in the t+1 frame, and the automatic gain signal x2(t) is output.
[0089] In the above embodiment, a robust method for controlling the gain value of speech is provided, which includes non-overlapping frame division of an input signal, calculation of a characteristic value of an original signal, then first amplification operation, then calculation of a characteristic value of a first amplified signal, execution of a second signal amplification operation, then calculation of a characteristic value of a second amplified signal, adjustment of the gain value of the first amplification to obtain a new gain value in combination with the characteristic value of the original signal, feedback of the new gain value to the next frame processing, and influence on the first amplification capability in the next frame.
[0090] Compared with the related art, the embodiment of the application achieves the mutual compensation effect of gain regulation by designing a double gain control structure, can effectively realize the volume balance effect of the sound that is large or small, and can enhance the robustness of the above double gain control structure through the design of feedback gain, avoid excessive gain regulation, and achieve the purpose of rapid gain regulation.
[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software on a general hardware platform, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.
[0092] In the embodiment, a voice signal processing device is also provided, Figure 4 is a structural block diagram of the voice signal processing device according to the embodiment of the present application, as Figure 4 shown, the device comprises:
[0093] The acquisition module 402 is configured to acquire a current frame of voice signal.
[0094] The first processing module 404 is configured to perform a first amplification operation on the current frame of voice signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame of voice signal of the current frame of voice signal and a second voice signal, and the second voice signal is a voice signal obtained after the first amplification operation and a second amplification operation are performed on the previous frame of voice signal.
[0095] The second processing module 406 is configured to determine a second gain value according to a first characteristic value of the first amplified signal, and perform the second amplification operation on the first amplified signal according to the second gain value to obtain a target voice signal.
[0096] In an optional embodiment, the second processing module 406 described above comprises: a first determining sub-module configured to determine a first log-likelihood ratio LR1 of a signal energy of the first amplified signal, and determine a set of envelope values of the first amplified signal, wherein the set of envelope values comprises envelope values respectively determined from each of W sub-frames after the first amplified signal is divided into the W sub-frames, and W is a positive integer greater than or equal to 1; and a second determining sub-module configured to determine the second gain value according to the first log-likelihood ratio LR1 and the set of envelope values, wherein the first characteristic value comprises the first log-likelihood ratio LR1 and the set of envelope values.
[0097] In an alternative embodiment, the second determining sub-module comprises: a selecting unit, configured to select a target envelope value from the set of envelope values; and a first determining unit, configured to determine the second gain value according to the first log-likelihood ratio LR1 and a relationship between the target envelope value and each envelope value in the set of envelope values.
[0098] In an alternative embodiment, the first determining unit comprises: a first determining sub-unit, configured to determine a gain value corresponding to an i-th sub-frame in the W sub-frames from the second gain value according to the following steps, where i is a positive integer greater than or equal to 1 and less than W: if a ratio of the target envelope value to an envelope value corresponding to the i-th sub-frame in the set of envelope values is greater than a predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (r*LR1); and if the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is less than or equal to the predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (the first log-likelihood ratio LR1*the target envelope value / the envelope value corresponding to the i-th sub-frame).
[0099] In an alternative embodiment, the first determining sub-module comprises: a second determining unit, configured to determine a first average energy value M1 of the first amplified signal; a first calculating unit, configured to calculate a first time average M_L1 and a first standard deviation D_L1 of the energy of the first amplified signal according to the following formulas: M_L1 = a*M1 + (1-a)*M_L1', a third determining unit, configured to determine the first log-likelihood ratio LR1 according to the first average energy value M1, the first time average M_L1 and the first standard deviation D_L1 according to the following formula: LR1 = b*(M1-M_L1) / D_L1 + (1-b)*LR1', where a is a first preset smoothing coefficient, b is a second preset smoothing coefficient, M_L1', D_L1' and LR1' represent a time average, a standard deviation and a log-likelihood ratio of the energy of the amplified signal obtained after the first amplification operation on the previous frame of speech signal, respectively.
[0100] In an alternative embodiment, the apparatus further comprises a determining module, configured to determine a third gain value according to the current frame of speech signal and a target frame of speech signal after obtaining the target frame of speech signal, where the third gain value is a gain value used in the first amplification operation on the target frame of speech signal.
[0101] In an alternative embodiment, the determining module comprises: a third determining sub-module, configured to determine a second log-likelihood ratio LR0 of signal energy of the current frame of speech signal, and determine a sub-frame energy value E(j) of the jth sub-frame, to obtain W sub-frame energy values wherein the jth sub-frame is used to represent the jth sub-frame of the W sub-frames after the target speech signal is divided into the W sub-frames, W is a positive integer greater than or equal to 1, and j is a positive integer greater than or equal to 1 and less than or equal to W; a fourth determining sub-module, configured to determine a third gain value according to the second log-likelihood ratio LR0 and the W sub-frame energy values a gain value adjustment amount, and a fifth determining sub-module, configured to determine the third gain value according to the following formula: the third gain value = the first gain value + (the gain value adjustment amount / m), wherein m is a positive integer greater than or equal to 1.
[0102] In an alternative embodiment, the third determining sub-module comprises: a fourth determining unit, configured to determine a second average energy value M0 of the current frame of speech signal; a second calculating unit, configured to calculate a second time average M_L0 and a second standard deviation D_L0 of the energy of the current frame of speech signal according to the following formulae: a fifth determining unit, configured to determine the second log-likelihood ratio LR0 according to the second average energy value M0, the second time average M_L0 and the second standard deviation D_L0, and according to the following formula: LR0 = β*(M0-M_L0) / D_L0 + (1-β)*LR0', wherein α is a first smoothing coefficient, β is a second smoothing coefficient, M_L0', D_L0' and LR0' represent a time average, a standard deviation and a log-likelihood ratio of signal energy of the previous frame of speech signal, respectively.
[0103] In an alternative embodiment, the third determining sub-module comprises: a third calculating unit, configured to calculate the energy value of the jth sub-frame according to the following formula for the jth sub-frame of the W sub-frames: wherein x(n) represents a signal amplitude of an nth sample point in the target speech signal, and K is the number of sample points in the jth sub-frame.
[0104] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the modules are located in the same processor; or each of the modules is located in a different processor in any combination.
[0105] The embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is arranged to execute the steps in any of the method embodiments when running.
[0106] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing a computer program.
[0107] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is arranged to execute the computer program to perform the steps in any of the method embodiments.
[0108] In an example embodiment, the electronic device can further comprise a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0109] The specific examples in the embodiment can refer to the examples described in the above embodiments and example embodiments, and the embodiment will not be described here again.
[0110] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, and they can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
[0111] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method of processing a speech signal, characterized by, The method comprises: obtaining a current frame voice signal; performing a first amplification operation on the current frame voice signal according to a first gain value to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame voice signal of the current frame voice signal and a second voice signal, and the second voice signal is obtained by performing the first amplification operation and a second amplification operation on the previous frame voice signal; determining a second gain value according to a first characteristic value of the first amplified signal, and performing the second amplification operation on the first amplified signal according to the second gain value to obtain a target voice signal; wherein the second gain value is determined according to the first characteristic value of the first amplified signal, which comprises determining a first log-likelihood ratio LR1 of a signal energy of the first amplified signal, and determining a set of envelope values of the first amplified signal, wherein the set of envelope values comprises envelope values determined according to each of W sub-frames obtained by dividing the first amplified signal into W sub-frames, and W is a positive integer greater than or equal to 1; and the second gain value is determined according to the first log-likelihood ratio LR1 and the set of envelope values, wherein the first characteristic value comprises the first log-likelihood ratio LR1 and the set of envelope values; the second gain value is determined according to the first log-likelihood ratio LR1 and the set of envelope values, which comprises selecting a target envelope value from the set of envelope values, and determining the second gain value according to the first log-likelihood ratio LR1 and a relationship between the target envelope value and each envelope value in the set of envelope values; According to the first log likelihood ratio LR1 and the relationship between the target envelope value and each envelope value in the set of envelope values, the second gain value is determined, including: determining a gain value corresponding to an i-th subframe in the W subframes included in the second gain value according to the following steps, wherein i is a positive integer greater than or equal to 1 and less than W: in a case that a ratio of the target envelope value to an envelope value corresponding to the i-th subframe in the set of envelope values is greater than a predetermined proportion threshold r, the gain value corresponding to the i-th subframe is determined to be equal to (r LR1); in a case that the ratio of the target envelope value to the envelope value corresponding to the i-th subframe is less than or equal to the predetermined proportion threshold r, the gain value corresponding to the i-th subframe is determined to be equal to (the first log likelihood ratio LR1 the target envelope value / the envelope value corresponding to the i-th subframe).
2. The method of claim 1, wherein, the first log-likelihood ratio LR1 of the signal energy of the first amplified signal is determined by: determining a first average energy value M1 of the first amplified signal; calculating a first time mean value M_L1 and a first standard deviation value D_L1 of the energy of the first amplified signal according to the following formula: , ; determining the first log-likelihood ratio LR1 according to the first average energy value M1, the first time mean value M_L1 and the first standard deviation value D_L1 according to the following formula: ; wherein, is a preset first smoothing coefficient, is a preset second smoothing coefficient, M_L1', D_L1', and LR1' are respectively used to represent a time average, a standard deviation value, and a log likelihood ratio of signal energy of an amplified signal obtained after the first amplification operation on the previous frame of speech signal.
3. The method of claim 1, wherein, after obtaining the target voice signal, the method further comprises: determining a third gain value according to the current frame voice signal and the target voice signal, wherein the third gain value is a gain value used when performing the first amplification operation on a next frame voice signal of the current frame voice signal.
4. The method of claim 3, wherein, the third gain value is determined according to the current frame voice signal and the target voice signal, which comprises: determining a second log-likelihood ratio LRO of a signal energy of the current frame voice signal, and determining a subframe energy value E(j) of a jth subframe, to obtain W subframe energy values wherein the jth subframe is used to represent a jth subframe of the W subframes after the target voice signal is divided into the W subframes, W is a positive integer greater than or equal to 1, and j is a positive integer greater than or equal to 1 and less than or equal to W. determining a gain value adjustment amount based on the second log likelihood ratio LR0 and the W subframe energy values , determining a gain value adjustment amount; determining the third gain value according to the following formula: the third gain value = the first gain value + (the gain value adjustment amount / m), and m is a positive integer greater than or equal to 1.
5. The method of claim 4, wherein, the second log-likelihood ratio LR0 of the signal energy of the current frame voice signal is determined by: determining a second average energy value M0 of the current frame voice signal; calculating a second time mean value M_L0 and a second standard deviation value D_L0 of the energy of the current frame voice signal according to the following formula: , ; According to the second average energy value M0, the second time average M_L0 and the second standard deviation value D_L0, and according to the following formula, the second log likelihood ratio LR0 is determined: ; wherein is a first smoothing coefficient, is a second smoothing coefficient, M_L0', D_L0' and LR0' are used to represent a time mean value, a standard deviation value and a log likelihood ratio of the signal energy of the previous frame of speech signal, respectively.
6. The method of claim 4, wherein, The determination of the subframe energy value E(j) of the jth subframe comprises: For the jth subframe in the W subframes, the energy value of the jth subframe is calculated according to the following formula: , Wherein, x(n) represents the signal amplitude of the nth sample point in the target voice signal, and K is the number of sample points in the jth subframe.
7. A speech signal processing apparatus characterized by comprising: Comprise: An acquisition module is configured to acquire a current frame of voice signal; A first processing module is configured to perform a first amplification operation on the current frame of voice signal according to a first gain value, to obtain a first amplified signal, wherein the first gain value is determined according to a previous frame of voice signal of the current frame of voice signal and a second voice signal, and the second voice signal is a voice signal obtained after performing the first amplification operation and a second amplification operation on the previous frame of voice signal; A second processing module is configured to determine a second gain value according to a first characteristic value of the first amplified signal, and perform the second amplification operation on the first amplified signal according to the second gain value, to obtain a target voice signal; The second processing module comprises: a first determination submodule configured to determine a first log likelihood ratio LR1 of signal energy of the first amplified signal, and determine a group of envelope values of the first amplified signal, wherein the group of envelope values comprises envelope values respectively determined according to each of W subframes after the first amplified signal is divided into the W subframes, and W is a positive integer greater than or equal to 1; and a second determination submodule configured to determine the second gain value according to the first log likelihood ratio LR1 and the group of envelope values, wherein the first characteristic value comprises the first log likelihood ratio LR1 and the group of envelope values; The second determination submodule comprises: a selection unit configured to select a target envelope value from the group of envelope values; and a first determination unit configured to determine the second gain value according to the first log likelihood ratio LR1 and a relationship between the target envelope value and each envelope value in the group of envelope values. The first determining unit comprises a first determining sub-unit configured to determine the gain value corresponding to the i-th sub-frame among the W sub-frames included in the second gain values according to the following steps, where i is a positive integer greater than or equal to 1 and less than W: in the case that the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame among the set of envelope values is greater than a predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (r LR1); in the case that the ratio of the target envelope value to the envelope value corresponding to the i-th sub-frame is less than or equal to the predetermined proportion threshold r, the gain value corresponding to the i-th sub-frame is determined to be equal to (the first log-likelihood ratio LR1 the target envelope value / envelope value corresponding to the i-th sub-frame).
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for adjusting gain and circuit
CN107911091A
Automatic gain control method of voice signal and related device thereof
CN113470691A