## 2 Materials and Methods
### Data Preprocessing Methods
#### 2.2.5 pad_array Algorithm  
The pad_array algorithm (Algorithm 6) is designed to augment the input array arr with zeros up to a given length length. If the input array already has a length greater than or equal to length, the algorithm returns the original array unchanged. If the length of the array is less than the required length, the missing elements are added symmetrically on both sides of the array as zeros.  
```
1:Input:arr--source array, length--required length of the result
2:Output:New array of length length
3:current_len \(\leftarrow\) length(arr)
4:ifcurrent_len \(\geq\) lengththen
5:return arr \(\triangleright\) The array is already long enough
6:else
7:pad_len \(\leftarrow\) length \(-\) current_len
8:\(left\_len \leftarrow\lfloor\frac{pad\_len}{2}\rfloor\)
9:\(right\_len \leftarrow\) pad_len \(-\) left_len
10: Augment \(arr\) to the left by \(left\_len\) zeros and to the right by \(right\_len\) zeros
11:return New augmented array
12:endif
```  
**Algorithm 6** pad_array  
Main Steps of the Algorithm  
Input data: The algorithm takes as input an array arr and the desired length length (integer).  
Check current length: The algorithm first determines the current length of the input array current_len. Then, it compares current_len with the given length length.  
In case the array is long enough: If current_len is greater than or equal to length, it means that the array already has the required or an excessive length. In this case, the algorithm does not perform any addition actions and simply returns the original array arr.  
In case the array needs to be appended: If current_len is less than length, the array must be appended to the required length:  
1. Calculating the length of the complement. The total length of the complement pad_len is calculated as the difference between the required length length length and the current length current_len: \(pad\_len=length-current\_len\).
2. Left and right complement distribution. The length of the complement pad_len is distributed approximately equally between the left and right sides of the array to ensure a symmetrical complement.  
The length of the left complement left_len is calculated as the integer part of dividing pad_len by two: \(left\_len=\lfloor\frac{pad\_len}{2}\rfloor\).
* The length of the right-hand complement right_len is calculated as the remainder: \(right\_len=pad\_len-left\_len\). This distribution ensures that the total length of the complement is equal to pad_len, even if pad_len is an odd number.
3. Zeros complementation. The array arr is appended with left_len zeros on the left and right_len zeros on the right. The complement operation is usually performed by creating a new array and copying the original elements of the arr array into it, adding zeros at the beginning and end.  
Output data: The algorithm returns a new array whose length is equal to length. If the original array was shorter, it will be appended with zeros symmetrically on both sides. If the original array was long enough, the original array is returned.  
Remarks  
The pad_array algorithm is useful in situations where arrays need to be brought to a uniform length for further processing, such as in batch processing, where all input data must have the same dimensionality. Symmetric addition with zeros helps to minimize distortions that can be introduced by addition, especially in the context of signal processing, where the position of elements relative to the beginning and end of the array may be important.