Sound coding and decoding method and related device and system

CN119604933APending Publication Date: 2025-03-11HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380055614.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-07-29
Filing Date
2023-05-06
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The complexity of calculating the codebook gain in the existing CELP encoding and decoding technology is high, especially in logarithmic operation and base 10 exponential operation, resulting in high algorithm complexity.

Method used

Obtain the linear or logarithmic domain estimate of the algebraic codebook gain by directly looking up the table in the first subframe, avoiding logarithmic log operations and base 10 exponential operations, directly calculating the quantized gain of the algebraic codebook, and reducing the complexity of the algorithm. Spend.

Benefits of technology

The complexity of the algorithm is significantly reduced, complex calculations of the codec are avoided at runtime, and calculation efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119604933A_ABST
    Figure CN119604933A_ABST
Patent Text Reader

Abstract

The invention relates to a sound coding and decoding method, a related device and a related system. The calculation process of CELP coding and decoding about algebraic book gain in a first subframe is improved. Firstly, a linear estimated value of an algebraic book gain in a linear domain can be obtained by looking up a table according to an index CTindex of a classification parameter CT of a current frame; then, the linear estimated value of the gain of the algebraic codebook in the linear domain is removed by utilizing the energy (represented as I) of the algebraic codebook vector from the algebraic codebook in the linear domain, and the estimated gain II of the algebraic codebook in the first subframe is obtained; therefore, when the estimation gain of the algebraic codebook of the first subframe is calculated by coding and decoding, high-complexity operations such as logarithm log operation and exponential operation taking 10 as the bottom can be completely avoided, and the algorithm complexity is remarkably reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Sound encoding and decoding method and related device and system

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 29, 2022, with application number 202210908196.9 and application name “Sound Coding and Decoding Method and Related Devices and Systems”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of sound coding and decoding, and in particular to a sound coding and decoding technology based on code-excited linear prediction (CELP). Background Art

[0003] Code-Excited Linear Prediction (CELP) technology, first proposed by Manfred R. Schroeder and Bishnu S. Atal in 1985, achieves a good compromise between quality and bit rate. In a CELP encoder, the input speech or audio signal (sound signal) is processed in frames. Frames are further divided into smaller blocks, called subframes. In the codec, the excitation signal is determined within each subframe and consists of two components: one derived from the past excitation (also known as an adaptive codebook) and the other from the algebraic codebook (also known as a fixed codebook or innovative codebook). The encoding side transmits coding parameters, such as the algebraic codebook gain and the adaptive codebook gain, to the decoding side. These coding parameters are calculated when the error between the reconstructed speech signal and the original is minimized. Reducing computational complexity is a hot research topic in this field.

[0004] Summary of the Invention

[0005] Various embodiments of the present application provide a sound coding and decoding method that can reduce the complexity of calculating codebook gain.

[0006] In a first aspect, a method for encoding a sound signal is provided, which is applied to a first subframe in a current frame. The method may include: receiving a frame classification parameter index of the current frame, searching a first mapping table for a linear estimate of an algebraic codebook gain in a linear domain based on the frame classification parameter index of the current frame, wherein each entry in the first mapping table includes two values: the frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain. The energy of an algebraic codebook vector from an algebraic codebook is calculated, the linear estimate of the algebraic codebook gain in the linear domain is divided by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook, and the estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook. The correction factor is derived from a winning codebook vector, which is selected from a gain codebook.

[0007] The method provided in the first aspect may further include: transmitting coding parameters. The coding parameters may include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0008] In a second aspect, a method for decoding a sound signal, similar to the method for encoding a sound signal in the first aspect, is provided. The method is also applied to a first subframe in a current frame. The method may include: receiving coding parameters, which may include: a frame classification parameter index of the current frame and an index of a winning codebook vector; searching a first mapping table for a linear estimate of an algebraic codebook gain in the linear domain based on the frame classification parameter index of the current frame. Each entry in the first mapping table includes two values: the frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain. Furthermore, the energy of the algebraic codebook vector from the algebraic codebook is calculated, and the linear estimate of the algebraic codebook gain in the linear domain is divided by the square root of the energy of the algebraic codebook vector to obtain an estimated algebraic codebook gain. Finally, the estimated algebraic codebook gain is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook. The correction factor is derived from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on the index of the winning codebook vector.

[0009] The methods provided in the first and second aspects have at least the following beneficial effects: when the codec calculates the estimated gain of the algebraic codebook of the first subframe, highly complex operations such as logarithmic operations and base 10 exponential operations can be completely avoided, significantly reducing the complexity of the algorithm. In addition, the codec can directly look up the table to obtain the corresponding parameter CT of the current frame. The value of is saved to avoid recalculation during codec runtime, thus reducing the algorithm complexity.

[0010] In a third aspect, a method for encoding a sound signal is provided, applied to a first subframe in a current frame. The method may include: receiving a frame classification parameter index of the current frame; searching a first mapping table for a linear estimate of an algebraic codebook gain in the logarithmic domain based on the frame classification parameter index of the current frame, wherein each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimate of the algebraic codebook gain in the logarithmic domain. Furthermore, converting the linear estimate of the algebraic codebook gain in the logarithmic domain to a linear domain using an exponential operation to obtain a linear estimate of the algebraic codebook gain in the linear domain; calculating the energy of an algebraic codebook vector from the algebraic codebook; dividing the linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; and finally, multiplying the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook; the correction factor is derived from a winning codebook vector selected from the gain codebook.

[0011] The method provided in the third aspect may further include: transmitting coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0012] In a fourth aspect, relative to the method for encoding a sound signal in the third aspect, a method for decoding a sound signal is provided, which is also applied to the first subframe in the current frame, and the method may include: receiving coding parameters; the coding parameters include: the frame type of the current frame, the linear estimation constant in the first subframe, and the index of the winning codebook vector; using the linear estimation constant in the first subframe and the frame type of the current frame to perform linear estimation to obtain a linear estimation value of the algebraic codebook gain in the logarithmic domain; converting the linear estimation value of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain a linear estimation value of the algebraic codebook gain in the linear domain; calculating the energy of the algebraic codebook vector from the algebraic codebook; dividing the linear estimation value of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; multiplying the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on the index of the winning codebook vector.

[0013] The methods provided in the third and fourth aspects have at least the following beneficial effects: when the codec calculates the estimated gain of the algebraic codebook for the first subframe, logarithmic and exponential operations associated with the energy Ec of the algebraic codebook vector can be avoided, thereby reducing algorithmic complexity. Furthermore, the codec can directly look up the table to obtain the value of a0+a1CT corresponding to the parameter CT of the current frame, eliminating the need to recalculate this value during codec runtime, thus saving computational effort.

[0014] In a fifth aspect, a method for encoding a sound signal is provided, which is applied to the first subframe in the current frame. The method may include: performing linear estimation using the linear estimation constant in the first subframe and the frame type of the current frame to obtain a linear estimation value of the algebraic codebook gain in the logarithmic domain; converting the linear estimation value of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain a linear estimation value of the algebraic codebook gain in the linear domain; calculating the energy of the algebraic codebook vector from the algebraic codebook; dividing the linear estimation value of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain the estimated gain of the algebraic codebook; multiplying the estimated gain of the algebraic codebook by a correction factor to obtain the quantization gain of the algebraic codebook; the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook.

[0015] The method provided in the fifth aspect may further include: transmitting coding parameters, the coding parameters including: a frame type of a current frame, a linear estimation constant, and an index of a winning codebook vector in a gain codebook.

[0016] In a sixth aspect, relative to the method for encoding a sound signal in the fifth aspect, a method for decoding a sound signal is provided, which is also applied to the first subframe in the current frame, and the method may include: receiving coding parameters; the coding parameters include: the frame type of the current frame, the linear estimation constant in the first subframe, and the index of the winning codebook vector; using the linear estimation constant in the first subframe and the frame type of the current frame to perform linear estimation to obtain a linear estimation value of the algebraic codebook gain in the logarithmic domain; converting the linear estimation value of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain a linear estimation value of the algebraic codebook gain in the linear domain; calculating the energy of the algebraic codebook vector from the algebraic codebook; dividing the linear estimation value of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; multiplying the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on the index of the winning codebook vector.

[0017] The methods provided in the fifth and sixth aspects have at least the following beneficial effects: when encoding and decoding the estimated gain of the algebraic codebook of the first subframe, the logarithmic and exponential operations involved in the energy Ec of the algebraic codebook vector can be avoided, thereby reducing the algorithm complexity.

[0018] In a seventh aspect, a method for encoding a sound signal is provided, which is applied to the first subframe in the current frame. The method may include: receiving a frame classification parameter index of the current frame; searching a linear estimate of the algebraic codebook gain in the linear domain in a first mapping table according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimate of the algebraic codebook gain in the linear domain; calculating the energy Ec of the algebraic codebook vector from the algebraic codebook, performing a logarithm operation with a base of 10 on the square root of the energy, and then taking the inverse of the logarithm value and performing an exponential operation with a base of 10 to obtain Multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the estimated gain of the algebraic codebook; The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook.

[0019] The method provided in the seventh aspect may further include: transmitting coding parameters, the coding parameters including: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0020] In an eighth aspect, relative to the method for encoding a sound signal in the seventh aspect, a method for decoding a sound signal is provided, which is also applied to the first subframe in the current frame, and the method may include: receiving encoding parameters; the encoding parameters include: the frame classification parameter index of the current frame, the index of the winning codebook vector; searching for a linear estimate of the algebraic codebook gain in the linear domain in the first mapping table according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimate of the algebraic codebook gain in the linear domain; calculating the energy Ec of the algebraic codebook vector from the algebraic codebook, and performing a logarithm operation with a base of 10 on the square root of the energy, and then taking the inverse of the value after the logarithm operation and performing an exponential operation with a base of 10 to obtain Multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the estimated gain of the algebraic codebook; The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, where the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on the index of the winning codebook vector.

[0021] The methods provided in the seventh and eighth aspects have at least the following beneficial effects: the codec can directly look up the table to obtain the corresponding parameter CT of the current frame. The value of can avoid the base 10 exponential operation involved in the linear estimation of the algebraic codebook gain, reducing the complexity of the algorithm.

[0022] The methods for encoding and decoding sound signals provided in aspects 1 to 8 above may further include: multiplying an algebraic codebook vector from an algebraic codebook by a quantization gain of an algebraic codebook gain to obtain an excitation contribution of the algebraic codebook. Furthermore, using a winning codebook vector selected from the gain codebook includes [ ]. Finally, adding the excitation contribution of the algebraic codebook to the excitation contribution of the adaptive codebook to obtain a total excitation. The total excitation can be used to reconstruct a speech signal through a synthesis filter.

[0023] In a ninth aspect, a device with speech coding functionality is provided, which can be used to implement the method provided in the first aspect. The device may include: a search component, such as a table lookup module 601 shown in FIG6 , configured to search a first mapping table for a linear estimate of an algebraic codebook gain in the linear domain based on a frame classification parameter index of a current frame. Each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain. A first calculator, including a square summer 603 and a square root calculator 604 as shown in FIG6 , is configured to calculate the energy of an algebraic codebook vector from an algebraic codebook. A first multiplier, such as the multiplier 602 shown in FIG6 , is configured to multiply the linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. A second multiplier, such as the multiplier 605 shown in FIG6 , is configured to multiply the estimated gain of the algebraic codebook by a correction factor included in a winning codebook vector to obtain a quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

[0024] The apparatus provided in the ninth aspect may further include: a communication component, the communication component being used to transmit coding parameters, the coding parameters including: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0025] In a tenth aspect, a device with a speech decoding function is provided, which can be used to implement the method provided in the second aspect. The device may include: a communication component, configured to receive coding parameters. The coding parameters include: a frame classification parameter index of the current frame and an index of a winning codebook vector. A first search component, such as a table lookup module 601 shown in FIG6 , is configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the linear domain based on the frame classification parameter index of the current frame. Each entry in the first mapping table includes two values: the frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain. A first calculator, including a square summer 603 and a square root calculator 604 as shown in FIG6 , is configured to calculate the energy of an algebraic codebook vector from an algebraic codebook. A first multiplier, such as the multiplier 602 shown in FIG6 , is configured to multiply the linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. A second multiplier, such as multiplier 605 shown in FIG6 , is configured to multiply the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, where the correction factor is derived from the winning codebook vector. A second search component is configured to search the winning codebook vector from the gain codebook based on an index of the winning codebook vector.

[0026] In an eleventh aspect, a device with speech coding functionality is provided, which can be used to implement the method provided in the third aspect. The device may include: a search component, such as a table lookup module 701 shown in FIG7 , configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the logarithmic domain based on a frame classification parameter index of a current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimate of the algebraic codebook gain in the logarithmic domain; a converter, such as an exponential calculator 702 shown in FIG7 , configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain a linear estimate of the algebraic codebook gain in the linear domain; a first calculator, such as a square summer 704 and a square root calculator 705 shown in FIG7 , configured to calculate the energy of an algebraic codebook vector from an algebraic codebook; and a first multiplier, such as a multiplier 703 shown in FIG7 , configured to multiply the linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. The second multiplier, such as the multiplier 707 shown in FIG7 , is configured to multiply the estimated gain of the algebraic codebook by the correction factor included in the winning codebook vector to obtain the quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

[0027] The apparatus provided in the eleventh aspect may further include: a communication component, the communication component being used to transmit coding parameters, the coding parameters including: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0028] In the twelfth aspect, a device with a speech decoding function is provided, which can be used to implement the method provided in the fourth aspect above. The device may include: a communication component, which is used to receive coding parameters. The coding parameters include: a frame classification parameter index of the current frame, and an index of a winning codebook vector. A first search component, such as the table lookup module 701 shown in FIG7 , is used to search the first mapping table for a linear estimate of the algebraic codebook gain in the logarithmic domain based on the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the logarithmic domain. A converter, such as the exponential calculator 702 shown in FIG7 , is used to convert the linear estimate of the algebraic codebook gain in the logarithmic domain into the linear domain through an exponential operation to obtain a linear estimate of the algebraic codebook gain in the linear domain.

[0029] The first calculator, including a square summator 704 and a square root calculator 705 as shown in FIG7 , is configured to calculate the energy of an algebraic codebook vector from an algebraic codebook. A first multiplier, such as multiplier 703 as shown in FIG7 , is configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. A second multiplier, such as multiplier 707 as shown in FIG7 , is configured to multiply the estimated gain of the algebraic codebook by a correction factor to obtain a quantized gain of the algebraic codebook, the correction factor being derived from the winning codebook vector. A second search component is configured to search the winning codebook vector from the gain codebook based on an index of the winning codebook vector.

[0030] In a thirteenth aspect, a device having a speech coding function is provided, which can be used to implement the method provided in the fifth aspect. The device may include: a linear prediction component, such as a linear estimation module 801 shown in FIG8 , configured to perform linear estimation using a linear estimation constant in a first subframe and a frame type of a current frame to obtain a linear estimate of an algebraic codebook gain in a logarithmic domain; a converter, such as an exponential calculator 802 shown in FIG8 , configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain to a linear domain through an exponential operation to obtain a linear estimate of the algebraic codebook gain in the linear domain; a first calculator, including a square summer 804 and a square root calculator 805 shown in FIG8 , configured to calculate the energy of an algebraic codebook vector from an algebraic codebook; and a first multiplier, such as a multiplier 803 shown in FIG8 , configured to multiply the linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. The second multiplier, such as the multiplier 806 shown in FIG8 , is configured to multiply the estimated gain of the algebraic codebook by the correction factor included in the winning codebook vector to obtain the quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

[0031] The apparatus provided in the thirteenth aspect may further include: a communication component, the communication component being used to transmit coding parameters, the coding parameters including: a frame type of the current frame, a linear estimation constant, and an index of the winning codebook vector in the gain codebook.

[0032] In a fourteenth aspect, a device with a speech decoding function is provided, which can be used to implement the method provided in the sixth aspect above. The device may include: a communication component, the communication component being used to receive coding parameters. The coding parameters include: the frame type of the current frame, the linear estimation constant in the first subframe, and the index of the winning codebook vector. A linear prediction component, such as the linear estimation module 801 shown in Figure 8, is used to perform linear estimation using the linear estimation constant in the first subframe and the frame type of the current frame to obtain a linear estimate of the algebraic codebook gain in the logarithmic domain. A converter, such as the exponential calculator 802 shown in Figure 8, is used to convert the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain a linear estimate of the algebraic codebook gain in the linear domain. A first calculator, including the square summer 804 and the square root calculator 805 shown in Figure 8, is used to calculate the energy of the algebraic codebook vector from the algebraic codebook. A first multiplier, such as multiplier 803 shown in FIG8 , is configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook. A second multiplier, such as multiplier 806 shown in FIG8 , is configured to multiply the estimated gain of the algebraic codebook by a correction factor derived from the winning codebook vector to obtain a quantized gain of the algebraic codebook. A search component is configured to search the winning codebook vector from the gain codebook based on an index of the winning codebook vector.

[0033] In the fifteenth aspect, a device with a speech coding function is provided, which can be used to implement the method provided in the seventh aspect above. The device may include: a first search component, such as the table lookup module 901 shown in Figure 9, which is used to search the linear estimate of the algebraic codebook gain in the linear domain in the first mapping table according to the frame classification parameter index of the current frame. Each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimate of the algebraic codebook gain in the linear domain. A first calculator, including a square summer 903 and a square root calculator 904 as shown in Figure 9, is used to calculate the energy Ec of the algebraic codebook vector from the algebraic codebook. A logarithm operator, such as the calculator 905 shown in Figure 9, is used to perform a logarithm operation with a base of 10 on the square root of the energy. An exponential operator, such as the calculator 906 shown in Figure 9, is used to take the inverse of the value after the logarithm operation and then perform an exponential operation with a base of 10 to obtain The first multiplier, such as the multiplier 902 shown in FIG9 , is used to multiply the linear estimate of the algebraic codebook gain in the linear domain by The second multiplier, such as the multiplier 907 shown in FIG9 , is used to convert the estimated gain of the algebraic codebook into The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook.

[0034] The apparatus provided in the fifteenth aspect may further include: a communication component, the communication component being used to transmit coding parameters, the coding parameters including: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

[0035] In the sixteenth aspect, a device with a speech decoding function is provided, which can be used to implement the method provided in the eighth aspect above. The device may include: a communication component for receiving coding parameters. The coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook. A first search component, such as the table lookup module 901 shown in FIG9 , is used to search the first mapping table for a linear estimate of the algebraic codebook gain in the linear domain according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain. A first calculator, including a square summer 903 and a square root calculator 904 as shown in FIG9 , is used to calculate the energy Ec of the algebraic codebook vector from the algebraic codebook. A logarithm operator, such as the calculator 905 shown in FIG9 , is used to perform a logarithm operation with a base of 10 on the square root of the energy. An exponential operator, such as the calculator 906 shown in FIG9 , is used to take the inverse of the value after the logarithm operation and then perform an exponential operation with a base of 10 to obtain The first multiplier, such as the multiplier 902 shown in FIG9 , is used to multiply the linear estimate of the algebraic codebook gain in the linear domain by The second multiplier, such as the multiplier 907 shown in FIG9 , is used to convert the estimated gain of the algebraic codebook into The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, where the correction factor comes from the winning codebook vector. The second searching component is configured to search the winning codebook vector from the gain codebook based on the index of the winning codebook vector.

[0036] The apparatus with speech encoding and decoding functions provided in aspects 9 to 16 above may further include:

[0037] a third multiplier, configured to multiply the algebraic codebook vector from the algebraic codebook by a quantized gain of the algebraic codebook gain to obtain an excitation contribution of the algebraic codebook;

[0038] a fourth multiplier, configured to multiply the adaptive codebook vector from the adaptive codebook by the quantization gain of the adaptive codebook included in the winning codebook vector selected from the gain codebook to obtain an excitation contribution of the adaptive codebook;

[0039] An adder is used to add the excitation contribution of the algebraic codebook and the excitation contribution of the adaptive codebook to obtain a total excitation.

[0040] In a seventeenth aspect, a voice communication system is provided, which may include: a first device and a second device, wherein the first device may be configured to perform the methods for encoding voice signals provided in the first, third, fifth, and seventh aspects, and the second device may be configured to perform the methods for encoding voice signals provided in the second, fourth, sixth, and eighth aspects. The first device may be the device having voice encoding functionality provided in the ninth, eleventh, thirteenth, and fifteenth aspects, and the second device may be the device having voice decoding functionality provided in the ninth, twelfth, fourteenth, and sixteenth aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments of the present application will be described below.

[0042] FIG1 shows a block diagram of an existing CELP encoding algorithm;

[0043] FIG2 shows a block diagram of an existing CELP decoding algorithm;

[0044] FIG3 shows a gain quantization process in an encoder for memoryless joint gain coding;

[0045] FIG4 shows the process of calculating the algebraic codebook gain in the first subframe;

[0046] FIG5 shows the process of calculating the algebraic codebook gain in the second subframe and subsequent subframes;

[0047] FIG6 shows a process of calculating the algebraic codebook gain in the first subframe provided in the first embodiment of the present application;

[0048] FIG7 shows a process of calculating the algebraic codebook gain in the first subframe provided by the second embodiment of the present application;

[0049] FIG8 shows a process of calculating the algebraic codebook gain in the first subframe provided in the third embodiment of the present application;

[0050] FIG9 shows a process of calculating the algebraic codebook gain in the first subframe provided by the fourth embodiment of the present application;

[0051] FIG10 shows a process for using the calculated estimated constants for gain codebook design;

[0052] FIG11 shows a voice communication system including a voice encoding device and a voice decoding device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The embodiments of the present application improve the existing technology of CELP coding and decoding, and can reduce the complexity of calculating codebook gain while realizing memoryless joint gain coding.

[0054] Existing CELP codec technology

[0055] FIG1 shows a block diagram of an existing CELP encoding algorithm.

[0056] The input speech signal is first preprocessed. During the preprocessing, the input speech signal can be sampled and pre-emphasized. The preprocessed signal is further output to the LPC analysis, quantization and interpolation module 101 and the adder 102. The LPC analysis, quantization and interpolation module 101 performs linear prediction analysis on the input speech signal, quantizes and interpolates the analysis results, and calculates the linear prediction coding (LPC) parameters. The LPC parameters are used to construct the synthesis filter 103. The algebraic codebook vector from the algebraic codebook is multiplied by the algebraic codebook gain g c The result is multiplied by the adaptive codebook gain g from the adaptive codebook vector p The results are output to adder 104 for addition, and the added result is output to synthesis filter 103 to construct the reconstructed speech signal generated after the excitation signal passes through synthesis filter 103. The reconstructed speech signal is also output to adder 102 and subtracted from the input speech signal to obtain an error signal.

[0057] The error signal is processed by a perceptual weighting filter 105, which modifies the spectrum according to auditory perception and is fed back to a pitch analysis module 106 and an algebra codebook search module 107. The perceptual weighting filter 105 is also constructed based on LPC parameters.

[0058] The excitation signal and codebook gain are determined based on the principle of minimizing the mean square error of the perceptually weighted error signal. The pitch analysis module 106 infers the pitch period through autocorrelation analysis and searches the adaptive codebook to determine the optimal adaptive codebook vector, thereby obtaining an excitation signal with quasi-periodic characteristics in the speech. The algebraic codebook search module 107 searches the algebraic codebook and determines the optimal algebraic codebook vector based on the principle of minimizing the weighted mean square error, thereby obtaining a random excitation signal for the speech model. The gain of the optimal adaptive codebook vector and the gain of the optimal algebraic codebook vector are then determined. Coding parameters such as the codebook quantization gain, the index of the optimal adaptive codebook vector in the adaptive codebook, the index of the optimal algebraic codebook vector in the algebraic codebook, and linear predictive coding parameters form a bitstream that is transmitted to the decoding side.

[0059] FIG2 shows a block diagram of an existing CELP decoding algorithm.

[0060] First, the decoding side obtains the coding parameters from the compressed bitstream. It then uses these coding parameters to generate an excitation signal. Each subframe undergoes the following processing: the adaptive codebook vector and the algebraic codebook vector are multiplied by their respective quantization gains to generate the excitation signal. The excitation signal then passes through the linear prediction synthesis filter 201 to obtain the reconstructed speech signal. On the decoding side, the linear prediction synthesis filter 201 is also constructed based on the LPC parameters.

[0061] Memory-less joint gain coding

[0062] Furthermore, memoryless joint gain coding can be implemented for the adaptive codebook gain and the algebraic codebook gain in each subframe, especially at low bit rates (such as 7.2kbps and 8kbps). After implementing joint gain coding, the quantized gain g of the adaptive codebook is transmitted with the bit stream. p Index into the gain codebook.

[0063] Before the gain quantization process, it is assumed that the adaptive codebook and algebraic codebook of the filter are already known. The gain quantization in the encoder is achieved by searching the designed gain codebook based on the minimum mean square error (MMSE) principle. Each entry in the gain codebook consists of two values: the quantization gain g of the adaptive codebook and the quantization gain g of the adaptive codebook. p and a correction factor γ for the algebraic codebook gain. The estimation of the algebraic codebook gain is done in advance, and the result g c0 is used to multiply the correction factor γ selected from the gain codebook. In each subframe, the gain codebook is searched completely, for example, with index q=0, ..., Q-1. If the quantization gain of the adaptive part of the excitation is forced to be below a certain threshold, it is possible to limit the search range. To allow for a reduced search range, the codebook entries in the gain codebook can be denoted by g. p The gain quantization process can be shown in Figure 3.

[0064] Gain quantization is achieved by minimizing the energy of the error signal e(i). The error energy is expressed by the following formula: E = e T e=(xg P yg c z) T (xg P yg c z) Formula (1)

[0065] Will g c Replaced by γ*g c0 , the formula can be expanded into:

[0066] constants c0, c1, c2, c3, c4, and c5 and the estimated gain g c0 is calculated before searching the gain codebook. The error energy E is calculated for each codebook entry. The codebook vector [g p ;γ] is selected as the winning codebook vector, whose entries correspond to the quantization gain g of the adaptive codebook p and γ.

[0067] Then, the quantization gain g of the fixed codebook is c It can be calculated as follows: g c =g c0 *γ Formula (3)

[0068] In the decoder, the received index is used to obtain the quantization gain g of the adaptive excitation p And the quantized correction factor γ of the estimated gain of the algebraic excitation. In the encoder, the estimated gain of the algebraic part of the excitation is also done in the same way.

[0069] In the first subframe of the current frame, the estimated (predicted) gain of the algebraic codebook is given by the following formula (4):

[0070] Among them, CT is the coding classification parameter (coding mode), which is the type selected for the current frame in the encoder preprocessing part. c is the energy of the filtered algebraic codebook vector, expressed in dB, as calculated in Equation (5) below. The estimation constants a0 and a1 are determined by minimizing the MSE on a large signal database. The coding mode parameter CT in the above equation is constant for all subframes of the current frame. The superscript [0] indicates the first subframe of the current frame.

[0071] Where c(n) is the filtered algebraic code vector.

[0072] FIG4 shows the gain estimation process of the first subframe.

[0073] The estimation process of the algebraic codebook gain is summarized as follows: the algebraic codebook gain is estimated based on the classification parameter CT of the current frame. The estimated algebraic codebook gain has excluded the energy of the algebraic code vector from the algebraic codebook. Finally, the estimated algebraic codebook gain is multiplied by the correction factor γ selected from the gain codebook to obtain the quantized algebraic codebook gain g c .

[0074] Specifically, as shown in FIG4 , the algebraic codebook gain is first linearly estimated in the logarithmic domain according to the classification parameter CT to obtain a linear estimate of the algebraic codebook gain: a0+a1CT. Then, the energy parameter of the algebraic codebook vector from the algebraic codebook is subtracted from the linear estimate. Get the estimated gain of the algebraic codebook in the logarithmic domain: Where Ec is obtained by the above formula (5). Then, the estimated gain of the algebraic codebook in the logarithmic domain is converted to the linear domain to obtain the estimated gain of the algebraic codebook in the linear domain Refer to the above formula (4). Finally, the estimated gain of the algebraic codebook is Multiplying by the correction factor γ selected from the gain codebook, the quantized algebraic codebook gain is obtained

[0075] Quantization gain of adaptive codebook Select directly from the gain codebook, specifically search the gain codebook based on the minimum mean square error (MMSE) principle, refer to the above formula (2).

[0076] All subframes after the first subframe of the current frame use a slightly different estimation scheme. The difference is that in these subframes, the quantization gains of both the adaptive codebook and the algebraic codebook from the previous subframe are used as auxiliary estimation parameters to improve efficiency. The estimated gain of the algebraic codebook in the kth subframe, k>0, is given by the following formula (6):

[0077] Where k = 1, 2, 3. The first and second summation terms ∑ in the exponent represent the quantization gain of the algebraic codebook of the previous subframe and the quantization gain of the adaptive codebook, respectively. Estimation constants b0,…,b 2k+1 It is also determined by MSE minimization on the large signal database.

[0078] The gain estimation process for the second and subsequent subframes is shown in Figure 5. Unlike the first frame, in addition to the classification parameter CT of the current frame, the algebraic codebook gain of the subsequent subframe is also estimated based on the adaptive and quantized gains of the algebraic codebook of the previous subframe.

[0079] Specifically, as shown in Figure 5, the estimated gain of the algebraic codebook is first calculated in the logarithmic domain: That is, the exponential term in formula (6). Then, the estimated gain of the algebraic codebook in the logarithmic domain is converted to the linear domain. Finally, the algebraic codebook gain estimated in the linear domain is multiplied by the correction factor γ selected from the gain codebook to form the quantized algebraic codebook gain.

[0080] The quantization gain of the adaptive codebook in the second and subsequent subframes Also directly selected from the gain codebook.

[0081] The estimation process for the second and subsequent subframes differs from that for the first subframe in that the energy of the algebraic codebook vector from the algebraic codebook is not subtracted from the estimated gain of the algebraic codebook in the logarithmic domain. This is because the gain estimation for subsequent subframes is based on the algebraic codebook gain of the previous subframe, and this energy has already been subtracted from the algebraic codebook gain of the first subframe. Therefore, the gain estimation for subsequent subframes does not need to consider the effect of removing this energy.

[0082] For memoryless joint gain coding, further reference may be made to the following document: 3GPP TS26.445, "Codec for Enhanced Voice Services (EVS); Detailed algorithmic description", the entire contents of which are incorporated herein by reference.

[0083] In the decoder, the winning codebook vector [g p ;γ], where g p is the quantization gain of the adaptive codebook, and the correction factor γ is multiplied by the estimated gain g of the algebraic codebook c0 Get the quantization gain g of the algebraic codebook c . g c0 The calculation method is the same as that used in the encoder. The adaptive codebook vector and the algebraic codebook vector are decoded from the bitstream and distributed multiplied by the quantization gains of the adaptive and algebraic codebooks to obtain the adaptive and algebraic excitation contributions. Finally, these two excitation contributions are added together to form the total excitation, which is filtered through a linear predictive synthesis filter to reconstruct the speech signal.

[0084] The existing CELP codec technology has a high computational complexity. For example, in the above formula (4), estimating the algebraic codebook gain in the first subframe requires performing both a logarithmic operation and a base-10 exponential operation, which is computationally intensive.

[0085] To this end, various embodiments of the present application improve the calculation process of the algebraic codebook gain in the first subframe, which can save high-complexity operations such as logarithmic operations and base-10 exponential operations, thereby reducing the calculation complexity of the codebook gain.

[0086] Example 1

[0087] The calculation process of the algebraic codebook gain in the first subframe provided in the first embodiment is to estimate the algebraic codebook gain in the first subframe. The calculation formula has been optimized as follows to reduce the complexity (ensuring that the calculation results remain unchanged and the effect is not affected):

[0088] Since the linear estimate of the algebraic codebook gain in the linear domain It is only related to the classification parameter CT and the estimated constants a0 and a1 in the logarithmic domain. Therefore, The values ​​can be enumerated in advance through a table. Represents the linear estimate of the algebraic codebook gain in the linear domain. The codec can maintain a mapping table b, each entry in which includes two values: the index CTindex of the classification parameter CT and the linear estimate of the algebraic codebook gain in the linear domain. In this way, the codec can directly look up the table to obtain the parameter CT corresponding to the current frame. The value of is saved to avoid recalculation during codec runtime, thus reducing the algorithm complexity.

[0089] make

[0090] The calculation process of formula (7) can be further simplified as follows:

[0091] The calculation process of the estimated gain of the algebraic codebook in the first subframe represented by formula (9) can be summarized as follows: First, according to the index CT of the classification parameter CT of the current frame index The linear estimate of the algebraic codebook gain in the linear domain is obtained by looking up the table. Then, the energy E of the algebraic codebook vector from the algebraic codebook in the linear domain is used. c The square root of ) Remove the linear estimate of the algebraic codebook gain in the linear domain to obtain the estimated gain of the algebraic codebook in the first subframe In this way, when encoding and decoding the estimated gain of the algebraic codebook of the first subframe, highly complex operations such as logarithmic operations and exponential operations with a base of 10 can be completely avoided, thereby significantly reducing the complexity of the algorithm.

[0092] The encoding side can transmit the following encoding parameters to the decoding side: the index CT of the classification parameter CT of the current frame index , the winning codebook vector [g p ;γ] is the index in the gain codebook.

[0093] FIG6 shows a calculation process of the algebraic codebook gain in the first subframe provided by the first embodiment.

[0094] As shown in FIG6 , the index CT of the classification parameter CT of the current previous frame is first input to the table lookup module 601. index。 Then, the table lookup module 601 obtains the linear estimation value of the algebraic codebook gain in the linear domain (hereinafter represented as b[CT index ]), and output b[CT index] to the multiplier 602. And, the square root value of the energy of the algebraic codebook vector from the algebraic codebook is calculated in sequence through the square summer 603 and the square root calculator 604: The square summator 603 calculates Ec by the above formula (5) and then outputs The reciprocal value of b[CT index ] and then obtain the estimated gain of the algebraic codebook Then, the estimated gain of the algebraic codebook is output To the multiplier 605, it is multiplied by the correction factor γ from the gain codebook to obtain the quantization gain of the algebraic codebook Quantization gain of algebraic codebook The algebraic codebook contribution of the excitation is output to the adder 607 to be added to the adaptive codebook contribution of the excitation to obtain the total filtered excitation.

[0095] The adaptive codebook contribution of the excitation is obtained by multiplying the adaptive codebook vector (filtered adaptive excitation) from the adaptive codebook output to the multiplier 608 by the quantization gain of the adaptive codebook from the gain codebook. The quantization gain of the adaptive codebook is obtained. Select directly from the gain codebook, specifically search the gain codebook based on the minimum mean square error (MMSE) principle, refer to the above formula (2).

[0096] Example 2

[0097] The calculation process of the algebraic codebook gain in the first subframe provided in the second embodiment is to estimate the algebraic codebook gain in the first subframe. The calculation formula of is also optimized as follows (same as the above formula (7)) to reduce the complexity:

[0098] Slightly different from the first embodiment, only the values ​​of a0+a1CT in formula (7) are enumerated in advance through a table. a0+a1CT represents the linear estimate of the algebraic codebook gain in the logarithmic domain. In this case, each entry in the mapping table b maintained by the codec may include two values: the index CT of the classification parameter CT index And the linear estimate of the algebraic codebook gain in the logarithmic domain a0+a1CT. In this way, the codec can directly look up the table to obtain the value of a0+a1CT corresponding to the parameter CT of the current frame, which can avoid calculating the value again when the codec is running, saving the amount of calculation. Let b[CT index ]=a0+a1CT formula (10)

[0099] The calculation process of formula (7) can be further simplified as follows:

[0100] The calculation process of the estimated gain of the algebraic codebook in the first subframe represented by formula (11) can be summarized as follows: First, according to the index CT of the classification parameter CT of the current frame index The linear estimate of the algebraic codebook gain in the logarithmic domain is obtained by looking up the table. Then, the energy E of the algebraic codebook vector from the algebraic codebook in the linear domain is used. c The square root of ) Remove the linear estimate of the algebraic codebook gain in the linear domain to obtain the estimated gain of the algebraic codebook in the first subframe In this way, when encoding and decoding the estimated gain of the algebraic codebook of the first subframe, highly complex operations such as logarithmic operations and exponential operations with a base of 10 can be reduced, thereby reducing the complexity of the algorithm.

[0101] The encoding side can transmit the following encoding parameters to the decoding side: the index CT of the classification parameter CT of the current frame index , the winning codebook vector [g p ;γ] is the index in the gain codebook.

[0102] FIG7 shows a calculation process of the algebraic codebook gain in the first subframe provided by the second embodiment.

[0103] As shown in FIG7 , the index CT of the classification parameter CT of the current previous frame is first input to the table lookup module 701. index。 Then, the table lookup module 701 calculates the value of the index CT index The linear estimate of the algebraic codebook gain in the logarithmic domain is obtained by table lookup (hereinafter represented as b[CT index ]), and output b[CT index ] to the base 10 exponential calculator 702 to obtain a linear estimate of the algebraic codebook gain in the linear domain: Next, the linear estimate of the algebraic codebook gain in the linear domain is output To the multiplier 703. And, the square root value of the energy of the algebraic codebook vector from the algebraic codebook is calculated in sequence through the square summator 704 and the square root calculator 705: The square summator 704 calculates Ec by the above formula (5) and then outputs The reciprocal value of is sent to the multiplier 703 to remove Then we can get the estimated gain of the algebraic codebook Then, the estimated gain of the algebraic codebook is output To the multiplier 706, it is multiplied by the correction factor γ from the gain codebook to obtain the quantization gain of the algebraic codebook Quantization gain of algebraic codebook The algebraic codebook contribution of the excitation is output to the adder 708 to be added to the adaptive codebook contribution of the excitation to obtain the total filtered excitation.

[0104] The adaptive codebook contribution of the excitation is obtained by multiplying the adaptive codebook vector (filtered adaptive excitation) from the adaptive codebook output to the multiplier 709 by the quantization gain of the adaptive codebook from the gain codebook. The quantization gain of the adaptive codebook is obtained. Select directly from the gain codebook, specifically search the gain codebook based on the minimum mean square error (MMSE) principle, refer to the above formula (2).

[0105] Example 3

[0106] The calculation process of the algebraic codebook gain in the first subframe provided in the third embodiment is to estimate the algebraic codebook gain in the first subframe. The calculation formula of is also optimized as follows (same as the above formula (7)) to reduce the complexity:

[0107] Different from the previous embodiment, the linear estimate of the algebraic codebook gain in the linear domain is not Or the linear estimate of the algebraic codebook gain in the logarithmic domain a0+a1CT is not enumerated in advance through a table, but is obtained by exponential operation with base 10.

[0108] The calculation process of the estimated gain of the algebraic codebook in the first subframe represented by formula (7) can be summarized as follows: First, the linear estimate of the algebraic codebook gain in the logarithmic domain a0+a1CT is calculated based on the classification parameter CT of the current frame. Then, the linear estimate of the algebraic codebook gain in the logarithmic domain a0+a1CT is converted to the linear domain through an exponential operation with a base of 10, and the result is Using the energy E of the algebraic codebook vector from the algebraic codebook in the linear domain c The square root of ) removes the linear estimate of the algebraic codebook gain in the linear domain Get the estimated gain of the algebraic codebook in the first subframe In this way, when the codec calculates the estimated gain of the algebraic codebook of the first subframe, the partial factor can be avoided. The logarithmic operations and base 10 exponential operations involved reduce the complexity of the algorithm.

[0109] The encoding side can transmit the following encoding parameters to the decoding side: the frame type CT of the current frame, the linear estimation constants a0, a1, the winning codebook vector [g p ;γ] is the index in the gain codebook.

[0110] FIG8 shows a calculation process of the algebraic codebook gain in the first subframe provided by the third embodiment.

[0111] As shown in FIG8 , the classification parameter CT of the current previous frame is first input to the linear estimation module 801. Then, the linear estimation module 801 calculates the linear estimation value a0+a1CT of the algebraic codebook gain in the logarithmic domain based on the parameter CT, and outputs a0+a1CT to the base 10 exponential calculator 802 to obtain the linear estimation value of the algebraic codebook gain in the linear domain: Next, the linear estimate of the algebraic codebook gain in the linear domain is output To the multiplier 803. And, the square root value of the energy of the algebraic codebook vector from the algebraic codebook is calculated in sequence through the square summer 804 and the square root calculator 805: The square summator 804 calculates Ec using the above formula (5) and then outputs The reciprocal value of is sent to the multiplier 803 to remove Then we can get the estimated gain of the algebraic codebook Then, the estimated gain of the algebraic codebook is output To the multiplier 806, it is multiplied by the correction factor γ from the gain codebook to obtain the quantization gain of the algebraic codebook Quantization gain of algebraic codebook The algebraic codebook contribution of the excitation is output to the adder 808 to be added to the adaptive codebook contribution of the excitation to obtain the total filtered excitation.

[0112] The adaptive codebook contribution of the excitation is obtained by multiplying the adaptive codebook vector (filtered adaptive excitation) from the adaptive codebook output to the multiplier 809 by the quantization gain of the adaptive codebook from the gain codebook. The quantization gain of the adaptive codebook is obtained. Select directly from the gain codebook, specifically search the gain codebook based on the minimum mean square error (MMSE) principle, refer to the above formula (2).

[0113] Example 4

[0114] The calculation process of the algebraic codebook gain in the first subframe provided in the fourth embodiment is to estimate the algebraic codebook gain in the first subframe. The calculation formula of is optimized as follows to reduce the complexity:

[0115] The same thing as the first embodiment is that the linear estimate of the algebraic codebook gain in the linear domain It is only related to the classification parameter CT and the estimated constants a0 and a1 in the logarithmic domain. Therefore, The values ​​can be enumerated in advance through a table. Represents the linear estimate of the algebraic codebook gain in the linear domain. The codec can maintain a mapping table b, each entry in which includes two values: the index CT of the classification parameter CT index and linear estimates of the algebraic codebook gain in the linear domain In this way, the codec can directly look up the table to obtain the parameter CT corresponding to the current frame. The value of is saved to avoid recalculation during codec runtime, thus reducing the algorithm complexity.

[0116] make

[0117] The calculation process of formula (12) can be further simplified as follows:

[0118] The calculation process of the estimated gain of the algebraic codebook in the first subframe represented by formula (13) can be summarized as follows: First, according to the index CT of the classification parameter CT of the current frame index Look up the table to obtain the linear estimate of the algebraic codebook gain in the linear domain And, the energy parameter of the algebraic codebook vector from the algebraic codebook is Take the opposite number and perform an exponential operation on it with base 10 to get Finally, the linear estimate of the algebraic codebook gain in the linear domain is Multiply Get the estimated gain of the algebraic codebook In this way, when the estimated gain of the algebraic codebook of the first subframe is calculated during encoding and decoding, the exponential operation with base 10 involved in the linear estimation value of the algebraic codebook gain can be avoided, thereby reducing the complexity of the algorithm.

[0119] The encoding side can transmit the following encoding parameters to the decoding side: the index CT of the classification parameter CT of the current frame index , the winning codebook vector [g p ;γ] is the index in the gain codebook.

[0120] FIG9 shows a calculation process of the algebraic codebook gain in the first subframe provided by the fourth embodiment.

[0121] As shown in FIG9 , firstly, the index CT of the classification parameter CT of the current previous frame is input to the table lookup module 901. index。 Then, the table lookup module 901 obtains the linear estimation value of the algebraic codebook gain in the linear domain (hereinafter represented as b[CT index ]), and output b[CT index ] to the multiplier 902. And, the square root value of the energy of the algebraic codebook vector from the algebraic codebook is calculated in sequence through the square summer 903 and the square root calculator 904: The square summator 903 calculates Ec using the above formula (5). Then it outputs to the calculator 905 for After performing the logarithm operation, take the opposite number and get Then output to the calculator 906 for Performing exponential operation with base 10 yields Re-output To the multiplier 902, to be multiplied by b[CT index ] and then obtain the estimated gain of the algebraic codebook Then, the estimated gain of the algebraic codebook is output To the multiplier 907, it is multiplied by the correction factor γ from the gain codebook to obtain the quantization gain of the algebraic codebook Quantization gain of algebraic codebook The algebraic codebook contribution of the excitation is output to the adder 909 to be added to the adaptive codebook contribution of the excitation to obtain the total filtered excitation.

[0122] The adaptive codebook contribution of the excitation is obtained by multiplying the adaptive codebook vector (filtered adaptive excitation) from the adaptive codebook output to the multiplier 910 by the quantization gain of the adaptive codebook from the gain codebook. The quantization gain of the adaptive codebook is obtained. Select directly from the gain codebook, specifically search the gain codebook based on the minimum mean square error (MMSE) principle, refer to the above formula (2).

[0123] In the fourth embodiment, it is also possible to make b[CT index ]=a0+a1CT, that is, only the values ​​of a0+a1CT are enumerated in advance through the table in Table b. At this time, the calculation process of formula (12) can be further simplified as follows:

[0124] The calculation process of the estimated gain of the algebraic codebook in the first subframe represented by formula (14) can be summarized as follows: First, according to the index CT of the classification parameter CT of the current frame index The linear estimate of the algebraic codebook gain in the logarithmic domain is obtained by looking up the table. In addition, the energy of the algebraic codebook vector from the algebraic codebook is subtracted from the linear estimate of the algebraic codebook gain a0+a1CT in the logarithmic domain. get Finally, yes Performing exponential operation with base 10 yields The calculation process represented by formula (14) can obtain the advance estimate of the algebraic codebook in the logarithmic domain by looking up the table without the need for codec calculation, thus saving the amount of calculation.

[0125] In the above embodiment, the value of the classification parameter CT for the current frame can be selected based on the signal type. For example, for narrowband signals, the values ​​of the parameter CT are set to 1, 3, 5, and 7 for unvoiced, voiced, normal, and transition frames, respectively, while for wideband signals, they are set to 0, 2, 4, and 6, respectively. Signal classification will be described below and will not be expanded upon here.

[0126] Signal Type

[0127] The method for determining the classification of a frame (parameter CT) can be different. For example, a basic classification can be performed based on voiced or unvoiced speech only. Another example is that more categories such as strongly voiced or strongly unvoiced speech can be added.

[0128] Signal classification can be performed through the following three steps. First, the speech activity detector (SAD) distinguishes between valid and invalid speech frames. If an invalid speech frame is detected, such as ground noise, the classification is terminated and the frame is encoded using the comfort noise generator (CNG). If a valid speech frame is detected, the frame is further classified to distinguish unvoiced frames. If the frame is further classified as an unvoiced signal, the classification is terminated and the frame is encoded using the encoding method that is most suitable for the unvoiced signal. Otherwise, it is further determined whether the frame is stable voiced speech. If the frame is classified as a stable voiced speech frame, the frame is encoded using the encoding method that is most suitable for stable voiced speech signals. Otherwise, the frame may contain non-stable signal segments such as the onset of voiced speech or rapidly evolving voiced speech signals.

[0129] The distinction of unvoiced signals can be based on the following parameters: voicing metrics Average spectral tilt The maximum short-term energy increment dE0 and the maximum short-term energy deviation dE at the low level. This application does not limit the algorithm for distinguishing the unvoiced signal. For example, the algorithm mentioned in the following literature can be used: Jelinek, M., et al., "Advances in source-controlled variable bitrate wideband speech coding", Special Workshop in MAUI (SWIM); Lectures by masters in speech processing, Maui, January 12-24, 2004, which is hereby incorporated by reference in its entirety.

[0130] If a frame is not classified as a valid frame or an unvoiced frame, it is tested whether it is a stable voiced frame. The distinction between stable voiced frames can be based on the following parameters: normalized correlation of each subframe (with 1 / 4 subsample resolution) Average spectral tilt and open-loop pitch estimation for all subframes (with 1 / 4 subsample resolution). This application also places no restriction on the algorithm for distinguishing stable voiced frames.

[0131] In the above embodiment, in addition to the classification parameter CT, the linear estimation gain of the algebraic codebook in the first subframe of the current frame is also related to the estimation constant a i Related. Estimated constant a i This can be determined through training with large sample data.

[0132] Calculation of estimated constants

[0133] The large sample of training data may include a large number of diverse speech signals in different languages, different genders, different ages, different environments, etc. Also, assume that the large sample of training data includes N+1 frames.

[0134] The estimated coefficients are found by minimizing the mean squared error between the estimated gain of the algebraic codebook and the optimal gain in the logarithmic domain over all frames in the training data of a large sample.

[0135] For the first subframe in the nth frame, the mean square error energy is given by:

[0136] In the first subframe of the nth frame, the estimated gain of the algebraic codebook in the logarithmic domain is given by the following formula:

[0137] Where i=0,...,L-1. L represents L samples of the input speech signal. i(n) represents the energy of the algebraic codebook vector from the algebraic codebook in the nth frame, which can be calculated by referring to the above formula (5).

[0138] After substituting into formula (16), formula (15) becomes:

[0139] In the above formula (17), represents the optimal algebraic codebook gain in the first subframe, which can be calculated by the following formulas (18) and (19):

[0140] The constants or correlation coefficients c0, c1, c2, c3, c4 and c5 are calculated using the following formula: c0 = y t y, c1 = x t y, c2 = z t z, c3 = x t z, c4 = y t z,c5=x t x Formula (19)

[0141] By defining the normalized gain of the algebraic codebook in the logarithmic domain To simplify the calculation process of minimum mean square error MSE:

[0142] in,

[0143] The solution to the minimum mean square error (MSE) defined above (i.e., the optimal values ​​of the estimated constants a0 and a1) is obtained through the following pair of partial derivatives:

[0144] At this point, the optimal values ​​of the estimated constants a0 and a1 can be determined. We do not provide the expressions for the optimal values ​​of the estimated constants a0 and a1 here, that is, we do not show the solution of formula (21), as the expression is relatively complex. In practical applications, their values ​​can be calculated in advance using computing software such as MATLAB.

[0145] For the second and subsequent subframes in the nth frame, the mean square error energy is given by:

[0146] Where k≥2, The value of is also calculated by the above formulas (18) and (19); represents the estimated gain of the log-domain algebraic codebook in the k-th subframe. Calculated by the following formula (23):

[0147] In order to solve the estimation constants b0, b1, ..., b to achieve the minimum mean square error MSE k The optimal value of , similar to the solution method in the first subframe, can be obtained by taking the partial derivative of formula (22).

[0148] So far, the estimated constants b0, b1, ..., b k The optimal value of can be determined. No estimated constants b0, b1, ..., b are provided here. k The expression for the optimal value of is relatively complex. In practical applications, its value can be calculated in advance using computing software such as MATLAB.

[0149] As shown in FIG10 , the calculated estimated constants can be used to design a gain codebook for each subframe, and the gain quantization for each subframe can then be determined based on the estimated constants and the gain codebook as described above. As described above, the estimate of the algebraic codebook gain varies slightly in each subframe, and the estimated coefficients are calculated using the minimum mean square error (MSE). The gain codebook can be designed with reference to the KMEANS algorithm in the following literature: MacQueen, JB (1967), "Some Methods for Classification and Analysis of Multivariate Observations", Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, University of California Press, pp. 281-297, which is hereby incorporated by reference in its entirety.

[0150] FIG11 shows a voice communication system 110 including a voice encoding device 113 and a voice decoding device 117 provided in an embodiment of the present application. The voice communication system 110 supports the transmission of voice signals via a communication channel 115. The communication channel 115 can be a wireless communication link or a wired link formed by a wire or the like. The communication channel 115 can support multiple simultaneous voice communications that require shared bandwidth resources. The communication channel 115 is not limited to communication between devices; it can also be extended to a storage unit within a single device for implementing shared communication. For example, a storage unit of a single device records and stores encoded voice signals for later playback.

[0151] At the transmitter end, a voice collection device 111, such as a microphone, converts the voice into an analog voice signal 120, which is then supplied to an analog-to-digital (A / D) converter 112. A / D converter 112 converts analog voice signal 120 into a digital voice signal 121. A voice encoder 113 encodes digital voice signal 121 to generate a set of binary coding parameters 122, which are then transmitted to a channel encoder 114 via communication components. Channel encoder 114 performs channel coding operations, such as adding redundancy, on coding parameters 122 to form a bit stream 123, which is then transmitted via a communication channel 115.

[0152] At the receiver end, the channel decoder 116 performs channel decoding operations on the bit stream 124 received via the communication component, for example, by utilizing the redundant information in the bit stream 124 to detect and correct channel errors that occurred during transmission. The speech decoding device 117 converts the bit stream 125 received from the channel decoder back into coding parameters to create a synthesized speech signal 126. The synthesized speech signal 126 reconstructed in the speech decoding device 117 is converted back into an analog speech signal 127 in the digital-to-analog (D / A) converter 108. Finally, the analog speech signal 127 is played back through a sound playback device such as a speaker unit 119.

[0153] The speech encoding device 113 encodes the speech signal to obtain encoding parameters, and the speech decoding device 117 reconstructs the speech signal using the encoding parameters carried in the bit stream. Please refer to the above content and will not be repeated here.

[0154] The various components on the transmitter side can be integrated into one electronic device, and the various components on the receiver side can be integrated into another electronic device. In this case, the two electronic devices communicate via a communication channel formed by a wired or wireless link, such as the transmission of coding parameters. The various components on the transmitter side and the various components on the receiver side can also be integrated into the same electronic device. In this case, data exchange, i.e., communication, such as the transmission of coding parameters, is achieved between the transmitter and receiver sides within the electronic device via a shared storage unit.

[0155] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for encoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receiving a frame classification parameter index of the current frame; Searching the linear estimation value of the algebraic codebook gain in the linear domain in a first mapping table according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimation value of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook; the correction factor comes from a winning codebook vector, and the winning codebook vector is selected from a gain codebook.

2. The method according to claim 1, wherein The method further comprises: Transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

3. A method for encoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receiving a frame classification parameter index of the current frame; Searching, in a first mapping table, for a linear estimate of an algebraic codebook gain in a logarithmic domain according to a frame classification parameter index of the current frame; each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of an algebraic codebook gain in a logarithmic domain; Converting the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook; the correction factor comes from a winning codebook vector, and the winning codebook vector is selected from a gain codebook.

4. The method according to claim 3, wherein The method further comprises: Transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

5. A method for encoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Performing linear estimation using a linear estimation constant in the first subframe and a frame type of the current frame to obtain a linear estimation value of an algebraic codebook gain in a logarithmic domain; Converting the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook; the correction factor comes from a winning codebook vector, and the winning codebook vector is selected from a gain codebook.

6. The method according to claim 5, wherein The method further comprises: Transmit coding parameters, where the coding parameters include: a frame type of the current frame, the linear estimation constant, and an index of the winning codebook vector in the gain codebook.

7. A method for decoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receive coding parameters; the coding parameters include: a frame classification parameter index of the current frame, and an index of a winning codebook vector; Searching, in a first mapping table, for a linear estimate of the algebraic codebook gain in the linear domain based on a frame classification parameter index of the current frame; each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook, where the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on an index of the winning codebook vector.

8. A method for decoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receive coding parameters; the coding parameters include: a frame classification parameter index of the current frame, and an index of a winning codebook vector; Searching, in a first mapping table, for a linear estimate of an algebraic codebook gain in a logarithmic domain based on a frame classification parameter index of the current frame; each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of an algebraic codebook gain in a logarithmic domain; Converting the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook, where the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on an index of the winning codebook vector.

9. A method for decoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receive coding parameters; the coding parameters include: a frame type of the current frame, a linear estimation constant in the first subframe, and an index of a winning codebook vector; Performing linear estimation using a linear estimation constant in the first subframe and a frame type of the current frame to obtain a linear estimation value of an algebraic codebook gain in a logarithmic domain; Converting the linear estimate of the algebraic codebook gain in the logarithmic domain to the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; Calculate the energy of an algebraic codebook vector from an algebraic codebook; Dividing a linear estimate of the algebraic codebook gain in the linear domain by the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook is multiplied by a correction factor to obtain a quantization gain of the algebraic codebook, where the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook based on an index of the winning codebook vector.

10. A method for encoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receiving a frame classification parameter index of the current frame; Searching the linear estimation value of the algebraic codebook gain in the linear domain in a first mapping table according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimation value of the algebraic codebook gain in the linear domain; Calculate the energy Ec of the algebraic codebook vector from the algebraic codebook, perform a base 10 logarithm operation on the square root of the energy, and then perform a base 10 exponential operation on the value after the logarithm operation to obtain Multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, wherein the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook.

11. The method according to claim 10, wherein The method further comprises: Transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

12. A method for decoding a sound signal, applied to the first subframe in a current frame, characterized in that: The method comprises: Receive coding parameters; the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector; Searching the linear estimation value of the algebraic codebook gain in the linear domain in a first mapping table according to the frame classification parameter index of the current frame; each entry in the first mapping table includes two values: the frame classification parameter index and the linear estimation value of the algebraic codebook gain in the linear domain; Calculate the energy Ec of the algebraic codebook vector from the algebraic codebook, perform a base 10 logarithm operation on the square root of the energy, and then perform a base 10 exponential operation on the value after the logarithm operation to obtain Multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the estimated gain of the algebraic codebook; The estimated gain of the algebraic codebook The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, the correction factor being from the winning codebook vector, the winning codebook vector being selected from the gain codebook based on the index of the winning codebook vector.

13. The method according to any one of claims 1 to 12, wherein The method further comprises: multiplying an algebraic codebook vector from an algebraic codebook by a quantized gain of the algebraic codebook gain to obtain an excitation contribution of the algebraic codebook; multiplying an adaptive codebook vector from the adaptive codebook by a quantization gain of the adaptive codebook included in a winning codebook vector selected from the gain codebook to obtain an excitation contribution of the adaptive codebook; The excitation contribution of the algebraic codebook and the excitation contribution of the adaptive codebook are added to obtain a total excitation.

14. A voice communication system, characterized in that: include: A first device and a second device, wherein: the first device is used to execute the method described in any one of claims 1-6, 10-11, and 13, and the second device is used to execute the method described in any one of claims 7-9, 12-13.

15. A device with a speech coding function, characterized in that: include: a search component, configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the linear domain according to a frame classification parameter index of a current frame; wherein each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The second multiplier is configured to multiply the estimated gain of the algebraic codebook by the correction factor included in the winning codebook vector to obtain the quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

16. The device according to claim 15, characterized in that Also includes: The communication component is used to transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

17. A device with a speech coding function, characterized in that: include: a search component, configured to search a linear estimate of the algebraic codebook gain in the logarithmic domain in a first mapping table according to a frame classification parameter index of the current frame; wherein each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the logarithmic domain; A converter, configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain into the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The second multiplier is configured to multiply the estimated gain of the algebraic codebook by the correction factor included in the winning codebook vector to obtain the quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

18. The device according to claim 15, wherein Also includes: The communication component is used to transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

19. A device with a speech coding function, characterized in that: include: a linear prediction component, configured to perform linear estimation using a linear estimation constant in the first subframe and a frame type of the current frame to obtain a linear estimation value of an algebraic codebook gain in a logarithmic domain; A converter, configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain into the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; The second multiplier is configured to multiply the estimated gain of the algebraic codebook by the correction factor included in the winning codebook vector to obtain the quantization gain of the algebraic codebook; the winning codebook vector is selected from the gain codebook.

20. The device according to claim 19, wherein Also includes: The communication component is used to transmit coding parameters, where the coding parameters include: a frame type of the current frame, the linear estimation constant, and an index of the winning codebook vector in the gain codebook.

21. A device with a speech decoding function, characterized in that: include: a communication component configured to receive encoding parameters; The encoding parameters include: a frame classification parameter index of the current frame, and an index of a winning codebook vector; a first searching component, configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the linear domain based on a frame classification parameter index of the current frame; wherein each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; a second multiplier, configured to multiply the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, wherein the correction factor is derived from the winning codebook vector; The second searching component is configured to search for the winning codebook vector from the gain codebook based on the index of the winning codebook vector.

22. A device with a speech decoding function, characterized in that: include: a communication component configured to receive encoding parameters; The encoding parameters include: a frame classification parameter index of the current frame, and an index of a winning codebook vector; a first searching component, configured to search a first mapping table for a linear estimate of an algebraic codebook gain in a logarithmic domain based on a frame classification parameter index of the current frame; wherein each entry in the first mapping table comprises two values: a frame classification parameter index and a linear estimate of an algebraic codebook gain in a logarithmic domain; A converter, configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain into the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; a second multiplier, configured to multiply the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, wherein the correction factor is derived from the winning codebook vector; The second searching component is configured to search for the winning codebook vector from the gain codebook based on the index of the winning codebook vector.

23. A device with a speech decoding function, characterized in that: include: a communication component configured to receive encoding parameters; The encoding parameters include: the frame type of the current frame, a linear estimation constant in the first subframe, an index of a winning codebook vector; a linear prediction component, configured to perform linear estimation using a linear estimation constant in the first subframe and a frame type of the current frame to obtain a linear estimation value of an algebraic codebook gain in a logarithmic domain; A converter, configured to convert the linear estimate of the algebraic codebook gain in the logarithmic domain into the linear domain through an exponential operation to obtain the linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating the energy of an algebraic codebook vector from an algebraic codebook; a first multiplier, configured to multiply a linear estimate of the algebraic codebook gain in the linear domain by the inverse of the square root of the energy of the algebraic codebook vector to obtain an estimated gain of the algebraic codebook; a second multiplier, configured to multiply the estimated gain of the algebraic codebook by a correction factor to obtain a quantization gain of the algebraic codebook, wherein the correction factor is derived from the winning codebook vector; A searching component is configured to search for the winning codebook vector from a gain codebook based on an index of the winning codebook vector.

24. A device with a speech coding function, characterized in that: include: a first searching component, configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the linear domain according to a frame classification parameter index of the current frame; wherein each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating an energy Ec of an algebraic codebook vector from an algebraic codebook; a logarithm operator, configured to perform a base 10 logarithm operation on the square root of the energy; An exponential operator is used to perform an exponential operation with a base of 10 on the value after the logarithmic operation to obtain the value The first multiplier is used to multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the estimated gain of the algebraic codebook; A second multiplier is used to multiply the estimated gain of the algebraic codebook The quantized gain of the algebraic codebook gain is obtained by multiplying the correction factor, wherein the correction factor comes from the winning codebook vector, and the winning codebook vector is selected from the gain codebook.

25. The device according to claim 24, wherein Also includes: The communication component is used to transmit coding parameters, where the coding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook.

26. A device with a speech decoding function, characterized in that: include: A communication component for receiving encoding parameters; The encoding parameters include: a frame classification parameter index of the current frame, and an index of the winning codebook vector in the gain codebook; a first searching component, configured to search a first mapping table for a linear estimate of the algebraic codebook gain in the linear domain according to a frame classification parameter index of the current frame; wherein each entry in the first mapping table includes two values: a frame classification parameter index and a linear estimate of the algebraic codebook gain in the linear domain; a first calculator for calculating an energy Ec of an algebraic codebook vector from an algebraic codebook; a logarithm operator, configured to perform a base 10 logarithm operation on the square root of the energy; An exponential operator is used to perform an exponential operation with a base of 10 on the value after the logarithmic operation to obtain the value The first multiplier is used to multiply the linear estimate of the algebraic codebook gain in the linear domain by Get the algebraic codebook The estimated gain of A second multiplier is used to multiply the estimated gain of the algebraic codebook A quantized gain of the algebraic codebook gain is obtained by multiplying the algebraic codebook gain by a correction factor, wherein the correction factor is derived from the winning codebook vector; The second searching component is configured to search for the winning codebook vector from the gain codebook based on the index of the winning codebook vector.

27. The device according to any one of claims 15 to 26, characterized in that Also includes: a third multiplier, configured to multiply an algebraic codebook vector from an algebraic codebook by a quantized gain of the algebraic codebook gain to obtain an excitation contribution of the algebraic codebook; a fourth multiplier, configured to multiply the adaptive codebook vector from the adaptive codebook by the quantization gain of the adaptive codebook included in the winning codebook vector selected from the gain codebook to obtain an excitation contribution of the adaptive codebook; An adder is configured to add the excitation contribution of the algebraic codebook and the excitation contribution of the adaptive codebook to obtain a total excitation.