## 2 Algorithms for Data Encoding to Minimize the File Size
Figure 2 demonstrates the configuration of an example value encoded in the 3-byte format, where the scaled value is determined by a group of three bytes, with values \(a_{0}\), \(a_{1}\), and \(a_{2}\), respectively. The 3-byte number format provides a 24-bit resolution, where each byte containing 8 bits can represent 1 of the 256 distinct values ranging from 0 to 255. This provides a 3-byte number format for a total of \(256^{3}=16\),777,216 possible values (\(2^{24}\)). In the example described in Figure 2, the scaled value, \(X\), is calculated as follows:  
\[ \begin{array}{ll}X&=a_{0}\times 256^{0}+a_{1}\times 256^{1}+a_{2}\times 256^{2 }\\ &=6\times 256^{0}+30\times 256^{1}+150\times 256^{2}\\ &=9,838,086\end{array}  \tag{3}\]  
The minimum possible scaled value is \(X_{min}=0\), which occurs when \(a_{0}=a_{1}=a_{2}=0\). The maximum possible scaled value is \(X_{max}=16,777,215=2^{24}-1\), which occurs when \(a_{0}=a_{1}=a_{2}=255\). To represent the full input range of acquired values, \(A\), the lower limit value, \(A_{min}=-10\) V, is assigned to \(X_{min}\), and the upper limit value, \(A_{max}=10\) V, is assigned to \(X_{max}\). The conversion algorithm is depicted in Figure 3 and can be mathematically expressed as follows:  
\[X=\mathit{Round}\bigg{(}\frac{16,777,215}{20}\left(A+10\right)\bigg{)} \tag{4}\]  
or:  
\[A=\frac{20X}{16,777,215}-10 \tag{5}\]  
Figure 2: Composition of an example scaled value of the 3-byte number format. In this case, the scaled value, \(X=9,838,086\), represents the acquired value, \(A=1.727913\). The round method in Equation (4) can be used to round off a value to the nearest integer. During the measurements, the value \(A\) is acquired from the analog inputs. Subsequently, \(X\) is determined using Equation (4). The next issue is how to store these values in a 3-byte number format. The three components can be calculated as follows:  
\[a_{2}=Floor\left(\frac{X}{256^{2}}\right) \tag{6}\]  
\[a_{1}=Floor\left(\frac{X-a_{2}\times 256^{2}}{256}\right) \tag{7}\]  
\[a_{0}=X-a_{2}\times 256^{2}-a_{1}\times 256 \tag{8}\]  
The floor method returns the largest integer value that is less than or equal to a given number. Equations (6) and (7) can be understood by considering the integer part after the division. The combination of a 24-bit resolution and a \(\pm 10\) V analog input range offers the smallest signal detectable change of 0.000001, according to Equation (2). Thus, to represent an acquired value in text format, seven digits are needed, along with a dot symbol, plus/minus sign, and delimiter, totaling ten characters. Therefore, 10 bytes are required to store the value acquired by the DAQ. However, the 3-byte number format can represent the same value using only 3 bytes, thereby reducing the file size by 3.3 times, while maintaining the precision of the sensor reading values. Indeed, most DAQ devices used for AE measurements have a 16-bit resolution, meaning that they require a number system that can represent 216 = 65,536 discrete levels. The 2-byte number format can fully adapt to this requirement, as it has an algorithm similar to the 3-byte number format, but with \(a_{2}\) always being zero (Equation (6)). Therefore, this format uses only two bytes--\(a_{0}\) and \(a_{1}\)--to represent a value, as shown in Equations (7) and (8). A DAQ device with a 16-bit resolution and a \(\pm 10\) V analog input range offers the smallest signal detectable change equal to 0.0003, as presented in Equation (1). Representing an acquired value as a text requires five digits. In the same manner as described above, eight bytes are required to store that value. Therefore, the 2-byte number format reduces the file size by 4 times compared with the text format. The 2-byte format can also be employed to represent sensor reading values with a 12-bit resolution. In addition, if a 32-bit resolution  
Figure 3: Conversion algorithm of 2-byte and 3-byte number formats. is needed in some special cases, the 4-byte number format can satisfy the data storage requirement in the same manner.