Acoustic codeword coding and decoding method and device, equipment and storage medium

By using the valid elements and preset threshold values ​​in the frame flag domain in the voice code data frame to determine the end frame, the problem of high channel transmission error rate in the prior art is solved, and the anti-code error of the shortwave system is improved and reliability.

CN119094078APending Publication Date: 2024-12-06GUANGZHOU HAIGE COMMUNICATION GROUP INCORPORATED COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310658987.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Under poor channel transmission conditions, the prior art relies on fixed values ​​to encode the data frame of the voice code source, resulting in a greater possibility of misjudgment and a decrease in the reliability of short-wave system transmission.

Method used

By introducing valid elements in the frame flag domain into the voice code data frame, and determining whether the data frame is an end frame based on the preset threshold value, and then decoding the end frame and all previous data frames, improving resistance Code error capability and reliability of data detection.

Benefits of technology

It improves the anti-code error capability and data detection reliability of short-wave low-speed voice code data transmission process, reduces the error judgment rate, and enhances the fault tolerance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094078A_ABST
    Figure CN119094078A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of short-wave communication, and provides an acoustic codeword encoding and decoding method, device and equipment and a storage medium, and the method comprises the steps: receiving a data frame of acoustic codeword data transmitted by a transmitting end; the data frame at least comprises a vocoder data field and a frame mark word field, the frame mark word field comprises effective elements, and the number of the effective elements is used for judging whether the data frame is an end frame or not; determining whether the data frame is an end frame or not according to a preset threshold value of an effective element corresponding to the vocoder data; and when the data frame is an end frame, decoding the end frame and all data frames before the end frame to obtain target pulse code modulation (PCM) voice data. According to the method provided by the invention, the data frame of the vocoder data with the effective elements sent by the sending end is received, and the vocoder data is decoded to obtain the target pulse code modulation (PCM) voice data, so that the error code resistance and the reliability of data detection in the short-wave low-speed vocoder data transmission process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of shortwave communication, and in particular to a method, device, equipment and storage medium for encoding and decoding vocoded speech. Background Art

[0002] The channel bandwidth of military shortwave and ultra-shortwave communications is small and the channel conditions are unstable. Therefore, the shortwave transmission process requires the use of a low-rate source coding method.

[0003] In the prior art, fixed values ​​are usually used to describe the types of different vocoder data frames, for example, value 1 represents the start frame, value 2 represents the middle frame, and value 3 represents the end frame. The sender encodes the value into the specified field when performing vocoder source encoding, and the receiver decodes and judges after receiving the vocoder data. However, if the channel transmission condition is poor, the demodulated source data of the receiver may still have a certain bit error rate. Therefore, the vocoder data frame is encoded by relying on a fixed value, and then the encoded vocoder data frame is detected and judged during the source transmission process, resulting in a greater possibility of misjudgment, and the reliability of shortwave system transmission is reduced. Summary of the invention

[0004] The present invention provides a vocoder encoding and decoding method, device, equipment and storage medium, which are used to solve the defect of high bit error rate in the prior art and improve the fault tolerance and bit error resistance of the vocoder data transmission process.

[0005] In a first aspect, the present invention provides a method for decoding vocoded speech, the method comprising:

[0006] Receive a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of the valid elements is used to determine whether the data frame is an end frame;

[0007] Determining whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0008] When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

[0009] Optionally, determining whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data includes:

[0010] Detecting the valid elements on the data frame to obtain the number of valid elements contained in the data frame;

[0011] Whether the data frame is an end frame is determined according to the number of valid elements included in the data frame and a threshold value of the valid elements.

[0012] Optionally, the number of valid elements in the frame flag word field included in the data frame is a first value; the number of all frame flag words in the frame flag word field included in the data frame is a second value; the threshold value of the valid element is a first proportion of a preset number of valid elements in a number corresponding to a preset length of the frame flag word; and judging whether the data frame is an end frame according to the number of valid elements included in the data frame and the threshold value of the valid element includes:

[0013] Whether the data frame is an end frame is determined according to a first value corresponding to the data frame, a second value corresponding to the data frame, and a threshold value of the valid element.

[0014] Optionally, judging whether the data frame is an end frame according to the first value corresponding to the data frame, the second value corresponding to the data frame, and the threshold value of the valid element includes:

[0015] Dividing the first value by the second value to obtain a second proportion corresponding to the data frame;

[0016] Comparing the second proportion with the threshold value of the valid element;

[0017] When the second proportion is greater than or equal to the threshold value of the valid element, the data frame is determined as an end frame.

[0018] Optionally, decoding the end frame and all data frames before the end frame to obtain target PCM voice data includes:

[0019] splicing the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame to obtain spliced ​​vocoded speech data;

[0020] The concatenated vocoded speech data is decoded to obtain target PCM speech data.

[0021] In a second aspect, the present invention further provides a method for encoding vocoded speech, the method comprising:

[0022] The sampled first pulse code modulation PCM voice data is compressed and encoded to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0023] The data frame of the vocoded speech data is sent to a receiving end.

[0024] Optionally, the valid element is a bit value 1 in the frame flag field.

[0025] In a third aspect, the present invention further provides a vocoded speech decoding device, the device comprising:

[0026] A receiving module, used for receiving a data frame of vocoded speech data sent by a sending end; the data frame at least comprises: a vocoded speech data field and a frame flag word field, the frame flag word field comprises valid elements, and the number of the valid elements is used to determine whether the data frame is an end frame;

[0027] The decoding module is used to determine whether the data frame is an end frame according to a preset threshold value of a valid element corresponding to the vocoded speech data; when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM speech data.

[0028] In a fourth aspect, the present invention further provides a vocoder encoding device, the device comprising:

[0029] The encoding module is used to compress and encode the sampled first pulse code modulation PCM voice data to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0030] The sending module is used to send the data frame of the vocoded speech data to the receiving end.

[0031] In a fourth aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for decoding or encoding vocoded speech as described above is implemented.

[0032] In a fifth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned vocoded speech decoding methods or vocoded speech encoding methods.

[0033] In a sixth aspect, the present invention further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned vocoded speech decoding methods or the above-mentioned vocoded speech encoding methods.

[0034] The present invention provides a method, device, equipment and storage medium for encoding and decoding vocoder data. The method receives a data frame of vocoder data sent by a transmitter, wherein the data frame at least includes: a vocoder data field and a frame flag field, wherein the frame flag field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame. Then, according to a threshold value of valid elements corresponding to the vocoder data set in advance, it is determined whether the data frame is an end frame. When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data. The present invention receives a data frame of vocoder data with valid elements set in advance sent by a transmitter, and determines whether the data frame is an end frame in combination with a threshold value of valid elements corresponding to the vocoder data set in advance. Then, when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data, thereby improving the error resistance and data detection reliability of the shortwave low-speed vocoder data transmission process. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 It is one of the flow charts of the vocoded speech decoding method provided by the present invention;

[0037] Figure 2 It is a schematic diagram of the structure of a data frame of the vocoded speech data provided by the present invention;

[0038] Figure 3 This is a second flow chart of the method for decoding vocoded speech provided by the present invention;

[0039] Figure 4 It is one of the flow charts of the vocoding speech encoding method provided by the present invention;

[0040] Figure 5 This is the second flow chart of the vocoding method provided by the present invention;

[0041] Figure 6 It is a structural schematic diagram of the vocoded speech decoding device provided by the present invention;

[0042] Figure 7 It is a structural schematic diagram of the vocoding speech encoding device provided by the present invention;

[0043] Figure 8It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] First, the application scenario of the vocoded speech encoding and decoding method provided by the embodiment of the present invention is introduced.

[0046] The channel bandwidth of military shortwave and ultra-shortwave communications is small and the channel conditions are unstable. Therefore, the shortwave transmission process requires the use of a low-rate source coding method.

[0047] In the prior art, fixed values ​​are usually used to describe the types of different vocoded speech data frames, for example, value 1 represents the start frame, value 2 represents the middle frame, and value 3 represents the end frame. The sender encodes the value into the specified field when performing vocoded speech source encoding, and the receiver decodes and judges after receiving the vocoded speech data.

[0048] The prior art has the following shortcomings: under poor channel transmission conditions, the demodulated source data at the receiving end may still have a certain bit error rate. Therefore, the method of encoding the vocoded speech source data frame is based on a fixed value, and then the vocoded speech data frame is detected and judged during the source transmission process, which has a high possibility of misjudgment and reduces the reliability of shortwave system transmission.

[0049] In view of the above shortcomings, the present invention provides a solution for vocoder coding and decoding which can effectively improve the accuracy, fault tolerance and error resistance of the vocoder data transmission process.

[0050] Combine the following Figure 1-Figure 7 The solution of vocoding and decoding provided by the present invention is described.

[0051] Figure 1 FIG. 1 is a flow chart of a method for decoding vocoded speech provided by the present invention. Figure 1 As shown, the method specifically comprises the following steps:

[0052] Step 101, receiving a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame;

[0053] Specifically, the execution subject of the method is the receiving end. It can be understood that, specifically, the execution subject can be any electronic device of the receiving end, such as an electronic computer, a numerical control system controlled by an electronic computer, etc. This embodiment does not limit this.

[0054] Specifically, the receiving end receives the data frame of the vocoded speech data sent by the sending end. It can be understood that the vocoded speech data can include multiple data frames. For each data frame, the data frame at least includes a vocoded speech data field and a frame flag field. The vocoded speech data field is a data content part that encapsulates the encoded vocoded speech data content according to a specific format requirement, and the frame flag field is a field for encoding the data frame. The frame flag field is used to determine whether the data frame is a process frame or an end frame during the transmission of the data frame of the vocoded speech data, thereby determining that the data frame reception is completed, so as to facilitate the data reception completion processing.

[0055] For example, the structure of the data frame of the vocoded speech data is as follows: Figure 2 As shown, the data frame of the voice code speech data includes a voice code speech data field and a frame mark word field.

[0056] The length of the frame flag field of the data frame can be preset according to the voice code speech data field. For example, for 100 bytes of voice code speech data, the length of the corresponding frame flag field is 16 bits.

[0057] Further, the frame flag field of the data frame includes valid elements. It is understandable that the number of valid elements in the frame flag field of the data frame should be less than or equal to the number corresponding to the length of the frame flag field. For example, the length of the frame flag field of the data frame is 16 bits, and the number of valid elements should be less than or equal to 16 bits, such as 3 bits, 5 bits, 8 bits, etc. The number of valid elements can be used to determine whether the data frame is an end frame.

[0058] Optionally, a check code, such as a cyclic redundancy check (CRC), may be added to the frame flag field of the data frame of the vocoded speech data to check whether the vocoded speech data is garbled. Correspondingly, if it is detected that the data in the data frame is garbled or erroneous, a retransmission or direct reception operation may be requested. This process is similar to the general data verification process and will not be described in detail here.

[0059] Step 102, determining whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0060] Specifically, after receiving the data frame of the vocoded speech data sent by the sending end, the receiving end can detect and judge the data frame of the vocoded speech data in real time. For example, it can determine whether the received data frame of the vocoded speech data is an end frame according to a threshold value of a valid element corresponding to the vocoded speech data that is preset. It can be understood that the sending end sends the vocoded speech data in real time, and the receiving end also detects the data frame of the vocoded speech data in real time.

[0061] Step 103: When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

[0062] When it is determined that the data frame of the currently received vocoded speech data is an end frame, it indicates that the data transmission is temporarily terminated or terminated, which means that the data transmission process of the current vocoded speech data is terminated. Then, the received end frame and all data frames before the end frame can be spliced ​​to obtain the spliced ​​vocoded speech data, and the spliced ​​vocoded speech data can be decoded, for example, by using a vocoder to decode, and finally the decoded pulse code modulation (PCM) speech data is obtained, which is determined as the target pulse code modulation PCM speech data.

[0063] At this point, the transmission process of the vocoded speech data is completed.

[0064] In the method provided by the embodiment of the present invention, a data frame of vocoder data sent by a transmitting end is received, wherein the data frame at least includes: a vocoder data field and a frame flag field, the frame flag field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame, and then, according to a preset threshold value of valid elements corresponding to the vocoder data, it is determined whether the data frame is an end frame, and when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data. The present invention receives a data frame of vocoder data with valid elements set by a transmitting end, and combines the preset threshold value of valid elements corresponding to the vocoder data to determine whether the data frame is an end frame, and then, when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data, thereby improving the error resistance and data detection reliability of the shortwave low-speed vocoder data transmission process.

[0065] Optionally, determining whether the data frame is an end frame according to a preset threshold value of a valid element corresponding to the vocoded speech data includes:

[0066] Detecting valid elements of the data frame to obtain the number of valid elements contained in the data frame;

[0067] Whether the data frame is an end frame is determined based on the number of valid elements contained in the data frame and the threshold value of the valid elements.

[0068] Specifically, the threshold value of the valid element corresponding to the vocoded speech data can be preset, for example, the threshold value of the valid element can be determined according to the size of the data frame of the vocoded speech data, such as 80%, 60%, 90%. It can be understood that the larger the threshold value of the valid element, the more accurate the result of determining whether the data is a data frame through the threshold value of the valid element, but the channel condition of the transmission channel is required to be higher, so it is necessary to select a suitable threshold value according to the current channel condition. Generally, the better the channel condition, the higher the threshold value can be set.

[0069] Furthermore, in step 102, the receiving end may first detect valid elements in the data frame of the voice coded speech data to obtain the number of valid elements contained in the data frame, specifically, detect valid elements contained in the frame flag field of the data frame to obtain the number of valid elements contained in the data frame.

[0070] Furthermore, after obtaining the number of valid elements included in the data frame, it can be determined whether the data frame is an end frame according to the number of valid elements included in the data frame and a preset threshold value of valid elements.

[0071] In the method provided by the embodiment of the present invention, by detecting valid elements in a data frame, the number of valid elements contained in the data frame is obtained, and then combined with a preset threshold value of valid elements, it is determined whether the data frame is an end frame. Furthermore, when the data frame is an end frame, the end frame and all data frames before the end frame can be decoded to obtain target pulse code modulation PCM voice data. By determining whether a data frame is an end frame through valid element detection combined with a preset threshold value of valid elements, the obtained judgment result is more accurate, and the error resistance during the transmission of shortwave low-speed voice code speech data is improved.

[0072] Optionally, the number of valid elements in the frame flag word field included in the data frame is a first value; the number of all frame flag words in the frame flag word field included in the data frame is a second value; the threshold value of the valid element is a first proportion of the preset number of valid elements in the number corresponding to the preset length of the frame flag word; judging whether the data frame is an end frame according to the number of valid elements included in the data frame and the threshold value of the valid element, includes:

[0073] Whether the data frame is an end frame is determined according to a first value corresponding to the data frame, a second value corresponding to the data frame, and a threshold value of a valid element.

[0074] Specifically, the number of valid elements in the frame flag word field included in the data frame of the voice code speech data may be a first value, the number of all frame flag words in the frame flag word field included in the data frame may be a second value, and the threshold value of the valid element refers to the first proportion of the preset number of valid elements in the number corresponding to the preset length of the frame flag word. Exemplarily, the preset number of valid elements is 12 bits, the number corresponding to the preset length of the frame flag word is, for example, 16 bits, and the threshold value of the valid element, i.e., the first proportion, is 75%.

[0075] Further, whether the data frame is an end frame can be determined based on the first value corresponding to the data frame, that is, the number of valid elements in the frame flag word field contained in the data frame of the voice-coded speech data, the second value corresponding to the data frame (the number of all frame flag words in the frame flag word field contained in the data frame) and the threshold value of the valid elements (the first proportion).

[0076] In the method provided by the embodiment of the present invention, whether the data frame is an end frame is determined according to the first value corresponding to the data frame, the second value corresponding to the data frame and the threshold value of the valid element. The result of determining the end frame by this method is relatively accurate.

[0077] Optionally, judging whether the data frame is an end frame according to a first value corresponding to the data frame, a second value corresponding to the data frame, and a threshold value of a valid element includes:

[0078] Divide the first value by the second value to obtain a second proportion corresponding to the data frame;

[0079] Comparing the second proportion with a threshold value of a valid element;

[0080] When the second proportion is greater than or equal to the threshold value of the valid element, the data frame is determined as an end frame.

[0081] Specifically, according to the first value corresponding to the data frame, the second value corresponding to the data frame and the threshold value of the valid element, the specific process of judging whether the data frame is an end frame is as follows:

[0082] First, the first value is divided by the second value to obtain a second proportion corresponding to the data frame, and then the second proportion is compared with the threshold value of the valid element. When the second proportion is greater than or equal to the threshold value of the valid element, the data frame is determined to be an end frame. For example, the number of valid elements in the frame flag word field contained in the data frame is divided by the number of frame flag words in the frame flag word field contained in the data frame to obtain a second proportion of the number of valid elements in the data frame to the number of frame flag words, and the second proportion is compared with the preset threshold value of the valid element to determine whether the data frame is an end frame.

[0083] The specific process example of judging whether a data frame is an end frame is as follows:

[0084] Suppose that the preset number of valid elements is 12 bits, the number corresponding to the preset length of the frame flag word is, for example, 16 bits, the threshold value of the valid element, that is, the first proportion, is 75%, the number of valid elements in the frame flag word field contained in the first data frame is 14 bits, that is, the first value is 14 bits, and the number corresponding to the preset length of the frame flag word is 16 bits, that is, the second value is 16 bits.

[0085] Divide the first value by the second value to get the second ratio:

[0086] 14÷16=87.5%;

[0087] Compare the second proportion with the threshold value of the valid element to obtain:

[0088] 87.5%>75%;

[0089] Therefore, the first data frame is determined to be the end frame.

[0090] In the method provided by the embodiment of the present invention, the first value is divided by the second value to obtain the second proportion corresponding to the data frame, and then the second proportion is compared with the threshold value of the valid element to determine whether the data frame is an end frame. By using the valid element detection method to determine whether the data frame is an end frame, the judgment result obtained is more accurate, and the error resistance and reliability of the data transmission process are improved.

[0091] Optionally, the end frame and all data frames before the end frame are decoded to obtain target PCM voice data, including:

[0092] splicing the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame to obtain spliced ​​vocoded speech data;

[0093] The concatenated vocoded speech data is decoded to obtain the target PCM speech data.

[0094] Specifically, after the judgment in step 102, if it is determined that the data frame is an end frame, it means that the data receiving process is ended. At this time, the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame (that is, all data frames before the last frame) are spliced ​​to obtain the spliced ​​vocoded speech data.

[0095] Furthermore, based on the spliced ​​vocoded speech data, the receiving end can decode the spliced ​​vocoded speech data using a decoding device such as a vocoder to obtain target PCM speech data. The process of decoding the spliced ​​vocoded speech data can also be regarded as a process of restoring the original PCM speech data, so that the receiving end can receive the original source sent by the sending end.

[0096] In the method provided by the embodiment of the present invention, the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame are spliced ​​to obtain the spliced ​​vocoded speech data, and then the spliced ​​vocoded speech data are decoded to obtain the target PCM voice data, so that the reliability of the shortwave low-speed data transmission process is improved and the error resistance capability is strong.

[0097] Figure 3 FIG. 2 is a flow chart of the method for decoding vocoded speech provided by the present invention. Figure 3 As shown, the method specifically comprises the following steps:

[0098] Step 301: The transmitting end compresses and encodes the sampled first pulse code modulation (PCM) voice data to obtain a data frame of vocoded speech data;

[0099] Step 302: The transmitting end sends a data frame of the vocoded speech data to the receiving end;

[0100] Step 303, the receiving end receives the data frame of the vocoded speech data sent by the sending end;

[0101] Step 304, the receiving end determines whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0102] Step 305: When the data frame is an end frame, decode the end frame and all data frames before the end frame to obtain target pulse code modulation PCM voice data.

[0103] Specifically, the transmitting end first compresses and encodes the sampled first pulse code modulation PCM voice data to obtain a data frame of the vocoded speech data. The encoding algorithm may be, for example, a sinusoidal excitation linear prediction (SELP) algorithm or a mixed excitation linear prediction (MELP) algorithm, which is not limited in this embodiment. The data frame of the vocoded speech data obtained after encoding is generally 6-8 bytes, which is the source data applicable to the transmission through the shortwave wireless channel, that is, the data frame of the vocoded speech data. Then, the transmitting end sends the data frame of the vocoded speech data to the receiving end. Further, the receiving end receives the data frame of the vocoded speech data, and then determines whether the data frame is an end frame according to the threshold value of the valid element corresponding to the pre-set vocoded speech data. When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain the target pulse code modulation PCM speech data.

[0104] The method provided in the embodiment of the present invention can effectively improve the accuracy, fault tolerance and error resistance of the voice coded speech data transmission process, and can also be used as a general data encoding method and applied in a transmission system with errors to improve the system's error resistance capability.

[0105] Figure 4 It is one of the flow charts of the vocoding method provided by the present invention, such as Figure 4 As shown, the method comprises the following steps:

[0106] Step 401: compress and encode the sampled first pulse code modulation PCM voice data to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0107] Specifically, the sampled first pulse code modulation PCM voice data, that is, the original voice, for example, the PCM voice data sampled at 8 kHz (KHz), may include multiple frames, wherein the vocoder encoding end usually analyzes the first PCM voice data by frame processing, and the voice length of each frame is about 25-75 milliseconds (ms). The transmitting end, for example, compresses and encodes the sampled first PCM voice data through the vocoder, and the encoding algorithm may, for example, adopt a sinusoidal excitation linear prediction (SELP) algorithm or a mixed excitation linear prediction (MELP) algorithm, which is not limited in this embodiment. The data frame of the vocoded speech data obtained after encoding is generally 6-8 bytes, which is the source data suitable for transmission through a shortwave wireless channel, that is, the data frame of the vocoded speech data.

[0108] Furthermore, the data frame of the vocoded speech data includes a vocoded speech data field and a frame flag field, the frame flag field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame during decoding.

[0109] Step 402: Send the data frame of the vocoded speech data to the receiving end.

[0110] The data frame of the vocoded speech, that is, the data frame containing the data field of the vocoded speech and the frame mark field, is sent to the receiving end. It is understandable that the frame mark field corresponding to the data frame of the vocoded speech data contains a valid element.

[0111] In the method provided by the embodiment of the present invention, the first pulse code modulation PCM voice data sampled is compressed and encoded by the transmitting end to obtain a data frame of the vocoded speech data, wherein the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes a valid element, and then the data frame of the vocoded speech data is sent to the receiving end. The present invention sets a valid element in the data frame of the vocoded speech data, so that the receiving end determines whether the data frame is an end frame in combination with a threshold value of a valid element corresponding to the vocoded speech data set in advance. Then, when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain the target pulse code modulation PCM voice data, thereby improving the error resistance capability and data detection reliability of the shortwave low-speed vocoded speech data transmission process.

[0112] Optionally, the valid element is a bit value 1 in the frame flag field.

[0113] Specifically, the frame flag word field contained in the data frame of the voice code speech data includes the voice code speech data field and the frame flag word field, wherein the frame flag word field includes valid elements, and the valid elements can be customized. In the embodiment of the present invention, the valid element can be set to the bit value 1 in the frame flag word field. For example, the frame flag word field value contained in the data frame in the embodiment of the present invention is shown in FIG. Figure 5 .

[0114] Illustratively, in the example of the present invention, a bit value of 1 in the frame control word is defined as a valid element, and the valid element threshold value is 80%.

[0115] Figure 5 FIG. 2 is a flow chart of the voice coding method provided by the present invention. Figure 5 As shown, the frame flag word field of the voice coded speech data frame adopts a 16-bit frame flag word, that is, the number of frame flags contained in the frame flag word field is 16 bits.

[0116] Among them, 510 is the value of the frame flag word field of the non-end frame defined by the sender, which is represented by a 16-bit all-0 bit value and is used to represent the frame flag word field of all data frames before the end frame;

[0117] 520 is the value of the frame flag word field of the end frame defined by the sender, which is represented by a 16-bit all-1 bit value and is used to indicate the last data frame, that is, the frame flag word field of the end frame;

[0118] 530 and 540 are two examples of the frame flag word field of the end frame demodulated by the receiving end, where 530 has 2 bit errors and 540 has 3 bit errors. The second proportion of the number of valid elements in the two to the number of all frame flag words in the frame flag field exceeds the preset valid element threshold of 80%. It can be determined that 530 and 540 are the frame flag fields of the end frame, and the data frame is the end frame.

[0119] In the method provided in the embodiment of the present invention, compared with the traditional solution that uses a fixed value in the frame flag field to describe the types of different vocoder data frames and then detects and judges the frames during the vocoder transmission process, the error resistance and fault tolerance capabilities of the vocoder data during the transmission process are improved, and the reliability of shortwave system transmission is further improved.

[0120] The vocoded speech decoding device provided by the present invention is described below. The vocoded speech decoding device described below and the vocoded speech decoding method described above can be referred to each other. Figure 6 Schematic diagram of the structure of the vocoded speech decoding device provided by the present invention. Figure 6 As shown, the vocoded speech decoding device 600 includes: a receiving module 610 and a decoding module 620, wherein:

[0121] The receiving module 610 is used to receive a data frame of the vocoded speech data sent by the transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame;

[0122] The decoding module 620 is used to determine whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data; when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM speech data.

[0123] The vocoder decoding device provided by the embodiment of the present invention receives a data frame of vocoder data sent by a transmitter through a receiving module 610, wherein the data frame at least includes: a vocoder data field and a frame flag field, the frame flag field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame, and then the decoding module 620 determines whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoder data, and when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data. The present invention receives a data frame of vocoder data with valid elements set by a transmitter, and determines whether the data frame is an end frame in combination with a preset threshold value of valid elements corresponding to the vocoder data, and then, when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data, thereby improving the error resistance and data detection reliability of the shortwave low-speed vocoder data transmission process.

[0124] Optionally, the decoding module 620 is specifically configured to:

[0125] Detecting valid elements of the data frame to obtain the number of valid elements contained in the data frame;

[0126] Whether the data frame is an end frame is determined based on the number of valid elements contained in the data frame and the threshold value of the valid elements.

[0127] Optionally, the number of valid elements in the frame flag word field included in the data frame is a first value; the number of all frame flag words in the frame flag word field included in the data frame is a second value; the threshold value of the valid element is a first proportion of the preset number of valid elements to the number corresponding to the preset length of the frame flag word;

[0128] Optionally, the decoding module 620 is specifically configured to:

[0129] Whether the data frame is an end frame is determined according to a first value corresponding to the data frame, a second value corresponding to the data frame, and a threshold value of a valid element.

[0130] Optionally, the decoding module 620 is specifically configured to:

[0131] Divide the first value by the second value to obtain a second proportion corresponding to the data frame;

[0132] Comparing the second proportion with a threshold value of a valid element;

[0133] When the second proportion is greater than or equal to the threshold value of the valid element, the data frame is determined as an end frame.

[0134] Optionally, the decoding module 620 is further configured to:

[0135] splicing the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame to obtain spliced ​​vocoded speech data;

[0136] The concatenated vocoded speech data is decoded to obtain the target PCM speech data.

[0137] The following is a description of a vocoded speech encoding device 700 provided by the present invention. The vocoded speech encoding device described below and the vocoded speech encoding method described above can be referred to each other. Figure 7 Schematic diagram of the structure of the vocoded speech decoding device provided by the present invention. Figure 7 As shown, the vocoded speech decoding device 700 includes: an encoding module 710 and a sending module 720, wherein:

[0138] The encoding module 710 is used to compress and encode the sampled first pulse code modulation PCM voice data to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0139] The sending module 720 is used to send the data frame of the vocoded speech data to the receiving end.

[0140] The vocoder decoding device provided by the embodiment of the present invention compresses and encodes the sampled first pulse code modulation PCM voice data at the transmitting end through the encoding module 710 to obtain a data frame of the vocoder data, wherein the data frame at least includes: a vocoder data field and a frame flag word field, and the frame flag word field includes a valid element. Then, the transmitting module 720 transmits the data frame of the vocoder data to the receiving end. The present invention sets a valid element in the data frame of the vocoder data so that the receiving end determines whether the data frame is an end frame in combination with a threshold value of a valid element corresponding to the vocoder data set in advance. Then, when the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain the target pulse code modulation PCM voice data, thereby improving the error resistance capability and data detection reliability of the shortwave low-speed vocoder data transmission process.

[0141] Optionally, the valid element is a bit value 1 in the frame flag field.

[0142] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the vocoded speech decoding method, which includes:

[0143] Receive a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame;

[0144] Determine whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0145] When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

[0146] Or, performing a vocoder encoding method, the method comprising:

[0147] The sampled first pulse code modulation PCM voice data is compressed and encoded to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0148] The data frame of the vocoded speech data is sent to the receiving end.

[0149] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0150] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can perform a vocoded speech decoding method, the method comprising:

[0151] Receive a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame;

[0152] Determine whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0153] When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

[0154] Or, performing a vocoder encoding method, the method comprising:

[0155] The sampled first pulse code modulation PCM voice data is compressed and encoded to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0156] The data frame of the vocoded speech data is sent to the receiving end.

[0157] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program is implemented to perform a vocoded speech decoding method, the method comprising:

[0158] Receive a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of valid elements is used to determine whether the data frame is an end frame;

[0159] Determine whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data;

[0160] When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

[0161] Or, performing a vocoder encoding method, the method comprising:

[0162] The sampled first pulse code modulation PCM voice data is compressed and encoded to obtain a data frame of vocoded speech data; the data frame at least includes: a vocoded speech data field and a frame flag word field, and the frame flag word field includes valid elements;

[0163] The data frame of the vocoded speech data is sent to the receiving end.

[0164] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for decoding vocoded speech, characterized in that: include: Receive a data frame of vocoded speech data sent by a transmitting end; the data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of the valid elements is used to determine whether the data frame is an end frame; Determining whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data; When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

2. The method for decoding vocoded speech according to claim 1, characterized in that: The step of determining whether the data frame is an end frame according to a preset threshold value of valid elements corresponding to the vocoded speech data comprises: Detecting the valid elements on the data frame to obtain the number of valid elements contained in the data frame; Whether the data frame is an end frame is determined according to the number of valid elements included in the data frame and a threshold value of the valid elements.

3. The method for decoding vocoded speech according to claim 2, characterized in that: The number of valid elements in the frame flag word field included in the data frame is a first value; the number of all frame flag words in the frame flag word field included in the data frame is a second value; the threshold value of the valid element is a first proportion of the preset number of valid elements in the number corresponding to the preset length of the frame flag word; The determining, according to the number of valid elements included in the data frame and the threshold value of the valid elements, whether the data frame is an end frame comprises: Whether the data frame is an end frame is determined according to a first value corresponding to the data frame, a second value corresponding to the data frame, and a threshold value of the valid element.

4. The method for decoding vocoded speech according to claim 3, characterized in that: The determining whether the data frame is an end frame according to the first value corresponding to the data frame, the second value corresponding to the data frame, and the threshold value of the valid element includes: Dividing the first value by the second value to obtain a second proportion corresponding to the data frame; Comparing the second proportion with the threshold value of the valid element; When the second proportion is greater than or equal to the threshold value of the valid element, the data frame is determined as an end frame.

5. The method for decoding vocoded speech according to any one of claims 1 to 4, characterized in that: The step of decoding the end frame and all data frames before the end frame to obtain target PCM voice data includes: splicing the vocoded speech data corresponding to the end frame and the vocoded speech data corresponding to all data frames before the end frame to obtain spliced ​​vocoded speech data; The concatenated vocoded speech data is decoded to obtain target PCM speech data.

6. A method for encoding vocoded speech, characterized in that: include: Compressing and encoding the sampled first pulse code modulation PCM voice data to obtain a data frame of vocoded speech data; The data frame at least includes: a voice code word data field and a frame mark word field, and the frame mark word field includes valid elements; The data frame of the vocoded speech data is sent to a receiving end.

7. The method for encoding vocoded speech according to claim 6, characterized in that: The valid element is the bit value 1 in the frame flag field.

8. A vocoded speech decoding device, characterized in that: include: A receiving module, used for receiving a data frame of the vocoded speech data sent by the sending end; The data frame at least includes: a vocoded speech data field and a frame flag word field, the frame flag word field includes valid elements, and the number of the valid elements is used to determine whether the data frame is an end frame; A decoding module, used to determine whether the data frame is an end frame according to a preset threshold value of a valid element corresponding to the vocoded speech data; When the data frame is an end frame, the end frame and all data frames before the end frame are decoded to obtain target pulse code modulation PCM voice data.

9. A vocoding speech encoding device, characterized in that: include: The encoding module is used to compress and encode the sampled first pulse code modulation PCM voice data to obtain a data frame of vocoded speech data; The data frame at least includes: a voice code word data field and a frame mark word field, and the frame mark word field includes valid elements; The sending module is used to send the data frame of the vocoded speech data to the receiving end.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the vocoded speech decoding method according to any one of claims 1 to 5 is implemented, or the vocoded speech encoding method according to any one of claims 6 to 7 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for decoding the vocoded speech according to any one of claims 1 to 5 is implemented, or the method for encoding the vocoded speech according to any one of claims 6 to 7 is implemented.