## 3 Materials and Methods
### Proposed Shipboard Data Compression Method  
Fixed-record-length data encoding methods, such as the previously described method used for AIS data encoding, require all data to be sent periodically in a predetermined order each time data are transmitted. Due to the predetermined order, data only need to be lined up with a delimiter character, such as a comma. However, the shipboard data are collected by various measuring devices at short time intervals. Some data items, such as the ship's position and heading, change their values rapidly, while others do not change for several seconds or even minutes. Thus, transmitting data items with no change in value may be redundant. Therefore, reducing the amount of shipboard data transferred can be achieved by utilizing the variable-record-length methods, which send only the data items that have changed since the last transmission, thus preventing unnecessary transmitting data without a change in value. These methods require specifying which data items to send each time, which is achieved by attaching tags to data values and, thus, identifying the corresponding data items. Furthermore, to avoid possible situations in which data reception starts later and, thus, there is no information about the data that have not changed for some time, the variable-record-length methods periodically send all data. The variable-record-length data encoding method proposed in this paper is described next. The method is based on the binary encoding of shipboard data. Shipboard data are digital numeric data that can be represented in binary or text format. Although the ASCII text data representation might be simpler to comprehend, the binary representation is more efficient as it reduces the number of bits required for numeric values with multiple digits. Using the binary format for data representation requires defining a technique to convert the integer values to the corresponding binary values. First, the number of bits used to represent integer values and the number of words allowed for each data item must be defined. Similar to the previously described AIS data encoding technique, the method proposed in this paper performs a six-bit encoding, and the resulting ASCII code is transmitted. The maximum binary field length for the data item representation is defined in the range of one to five six-bit words. Figure 10 shows various allowed lengths of binary fields and the corresponding data value ranges that can be expressed using them. In addition to the defined minimum and maximum numeric values, each range can also be positive only or have both positive and negative values. The appropriate value range ID denotes this property. For example, the minimum length of the binary field used to represent one data item is one six-bit word. One six-bit word enables the representation of numeric values either in the range of 0-63 or in the range of \(-32\)-31, marked by value range IDs of \(1\) and \(-1\), respectively. On the other hand, the maximum binary field length of five six-bit words corresponds to the numeric value range of 0-1 073 741 823 or \(-536\) 870 912-536 870 911, denoted by 5 or \(-5\), respectively. If thus encoded binary data are transmitted each time for each data item, the total amount of data transferred will be constant. However, to achieve data compression, the method proposed in this paper applies differential binary encoding where only data items whose value has changed since the last transmission are encoded and transmitted. The proposed approach results in the data format depicted in Figure 11. As shown in Figure 11, one data record consists of six six-bit words used to denote a timestamp (YYMMDD and HHMMSS), two words to define a total number of data items transmitted in the current data record, two words per item to specify each data item transmitted, and, finally, binary words representing data values with various number of words for individual data items. The properties of data items that will be used for their representation need to be defined.