Speech coding and decoding method, apparatus, computer device and storage medium
By combining signal subband decomposition and different quantization accuracies, the problem of low coding efficiency in existing speech coding methods is solved, achieving the effect of improving coding efficiency while ensuring speech quality.
Patent Information
- Application Number
- CN202210134733.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-02-14
AI Technical Summary
Existing speech coding methods have low coding efficiency and are difficult to effectively reduce channel bandwidth while ensuring speech quality.
The initial speech signal is decomposed into a first sub-band excitation signal and a second sub-band excitation signal using signal sub-band decomposition technology. The first sub-band excitation signal is then quantized with different quantization precisions. The high-frequency sub-band excitation signal is quantized with lower precision, while the low-frequency sub-band excitation signal is quantized with higher precision, thereby generating target coded data.
While ensuring voice quality, coding efficiency was improved and channel bandwidth requirements were reduced.
Smart Images

Figure CN116631418B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of speech processing, and particularly relates to a speech encoding method and device, computer equipment, a storage medium and a computer program product, and a speech decoding method and device, computer equipment, a storage medium and a computer program product. BACKGROUND
[0002] Speech encoding has a relatively wide application in daily communication. Speech encoding refers to reducing the channel bandwidth required for speech transmission while ensuring high-quality transmission of speech. For example, in the application of voice communication, the sending end collects speech data, encodes the speech data, and sends the encoded data to the receiving end, so that the receiving end can regenerate speech data through decoding and play the sound.
[0003] At present, speech encoding technology mainly includes three types: waveform encoding, parameter encoding and hybrid encoding. Specifically, waveform encoding is to process speech data as general waveform data to maintain the original waveform shape of the reconstructed speech waveform. Parameter encoding is to extract and encode the characteristic parameters of speech data to ensure that the reconstructed speech data maintains the semantics of the original speech. Hybrid encoding combines waveform encoding and parameter encoding, and includes both speech characteristic parameters and waveform encoding information. However, the current speech encoding method has the problem of low encoding efficiency. SUMMARY
[0004] Therefore, it is necessary to provide a speech encoding method, device, computer equipment, computer readable storage medium and computer program product capable of improving the speech encoding efficiency, and the present application also provides a speech decoding method, device, computer equipment, computer readable storage medium and computer program product.
[0005] In one aspect, the present application provides a speech encoding method. The method comprises:
[0006] performing signal sub-band decomposition based on an initial speech signal to be encoded to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial speech signal; the frequency value corresponding to the second sub-band excitation signal is higher than the frequency value corresponding to the first sub-band excitation signal;
[0007] quantizing the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal;
[0008] quantizing the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal; the first quantization precision is greater than the second quantization precision;
[0009] obtaining target coding data corresponding to the initial speech signal based on the first excitation quantization signal and the second excitation quantization signal.
[0010] In another aspect, the present application provides a speech coding device. The device comprises:
[0011] a subband decomposition module configured to perform signal subband decomposition on an initial speech signal to be coded to obtain a first subband excitation signal and a second subband excitation signal corresponding to the initial speech signal, the second subband excitation signal corresponding to a higher frequency value than the first subband excitation signal;
[0012] a quantization processing module configured to quantize the first subband excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first subband excitation signal, and quantize the second subband excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second subband excitation signal, the first quantization precision being greater than the second quantization precision;
[0013] an encoding data generation module configured to obtain target coding data corresponding to the initial speech signal based on the first excitation quantization signal and the second excitation quantization signal.
[0014] In another aspect, the present application provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the speech coding method when executing the computer program.
[0015] In another aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program implements the steps of the speech coding method when executed by a processor.
[0016] In another aspect, the present application provides a computer program product. The computer program product comprises a computer program, and the computer program implements the steps of the speech coding method when executed by a processor.
[0017] The speech coding method, device, computer device, storage medium and computer program product described above perform signal sub-band decomposition based on an initial speech signal to be coded, obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial speech signal, quantize the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal, and quantize the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal, wherein the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal, and the first quantization precision is greater than the second quantization precision. Since the energy of a high-frequency excitation signal is low, the influence of quantization with a lower quantization precision on speech signal coding is small, so that the coding efficiency can be improved while the speech quality is ensured.
[0018] In another aspect, the present application provides a speech decoding method. The method comprises:
[0019] obtaining target coding data, and obtaining a first excitation quantization signal and a second excitation quantization signal based on the target coding data;
[0020] wherein the first excitation quantization signal is obtained by quantization according to a first quantization precision; the second excitation quantization signal is obtained by quantization according to a second quantization precision; and the first quantization precision is greater than the second quantization precision;
[0021] performing quantization restoration processing on the first excitation quantization signal to obtain a first sub-band excitation signal, and performing quantization restoration processing on the second excitation quantization signal to obtain a second sub-band excitation signal; and the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal;
[0022] performing signal sub-band synthesis based on the first sub-band excitation signal and the second sub-band excitation signal to obtain a target speech signal.
[0023] In another aspect, the present application also provides a speech decoding device. The device comprises:
[0024] a coding data obtaining module, configured to obtain target coding data, and obtain a first excitation quantization signal and a second excitation quantization signal based on the target coding data; wherein the first excitation quantization signal is obtained by quantization according to a first quantization precision; the second excitation quantization signal is obtained by quantization according to a second quantization precision; and the first quantization precision is greater than the second quantization precision;
[0025] a quantization reduction module, configured to perform quantization reduction processing on the first excitation quantization signal to obtain a first subband excitation signal, and perform quantization reduction processing on the second excitation quantization signal to obtain a second subband excitation signal; the frequency value of the second subband excitation signal is higher than the frequency value of the first subband excitation signal;
[0026] a subband synthesis module, configured to perform signal subband synthesis based on the first subband excitation signal and the second subband excitation signal to obtain a target speech signal.
[0027] In another aspect, the present application also provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the speech decoding method when executing the computer program.
[0028] In another aspect, the present application also provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program implements the steps of the speech decoding method when executed by a processor.
[0029] In another aspect, the present application also provides a computer program product. The computer program product comprises a computer program, and the computer program implements the steps of the speech decoding method when executed by a processor.
[0030] The speech decoding method, device, computer device, storage medium and computer program product obtain target encoding data, analyze a first excitation quantization signal and a second excitation quantization signal based on the target encoding data, wherein the first excitation quantization signal is obtained by quantization at a first quantization precision, the second excitation quantization signal is obtained by quantization at a second quantization precision, the first quantization precision is greater than the second quantization precision, the first excitation quantization signal is subjected to quantization reduction processing to obtain a first subband excitation signal, the second excitation quantization signal is subjected to quantization reduction processing to obtain a second subband excitation signal, the frequency value of the second subband excitation signal is higher than the frequency value of the first subband excitation signal, and signal subband synthesis is performed based on the first subband excitation signal and the second subband excitation signal to obtain a target speech signal. Since the excitation quantization signals of different quantization precisions can be subjected to quantization reduction, and each subband excitation signal obtained can be subjected to subband synthesis, an accurate target speech signal can be decoded. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 An application environment diagram of the speech encoding method and the speech decoding method in one embodiment;
[0032] Figure 2 A flowchart of the speech encoding method in one embodiment;
[0033] Figure 3 a schematic diagram of a spectrogram in one embodiment;
[0034] Figure 4 a schematic diagram of a speech decoding method in one embodiment;
[0035] Figure 5 a schematic diagram of an encoding process in one embodiment;
[0036] Figure 6 a schematic diagram of a decoding process in one embodiment;
[0037] Figure 7 a schematic diagram of an encoding process in another embodiment;
[0038] Figure 8 a schematic diagram of an encoding process and a decoding process in one embodiment;
[0039] Figure 9 a block diagram of a speech encoding apparatus in one embodiment;
[0040] Figure 10 a block diagram of a speech decoding apparatus in one embodiment;
[0041] Figure 11 a block diagram of a computer device in one embodiment;
[0042] Figure 12 a block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0044] The present application relates to speech encoding technology and speech decoding technology, wherein speech encoding refers to converting an analog signal of speech into a digital signal, and compressing the speech by using redundancy existing in speech data and human hearing characteristics, and then transmitting the encoded data to a speech decoding end; speech decoding refers to decoding the encoded data after receiving the encoded data, and regenerating a digital signal of speech to play out sound.
[0045] The speech coding method and the speech decoding method provided in the embodiments of the present application can be applied to a system composed of a speech coding end and a speech decoding end. The speech coding end and the speech decoding end are connected through a wired or wireless network. The speech coding end and the speech decoding end can be computer devices, which can be terminals or servers. The terminal can be, but is not limited to, various desktop computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server can be implemented by an independent server or a server cluster composed of multiple servers. In an embodiment, as shown in FIG. 1, it is an application environment diagram of the speech coding method and the speech decoding method provided in the embodiments of the present application. In the figure, the speech coding end 102 is a terminal corresponding to a first user, and the speech decoding end 104 is a terminal corresponding to a second user. The terminal corresponding to the first user and the terminal corresponding to the second user can communicate through a network. Figure 1
[0046] In the speech coding method provided in the embodiments of the present application, the speech coding end performs signal sub-band decomposition based on an initial speech signal to be coded, to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial speech signal. The first sub-band excitation signal is quantized at a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal. The second sub-band excitation signal is quantized at a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal. The target coding data corresponding to the initial speech signal is obtained based on the first excitation quantization signal and the second excitation quantization signal. The frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal, and the first quantization precision is greater than the second quantization precision.
[0047] In the speech decoding method provided in the embodiments of the present application, the speech decoding end obtains target coding data, analyzes the target coding data to obtain a first excitation quantization signal and a second excitation quantization signal, performs quantization restoration processing on the first excitation quantization signal to obtain a first sub-band excitation signal, performs quantization restoration processing on the second excitation quantization signal to obtain a second sub-band excitation signal, and performs signal sub-band synthesis based on the first sub-band excitation signal and the second sub-band excitation signal to obtain a target speech signal. The first excitation quantization signal is obtained by quantization at a first quantization precision; the second excitation quantization signal is obtained by quantization at a second quantization precision; the first quantization precision is greater than the second quantization precision; and the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal.
[0048] It should be noted that in the embodiments of this application, the voice encoding end and the voice decoding end are a logical concept, referring to the encoding state and the decoding state. The voice encoding end can also perform voice decoding. When the voice encoding end performs voice decoding, the voice encoding end can act as the voice decoding end. Similarly, the voice decoding end can also perform voice encoding. When the voice decoding end performs voice encoding, the voice decoding end can also act as the voice encoding end.
[0049] In one embodiment, such as Figure 2 As shown, a speech coding method is provided, which is applied to... Figure 1 Taking the voice encoding end in the middle as an example, the following steps are included:
[0050] Step 202: Based on the initial speech signal to be encoded, perform signal subband decomposition to obtain the first subband excitation signal and the second subband excitation signal corresponding to the initial speech signal; the frequency value corresponding to the second subband excitation signal is higher than the frequency value corresponding to the first subband excitation signal.
[0051] Here, the initial speech refers to the digital signal obtained after converting the analog signal captured by the microphone. Signal subband decomposition refers to the process of breaking down a signal into multiple subbands. The signal being decomposed can be a wideband signal, while the resulting subband signals can be narrowband signals. If the frequency value corresponding to the second subband excitation signal is higher than that corresponding to the first subband excitation signal, meaning the frequency range of the second subband excitation signal is greater than that of the first subband excitation signal, then the second subband excitation signal is a high-frequency subband signal relative to the first subband excitation signal, while the first subband excitation signal is a low-frequency subband signal relative to the second subband excitation signal.
[0052] Specifically, the speech encoding end acquires the initial speech signal to be encoded, processes the initial speech signal to obtain the initial excitation signal, samples the initial excitation signal at a preset sampling frequency to obtain the sampled signal, which includes a preset number of sampling points, and performs signal subband decomposition on the sampled signal to obtain the first subband excitation signal and the second subband excitation signal corresponding to the initial speech signal.
[0053] In one embodiment, the voice encoding end can acquire the initial voice signal to be encoded by acquiring the original voice through its built-in microphone and converting it into the initial voice signal to be encoded through an analog-to-digital converter circuit, or by acquiring the voice signal sent by other voice processing devices, or by acquiring the voice signal from the network. This application does not limit the specific method of acquisition.
[0054] In one embodiment, after the voice encoding end obtains the initial voice signal to be encoded, the initial voice signal is framed, for each frame of signal, the signal frame is determined to be a voice frame or a non-voice frame through voice activity detection (VAD), after high-pass filtering, the voice frame is subjected to pitch analysis, linear prediction analysis, noise shaping analysis, and gain calculation, and then the initial excitation signal of the signal frame is calculated.
[0055] In one embodiment, the voice encoding end can use a quadrature mirror filter (QMF) to perform sub-band symmetric decomposition on the initial excitation signal of the initial voice signal, to obtain a first sub-band excitation signal and a second sub-band excitation signal with equal frequency widths. For example, assuming that the frequency width of the initial excitation signal is 8 KHZ, a first sub-band excitation signal ex1_low with a frequency width of 4 KHZ and a second sub-band excitation signal ex1_high with a frequency width of 4 KHZ can be obtained through the quadrature mirror filter, where the frequency value of ex1_high is higher than that of ex1_low.
[0056] In other embodiments, the voice encoding end can continue to decompose the decomposed high-frequency signal, i.e., the second sub-band excitation signal, by one or more levels. Specifically, for the second sub-band excitation signal, the voice encoding end can use the quadrature mirror filter to continue to decompose, to obtain a first decomposed signal and a second decomposed signal with equal frequency widths, where the frequency value of the second decomposed signal is higher than that of the first decomposed signal. For example, the second sub-band excitation signal ex1_high with a frequency width of 4 KHZ described above can be further decomposed to obtain two 2 KHZ signals: ex2_low and ex2_high, where the frequency value of ex2_high is higher than that of ex2_low. Further, for the decomposed second decomposed signal, the voice encoding end can use the quadrature mirror filter to continue to decompose, to obtain two signals with equal frequency widths, and the frequency value of one of the signals is higher than that of the other, for example, ex2_high described above can be further decomposed to obtain two 1 KHZ signals: ex3_low and ex3_high, where the frequency value of ex3_high is higher than that of ex3_low.
[0057] Step 204: quantizing the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal.
[0058] Step 206: quantizing the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal; the first quantization precision is greater than the second quantization precision.
[0059] Quantization precision refers to the accuracy of quantizing the excitation signal. Quantizing the excitation signal involves representing it with a specific numerical value to reduce the number of bits required for transmission. Higher quantization precision results in a smaller error between the quantized signal and the excitation signal, leading to a more accurate quantized signal.
[0060] like Figure 3 The image shows an example of a spectrogram in one embodiment. Spectral analysis of the voiced speech signal reveals that the speech spectrum energy is mainly concentrated in the low to mid-frequency range (300-3000 Hz), while the high-frequency (>5000 Hz) signal energy is weaker. Based on this, this application proposes a sub-band decomposition method to divide the excitation signal obtained during the encoding process into multiple sub-band excitation signals. Each sub-band excitation signal is quantized independently. The low-frequency excitation signal is quantized with higher precision to ensure speech quality, while the high-frequency excitation signal is quantized with lower precision to improve encoding efficiency.
[0061] Based on this, the speech encoder can quantize the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantized signal corresponding to the first sub-band excitation signal, and quantize the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantized signal corresponding to the second sub-band excitation signal. The first quantization precision is greater than the second quantization precision.
[0062] Understandably, quantization precision can be represented in different ways depending on the implementation. For example, quantization precision can be represented based on the quantization error during the quantization process; the larger the quantization error, the smaller the quantization precision. Quantization error refers to the cost or distortion incurred when restoring the sub-band excitation signal based on the excitation quantization signal.
[0063] In one embodiment, the speech encoding end can quantize the subband excitation signal based on a pre-established quantization mapping relationship, wherein the quantization mapping relationship pre-defines a one-to-one association relationship between each identification information and each signal vector, and the identification information is used to identify the signal vector. In the encoding process, when the subband excitation signal is quantized, the speech encoding end can search for a signal vector matching from each signal vector, and the identification information associated with the searched signal vector is taken as the excitation quantization signal. In the decoding process, the corresponding signal vector can be obtained according to the identification information and the quantization mapping relationship to realize quantization restoration. Based on this, a smaller quantization error can be set for the first subband excitation signal, so that the speech encoding end can search for a signal vector with higher matching degree, to realize quantization processing of the first subband excitation signal according to the first quantization precision, and the second subband excitation signal can be quantized loosely, and a larger quantization error is set, so that the speech encoding end can quickly search for a matching signal vector meeting the quantization error, to realize quantization processing of the second subband excitation signal according to the second quantization precision, wherein assuming that the quantization error set for the first subband excitation signal is X1, and the quantization error set for the first subband excitation signal is X2, to make the first quantization precision greater than the second quantization precision, then the quantization error X1 is smaller than the quantization error X2.
[0064] In step 208, target encoding data corresponding to the initial speech signal is obtained based on the first excitation quantization signal and the second excitation quantization signal.
[0065] Specifically, the speech encoding end can obtain the initial speech signal based on the first excitation quantization signal, the second excitation quantization signal, and other encoding parameters calculated in the encoding process. It can be understood that the other encoding parameters calculated in different encoding modes are not the same, for example, in the SILK encoder, the other encoding parameters can include gain, vad parameter, line spectrum frequency, pitch parameter, etc.
[0066] In one embodiment, the speech encoding end can respectively compress and encode the first excitation quantization signal, the second excitation quantization signal, and each encoding parameter, and then uniformly package each encoding data to obtain an encoding data packet, and take the obtained encoding data packet as the target encoding data corresponding to the initial speech signal. In other embodiments, the speech encoding end can first package the first excitation quantization signal, the second excitation quantization signal, and each encoding parameter into one data packet, compress and encode the data packet to obtain the target encoding data corresponding to the initial speech signal.
[0067] In the voice coding method, signal sub-band decomposition is performed based on an initial voice signal to be coded to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial voice signal, the first sub-band excitation signal is quantized at a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal, and the second sub-band excitation signal is quantized at a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal, wherein the frequency value corresponding to the second sub-band excitation signal is higher than the frequency value corresponding to the frequency range of the first sub-band excitation signal, and the first quantization precision is greater than the second quantization precision. Since the energy of the high-frequency excitation signal is low, the quantization at the lower quantization precision has little effect on the voice quality of the voice signal, so that the coding efficiency can be improved while ensuring the voice quality.
[0068] In one embodiment, the first sub-band excitation signal is quantized at the first quantization precision to obtain the first excitation quantization signal corresponding to the first sub-band excitation signal, including: obtaining a first quantization mapping relationship constructed based on the first quantization precision, and quantizing the first sub-band excitation signal based on the first quantization mapping relationship to obtain the first excitation quantization signal corresponding to the first sub-band excitation signal; and the second sub-band excitation signal is quantized at the second quantization precision to obtain the second excitation quantization signal corresponding to the second sub-band excitation signal, including: obtaining a second quantization mapping relationship constructed based on the second quantization precision, and quantizing the second sub-band excitation signal based on the second quantization mapping relationship to obtain the second excitation quantization signal corresponding to the second sub-band excitation signal.
[0069] In the quantization mapping relationship, a one-to-one association relationship between each identification information and each signal vector is predefined. In the coding process, when the sub-band excitation signal is quantized, the voice coding end can search for a signal vector matching the sub-band excitation signal from the signal vectors, and the identification information associated with the searched signal vector is used as the excitation quantization signal. In the decoding process, the corresponding signal vector can be obtained according to the identification information and the quantization mapping relationship to realize quantization restoration. The identification information can be one of numbers, letters, etc.
[0070] In this embodiment, the first quantization mapping relationship and the second quantization mapping relationship are constructed based on the same manner, the first quantization mapping relationship includes an association relationship between a first number of identification information and a first number of signal vectors, and the second quantization mapping relationship includes an association relationship between a second number of identification information and a second number of signal vectors, the first quantization mapping relationship is constructed based on the first quantization precision, the second quantization mapping relationship is constructed based on the second quantization precision, and the first number is greater than the second number to ensure that the first quantization precision is greater than the second quantization precision.
[0071] Specifically, the speech encoding end obtains a first quantization mapping relationship constructed based on a first quantization precision, searches a signal vector with the highest matching degree from the first quantization mapping relationship and the first sub-band excitation signal, takes the searched signal vector as a first excitation quantization signal corresponding to the first sub-band excitation signal, obtains a second quantization mapping relationship constructed based on a second quantization precision, searches a signal vector with the highest matching degree from the second quantization mapping relationship and the second sub-band excitation signal, and takes the searched signal vector as a second excitation quantization signal corresponding to the second sub-band excitation signal.
[0072] In the embodiment, by constructing quantization mapping relationships with different precisions in advance, the speech encoding end can quickly realize quantization with different precisions by using different quantization mapping relationships to quantize different sub-band excitation signals.
[0073] In one embodiment, the first sub-band excitation signal is quantized based on the first quantization mapping relationship to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal, including: obtaining a first target codebook, searching a first target vector matching the first sub-band excitation signal from the first target codebook, and obtaining the first excitation quantization signal based on a codebook serial number corresponding to the first target vector in the first target codebook; and the second sub-band excitation signal is quantized based on the second quantization mapping relationship to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal, including: obtaining a second target codebook, searching a second target vector matching the second sub-band excitation signal from the second target codebook, and taking a codebook serial number corresponding to the second target vector in the second target codebook as the second excitation quantization signal; wherein the codebook size of the second target codebook is smaller than the codebook size of the first target codebook.
[0074] The quantization mapping relationship can be represented as a codebook, which includes a codebook serial number and a codebook vector. The codebook serial number can be a number or a letter, and the codebook serial number and the codebook vector have a one-to-one mapping relationship. During decoding, the codebook serial number can be used as an index to find the codebook vector from the codebook to realize quantization restoration. The first target codebook corresponds to the first quantization precision, and the second target codebook corresponds to the second quantization precision. Since the first quantization precision is greater than the second quantization precision, the codebook size of the first target codebook is greater than the codebook size of the second target codebook. The codebook size is used to represent the number of codebook vectors contained in the codebook. The larger the codebook size, the more codebook vectors contained in the codebook. For example, assuming that the codebook Y includes five codebook vectors: Y1, Y2, Y3, Y4, and Y5, the codebook size is 5.
[0075] In one embodiment, in the case that the codebook size of the first target codebook is greater than the codebook size of the second target codebook, the number of bits required for the codebook index of the second target codebook can be further set to be less than the number of bits required for the codebook index of the first target codebook. For example, the codebook size of the first target codebook is 128, and the codebook size of the second target codebook is 32. The codebook index of the first target codebook needs to be represented by 8 bits of binary, while the codebook index of the second target codebook only needs to be represented by 6 bits of binary. Obviously, when the codebook index of the first target codebook is used as the first excitation quantization signal and the codebook index of the second target codebook is used as the second excitation quantization signal, the number of bits required for coding the second excitation quantization signal is less than the number of bits required for coding the first excitation quantization signal.
[0076] Specifically, when quantizing the first subband excitation signal, the speech encoding end can search for a codebook vector with the minimum distortion measure between the first subband excitation signal from the first target codebook after obtaining the first target codebook, obtain a first target vector, and use the codebook index corresponding to the first target vector in the first target codebook as the first excitation quantization signal. When quantizing the second subband excitation signal, the speech encoding end can search for a codebook vector with the minimum distortion measure between the second subband excitation signal from the second target codebook after obtaining the second target codebook, obtain a second target vector, and use the codebook index corresponding to the second target vector in the second target codebook as the first excitation quantization signal.
[0077] In one embodiment, the distortion measure described above can be the Euclidean distortion, which can be calculated according to the following formula (1), where d2(x, y) is the distortion measure between the subband excitation signal x and the codebook vector y, the subscript 2 indicates the square error, x i is the i-th component of the subband excitation signal x, i.e., the i-th sampling point in the subband excitation signal, and the subband excitation signal includes a total of k sampling points, y i represents the i-th component of the codebook vector y, and the codebook vector y is a k-dimensional vector:
[0078]
[0079] In the above embodiment, for each subband excitation signal, the target codebook is obtained to perform quantization, which can improve the quantization efficiency and save the quantization time. Moreover, the number of bits required for the codebook index of the second target codebook is less than the number of bits required for the codebook index of the first target codebook. For the high-frequency excitation signal, fewer bits can be used for description. The energy of the high-frequency signal is low, and the human ear does not perceive it significantly. Therefore, the bandwidth can be effectively reduced while ensuring the speech quality, and the coding efficiency can be improved.
[0080] In one embodiment, searching the first target codebook to obtain a first target vector matching the first subband excitation signal, and obtaining the first excitation quantization signal based on a codebook index corresponding to the first target vector in the first target codebook comprises: searching the first target codebook to obtain a first target vector matching the first subband excitation signal, and obtaining a first codebook index corresponding to the first target vector in the first target codebook; obtaining an error vector between the first target vector and the first subband excitation signal; searching the first target codebook to obtain a second target vector matching the error vector, and obtaining a second codebook index corresponding to the second target vector in the first target codebook; and taking the first codebook index and the second codebook index as the first excitation quantization signal.
[0081] Specifically, in the embodiment, the speech encoding end can quantize the first subband excitation signal in two stages. In the first stage of quantization, the speech encoder can search the first target codebook for a codebook vector having the minimum distortion measure with the first subband excitation signal to obtain a first target vector, and obtain a first codebook index corresponding to the first target vector in the first target codebook. In the second stage of quantization, the speech encoder can obtain an error vector between the first target vector and the first subband excitation signal, search the first target codebook for a codebook vector having the minimum distortion measure with the error vector to obtain a second target vector, and obtain a second codebook index corresponding to the second target vector in the first target codebook. The speech encoder takes the first codebook index and the second codebook index as the first excitation quantization signal.
[0082] In one embodiment, searching the second target codebook to obtain a second target vector matching the second subband excitation signal, and obtaining the second excitation quantization signal based on a codebook index corresponding to the second target vector in the second target codebook comprises: searching the second target codebook to obtain a third target vector matching the second subband excitation signal, and obtaining a third codebook index corresponding to the third target vector in the second target codebook; obtaining an error vector between the third target vector and the second subband excitation signal; searching the second target codebook to obtain a fourth target vector matching the error vector, and obtaining a fourth codebook index corresponding to the fourth target vector in the second target codebook; and taking the third codebook index and the fourth codebook index as the second excitation quantization signal.
[0083] Specifically, in the embodiment, the speech encoder can perform two-stage quantization on the second subband excitation signal, wherein in the second stage quantization, the speech encoder can search for a codebook vector with minimum distortion measure between the second subband excitation signal from the second target codebook to obtain a third target vector, and obtain a codebook serial number in the second target codebook corresponding to the third target vector; in the second stage quantization, the speech encoder can obtain an error vector between the third target vector and the second subband excitation signal, search for a codebook vector with minimum distortion measure between the error vector from the second target codebook to obtain a fourth target vector, and obtain a codebook serial number in the second target codebook corresponding to the fourth target vector, and the speech encoder takes the codebook serial number corresponding to the third target vector and the codebook serial number corresponding to the fourth target vector as the second excitation quantization signal.
[0084] In the above embodiment, for each subband excitation signal, a target vector matching the subband excitation signal is obtained from the corresponding target codebook, and a codebook serial number in the target codebook corresponding to the target vector is obtained; further, an error vector between the target vector and the subband excitation signal is obtained, a target vector matching the error vector is obtained from the target codebook, and a codebook serial number in the target codebook corresponding to the target vector is obtained, and finally the two obtained codebook serial numbers are taken as the excitation quantization signal, realizing two-stage quantization. Through two-stage quantization, the quantization accuracy can be improved.
[0085] In one embodiment, the generation steps of the first target codebook and the second target codebook include: obtaining a training speech signal set, a first codebook size of the first target codebook, and a second codebook size of the second target codebook; performing signal subband decomposition based on the training speech signal in the training speech signal set to obtain first subband training signals and second subband training signals corresponding to the training speech signal; clustering based on the first subband training signals to obtain a first number of first clustering clusters; the first number matches the first codebook size; clustering based on the second subband training signals to obtain a second number of second clustering clusters; the second number matches the second codebook size; for the first clustering cluster, the clustering center of the first clustering cluster is determined as a first codebook vector, and the first codebook vector is associated with a first codebook serial number in a first codebook serial number set to obtain the first target codebook; for the second clustering cluster, the clustering center of the second clustering cluster is determined as a second codebook vector, and the second codebook vector is associated with a second codebook serial number in a second codebook serial number set to obtain the second target codebook.
[0086] The training speech signal set includes a plurality of training speech signals. The training speech signals have the same frequency bandwidth as the initial speech signal and are subjected to signal subband decomposition in the same manner as the initial speech signal, so that the first subband training signals and the first subband excitation signals are in the same frequency range, and the second subband training signals and the second subband excitation signals are in the same frequency range. The first subband training signals can contain the same number of sampling points as the first subband excitation signals, the second subband training signals can contain the same number of sampling points as the second subband excitation signals, the sampling points of the first subband training signals can be arranged in chronological order to form a first training vector, and the sampling points of the second subband training signals can be arranged in chronological order to form a second training vector. The codebook size is used to represent the number of association relationships between codebook indices and codebook vectors contained in the codebook. The first quantity matches the first codebook size, that is, the number value represented by the first codebook size is consistent with the first quantity, for example, the first codebook size is L, and the first quantity is L. The second quantity matches the second codebook size, that is, the number value represented by the second codebook size is consistent with the second quantity.
[0087] Specifically, the speech encoding end performs signal subband decomposition on each training speech signal in the training speech signal set to obtain the first subband training signal and the second subband training signal corresponding to each training speech signal. The encoding end clusters the first training vector corresponding to each first subband training signal to obtain a first number of first clustering clusters. For each first clustering cluster, the clustering center of the first clustering cluster is determined as a first codebook vector, thereby obtaining a plurality of first codebook vectors. For each first codebook vector, an association relationship can be established between the first codebook vector and a first codebook index in a first codebook index set to obtain a first target codebook. The number of first codebook indices in the first codebook index set is consistent with the first quantity; different first codebook indices are associated with different first codebook vectors.
[0088] The speech encoding end clusters the second training vector corresponding to each second subband training signal to obtain a second number of second clustering clusters. For each second clustering cluster, the clustering center of the second clustering cluster is determined as a second codebook vector, thereby obtaining a plurality of second codebook vectors. For each second codebook vector, an association relationship can be established between the second codebook vector and a second codebook index in a second codebook index set to obtain a second target codebook. The number of second codebook indices in the second codebook index set is consistent with the second quantity; different second codebook indices are associated with different second codebook vectors.
[0089] For example, assuming that the first codebook size is 5, the first number is 5, and the first codebook sequence number set includes five first codebook sequence numbers {1, 2, 3, 4, 5}, five clustering clusters can be obtained through clustering, which are clustering cluster A, clustering cluster B, clustering cluster C, clustering cluster D, and clustering cluster E. The clustering center of the clustering cluster A can be associated with the first codebook sequence number 1, the clustering center of the clustering cluster B can be associated with the first codebook sequence number 2, the clustering center of the clustering cluster C can be associated with the first codebook sequence number 3, the clustering center of the clustering cluster D can be associated with the first codebook sequence number 3, and the clustering center of the clustering cluster E can be associated with the first codebook sequence number 5, to obtain the first target codebook.
[0090] In an embodiment, the clustering can employ a K-means algorithm, and other prior art algorithms can also be employed, and the method of clustering is not limited in the present application.
[0091] In the above embodiment, the first subband training signal and the second subband training signal corresponding to the training speech signal are obtained through signal subband decomposition based on the training speech signal in the training speech signal set, and then the codebook vectors of the codebooks are determined through clustering, so that the first target codebook can be quickly generated.
[0092] In an embodiment, the signal subband decomposition is performed based on the initial speech signal to be coded to obtain the first subband excitation signal and the second subband excitation signal corresponding to the initial speech signal, which includes: performing signal analysis processing and filtering processing on the initial speech signal to be coded to obtain the initial excitation signal corresponding to the initial speech signal; performing signal subband decomposition on the initial excitation signal to obtain the subband excitation signal in the first frequency range and the subband excitation signal in the second frequency range; the frequency value of the second frequency range is greater than the frequency value of the first frequency range; the subband excitation signal in the first frequency range is determined as the first subband excitation signal corresponding to the initial speech signal, and the second subband excitation signal corresponding to the initial speech signal is determined based on the subband excitation signal in the second frequency range.
[0093] The initial excitation signal is a residual signal. The signal analysis processing can be based on analysis, linear prediction analysis, noise shaping analysis, etc., and the filtering processing can be high-pass filtering.
[0094] Specifically, the speech encoding end can sample the initial excitation signal at a preset sampling frequency to obtain a preset number of sampling points, perform signal subband decomposition based on the sampling points to obtain a subband excitation signal in a first frequency range and a subband excitation signal in a second frequency range, determine the subband excitation signal in the first frequency range as a first subband excitation signal corresponding to the initial speech signal, and determine the subband excitation signal in the second frequency range as a second subband excitation signal corresponding to the initial speech signal. Since the frequency value of the second frequency range is greater than the frequency value of the first frequency range, the subband excitation signal in the second frequency range is a high-frequency excitation signal relative to the subband excitation signal in the first frequency range, and the subband excitation signal in the first frequency range is a low-frequency subband signal relative to the subband excitation signal in the second frequency range.
[0095] In one embodiment, the speech encoding end can perform signal subband decomposition on the initial excitation signal by using a quadrature mirror filter to obtain two subband excitation signals with equal frequency widths. For example, assuming that the frequency width of the initial excitation signal is 8 KHZ, the subband excitation signal in the range of 0-4 KHZ and the subband excitation signal in the range of 4 KHZ-8 KHZ can be obtained by using the quadrature mirror filter, the subband excitation signal in the range of 0-4 KHZ is determined as the first subband excitation signal, and the subband excitation signal in the range of 4 KHZ-8 KHZ is determined as the second subband excitation signal.
[0096] In the above embodiment, the residual signal can be obtained by performing signal analysis processing and filtering processing on the initial speech signal, and the signal subband decomposition based on the residual signal can further improve the coding efficiency.
[0097] In one embodiment, determining the second subband excitation signal corresponding to the initial speech signal based on the subband excitation signal in the second frequency range includes: determining the subband excitation signal in the second frequency range as an intermediate excitation signal; performing signal subband decomposition on the intermediate excitation signal to obtain a first decomposition signal and a second decomposition signal corresponding to the intermediate excitation signal; the frequency range of the second decomposition signal is higher than the frequency range of the first decomposition signal; both the first decomposition signal and the second decomposition signal are used as the second subband excitation signal; performing quantization processing on the second subband excitation signal at a second quantization precision to obtain a second excitation quantization signal corresponding to the second subband excitation signal, including: performing quantization processing on the first decomposition signal and the second decomposition signal at different second quantization precisions to obtain a second excitation quantization signal corresponding to the first decomposition signal and a second excitation quantization signal corresponding to the second decomposition signal; and the second quantization precision corresponding to the first decomposition signal is greater than the second quantization precision corresponding to the second decomposition signal.
[0098] In the embodiment, the high-frequency excitation signal can be further decomposed. The speech encoding end determines the sub-band excitation signal in the second frequency range as the intermediate excitation signal, and then can continue to perform signal sub-band decomposition on the intermediate excitation signal by using a mirror quadrature filter to obtain a first decomposition signal and a second decomposition signal with equal frequency widths, and the frequency range of the second decomposition signal is higher than that of the first decomposition signal, that is, the second decomposition signal is a high-frequency excitation signal relative to the first decomposition signal, and the first decomposition signal is a low-frequency sub-band signal relative to the second decomposition signal. The speech encoding end can take both the first decomposition signal and the second decomposition signal as the second sub-band excitation signal. Since the second decomposition signal is a high-frequency excitation signal, the signal energy is weak, and then the speech encoding end can use a lower quantization precision to quantize it. In order to ensure the speech quality, the speech encoding end can use a higher quantization precision to quantize the first decomposition signal. It can be understood that the lower and higher here are relative to the first decomposition signal and the second decomposition signal, that is, the quantization precision corresponding to the first decomposition signal is greater than the second quantization precision corresponding to the second decomposition signal. The quantization precision corresponding to the first sub-band excitation signal is the largest, which is greater than the quantization precision corresponding to the first decomposition signal and greater than the second quantization precision corresponding to the second decomposition signal.
[0099] In the above embodiment, by determining the sub-band excitation signal in the second frequency range as the intermediate excitation signal, finer sub-band division can be performed, and then the energy-weak high-frequency signal can be more accurately decomposed, the coding efficiency is further improved, and the wideband resource is better utilized.
[0100] In one embodiment, based on the first excitation quantization signal and the second excitation quantization signal, target coding data corresponding to the initial speech signal is obtained, including: determining coding gains corresponding to the first sub-band excitation signal and the second sub-band excitation signal; based on the first excitation quantization signal, the second excitation quantization signal, and the coding gains corresponding to the first sub-band excitation signal and the second sub-band excitation signal, target coding data corresponding to the initial speech signal is obtained.
[0101] The coding gain refers to a gain that needs to be coded. After the coding gain is sent to the speech decoding end, the speech decoding end can combine the coding gain and the subband excitation signals to perform subband synthesis to obtain a target speech signal. The target speech signal refers to a speech signal that is finally played by the speech decoding end. The coding gain and the first subband excitation signal and the second subband excitation signal can be that the coding gain directly serves as the gain of the first subband excitation signal and the gain of the second subband excitation signal. The coding gain and the first subband excitation signal and the second subband excitation signal can also be that the gain of the first subband excitation signal and the gain of the second subband signal can be calculated based on the coding gain in a preset manner. The preset manner is agreed by the speech coding end and the speech decoding end in advance. Therefore, only the coding gain needs to be coded in the coding process, and the gain of the first subband excitation signal and the gain of the second subband excitation signal can be obtained based on the coding gain in the decoding process.
[0102] It should be noted that the manner of determining the coding gain is different in different encoders. For the SILK encoder: in one embodiment, the coding gain can be an initial gain calculated based on the initial speech signal, that is, the calculated initial gain is directly used as the gain of the first subband excitation signal and the gain of the second subband excitation signal, without adjusting the gain. In another embodiment, after the initial gain is calculated, the initial coding gain can be adjusted to obtain the gain of the first subband excitation signal and the gain of the second subband excitation signal. For example, the initial gain is adjusted to be higher for the second subband excitation signal with a high frequency value to obtain the gain of the second subband excitation signal, and the initial gain is adjusted to be lower for the first subband excitation signal with a low frequency value to obtain the gain of the second subband excitation signal.
[0103] Specifically, after the speech coding end determines the coding gain corresponding to the first subband excitation signal and the second subband excitation signal, the speech coding end performs compression coding based on the first excitation quantization signal, the second excitation quantization signal, and the coding gain corresponding to the first subband excitation signal and the second subband excitation signal to obtain target coding data corresponding to the initial speech signal.
[0104] In the above embodiment, by determining the coding gain, the coding gain is also coded, so that the target speech signal obtained by decoding is more accurate.
[0105] In one embodiment, determining the coding gain corresponding to the first subband excitation signal and the second subband excitation signal includes: determining a first gain corresponding to the first subband excitation signal and a second gain corresponding to the second subband excitation signal; if the first gain and the second gain are increased based on an initial gain and in a preset gain increasing manner, the initial gain is determined as the coding gain corresponding to the first subband excitation signal and the second subband excitation signal; wherein the initial gain is calculated based on the initial speech signal.
[0106] The preset increment manner refers to an agreed gain increment manner between the speech encoding end and the speech decoding end. The preset increment manner is set at both the encoding end and the decoding end, and then at the time of encoding, the gain required in the decoding calculation can be calculated based on the initial gain and according to the preset increment manner. The preset increment manner may, for example, be that each gain is increased by a preset value, for example, the first gain is A, the second gain is A+B, the third gain is A+2B, and so on. The preset increment manner may, for example, also be that each gain is increased by a preset multiple, for example, the first gain is A, the second gain is 1.1A, the third gain is 1.2A, and so on.
[0107] Specifically, the speech encoding end determines a first gain corresponding to the first subband excitation signal and a second gain corresponding to the second subband excitation signal, and if the first gain and the second gain are increased based on the initial gain and according to the preset gain increment manner, the initial gain is determined as the encoding gain corresponding to the first subband excitation signal and the second subband excitation signal, so that at the encoding end, only the initial gain needs to be transmitted, and as long as the initial gain is encoded, the encoding efficiency is greatly improved, and the bandwidth resource is saved.
[0108] In the above embodiment, if the first gain and the second gain are increased based on the initial gain and according to the preset gain increment manner, the speech encoding end determines the initial gain as the encoding gain corresponding to the first subband excitation signal and the second subband excitation signal, which greatly improves the encoding efficiency and saves the bandwidth resource.
[0109] In one embodiment, the method further includes a step of configuring the gain increment manner, and the step of configuring the gain increment manner includes: obtaining the initial gain; taking the initial gain as the first gain and establishing an association relationship between the first gain and a first serial number; obtaining the second gain based on the initial gain and a first increment multiple and establishing an association relationship between the second gain and a second serial number; and configuring the first serial number to represent the first subband excitation signal and configuring the second serial number to represent the second subband excitation signal.
[0110] In an embodiment, taking an example that the second subband excitation signal includes three subband signals, the preset increasing mode is shown in Table 1 below, where the first serial number is 0, configured to represent the first subband excitation signal, the second serial number includes 1, 2, 3, respectively representing the three subband excitation signals included in the second subband excitation signal, and the greater the serial number value, the greater the frequency value of the represented subband excitation signal. For example, the three subband excitation signals included in the second subband excitation signal are obtained through three-level signal subband decomposition, the first-level decomposition is based on the decomposition of the initial speech signal, obtaining the first subband excitation signal exc1_low and the intermediate excitation signal exc1_high, then decomposing exc1_high to obtain the first decomposition signal exc2_low and the intermediate decomposition signal exc2_high, and continuing to decompose the intermediate decomposition signal exc2_high to obtain exc3_low and exc3_high, then three-level decomposition obtains three second subband excitation signals, i.e. exc2_low, exc3_low and exc3_high, where the frequency value in the frequency range of exc3_high is the highest, exc3_low is the second, and the frequency value in the frequency range of exc2_low is the lowest. Then the second serial number 1 can be configured to represent exc2_low, the second serial number 2 can be configured to represent exc3_low, and the second serial number 3 can be configured to represent exc3_high.
[0111] Table 1
[0112] Serial number Gain multiple 0 1 1 1.1 2 1.2 3 1.3
[0113] The gain multiple corresponding to the serial number is used to represent the multiple of the subband excitation signal represented by the serial number relative to the initial gain. As shown in Table 1, in the above example, the gain of exc1_low is the initial gain, assuming g, then the gain of exc2_low is 1.1g, the gain of exc3_low is 1.2g, and the gain of exc3_high is 1.3g. It can be understood that the increasing multiple in the above Table 1 can also be other values, for example, it can be 1, 1.2, 1.4, 1.6, as long as a certain difference rule is formed, which is not limited in the present application.
[0114] In the above embodiment, by taking the initial gain as the first target gain, and establishing the association between the initial gain and the first serial number, the second target gain is obtained based on the initial gain and the first increasing multiple, and the association between the second target gain and the second serial number is established, the first serial number is configured to represent the first subband excitation signal, and the second serial number is configured to represent the second subband excitation signal, so that the configuration of the increasing mode can be quickly realized.
[0115] In an embodiment, as Figure 4As shown, a speech decoding method is provided, and the method is applied to Figure 1 The speech decoding method is described by taking a speech decoding end in the speech decoding method as an example, and includes the following steps.
[0116] In step 402, target encoding data is obtained, and a first excitation quantization signal and a second excitation quantization signal are parsed based on the target encoding data; the first excitation quantization signal is obtained by quantization at a first quantization precision; the second excitation quantization signal is obtained by quantization at a second quantization precision; the first quantization precision is greater than the second quantization precision.
[0117] The target encoding data refers to data obtained by the encoding end through the speech encoding method of the above embodiments.
[0118] Specifically, after receiving the target encoding data, the speech decoding end parses the target encoding data to obtain a set of encoding parameters, and the set of encoding parameters includes the first excitation quantization signal and the second excitation quantization signal. The first excitation quantization signal and the second excitation quantization signal are obtained by quantization at different quantization precisions, and specific details can be referred to the steps in the encoding process in the above embodiments. The set of encoding parameters can also include other parameters, such as gain, vad parameter, line spectrum frequency, pitch parameter, etc.
[0119] In step 404, the first excitation quantization signal is subjected to quantization restoration processing to obtain a first sub-band excitation signal, and the second excitation quantization signal is subjected to quantization restoration processing to obtain a second sub-band excitation signal; the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal.
[0120] The quantization restoration processing refers to a process of restoring a signal before quantization based on a signal after quantization. Since there is a certain distortion in the quantization process, there is a certain error between the restored signal and the signal before quantization.
[0121] Specifically, the speech decoding end subjects the first excitation quantization signal to quantization restoration processing to obtain the first sub-band excitation signal, and subjects the second excitation quantization signal to quantization restoration processing to obtain the second sub-band excitation signal. The frequency value of the frequency range where the second sub-band excitation signal is located is higher than the frequency value of the frequency range where the first sub-band excitation signal is located, i.e., the second sub-band excitation signal is a high-frequency excitation signal relative to the first sub-band excitation signal, and the first sub-band excitation signal is a low-frequency excitation signal relative to the second sub-band excitation signal.
[0122] In one embodiment, the speech decoding end can search the first quantization mapping relationship for identification information matching the first excitation quantization signal, and determine a signal vector associated with the identification information as the first subband excitation signal. The speech decoding end can search the second quantization mapping relationship for identification information matching the second excitation quantization signal, and determine a signal vector associated with the identification information as the second subband excitation signal.
[0123] In one embodiment, the speech decoding end can search the first target codebook for a codebook serial number matching the first excitation quantization signal, and determine a signal vector associated with the codebook serial number as the first subband excitation signal. The speech decoding end can search the second target codebook for a codebook serial number matching the second excitation quantization signal, and determine a signal vector associated with the codebook serial number as the second subband excitation signal.
[0124] At step 406, signal subband synthesis is performed based on the first subband excitation signal and the second subband excitation signal to obtain a target speech signal.
[0125] The target speech signal refers to a speech signal directly used for playing by the speech decoding end. The signal subband synthesis is the inverse process of signal subband decomposition.
[0126] Specifically, the speech decoding end performs signal subband synthesis based on the first decomposition signal and the second decomposition signal, and obtains a synthesized excitation signal. The synthesized excitation signal continues subsequent decoding processing, such as long-time filtering processing and short-time filtering processing, and a target speech signal is obtained.
[0127] In one embodiment, when performing signal subband synthesis, the speech decoding end first determines the gain of the first subband excitation signal and the gain of the second subband excitation signal, multiplies the restored first subband excitation signal by its corresponding gain to obtain a first target excitation signal, and multiplies the restored second subband excitation signal by its corresponding gain to obtain a second target excitation signal. In one embodiment, the gain of the first subband excitation signal and the gain of the second subband excitation signal are based on an initial gain and are incremented in a preset gain increment manner. When the speech decoding end decodes to obtain the initial gain, the speech decoding end can determine the gain of the first subband excitation signal and the gain of the second subband excitation signal based on the initial gain and in the preset gain increment manner, respectively.
[0128] In one embodiment, the speech decoding end can use a quadrature mirror filter to perform signal subband synthesis.
[0129] The voice decoding method, target coding data is acquired, first excitation quantization signals and second excitation quantization signals are obtained based on target coding data analysis, wherein the first excitation quantization signals are obtained by quantization according to the first quantization accuracy; the second excitation quantization signals are obtained by quantization according to the second quantization accuracy; the first quantization accuracy is greater than the second quantization accuracy, the first excitation quantization signals are subjected to quantization restoration processing to obtain first subband excitation signals, the second excitation quantization signals are subjected to quantization restoration processing to obtain second subband excitation signals; the frequency value of the second subband excitation signals is higher than the frequency value of the first subband excitation signals, signal subband synthesis is performed based on the first subband excitation signals and the second subband excitation signals to obtain target voice signals, since the excitation quantization signals of different quantization accuracies can be subjected to quantization restoration, and each subband excitation signal obtained can be subjected to subband synthesis, the accurate target voice signals can be decoded.
[0130] In one embodiment, the second excitation quantization signals include first target sub-signals and second target sub-signals; the second quantization accuracy corresponding to the first target sub-signals is greater than the second quantization accuracy corresponding to the second target sub-signals; the quantization restoration processing of the second excitation quantization signals to obtain the second subband excitation signals includes: the first target sub-signals are subjected to quantization restoration processing to obtain first decomposition signals, and the second target sub-signals are subjected to quantization restoration processing to obtain second decomposition signals; the first decomposition signals and the second decomposition signals are subjected to signal subband synthesis to obtain the second subband excitation signals.
[0131] Specifically, since the second excitation quantization signals include the first target sub-signals and the second target sub-signals, and the second quantization accuracy corresponding to the first target sub-signals is greater than the second quantization accuracy corresponding to the second target sub-signals, the encoding end performs twice decomposition in the encoding process, the first subband excitation signals and the second subband excitation signals are obtained by the first subband signal decomposition, wherein the second subband excitation signals are high-frequency excitation signals, the first decomposition signals and the second decomposition signals are obtained by further decomposition, three subband signals are obtained by twice decomposition, the three subband excitation signals are subjected to quantization of different accuracies to obtain three different excitation quantization signals, and the decoding end needs to perform twice signal synthesis when decoding, the first target sub-signals quantized based on the first decomposition signals are restored to obtain the first decomposition signals, and the second target sub-signals quantized based on the second decomposition signals are restored to obtain the second decomposition signals, then the first decomposition signals and the second decomposition signals are subjected to signal subband synthesis to obtain the second subband excitation signals, and the second subband excitation signals and the first subband excitation signals are subjected to signal subband synthesis to obtain target voice signals.
[0132] In the above embodiment, the first target sub-signal is subjected to quantization reduction processing to obtain a first decomposition signal, the second target sub-signal is subjected to quantization reduction processing to obtain a second decomposition signal, and the first decomposition signal and the second decomposition signal are subjected to signal sub-band synthesis to obtain a second sub-band excitation signal. The accurate target speech signal can be obtained through twice signal sub-band synthesis, and the decoding accuracy is improved.
[0133] In one embodiment, the encoding method of the present application can be applied in a CELP encoding technology. The CELP encoding technology is an effective medium-low code rate speech compression encoding technology. The CELP encoding technology takes a codebook as an excitation source, has the advantages of low code rate, high quality of synthesized speech, strong anti-noise ability, and the like, and is widely used at a code rate of 4.8-16 kbps. At present, speech encoders using the CELP technology include G.723, G.728, G.729, G.722.2, and the like. Figure 5 The encoding flowchart of the CELP encoding technology is shown in FIG. 1. Figure 5 At the speech encoding end, after the initial speech signal is preprocessed through high-pass filtering and the like, linear prediction parameters are obtained through LPC (linear predictive coding). The LPC parameters are a set of linear prediction filter coefficients. The LPC parameters are converted into LSP parameters and quantized. The initial speech signal and the result of the prediction filtering of the LPC parameters are the difference, which is an initial excitation signal. The initial excitation signal is a residual signal. The residual signal is subjected to adaptive codebook analysis and search through an open loop and a closed loop to obtain adaptive codebook parameters. Then, the speech encoding method provided in the embodiment is used to obtain excitation quantization signals (i.e., fixed codebook parameters) of different precisions through a fixed codebook. That is, the residual signal is subjected to one-level or multi-level sub-band decomposition to obtain a plurality of sub-band excitation signals at different frequency ranges. Then, the sub-band excitation signals are subjected to quantization processing through different fixed codebooks to obtain the excitation quantization signals. The higher the frequency value of the sub-band excitation signal at the frequency range, the lower the codebook size corresponding to the quantization. Finally, adaptive codebook gain parameters and gain parameters of each fixed codebook are calculated. The encoding parameters obtained in the encoding process are packaged and transmitted to the decoding end through a channel.
[0134] Reference is made to FIG. 1. Figure 6For the decoding flow chart of CELP coding technology, the decoding end parses all the coding parameters from the received coding data packet, interpolates the LSP parameters to obtain the LPC filter coefficients, multiplies each excitation quantization signal in the fixed codebook parameters and the respective fixed codebook gain to generate each fixed codebook excitation signal, then performs signal sub-band synthesis to obtain a synthesized excitation signal, multiplies the adaptive codebook parameters and the adaptive codebook gain to generate an adaptive codebook excitation signal, filters and post-processes the sum of the adaptive codebook excitation signal and the synthesized excitation signal through an LPC synthesis filter to obtain the final target speech signal.
[0135] In one embodiment, the coding method of the present application can be applied in the SILK coding technology. The SILK speech encoder is a variant of the CELP model, and the main improvement is the introduction of a noise shaping link to make the residual excitation signal spectrum more flat, further improving the quantization signal-to-noise ratio of the excitation. As follows Figure 7 For the coding process of the SILK encoder, first, the input speech signal is subjected to vad processing and high-pass filtering processing, the output signal of the high-pass filtering is subjected to noise shaping analysis, the gain and filter coefficients used in the noise shaping quantization are obtained by using the noise shaping analysis, the signal output by the vad processing is subjected to pitch analysis, and the clear / dull sound decision is made, the pitch period of the dull sound signal is estimated, the autocorrelation coefficients and the pitch delay of the pitch are obtained, the signal output by the pitch analysis is subjected to LTP analysis, the output of the noise shaping analysis is subjected to pre-filtering processing, the signals obtained by the pitch analysis and the noise shaping analysis, and the speech signal after the high-pass filtering processing are further subjected to prediction analysis, then the LSF parameters are extracted, and the multi-level vector quantization is used to extract the feature parameters, and the quantized parameters are converted into LPC coefficients, and the synchronization of coding and decoding is realized through the conversion, and the noise shaping quantization is performed on this basis. The noise shaping quantization here is to quantize the excitation signal after noise shaping. In the quantization process, the excitation signal can be subjected to one or more sub-band decompositions to obtain a plurality of sub-band excitation signals at different frequency ranges, and then the sub-band excitation signals are quantized according to different quantization accuracies to obtain excitation quantization signals. The higher the frequency value of the sub-band excitation signal in the frequency range, the lower the corresponding quantization accuracy during quantization. Finally, the extracted parameters are subjected to interval coding to realize the entire coding process.
[0136] The application further provides an application scenario of the speech coding method and the speech decoding method. In the application scenario, the speech coding method and the speech decoding method are used for speech communication between user A and user B. When user A and user B are in speech communication, the speech coding method and the speech decoding method can be used to code, transmit and decode the speech signal of user A and the speech signal of user B, so as to realize the speech communication between user A and user B. In a specific implementation, when user A sends a speech signal to user B, the terminal of user A is a speech coding terminal, and the terminal of user B is a speech decoding terminal. Taking the terminal of user A as a vehicle terminal and the terminal of user B as a mobile phone as an example. After the vehicle terminal of user A and the mobile phone of user B establish a communication connection, the vehicle terminal of user A can collect the speech signal of user A and code the speech signal to obtain target coding data, and transmit the target coding data to the mobile phone of user B. Then, the mobile phone of user B can decode the target coding data to regenerate a speech signal and play the speech signal. Similarly, the mobile phone of user B can also send target coding data to the vehicle terminal of user A, and the vehicle terminal of user A can also decode the target coding data to generate a speech signal and play the speech signal.
[0137] Specifically, referring to Figure 8 The speech coding method and the speech decoding method are applied as follows in the application scenario:
[0138] In the coding process, the collected speech signal is used as an initial speech signal. After the speech coding terminal performs speech activity detection, high-pass filtering, gene analysis, linear prediction analysis, noise shaping, gain calculation and other processing based on the initial speech signal, an initial excitation signal is obtained. The initial excitation signal is subjected to signal subband decomposition, and then different codebooks are used to quantize each subband excitation signal obtained by the decomposition with different quantization precisions to obtain each excitation quantization signal, such as a first excitation quantization signal, a second excitation quantization signal, a third excitation quantization signal and the like. The number of excitation quantization signals is determined by the number of subband decomposition levels, and can be referred to the description in the foregoing embodiments. The coding terminal further encapsulates the excitation quantization signals and all other coding parameters in the coding process to obtain target coding data, and outputs the target coding data to the speech decoding terminal. Since the method of quantizing each subband excitation signal with different quantization precisions is used, the coding compression bit occupancy rate of each subband excitation signal can be greatly reduced. The compression is mainly in the high-frequency weak signal, and the auditory perception of the human ear is not obvious, so the required bandwidth can be effectively reduced. On the contrary, under the same bandwidth condition, the quantization precision of the medium and low frequency excitation can be higher, more bits can be allocated to describe the medium and low frequency excitation signal, and the high frequency excitation signal can be described with fewer bits than before. This can improve the auditory quality.
[0139] In the decoding process, the decoding end analyzes the received target encoded data to obtain each excitation quantization signal and other encoding parameters, each excitation quantization signal is quantized and restored to obtain each subband excitation signal, i.e., the first subband excitation signal, the second subband excitation signal, the third subband excitation signal, …, using the codebook used in the encoding process. Each subband excitation signal is multiplied by the respective gain to obtain each target excitation signal. Each target excitation signal is subjected to signal subband synthesis, which is the inverse process of signal subband decomposition. The signal subband synthesis process is the inverse process of the signal subband decomposition process, i.e., according to the corresponding combination of the signal subband decomposition process, the subband synthesis can be performed by a QMF orthogonal mirror filter bank. For example, if the encoding process has undergone three-level subband decomposition, three-level subband synthesis is required. In the previous example, exc3_high and exc3_low are QMF synthesized to obtain exc2_high, which is then QMF synthesized with exc2_low to obtain exc1_high. Finally, exc1_high is QMF synthesized with exc1_low to obtain the complete (8 kHz spectral bandwidth) excitation signal output. Subsequently, the normal decoding process is performed, including long-term prediction filtering and short-term prediction filtering, and finally the decoded sound signal is obtained.
[0140] It can be understood that the speech encoding end and the speech decoding end can store the same codebook, and the speech encoding end and the speech decoding end can agree that the speech decoding end determines the codebook used in the restoration process based on the order in which each excitation quantization signal is parsed, to ensure that the codebooks used by the speech encoding end and the speech decoding end for subband excitation signals of different frequency ranges are consistent.
[0141] It can also be understood that the speech encoding end and the speech decoding end can also agree that, in the decoding process, the gain used when each subband excitation signal is multiplied by the respective gain is increased based on the initial gain in a predetermined increasing manner, and the greater the frequency value of the frequency range in which the subband excitation signal is located, the greater the gain. For details, please refer to the description in the above embodiments. The initial gain is the gain parsed by the decoding end from the target encoded data packet. Since the speech encoding end and the speech decoding end agree on the predetermined increasing manner, the encoding end only needs to transmit the initial gain to the decoding end, thereby improving the encoding efficiency and effectively reducing the bandwidth.
[0142] The present application can also be applied in the scenario of video call. When user A and user B are conducting a video call, the speech signal of user A and the speech signal of user B can be encoded, transmitted and decoded using the scheme of the present application, thereby realizing the transmission of the speech signal in the video call between user A and user B.
[0143] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0144] Based on the same inventive concept, embodiments of this application also provide a speech encoding apparatus for implementing the speech encoding method described above, and a speech decoding apparatus for implementing the speech decoding method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, specific limitations in one or more apparatus embodiments provided below can be found in the limitations of the method described above, and will not be repeated here.
[0145] In one embodiment, such as Figure 9 As shown, a speech coding device 900 is provided, comprising:
[0146] The subband decomposition module 902 is used to decompose the signal subband based on the initial speech signal to be encoded, to obtain the first subband excitation signal and the second subband excitation signal corresponding to the initial speech signal; the frequency value corresponding to the second subband excitation signal is higher than the frequency value corresponding to the first subband excitation signal.
[0147] The quantization processing module 904 is used to quantize the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantized signal corresponding to the first sub-band excitation signal, and to quantize the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantized signal corresponding to the second sub-band excitation signal; the first quantization precision is greater than the second quantization precision.
[0148] The encoding data generation module 906 is used to obtain target encoded data corresponding to the initial speech signal based on the first excitation quantization signal and the second excitation quantization signal.
[0149] The voice coding device is based on the initial voice signal to be coded to perform signal sub-band decomposition, to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial voice signal, to quantize the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal, and to quantize the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal, wherein the frequency value corresponding to the second sub-band excitation signal is higher than the frequency value corresponding to the frequency range of the first sub-band excitation signal, and the first quantization precision is greater than the second quantization precision. Since the energy of the high-frequency excitation signal is low, the influence of quantization with lower quantization precision on voice signal coding is small, so that the coding efficiency can be improved while ensuring the voice quality.
[0150] In one embodiment, the quantization processing module is further configured to obtain a first quantization mapping relationship constructed based on the first quantization precision, quantize the first sub-band excitation signal based on the first quantization mapping relationship to obtain the first excitation quantization signal corresponding to the first sub-band excitation signal, obtain a second quantization mapping relationship constructed based on the second quantization precision, and quantize the second sub-band excitation signal based on the second quantization mapping relationship to obtain the second excitation quantization signal corresponding to the second sub-band excitation signal.
[0151] In one embodiment, the quantization processing module is further configured to obtain a first target codebook, search for a first target vector matching the first sub-band excitation signal from the first target codebook, and obtain the first excitation quantization signal based on the codebook serial number corresponding to the first target vector in the first target codebook; obtain a second target codebook, search for a second target vector matching the second sub-band excitation signal from the second target codebook, and use the codebook serial number corresponding to the second target vector in the second target codebook as the second excitation quantization signal; wherein the codebook serial number of the second target codebook is smaller than the codebook size of the first target codebook.
[0152] In one embodiment, the quantization processing module is further configured to search for a first target vector matching the first sub-band excitation signal from the first target codebook, obtain a first codebook serial number corresponding to the first target vector in the first target codebook, obtain an error vector between the first target vector and the first sub-band excitation signal, search for a second target vector matching the error vector from the first target codebook, obtain a second codebook serial number corresponding to the second target vector in the first target codebook, and use the first codebook serial number and the second codebook serial number as the first excitation quantization signal.
[0153] In one embodiment, the apparatus further comprises: a codebook generation module configured to obtain a set of training speech signals, a first codebook size of a first target codebook, and a second codebook size of a second target codebook; perform signal subband decomposition on the training speech signals in the set of training speech signals to obtain first subband training signals and second subband training signals corresponding to the training speech signals; perform clustering on the first subband training signals to obtain a first number of first clustering clusters; the first number matches the first codebook size; perform clustering on the second subband training signals to obtain a second number of second clustering clusters; the second number matches the second codebook size; for the first clustering clusters, determine a clustering center of the first clustering clusters as a first codebook vector, and establish an association relationship between the first codebook vector and a first codebook serial number in a set of first codebook serial numbers to obtain the first target codebook; and for the second clustering clusters, determine a clustering center of the second clustering clusters as a second codebook vector, and establish an association relationship between the second codebook vector and a second codebook serial number in a set of second codebook serial numbers to obtain the second target codebook.
[0154] In one embodiment, the subband decomposition module is further configured to perform signal analysis processing and filtering processing on the initial speech signal to be encoded to obtain an initial excitation signal corresponding to the initial speech signal; perform signal subband decomposition on the initial excitation signal to obtain a subband excitation signal in a first frequency range and a subband excitation signal in a second frequency range; the frequency value of the second frequency range is greater than the frequency value of the first frequency range; determine the subband excitation signal in the first frequency range as a first subband excitation signal corresponding to the initial speech signal, and determine the subband excitation signal in the second frequency range as a second subband excitation signal corresponding to the initial speech signal.
[0155] In one embodiment, the subband decomposition module is further configured to determine the subband excitation signal in the second frequency range as an intermediate excitation signal; perform signal subband decomposition on the intermediate excitation signal to obtain a first decomposition signal and a second decomposition signal corresponding to the intermediate excitation signal; the frequency range of the second decomposition signal is higher than the frequency range of the first decomposition signal; both the first decomposition signal and the second decomposition signal are used as the second subband excitation signal; and the quantization processing module is further configured to perform quantization processing on the first decomposition signal and the second decomposition signal respectively according to different second quantization precisions to obtain a second excitation quantization signal corresponding to the first decomposition signal and a second excitation quantization signal corresponding to the second decomposition signal; wherein the second quantization precision corresponding to the first decomposition signal is greater than the second quantization precision corresponding to the second decomposition signal.
[0156] In one embodiment, the encoding data generation module is configured to determine encoding gains corresponding to the first subband excitation signal and the second subband excitation signal; and obtain target encoding data corresponding to the initial speech signal based on the first excitation quantized signal, the second excitation quantized signal and the encoding gains corresponding to the first subband excitation signal and the second subband excitation signal.
[0157] In one embodiment, the encoding data generation module is configured to determine a first gain corresponding to the first subband excitation signal and a second gain corresponding to the second subband excitation signal; and determine an initial gain as the encoding gain corresponding to the first subband excitation signal and the second subband excitation signal if the first gain and the second gain are increased based on an initial gain and in a preset gain increasing manner; wherein the initial gain is calculated based on the initial speech signal.
[0158] In one embodiment, the encoding data generation module is configured to obtain an initial gain; take the initial gain as the first gain and establish an association between the first gain and a first serial number; obtain a second gain based on the initial gain and a first increasing multiple and establish an association between the second gain and a second serial number; and configure the first serial number to represent the first subband excitation signal and configure the second serial number to represent the second subband excitation signal.
[0159] In one embodiment, as shown in FIG. 1, Figure 10 a speech encoding apparatus 1000 is provided, which comprises:
[0160] An encoding data obtaining module 1002 is configured to obtain target encoding data, parse the first excitation quantized signal and the second excitation quantized signal based on the target encoding data; wherein the first excitation quantized signal is obtained by quantization in a first quantization precision; the second excitation quantized signal is obtained by quantization in a second quantization precision; the first quantization precision is greater than the second quantization precision.
[0161] A quantization restoration module 1004 is configured to perform quantization restoration processing on the first excitation quantized signal to obtain the first subband excitation signal, and perform quantization restoration processing on the second excitation quantized signal to obtain the second subband excitation signal; the frequency value of the second subband excitation signal is higher than the frequency value of the first subband excitation signal.
[0162] A subband synthesis module 1006 is configured to perform signal subband synthesis based on the first subband excitation signal and the second subband excitation signal to obtain a target speech signal.
[0163] In one embodiment, the second excitation quantization signal comprises a first target sub-signal and a second target sub-signal; the second quantization precision corresponding to the first target sub-signal is greater than the second quantization precision corresponding to the second target sub-signal; the quantization reduction module is further configured to perform quantization reduction processing on the first target sub-signal to obtain a first decomposition signal, and perform quantization reduction processing on the second target sub-signal to obtain a second decomposition signal; and the first decomposition signal and the second decomposition signal are subjected to signal sub-band synthesis to obtain the second sub-band excitation signal.
[0164] The voice decoding apparatus obtains target encoding data, obtains a first excitation quantization signal and a second excitation quantization signal based on the target encoding data, wherein the first excitation quantization signal is obtained by quantization at a first quantization precision, and the second excitation quantization signal is obtained by quantization at a second quantization precision; the first quantization precision is greater than the second quantization precision; the first excitation quantization signal is subjected to quantization reduction processing to obtain a first sub-band excitation signal, and the second excitation quantization signal is subjected to quantization reduction processing to obtain a second sub-band excitation signal; the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal; and signal sub-band synthesis is performed based on the first sub-band excitation signal and the second sub-band excitation signal to obtain a target voice signal. Since the excitation quantization signals of different quantization precisions can be subjected to quantization reduction, and each sub-band excitation signal obtained can be subjected to sub-band synthesis, an accurate target voice signal can be decoded.
[0165] Each module in the voice encoding apparatus and the voice decoding apparatus can be realized by software, hardware, or a combination thereof, in whole or in part. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to each module.
[0166] In one embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in FIG. 6. Figure 11As shown in the figure. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control ability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store voice signal data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a speech coding method or a speech decoding method.
[0167] In one embodiment, a computer device which can be a terminal is provided, and its internal structure diagram can be as shown in the figure. Figure 12 As shown in the figure. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control ability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store voice signal data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a speech coding method or a speech decoding method.
[0168] Those skilled in the art can understand that, Figure 11 and Figure 12The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0169] In an embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.
[0170] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.
[0171] In an embodiment, a computer program product or computer program is provided, including computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above method embodiments.
[0172] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0173] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0174] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0175] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A speech coding method characterized by, The method comprises: performing signal sub-band decomposition based on an initial speech signal to be encoded to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial speech signal; the second sub-band excitation signal corresponds to a frequency value higher than that of the first sub-band excitation signal; quantizing the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal; quantizing the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal; the first quantization precision is greater than the second quantization precision; obtaining target encoding data corresponding to the initial speech signal based on the first excitation quantization signal and the second excitation quantization signal.
2. The method of claim 1, wherein, The quantizing the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal comprises: obtaining a first quantization mapping relationship constructed based on the first quantization precision, and quantizing the first sub-band excitation signal based on the first quantization mapping relationship to obtain the first excitation quantization signal corresponding to the first sub-band excitation signal; The quantizing the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal comprises: obtaining a second quantization mapping relationship constructed based on the second quantization precision, and quantizing the second sub-band excitation signal based on the second quantization mapping relationship to obtain the second excitation quantization signal corresponding to the second sub-band excitation signal.
3. The method of claim 2, wherein, The obtaining a first quantization mapping relationship constructed based on the first quantization precision, and quantizing the first sub-band excitation signal based on the first quantization mapping relationship to obtain the first excitation quantization signal corresponding to the first sub-band excitation signal comprises: obtaining a first target codebook, searching a first target vector matching the first sub-band excitation signal from the first target codebook, and obtaining the first excitation quantization signal based on a codebook serial number corresponding to the first target vector in the first target codebook; The quantizing the second sub-band excitation signal based on the second quantization mapping relationship to obtain the second excitation quantization signal corresponding to the second sub-band excitation signal comprises: obtaining a second target codebook, searching a second target vector matching the second sub-band excitation signal from the second target codebook, and taking a codebook serial number corresponding to the second target vector in the second target codebook as the second excitation quantization signal; wherein a codebook size of the second target codebook is smaller than a codebook size of the first target codebook.
4. The method of claim 3, wherein, The searching a first target vector matching the first sub-band excitation signal from the first target codebook, and obtaining the first excitation quantization signal based on a codebook serial number corresponding to the first target vector in the first target codebook comprises: searching the first target codebook to obtain a first target vector matching the first subband excitation signal, and obtaining a first codebook serial number corresponding to the first target vector in the first target codebook; obtaining an error vector between the first target vector and the first subband excitation signal; searching the first target codebook to obtain a second target vector matching the error vector, and obtaining a second codebook serial number corresponding to the second target vector in the first target codebook; taking the first codebook serial number and the second codebook serial number as the first excitation quantization signal.
5. The method of claim 3, wherein, The generation steps of the first target codebook and the second target codebook include: obtaining a training speech signal set, a first codebook size of the first target codebook, and a second codebook size of the second target codebook; performing signal subband decomposition on the training speech signals in the training speech signal set to obtain first subband training signals and second subband training signals corresponding to the training speech signals; performing clustering based on the first subband training signals to obtain a first number of first clustering clusters; the first number matches the first codebook size; performing clustering based on the second subband training signals to obtain a second number of second clustering clusters; the second number matches the second codebook size; for the first clustering cluster, determining a clustering center of the first clustering cluster as a first codebook vector, and establishing an association relationship between the first codebook vector and a first codebook serial number in a first codebook serial number set to obtain the first target codebook; for the second clustering cluster, determining a clustering center of the second clustering cluster as a second codebook vector, and establishing an association relationship between the second codebook vector and a second codebook serial number in a second codebook serial number set to obtain the second target codebook.
6. The method of claim 1, wherein, The signal subband decomposition based on the initial speech signal to be encoded includes: performing signal analysis processing and filtering processing on the initial speech signal to be encoded to obtain an initial excitation signal corresponding to the initial speech signal; performing signal subband decomposition on the initial excitation signal to obtain a subband excitation signal in a first frequency range and a subband excitation signal in a second frequency range; the frequency value of the second frequency range is greater than the frequency value of the first frequency range; determining the subband excitation signal in the first frequency range as the first subband excitation signal corresponding to the initial speech signal, and determining the subband excitation signal in the second frequency range as the second subband excitation signal corresponding to the initial speech signal.
7. The method of claim 6, wherein, The determination of the second subband excitation signal corresponding to the initial speech signal based on the subband excitation signal in the second frequency range includes: determining the subband excitation signal in the second frequency range as an intermediate excitation signal; performing signal subband decomposition on the intermediate excitation signal to obtain a first decomposition signal and a second decomposition signal corresponding to the intermediate excitation signal; the frequency range of the second decomposition signal is higher than the frequency range of the first decomposition signal; The first decomposition signal and the second decomposition signal are both taken as second subband excitation signals; The second subband excitation signal is quantized according to the second quantization precision to obtain a second excitation quantization signal corresponding to the second subband excitation signal, and the method comprises: The first decomposition signal and the second decomposition signal are quantized according to different second quantization precisions to obtain a second excitation quantization signal corresponding to the first decomposition signal and a second excitation quantization signal corresponding to the second decomposition signal; The second quantization precision corresponding to the first decomposition signal is greater than the second quantization precision corresponding to the second decomposition signal.
8. The method of claim 1, wherein, The target coding data corresponding to the initial speech signal is obtained based on the first excitation quantization signal and the second excitation quantization signal, and the method comprises: A coding gain corresponding to the first subband excitation signal and the second subband excitation signal is determined; The target coding data corresponding to the initial speech signal is obtained based on the first excitation quantization signal, the second excitation quantization signal and the coding gain corresponding to the first subband excitation signal and the second subband excitation signal.
9. The method of claim 8, wherein, The coding gain corresponding to the first subband excitation signal and the second subband excitation signal is determined, and the method comprises: A first gain corresponding to the first subband excitation signal and a second gain corresponding to the second subband excitation signal are determined; If the first gain and the second gain are increased based on an initial gain and according to a preset gain increasing mode, then The initial gain is determined as the coding gain corresponding to the first subband excitation signal and the second subband excitation signal; The initial gain is calculated based on the initial speech signal.
10. The method of claim 9, wherein, The configuration step of the gain increasing mode comprises: The initial gain is obtained; The initial gain is taken as a first gain, and an association relationship between the first gain and a first serial number is established; A second gain is obtained based on the initial gain and a first increasing multiple, and an association relationship between the second gain and a second serial number is established; The first serial number is configured to represent the first subband excitation signal, and the second serial number is configured to represent the second subband excitation signal.
11. A speech decoding method, characterized by, The method comprises: Target coding data is obtained, and a first excitation quantization signal and a second excitation quantization signal are obtained based on the target coding data; The first excitation quantization signal is quantized according to a first quantization precision; the second excitation quantization signal is quantized according to a second quantization precision; the first quantization precision is greater than the second quantization precision; The first excitation quantization signal is quantized and restored to obtain a first subband excitation signal, and the second excitation quantization signal is quantized and restored to obtain a second subband excitation signal; the frequency value of the second subband excitation signal is higher than the frequency value of the first subband excitation signal; Signal subband synthesis is performed based on the first subband excitation signal and the second subband excitation signal to obtain a target speech signal.
12. The method of claim 11, wherein, The second excitation quantization signal comprises a first target sub-signal and a second target sub-signal; the second quantization precision corresponding to the first target sub-signal is greater than the second quantization precision corresponding to the second target sub-signal; The quantization reduction processing of the second excitation quantization signal comprises: The first target sub-signal is subjected to quantization reduction processing to obtain a first decomposition signal, and the second target sub-signal is subjected to quantization reduction processing to obtain a second decomposition signal; The first decomposition signal and the second decomposition signal are subjected to signal sub-band synthesis to obtain the second sub-band excitation signal.
13. A speech coding apparatus characterized by comprising: The device comprises: A sub-band decomposition module is configured to perform signal sub-band decomposition on an initial speech signal to be encoded to obtain a first sub-band excitation signal and a second sub-band excitation signal corresponding to the initial speech signal; the frequency value corresponding to the second sub-band excitation signal is higher than the frequency value corresponding to the first sub-band excitation signal; A quantization processing module is configured to perform quantization processing on the first sub-band excitation signal according to a first quantization precision to obtain a first excitation quantization signal corresponding to the first sub-band excitation signal, and perform quantization processing on the second sub-band excitation signal according to a second quantization precision to obtain a second excitation quantization signal corresponding to the second sub-band excitation signal; the first quantization precision is greater than the second quantization precision; An encoded data generation module is configured to obtain target encoded data corresponding to the initial speech signal based on the first excitation quantization signal and the second excitation quantization signal.
14. A speech decoding apparatus characterized by comprising: The device comprises: An encoded data acquisition module is configured to acquire target encoded data, and parse the first excitation quantization signal and the second excitation quantization signal based on the target encoded data; the first excitation quantization signal is obtained by quantization according to a first quantization precision; the second excitation quantization signal is obtained by quantization according to a second quantization precision; the first quantization precision is greater than the second quantization precision; A quantization reduction module is configured to perform quantization reduction processing on the first excitation quantization signal to obtain a first sub-band excitation signal, and perform quantization reduction processing on the second excitation quantization signal to obtain a second sub-band excitation signal; the frequency value of the second sub-band excitation signal is higher than the frequency value of the first sub-band excitation signal; A sub-band synthesis module is configured to perform signal sub-band synthesis based on the first sub-band excitation signal and the second sub-band excitation signal to obtain a target speech signal.
15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 10 or 11 to 12.
16. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 10 or 11 to 12.
17. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 10 or 11 to 12.
Citation Information
Patent Citations
Method and device for searching constant codebook excitations at encoding and decoding ends
CN101572092A
Voice processing method, device and equipment
CN112669857A