## 3 Dataset and Cluster Analysis
### Dataset Preparation  
Based on the specimen configuration in Section 2.1, each recording file includes five 160 ms patches as illustrated in Figure 3. This yields three Zero Gap and two Gap patches per file. Additionally, there are parts in each file that only capture the ambient noise, as the recording of the acoustic sensors extends beyond the period where the laser was actively welding. For the Gap class, a further classification is possible depending on the size as Gap 0.1 (0.1 mm gap), Gap 0.2 (0.2 mm gap) and Gap 0.3 (0.3 mm gap). This enables the investigation of two different scenarios. Scenario I aims to investigate how the segment duration affects the accuracy of detecting a gap. This is achieved by classifying the segments into three classes, which are Zero Gap, Gap, and Noise. Scenario II, on the other hand, examines the relationship between the segment duration and the accuracy of identifying the gap size, coping with the more detailed information about the severity of weld failures. Here, the signal segments are classified into five classes, which are Zero Gap, Gap 0.1, Gap 0.2, Gap 0.3, and Noise.  
The segments of Noise class are selected from the signal part after 1.2 s, including the environmental noise as well as the interference from the robotic arm movement discussed in Section 3.1. Noise segments are included for the following reasons. Noise and interference from the environment are always present and appear as multiple narrowband signals in the same frequency range as that of the acoustic emissions from welding, as discussed in Figure 3. Although filtering out such interference is beyond the scope of this study, their impact on the informativeness of signal segments, especially when dealing with a very short segment, is of great interest. For instance, if a Gap 0.1 segment is misclassified as a Zero Gap segment, this still ensures that the segment contains at least some information about the welding process. However, if the same segment is misclassified as Noise, this implies that the weld-relevant information can no longer be extracted.  
To align with the purpose of this study, some files and parts of the recording need to be excluded, such that each signal segment corresponds to a single class regardless of its duration. As discussed in Section 3.1, the presence of unintended large gaps in Zero Gap patches makes the distinction between Zero Gap and small-sized Gap patches ambiguous [14]. For this reason, the recording files containing any Zero Gap patches larger than 0.07 mm were excluded from the dataset. A summary of the file count for each gap size is provided in Table 2. It is important to note that this study sticks to the labels based on the original specimen configurations. However, relabeling of the data is possible, which is discussed in [14]. Another measure was to remove the transitions between two consecutive patches from the dataset. This is due to its extremely short and unknown duration, prohibiting it from forming its own class with a sufficient number of samples. To ensure that no signal segments include any transition phase, the transitions were eliminated from each recording by trimming the beginning and end of each patch by 20 ms.