ADAPTIVE COMPRESSION OF DATA
A method of encoding data includes determining a magnitude of change between a first value associated with first data and a second value associated with second data based on a comparison of the first value and the second value. The first value is encoded into a first set of bits having a first number of bits. The method includes determining, based on the comparison of the first value and the second value, a second number of bits (that is less than the first number of bits) to be used to encode the magnitude of change. The method includes encoding the magnitude of change into a second set of bits having the second number of bits. The method further includes sending the second set of bits and a first indicator, with the first indicator indicating that the magnitude of change is encoded into the second number of bits.
Latest Patents:
The present disclosure generally relates to adaptive compression of data.
BACKGROUNDDifferential Pulse Code Modulation (DPCM) is an example of an approach to data compression. In a DPCM approach, rather than quantizing each data sample into a “full” number of bits, a difference between consecutive data samples may be quantized into a reduced number of bits (for transmission or storage).
SUMMARYIn an embodiment, a method of encoding data is disclosed. The method includes determining a magnitude of change between a first value associated with first data (that is encoded into a first set of bits having a first number of bits) and a second value associated with second data based on a comparison of the first value and the second value. Based on the comparison, a second number of bits (that is less than the first number of bits) may be used to encode the magnitude of change. The method includes encoding the magnitude of change into a second set of bits having the second number of bits. The second set of bits and an indicator may be sent, with the indicator indicating that the magnitude of change is encoded into the second number of bits.
In another embodiment, a method of decoding data is disclosed. The method includes receiving a first set of bits having a first number of bits and decoding the first set of bits to determine that the first set of bits corresponds to a first indicator. The first indicator indicates that a second number of bits are to be decoded, where the second number of bits is different from the first number of bits. The method further includes receiving a second set of bits having the second number of bits and decoding the second set of bits to determine a magnitude of change between a first value associated with first data and a second value associated with second data.
In another embodiment, a system includes a processor and a memory that is communicatively coupled to the processor. The memory stores instructions that are executable by the processor to perform various operations. The operations may include determining a magnitude of change between a first value associated with first data and a second value associated with second data based on a comparison of the first value and the second value. The first value is encoded into a first set of bits having a first number of bits. Based on the comparison, a second number of bits (that is less than the first number of bits) may be used to encode the magnitude of change. The operations include sending the second set of bits and an indicator. The indicator indicates that the magnitude of change is encoded into the second number of bits.
The described features, functions, and advantages may be achieved independently in various embodiments or may be combined in yet other embodiments further details of which can be seen with reference to the following description and drawings.
The present disclosure describes systems and methods of adaptive encoding/decoding of data in order to reduce a number of bits to be used for transmission and/or storage of the data. For example, a sensor may measure (sample) a particular parameter (e.g., temperature or pressure) at a particular sampling rate, and measured values (e.g., analog value, such as voltages) may be encoded (e.g., digitized) into a set of bits. In the present disclosure, a reference value (e.g., a value used as a reference for compression of data) may be encoded into a “full” number of bits and stored (and optionally transmitted). As an illustrative, non-limiting example, the reference value may be encoded into 12 bits (e.g., the “full” number of bits). In other examples, the “full” number of bits may be more than 12 bits or fewer than 12 bits. Rather than encoding each subsequent measured value into the “full” number of bits, a measured value (at the “full” number of bits) of a subsequent data sample is compared to the reference value in order to determine a magnitude of change (a “delta”) between the measured value and the reference value. The magnitude of change is encoded into a number of bits that is less than the “full” number of bits.
This process of encoding the magnitude of change into a reduced number of bits may be repeated for a particular number (N) of values that follow the reference value. Each of the N values is compared to the reference value to determine the magnitude of change between a particular measured value and the reference value. Comparing a measured value (at the “full” number of bits) to the reference value rather than comparing “delta” values may reduce drift due to errors in each “delta” value. After N values, a next measured value (N+1) is encoded as a “new” reference value (as a reference for compression of subsequent data).
To illustrate, when the reference value has 12 bits, the magnitude of change between a measured value and the reference value may be encoded into a reduced number of bits. As an example, a “default” reduced number of bits may be 8 bits. In other examples, the “default” reduced number of bits may be more than 8 bits or fewer than 8 bits. A particular number of bits may be selected as the “default” reduced number of bits such that most expected values can be encoded, using the encoding scheme, within the “default” number of bits. In some cases, the magnitude of change between the measured value and the reference value may be encoded as an 8-bit binary value (the “default” reduced number of bits). In other cases, the magnitude of change may be outside of a range of “delta” values that can be encoded into 8 bits. While the change may be encoded into a different reduced number of bits (e.g., 9, 10 or 11 bits), a detector/decoder may be “expecting” 8 bits (based on an encoding/decoding protocol). In the present disclosure, a particular indicator (or “codeword”) that is encoded into the “default” number of bits (e.g., 8 bits) may be pre-assigned to a particular “non-default” reduced number of bits (e.g., 9, 10, or 11 bits). The particular indicator provides a signal to the detector/decoder that a particular “delta” that follows the indicator is encoded into the “non-default” reduced number of bits. The “non-default” reduced number of bits may be decoded in order to identify the particular “delta” that follows the indicator. The examples provided herein describe different “non-default” reduced numbers of bits that are greater than the “default” reduced number of bits (e.g., 9, 10 or 11 bits compared to the “default” reduced number of 8 bits). In alternative embodiments (e.g., in cases of relatively “small” changes that can be encoded into fewer than the “default” reduced number of bits), the “default” reduced number of bits may be further reduced (e.g., to 7 bits or to 6 bits, etc.).
In an illustrative, non-limiting example of an encoding scheme, a difference between a measured temperature value and a reference temperature value may be reduced to a particular 8-bit binary value that corresponds to a temperature change in a range of −127 degrees to +128 degrees. When the temperature change between the measured value and the reference value is within this range (i.e., not greater than +128 and not less than −127), the temperature change may be encoded as an 8-bit binary value (the “default” reduced number of bits). In other cases, the temperature change may be outside of this range (i.e., greater than +128 or less than −127), and the change cannot be stored as an 8-bit binary value. While the change may be encoded into a different reduced number of bits (e.g., 9, 10 or 11 bits), a detector/decoder may be expecting an 8-bit binary value using this encoding scheme. In the present disclosure, an indicator (or “codeword”) may be sent prior to sending the data in the different reduced number of bits to provide a signal to the decoder that a different binary value (e.g., a 9 bit delta value, a 10 bit delta value, or an 11 bit delta value) follows the indicator.
To illustrate, using the encoded scheme above, a comparator may be used to provide 8-bit binary values less than an absolute value of 127 to an encoder. In this example, the comparator does not provide the values −128, −127, and 127, allowing these values to be used as codewords. To illustrate, in “2's complement,” the value −128 may be represented by the 8-bit binary value 10000000, the value −127 may be represented by the 8-bit binary value 10000001, and the value 127 may be represented by the 8-bit binary value 01111111. In this example, one codeword (e.g., 10000000) may be reserved for use as a first indicator of a first “non-default” reduced number of bits (e.g., 9 bits), another codeword (e.g., 10000001) may be reserved for use as a second indicator of a second “non-default” reduced number of bits (e.g., 10 bits), and another codeword (e.g., 01111111) may be reserved for use as a third indicator of a third “non-default” reduced number of bits (e.g., 11 bits). Thus, data that is stored/transmitted may be reduced in cases where the delta values fall within a “default” range, while the codewords may allow values outside of this range to be stored/transmitted when appropriate.
Referring to
In the embodiment illustrated in
The electronic device 102 includes a processor 120, a memory 122, and a communication interface 124 (or multiple communication interfaces). In the example of
The electronic device 102 is configured to receive or sample measured values from the sensor(s) 104 (e.g., via the communication interface 124) at a particular sampling rate. As an illustrative example, the electronic device 102 may receive or sample a value (e.g., a voltage measured by a thermocouple in the case of a temperature sensor) from the first sensor 108 and may receive or sample another value (e.g., a value corresponding to a pressure measurement) from the second sensor 110. The encoder 126 is configured to encode data into a set of bits (having a particular number of bits that may vary based on a sampling rate of the sensor). In some cases, the encoded value may be stored in the memory 122 of the electronic device 102 (e.g., onboard the space launch system 106). Alternatively or additionally, the encoded value may be sent to the server 116 (e.g., a ground-based server configured to communicate with the space launch system 106).
In the particular embodiment illustrated in
When the magnitude of change is to be encoded into a number of bits other than the “default” number of bits (e.g., a “non-default” reduced number of bits), the comparator 130 is configured to determine a particular indicator (“codeword”) to be used by the encoder 126 to provide a signal to a detector/decoder that the magnitude of change is not encoded into the “default” number of bits. In the particular embodiment illustrated in
In operation, a particular sensor (e.g., the first sensor 108) provides a first sample 160 (identified as “Sample(1)” in
After providing the first sample 160, the first sensor 108 provides a second sample 162 (identified as “Sample(2)” in
In the particular embodiment illustrated in
As an illustrative, non-limiting example, the magnitude of change between the reference value 158 and the second sample 162 may correspond to a temperature change, and the “default” reduced number of bits (W bits) may be 8 bits. When 8 bits are used, 256 digital values may be represented (e.g., 0-255). In this example, a temperature range may be divided into sub-ranges, each associated with a different digital value. Since temperature may vary up or down, the 256 sub-ranges may be shifted to +128 sub-ranges and −127 sub-ranges so that a direction of the temperature change can be represented. For example, when each sub-range is associated with 1° C., 8 bits may be used to represent changes from −127° C. to +128° C. In this example, when the temperature change is outside of this range (e.g., is greater than +128 degrees or is less than −127 degrees), the change cannot be represented by 8 bits. While the change may be encoded into a different number of bits (e.g., 9, 10 or 11 bits), a detector/decoder may be expecting an 8-bit value. In this case, one of the indicator(s) 150 (or “codewords”) may be sent prior to sending the data in the different number of bits to provide a signal to the decoder that a different binary value (e.g., a 9 bit delta value, a 10 bit delta value, or an 11 bit delta value) follows the indicator.
After providing the second sample 160,
In the particular embodiment illustrated in
To illustrate, in a particular encoding scheme, the comparator 130 may be used to provide 8-bit binary values representing changes (e.g., temperature changes) between −126 and +126 to the encoder 126. Thus, if the particular encoding scheme is such that each digital value corresponds to 1° C., the first range may represent temperature changes between −126° C. and +126° C., etc. In this example, the comparator 130 reserves the values −128, −127, and 127 for use as codewords. To illustrate, in “2's complement,” the value −128 may be represented by the 8-bit binary value 10000000, the value −127 may be represented by the 8-bit binary value 10000001, and the value 127 may be represented by the 8-bit binary value 01111111. As an illustrative, non-limiting example, the first indicator 152 (e.g., 10000000) may be used to identify that a magnitude of change (e.g., a temperature change having an absolute value from 127 to 256) corresponds to a 9-bit value that cannot be represented, based on the encoding scheme, using 8 bits. The second indicator 154 (e.g., 10000001) may be used to identify that a magnitude of change (e.g., a temperature change having an absolute value from 256 to 512) corresponds to a 10-bit value that cannot be represented, based on the encoding scheme using 8 bits (or 9 bits). The third indicator 156 (e.g., 01111111) may be used to identify that a magnitude of change (e.g., a temperature change having an absolute value from 512 to 1024) corresponds to an 11-bit value that cannot be represented, based on the encoding scheme using 8 bits (or 9 bits or 10 bits).
Thus,
As an example, the first sample 160 may be subtracted from the second sample 162 to determine a first change 210 (illustrated as “Delta(1)” in
As another example, the first sample 160 may be subtracted from the sample 168 (illustrated as “Sample(N)” in
Thus,
In the embodiment illustrated in
The server 116 may receive the first sample 160, and the decoder 308 may determine based on the counter 310 that the first sample 160 represents a “full” set of bits (e.g., V bits) to be decoded. The decoder 308 may decode the “full” set of bits to determine a value associated with the first sample 160. The server 116 may receive the first output 164, and the decoder 308 may determine based on the counter 310 that the first output 164 is not to be used as a reference value. When the decoder 308 determines that the first output 164 is not to be used as a reference value, the decoder 308 may determine whether the first output 164 is associated with one of the indicator(s) 150 stored in the memory 304. When the first output 164 is not associated with one of the indicator(s) 150, the decoder 308 may decode the first output 164 based on the “default” reduced number of bits to determine the change 166 (and optionally “re-create” the value based on the first sample 160 and the change 166).
The server 116 may receive the output 170. The output 170 includes a set of bits (e.g., the first indicator 152) having the “default” reduced number of bits. The decoder 308 may decode the set of bits and determine that the set of bits corresponds to the first indicator 152 (stored in the memory 304 of the server 116). The decoder 308 may determine (based on the first indicator 152) that a second number of bits (e.g., 9 bits, representing a “non-default” reduced number of bits) are to be decoded. The server 116 may receive the change 172 (e.g., a set of bits having a different number of bits than the “default” reduced number of bits). The decoder 308 may decode the set of bits (e.g., 9 bits in this example) to determine the magnitude of the change 172.
Thus,
The method 400 may include encoding a first value associated with first data (e.g., sensor data) into a first set of bits (having a first number of bits), at 402. For example, referring to
In the particular embodiment illustrated in
The method 400 includes comparing a subsequent value associated with the subsequent data to the first value to determine a magnitude of change (between the first value and the subsequent value), at 410. For example, referring to
The method 400 includes determining, based on the comparison, a reduced number of bits to be used to encode the magnitude of change, at 412. For example, referring to
The method 400 includes encoding the magnitude of change (between the subsequent value and the first value) into a second set of bits having the reduced number of bits, at 414. For example, referring to
In the particular embodiment illustrated in
The method 400 may also include sending (to the decoder) the indicator if needed (e.g., for a “non-default” reduced number of bits) and the second set of bits, at 418. For example, referring to
In the particular embodiment illustrated in
In response to determining that the threshold has not been satisfied, the method 400 may return to 406, where the counter may be incremented. In response to determining that the threshold has been satisfied, the method 400 includes resetting the counter, at 422. For example, referring to
In the example of
The method 500 also includes decoding the first set of bits to determine a first value (e.g., a value associated with first sensor data), at 504. For example, referring to
The method 500 includes receiving (at the decoder) a second set of bits having the first number of bits, at 506. For example, referring to
The method 500 includes determining, based on the indicator, a second number of bits to be decoded, at 510. The second number of bits is different from the first number of bits. For example, referring to
The method 500 includes receiving (at the decoder) a third set of bits having the second number of bits, at 512. For example, referring to
The computing device 610 may include a processor 620. The processor 620 may communicate with the system memory 630, one or more storage devices 640, one or more input/output interfaces 650, one or more communications interfaces 660, or a combination thereof. The system memory 630 may include volatile memory devices (e.g., random access memory (RAM) devices), nonvolatile memory devices (e.g., read-only memory (ROM) devices, programmable read-only memory, and flash memory), or both. The system memory 630 may include an operating system 632, which may include a basic/input output system for booting the computing device 610 as well as a full operating system to enable the computing device 610 to interact with users, other programs, and other devices. The system memory 630 may include one or more applications 634 which may be executable by the processor 620. For example, the one or more applications 634 may include instructions executable by the processor 620 to adaptively encode/decode data in a particular number of bits. The system memory 630 may include program data 636 usable for controlling the adaptive encoding/decoding of data.
The processor 620 may also communicate with one or more storage devices 640. For example, the one or more storage devices 640 may include nonvolatile storage devices, such as magnetic disks, optical disks, or flash memory devices. The storage devices 640 may include both removable and non-removable memory devices. The storage devices 640 may be configured to store an operating system, images of operating systems, applications, and program data. In a particular embodiment, the memory 630, the storage devices 640, or both, include tangible computer-readable media.
The processor 620 may also communicate with one or more input/output interfaces 650 that enable the computing device 610 to communicate with one or more input/output devices 670 to facilitate user interaction. The input/output interfaces 650 may include serial interfaces (e.g., universal serial bus (USB) interfaces or Institute of Electrical and Electronics Engineers (IEEE) 1394 interfaces), parallel interfaces, display adapters, audio adapters, and other interfaces. The input/output devices 670 may include keyboards, pointing devices, displays, speakers, microphones, touch screens, and other devices. The processor 620 may detect interaction events based on user input received via the input/output interfaces 1150. Additionally, the processor 620 may send a display to a display device via the input/output interfaces 650.
The processor 620 may communicate with devices or controllers 680 via the one or more communications interfaces 660. The one or more communications interfaces 660 may include wired Ethernet interfaces, IEEE 802 wireless interfaces, other wireless communication interfaces, or other network interfaces. The devices or controllers 680 may include host computers, servers, workstations, and other computing devices.
Embodiments described above are illustrative and do not limit the disclosure. It is to be understood that numerous modifications and variations are possible in accordance with the principles of the present disclosure.
The illustrations of the embodiments described herein are intended to provide a general understanding of the structure of the various embodiments. The illustrations are not intended to serve as a complete description of all of the elements and features of apparatus and systems that utilize the structures or methods described herein. Many other embodiments may be apparent to those of skill in the art upon reviewing the disclosure. Other embodiments may be utilized and derived from the disclosure, such that structural and logical substitutions and changes may be made without departing from the scope of the disclosure. For example, method steps may be performed in a different order than is shown in the figures or one or more method steps may be omitted. Accordingly, the disclosure and the figures are to be regarded as illustrative rather than restrictive.
Moreover, although specific embodiments have been illustrated and described herein, it should be appreciated that any subsequent arrangement designed to achieve the same or similar results may be substituted for the specific embodiments shown. This disclosure is intended to cover any and all subsequent adaptations or variations of various embodiments. Combinations of the above embodiments, and other embodiments not specifically described herein, will be apparent to those of skill in the art upon reviewing the description.
The Abstract of the Disclosure is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims. In addition, in the foregoing Detailed Description, various features may be grouped together or described in a single embodiment for the purpose of streamlining the disclosure. This disclosure is not to be interpreted as reflecting an intention that the claimed embodiments require more features than are expressly recited in each claim. Rather, as the following claims reflect, the claimed subject matter may be directed to less than all of the features of any of the disclosed embodiments.
Claims
1. A method of encoding data, the method comprising:
- determining, by a processor, a magnitude of change between a first value associated with first data and a second value associated with second data based on a comparison of the first value and the second value, wherein the first value is encoded into a first set of bits having a first number of bits;
- determining, by the processor, based on the comparison of the first value and the second value, a second number of bits to be used to encode the magnitude of change, wherein the second number of bits is less than the first number of bits;
- encoding, by the processor, the magnitude of change into a second set of bits, the second set of bits having the second number of bits; and
- sending, by the processor, the second set of bits and a first indicator, the first indicator indicating that the magnitude of change is encoded into the second number of bits.
2. The method of claim 1, further comprising generating an output that includes the first indicator and the second set of bits, wherein the magnitude of change between the first value and the second value is encoded into the second set of bits.
3. The method of claim 1, further comprising:
- receiving third data;
- determining a magnitude of change between the first value and a third value associated with the third data based on a comparison of the first value and the third value;
- determining, based on the comparison of the first value and the third value, a third number of bits to be used to encode the magnitude of change between the first value and the third value, wherein the third number of bits is less than the first number of bits;
- encoding the magnitude of change between the first value and the third value into a third set of bits, the third set of bits having the third number of bits; and
- sending the third set of bits and a second indicator, the second indicator indicating that the magnitude of change between the first value and the third value is encoded into the third number of bits.
4. The method of claim 3, wherein:
- the first indicator is selected in response to determining that the magnitude of change between the first value and the second value satisfies a first threshold; and
- the second indicator is selected in response to determining that the magnitude of change between the first value and the third value satisfies a second threshold.
5. The method of claim 1, further comprising:
- receiving third data;
- determining, based on a counter, that a third value associated with the third data is to be encoded into a third set of bits, the third set of bits having the first number of bits;
- encoding the third value into the third set of bits; and
- sending the third set of bits.
6. The method of claim 5, wherein the counter indicates a number of values that have been encoded into sets of bits having a reduced number of bits with respect to the first number of bits.
7. The method of claim 1, further comprising:
- receiving third data;
- determining, based on a counter that indicates a number of values that have been encoded into sets of bits having a reduced number of bits with respect to the first number of bits, that a magnitude of change between the first value and a third value associated with the third data is to be determined based on a comparison of the first value and the third value;
- determining, based on the comparison of the first value and the third value, a particular number of bits to be used to encode the magnitude of change between the first value and the third value, wherein the particular number of bits is less than the first number of bits; and
- encoding the magnitude of change into a third set of bits, the third set of bits having the particular number of bits.
8. The method of claim 7, wherein the particular number of bits is the second number of bits, the method further comprising sending the third set of bits and the first indicator.
9. The method of claim 7, wherein the particular number of bits is different from the second number of bits, the method further comprising sending the third set of bits without sending the first indicator.
10. The method of claim 7, wherein the particular number of bits is different from the second number of bits, the method further comprising sending the third set of bits and a second indicator, the second indicator indicating that the magnitude of change between the first value and the third value is encoded into the particular number of bits.
11. The method of claim 1, wherein the first data is received from a sensor of a space launch system, and wherein the second data is received from the sensor of the space launch system.
12. The method of claim 1, wherein:
- the first set of bits is sent to a memory, to a remote device, or a combination thereof; and
- the second set of bits and the first indicator is sent to the memory, to the remote device, or a combination thereof.
13. A method of decoding data, the method comprising:
- receiving, by a processor, a first set of bits having a first number of bits;
- decoding, by the processor, the first set of bits;
- determining, by the processor, that the first set of bits corresponds to a first indicator, wherein the first indicator indicates that a second number of bits are to be decoded, and wherein the second number of bits is different from the first number of bits;
- receiving, by the processor, a second set of bits having the second number of bits; and
- decoding, by the processor, the second set of bits to determine a magnitude of change between a first value associated with first data and a second value associated with second data.
14. The method of claim 13, further comprising:
- receiving a third set of bits having the first number of bits;
- decoding the third set of bits;
- determining that the third set of bits corresponds to a second indicator, wherein the second indicator indicates a third number of bits to be decoded, and wherein the third number of bits is different from the first number of bits and is different from the second number of bits;
- receiving a fourth set of bits having the third number of bits; and
- decoding the fourth set of bits to determine a magnitude of change between the first value associated with first data and a third value associated with third data.
15. The method of claim 13, further comprising:
- receiving a third set of bits having the first number of bits;
- decoding the third set of bits; and
- determining that the third set of bits corresponds to a third value associated with third data.
16. The method of claim 13, further comprising:
- receiving a third set of bits having the second number of bits; and
- decoding the third set of bits to determine a magnitude of change between the first value associated with first data and a third value associated with third data.
17. A system comprising:
- a processor; and
- a memory communicatively coupled to the processor, the memory storing instructions that are executable by the processor to perform operations comprising: determining a magnitude of change between a first value associated with first data and a second value associated with second data based on a comparison of the first value and the second value, wherein the first value is encoded into a first set of bits having a first number of bits; determining, based on the comparison of the first value and the second value, a second number of bits to be used to encode the magnitude of change, wherein the second number of bits is less than the first number of bits; encoding the magnitude of change into a second set of bits, the second set of bits having the second number of bits; and sending the second set of bits and an indicator, the indicator indicating that the magnitude of change is encoded into the second number of bits.
18. The system of claim 17, wherein the operations further comprise generating an output that includes the indicator and the second set of bits, wherein the magnitude of change between the first value and the second value is encoded into the second set of bits.
19. The system of claim 17, wherein the first data and the second data are captured by a sensor of a space launch system.
20. The system of claim 19, wherein the operations further comprise sending the first set of bits, the indicator, and the second set of bits to a ground-based system via a wireless transmission.
Type: Application
Filed: Jan 29, 2015
Publication Date: Aug 4, 2016
Applicant:
Inventor: Amir L. Liaghati (Huntsville, AL)
Application Number: 14/609,007