A Dynamic Time Warping Based Method to Synchronize Spectral and Protocol Domains for Troubleshooting Wireless Communication

An increase in popularity of wireless networks, mainly in industrial automation and manufacturing, has escalated the need for reliable wireless networks. One subtle way of achieving reliability is early diagnosis of transmission failures in order to take preventive measures against them. However, this can be difficult to achieve because these failures mainly arise from challenging signal propagation conditions and interference from co-existing networks, which is hard to diagnose. This leads to Quality-of-service (QoS) degradation and faulty applications, which may result in system breakdown and financial distress. In this paper, we propose a novel Dynamic Time Warping (DTW) based method named Variable Adaptive DTW (VADTW) for synchronizing spectral and protocol domains to obtain precise and complete information about collisions and co-existing links that cause interference, which can be utilized for troubleshooting. VADTW divides the spectral and protocol sequences in adaptive time bins and calculates variable window limits for each frame to perform the synchronization, which aims to complement the cross-RF-standard interference detection of the spectral domain with the MAC-Layer information from the protocol domain. To prove the effectiveness of the proposed approach, we tested it in a Wi-Fi network as a proof-of-concept. The experiments are performed with real-time data traffic captured in different scenarios. VADTW successfully synchronizes sequences even with a frame loss ratio of 50%. We also perform comparative analysis of VADTW with other DTW based approaches on the basis of performance, computational cost, and execution time.


I. INTRODUCTION
The swift transition of wireless networks in manufacturing, IIoT, military and industrial automation has accelerated the need for highly reliable networks demanding strict latency requirements and reduced transmission failures. These fail- The associate editor coordinating the review of this manuscript and approving it for publication was Biju Issac . ures usually occur due to adverse signal propagation conditions emerging through multipath propagation, path loss, non-line-of-sight (NLOS) and interference from co-existing networks operating on the same frequency, resulting in malfunctioned applications and QoS deterioration. In industrial scenarios such as automotive and semiconductor industries, such failures can even lead to system downtime and economic losses.
Although powerful monitoring tools already exist to troubleshoot such failures and identify causes of QoS degradation, they provide an indirect and insufficient assessment. For instance, protocol-based analysis (using sniffers such as Wireshark [1]) grants a detailed overview of higher protocol layers of communicating entities, but provide very limited information about the physical layer. In contrast, spectrum-based analysis provides a detailed insight into RF interference. It provides information about co-existence problems within and between RF-standards and also detects packet collisions which are missed by protocol-based analysis. It also grants deeper insights into the physical layer by guaranteeing accurate information about the spectral shape of the transmission consisting of signal bandwidth, power distribution, timestamps, etc. However, it does not provide any information about the higher protocol layers of the communication partners, i.e., the source or destination addresses, flags inside the protocol headers, content of the payload of a transmitted frame, etc., remains unknown. So even if interference or collision is detected by spectrum analysis, the actual interferer remains unrevealed. In terms of root cause analysis, an independent analysis of the protocol and spectral domain misses a number of insightful entanglements. Combining both domains allows for a much more comprehensive and user-friendly investigation of QoS degradation problems in wireless networks [2].
This manuscript contributes to the root cause analysis of QoS degradation by synchronizing spectrum-based analysis, which enables precise investigations of RF interference, with protocol-based analysis. This provides the user with a far-reaching insight into the link layer to obtain comprehensive information on interference problems. The cross-relationship of these two data sources enables inferences to be made that can be used to troubleshoot network problems rapidly, which is an integral part of recovering from sporadic and non-deterministic system failures. Although the synchronization of both domains appears to be straightforward and easy, it is complicated and challenging due to the flaws and imperfections present in the received traces from both methods. In protocol-based analysis, the temporal information is assigned by the operating system kernel instead of a deterministic timestamp generated in the receiver hardware, which makes it error-prone and inaccurate due to the resulting strong jitter. Additionally, it also suffers from bursty packet losses due to inadequate signal-to-noise ratio (SNR), overloaded system buses (e.g. PCIe or USB) and increased central processing unit (CPU) load [3]. Thus, an advanced and intelligent algorithm is required to perform synchronization.
In this paper, we propose a novel method known as Variable Adaptive Dynamic Time Warping (VADTW) to perform multi-level synchronization of protocol and spectral domains. VADTW works by dividing the sequences in adaptive time bins which are ordered in time. Adaptive time bins refer to bins of different lengths in time, where the length of the bin is determined by certain characteristics of the input sequences. Further, basic DTW 1 is applied to the frames 2 inside a time bin, where each frame within the sequence is assigned a time window of variable length. The window length specifies the time limits within which the frames of another sequence should be matched to the first sequence. VADTW is similar to some existing versions of DTW like Sakoe-Chiba [4], Itakura parallelogram [5] and Ratanamahatana-Keogh band [6] in a way that they also use a window element to limit the number of comparisons. The key difference is that VADTW uses a dynamic window element instead of a static one, where the window length for each frame is based on the characteristics of a sequence. By implementing binning and variable windowing, VADTW manages to reduce the computational complexity for synchronization as compared to unconstrained DTW, yet achieve considerable accuracy and precision.
In our previous work for synchronization published in [7], we started exploring the possibility of utilizing basic DTW for matching the sequences. Although we received promising results, we came across a few shortcomings and issues, and realised that a more sophisticated algorithm is required for the same. One of the major issues was bursty packet losses in protocol-based traces. When the burst size increases beyond 5 frames, the synchronization gets disrupted and accuracy drops. However, in real-life scenarios burst size is often much higher than 5. Another major drawback is the computational cost of basic DTW. It compares every frame of one sequence with every other frame of another sequence incurring huge number of comparisons and complexity of O(n 2 ), which is not feasible in practical scenarios where we have millions of frames. Additionally, the previous approach was only evaluated on a synthetic dataset. This work is an improvement over [7] in the following ways: • We propose a model based on variable window constraints and adaptive DTW to perform synchronization of spectral and protocol domains using multiple features and levels of synchronization, where coarse-grained synchronization creates adaptive time bins, and fine grained synchronization determines varying window limits and performs basic DTW using the limits.
• The proposed model limits the number of computations done by the basic DTW algorithm to only the useful ones, which significantly improves performance -without losing accuracy.
• In case of bursty packet losses, the fact of limiting the possible matches by time helps avoid wrongfully connecting the packets which are too far apart in time, and helps to produce a more precise synchronization.
• To evaluate the effectiveness and robustness of the proposed model in a real-world environment, we conducted experiments for Wi-Fi as a proof-of-concept. The Wi-Fi traffic from the testbed setup, as well as the office space environment setup is captured, and a robustness score is calculated for both configurations, without induced packet drops and up to 50% randomly introduced packet drops (for more details, see Section V-A). We also compare various DTW based algorithms statistically.
• The obtained results show that the proposed algorithm performs better than other algorithms when both performance and computational cost are considered. The paper is organized as follows: Section II discusses the existing state-of-the-art approaches and establishes the motivation for this work. Section III explains the fundamentals of DTW. Section IV describes the methodology of the proposed model. Section V discusses the different experimental setups used for the measurements, the performance of the proposed model in different scenarios, and a comparative analysis of different algorithms. Finally, Section VI concludes the paper.

II. RELATED WORK
Troubleshooting wireless networks to analyze the root cause of faulty applications has long been recognized as an important topic for network maintenance. The most researched method in the literature is protocol analysis. The protocol analysis has been widely used in the areas of Network forensics [8], [9] and anomaly detection [10], [11], [12], [13] to identify and investigate faults in the network introduced either by attacks such as denial-of-service, data exfiltration, etc., or by performance degradation induced by factors such as packet losses, overload, and jitter. Although protocol analysis techniques are very comprehensive and cost-effective, they are based on capturing the individual data packets as completely as possible. However, in wireless networks, interference or collisions in the network can lead to significant reception problems. Depending on the degree of data loss caused by these problems, significant misinterpretations can occur in the subsequent protocol analysis. Further, one of the most common ways of performing protocol analysis is by capturing and analyzing packet capture (pcap) files by Wireshark [1], [14]. Wireshark [1] is an open-source packet analyzer software that uses an opensource libpcap [15] library for capturing packets. The libpcap library uses a 2-copy process where the packets are first copied to the device driver memory and from there to the kernel buffer and further to the user space buffer [16]. Since writing to disks is impacted by overloaded system buses and CPU load, it results in packet losses and imprecise information like timestamps [16]. Thus, the analysis relying on such softwares suffers from impreciseness and ambiguity.
To detect interference and collisions in the network, arising mainly due to the coexisting RF-standards operating in the same frequency band, spectrum analysis is widely used. It not only provides accurate physical layer information, but also improves detection rate in scenarios where a received frame can no longer be correctly decoded. This is particularly common in scenarios where a large number of collisions between frames occur or where a very low SNR dominates [17]. Many previous studies [18], [19], [20], [21], [22], [23], [24] perform signal classification using Machine Learning (ML) algorithms to detect and recognize different RF-standards. They employ object detection or feature extraction techniques to extract relevant features from spectrograms and use them to classify coexisting standards in the network. Commercial real-time spectrum analyzers are also available [25]. Although these approaches have a high accuracy and processing speed, they only provide physical layer information (such as frame duration, center frequency, signal bandwidth, modulation coding scheme, and signal strength) about the detected frames. So even if interference or frame collisions are detected in the spectrum, there is no information about their source.
In this paper, we attempt to bridge the gap between spectral and protocol analysis by taking information from both domains and synchronizing them. By analyzing both domains separately, we realized that both domains provide significant and importantly, different information about the frames. When these two analyses are performed side by side and the results are merged, we obtain important additional information. In the spectrogram, a much more precise assignment of the individual frames is possible (e.g. source address, destination address, payload, header flags, etc.) and in the protocol analyses, information about frames that cannot be decoded (e.g. time of reception, bandwidth, length, etc.) is available, which can be used for troubleshooting failures and faults in the system.
One could argue that why not directly use a Software Defined Radio (SDR) to capture the spectrum and demodulate the packets? Although this sounds convincing, it is complicated and expensive. The baseband and MAC-layer processing for SDRs are expensive intellectual property (IP) block implementations that need to be written for every RFstandard. It is also hard to extend and adapt these solutions to changes in a communication standard as the creation of IP blocks and testing is time consuming and requires a high level of experience, and may not achieve the noise immunity and sensitivity offered by a commercial chip. On the other hand, obtaining spectral trace using deep-learning based spectrum analysis [17] and synchronizing it with protocol trace obtained using off the shelf receiver hardware does not require a separate demodulation operation or a new decoding device. It is an extendible approach and can be used for prototyping as well. The goal is to achieve a real-time monitor which can display the live RF-frames present in the network along with higher protocol layer information using synchronization. This can be useful, particularly in cases where the spectrum is used by co-existing systems and industry applications as the problems caused by collisions due to the hidden-node-problem and cross-standard interference can be detected and corrected swiftly. An automated evaluation of the analysis results could be used for advanced alerting systems, network management software or autonomous adaptation of channel usage in the context of cognitive radio.
To the best of our knowledge, we are the first ones to apply the concept of sequence alignment for acquiring more information about spectral frames from the protocol domain to help diagnose the failures in the network in a fast and efficient way.

III. BACKGROUND
DTW is a time series analysis method that provides a procedure for aligning temporally distorted sequences of variable length. It uses dynamic programming to calculate an optimal non-linear warp path from an element-wise cost matrix [26].
Given two sequences A = a 1 , a 2 , . . . a n of length n and . . b m of length m, the DTW distance between two elements at positions k and l in sequences A and B, respectively is given as: where d(a k , b l ) represents the squared euclidean distance between a k and b l , where k ≤ n and l ≤ m. A costmatrix is calculated from the distance values and then a path corresponding to minimum cost in the matrix represents an optimal warp path.
Comparing every element of A with every element of B to compute warp path is a slow and expensive process. Additionally, it can also wrongfully match pairs which are far apart in time. To prevent such issues, the notion of global constraints was introduced. Figure 1 represents the two most popular DTW versions for global constraints -Sakoe-Chiba [4] and Itakura Parallelogram [5]. However, in our case, the global constraints do not work because the frame sequence does not follow a uniform and regular behaviour, especially when it comes to packet rate and losses. There is no definite behaviour or pattern for the same. So, we need local constraints which take into account the varying parameters of sequences. The horizontal axis represent the spectral sequence and vertical axis represent the protocol sequence. Only those frames that are highlighted in purple are used to find the optimal warp path in order to match the protocol sequence with the frames of the spectral sequence [27].

IV. PROPOSED APPROACH
In this paper, we propose an approach to diagnose wireless networks for detecting the causes of QoS degradation. The fundamental idea is to provide completeness to automated spectrum analysis by complementing the information from protocol analysis so that whenever a disruption is detected while analyzing the spectrum, we have information about potential causes. We can take necessary measures swiftly to resolve the faults, such as shifting the sources to other non-interfering channels or raising an alarm in case of anomalous traffic or unexpected RF-standards, e.g., in the context of smart industry.
To perform synchronization of spectral and protocol domains, we propose an approach known as VADTW, which conducts multi-level synchronization consisting of coarse-grained and fine-grained levels. We discuss these synchronization levels one by one in detail.

A. COARSE-GRAINED SYNCHRONIZATION
This level of synchronization aims at splitting sequences into smaller subsequences based on their packet rate per unit of time. Let us assume the unit of time as θ. We define the Packet rate as number of packets in a sequence per θ. In other words, we divide sequences into bins of θ and then count the number of packets inside these bins. Further, both sequences are cross-correlated based on the packet rate to identify the displacement of one sequence relative to another. This is basically done to remove the lag (if present) in the sequences to optimize the process of synchronization.
After removing the lag, an offline change point analysis is applied on time bins to detect all bins where the packet rate has changed significantly. We use the Pruned Exact Linear Time (PELT) algorithm to detect the change points. PELT works through minimization of the costs and assumes that change points are spread all across the data. It has linear computational costs and is the fastest among the exact search methods and more accurate compared to the approximate search methods [28], [29], [30]. In addition, a union of the change points from both sequences is performed resulting in a single list of change points. On the basis of these change points, adaptive time bins are determined. All bins between each pair of consecutive change points form one adaptive bin in each sequence. In this way, bins having a continuous similar packet rate are merged and the ones where a significant variation is observed are considered as separate bins. These bins are called adaptive because they adapt to the packet rate variation of the sequences and vary in length in terms of time.
Methodology: Let us assume that the spectrum analysis sequence χ of time length n ms is divided into k θ ms time bins represented as t 1 , t 2 , . . . t k . Similarly, protocol analysis sequence β of length m ms is divided into q θ ms time bins represented as t ′ 1 , t ′ 2 , . . . t ′ q . The bins are cross-correlated and let us assume a lag of δ bins is detected in χ . After removing VOLUME 11, 2023 the lag, we get the new spectral sequence χ ′ with the time bins as: t δ+1:k . Using the PELT model, let us assume we detect µ change points in t δ+1:k at time bins τ 1:µ = {t i } δ+1≤i≤k and ν change points in t ′ 1:q at time bins τ ′ 1:ν = {t ′ j } 1≤j≤q . The change points are unioned and let us assume a total of ε adaptive time bins is produced having the bounds at λ 0 , λ 1 , . . . λ ε ms, where λ 0 = 0 ms and λ ε = max(n, m) ms. These bounds split the sequences χ ′ and β into adaptive bins, where the i th bin contains frames between λ i−1 and λ i ms. Further, to handle the frame losses, we remove adaptive bins which do not contain frames in at least one of the sequences. This produces χ ′′ and β ′′ .

B. FINE-GRAINED SYNCHRONIZATION
The aim of this level of synchronization is to identify an optimal match between the individual frames of both sequences. One intuitive way of moving ahead is to perform basic DTW on all adaptive time bins independently from each other and then merge the results to obtain an optimal warp path. We named this approach as Adaptive DTW (ADTW). Although the approach is convincing in terms of computational cost, it may suffer from false positives and negatives because of not considering the start and end points of a bin. Figure 2 shows an example for the same. In Figure 2(a), the two big boxes represent adaptive bins and blue colored boxes represent the optimal warp path using ADTW. Since we perform DTW only on the frames inside the time bins, the points marked in red can never be a part of the warp path which can lead to a loss in precision and recall.
To solve this problem, with VADTW we introduce the concept of variable window lengths. For every frame in the first sequence, we identify a window limit based on the time length of its adaptive bin and then match that frame to all the frames in the second sequence falling under this window limit. In this way, the matching is not constrained inside the adaptive bin and we overcome the problem of not considering the edges of the bins. Figure 2(b) shows an example of varying window constraints for synchronization.
Methodology: Let the jth frame in β ′′ be located in the adaptive bin i of length ς i = λ i − λ i−1 ms. Let j be present at η ms in β ′′ . So the variable window limit of j becomes η − ς i : η + ς i . It implies that β ′′ j is only synchronized with frames located between η − ς i and η + ς i ms in χ ′′ .
Thus, for every packet in β ′′ , we calculate a variable dynamic window limit and then use it while performing DTW to find an optimal warp path. Algorithm 1 explains the methodology used by VADTW in a nutshell.

V. EXPERIMENTAL RESULTS AND DISCUSSION
To conduct synchronization of protocol and spectral traces, VADTW uses two featurestotal duration of the frame and received signal strength (RSS). Total duration of the frame represents the air-time of the signal and RSS represents the energy of the signal at the position of the receiving antenna. For the RSS value, it must be ensured that the acquisition of spectral and protocol traces takes place in local proximity and with the same type of antenna; otherwise, the deviations of the measurements become too large. Furthermore, a normalization of RSS values is helpful and required. In our previous approach proposed in [7], we only used total duration as a feature, which gives incorrect pairings in cases where variation in duration between the frames is very low. Therefore it became necessary to include more features in the synchronization process in order to allow a unique mapping. However, the number of features available in spectral traces is very limited as it does not contain information extracted from the decoded content of the frames. After performing a thorough impact analysis of features on the accuracy of synchronization process, we identified that these two features provide the most precise results.
For our experiments, we considered the value of θ as 50 ms. The reason being if the value of θ is very small, it will produce a lot of empty bins and consumes a huge computation time, and if the value is large, it might miss some crucial packet rate variations. So, after performing considerable number of experiments, we identified that θ = 50 ms gives us the best results for a Wi-Fi system. However, it also depends on the frame sequences and may vary from sequence to sequence.
To illustrate the accuracy and robustness of the proposed approach, we extensively tested it on a real-world dataset obtained under a testbed setup and an office space environment setup (details are explained in Section V-A). To verify how the approach performs in case of bursty packet losses, we artificially introduced packet drops ranging from 5% to 50%. We also compared VADTW with ADTW and basic DTW in terms of performance and computational complexity.

A. PERFORMANCE ANALYSIS
For evaluating the performance of VADTW, we tested it on real Wi-Fi network traffic. However, it is difficult to perform accuracy measurements in real traffic as the ground truth is unknown. Moreover, no information about the content of the frames is received from the spectral trace. Therefore, obtaining a perfect synchronized sequence as a labelled ground truth is not feasible in our case. For this reason, we assess the accuracy of VADTW in terms of robustness in mapping sequences when packet drops are introduced. In other words, the shifts in alignment of sequences are calculated in case of additional artificial packet losses to verify the robustness of synchronization by the proposed approach. We conducted experiments in both a controlled and randomly chosen environment. To make the calculations precise, during the measurement, care was taken to ensure that the reception conditions were as good as possible and that the measurement hardware produced as little packet loss as possible.

1) TESTBED SETUP
The testbed setup for Wi-Fi network is shown in Figure 3. The setup consists of two stations (STA) and one access point (AP) as participating entities such that traffic consisting of  transmission control protocol (TCP) packets is transmitted from STAs to AP using Distributed Internet Traffic Generator (D-ITG) [31] at center frequency 5.765 Ghz. To obtain a protocol trace, Wireshark + Wi-Fi card in monitor mode (we call it Sniffer) is used and to get the spectral trace, a deep learning based spectrum analyzer proposed in [17] is used, which captures the spectrum using a SDR and uses advanced image recognition techniques to detect and classify frames into different RF-standards to which they belong. It provides a json file as an output containing precise physical layer information of the frames. The experiment is performed in an electromagnetic shielded tent represented by a solid line in Figure 3 to reduce external interference to minimum.
We capture the traffic for 30 seconds consisting of approximately 50, 000 frames using both analyzers and preprocess the traffic for synchronization. The first obtained optimal warp path is considered as a reference and further, random packet drops ranging from 5% to 50% are introduced in the sequences using the Three-state Markov Chain model proposed in [32]. This model is used because it provides sufficient control over the parameters of packet loss (such as burst size, percentage, etc.) and loss-free periods. The percentage of pairings that remain the same as the reference after artificial packet drops is further termed as robustness score. Table 1 shows the robustness scores for testbed setup in different packet loss scenarios.
In Table 1, SS stands for single source packet drop and AS stands for all sources packet drop, i.e., dropping packets from both spectral as well as protocol domain. The burst size of packet drops is maintained in coordination with the drop percentage. VADTW manages to align more than 50% pairs accurately even with 50% random packet drops from both sources in case of testbed setup with a burst size range of ⟨44 − 46⟩, which is fairly high. We also performed experiments in a random office space environment, where we do not control any parameters while capturing traffic.

2) OFFICE SPACE ENVIRONMENT SETUP
The experimental setup used for real-world office space environment is shown in Figure 4. In this setup, we randomly captured Wi-Fi traffic for 30 seconds in an office space consisting of multiple APs, clients and a moving smart- phone streaming a video. In total, 13 entities were present in the network during the experiment. The dotted line in the figure represents that the capture is performed in a random environment without any shielding against external interference. The captured traffic consists of approximately 70, 000 frames.
Similar to the previous scenario, we considered the first synchronized sequence as the reference and further dropped packets randomly to calculate the robustness scores shown in Table 1. It can be seen that even with completely random RF traffic, VADTW manages to achieve the robustness score of 42.8% in case of 50% packet losses from both the sources, which is noteworthy.

B. COMPARATIVE ANALYSIS
As discussed in Section II, the existing state-of-the-art approaches either apply protocol analysis or spectrum analysis for troubleshooting the failures in the network. The protocol analysis suffers from data loss and imprecise information as it heavily depends on reception conditions impacted by collisions and interference in the network (as explained in detail in Section II). On the contrary, spectrum analysis provides precise physical layer information. However, under certain conditions, such as densely populated networks, this information is insufficient to detect the source of faults and failures in the network (as explained in Section II). We apply both these approaches simultaneously and combine the results. It enables us to obtain physical layer information (such as frame duration, center frequency, signal bandwidth, modulation coding scheme, and signal strength) from spectrum analysis on one hand, and protocol layer information (e.g., source address, destination address, payload, header flags, etc.) from protocol analysis on the other hand. Our combined analysis empowers the swift diagnosis of wireless networks, which is of crucial importance in automation systems and industrial scenarios. To the best of our knowledge, we are the first ones to introduce the concept of protocol and spectrogram synchronization for root cause analysis of performance degradation in wireless networks.
To assess the efficiency of our proposed algorithm (VADTW) as a sequence alignment method, we performed a comparative analysis between VADTW, ADTW, and basic DTW to highlight the improvement obtained via VADTW in terms of performance (based on precision and recall) and computational complexity. Since the frame sequences in our use case do not exhibit steady and regular behaviour, particularly regarding packet loss and packet rates, global constraints are not suitable. Therefore, we did not compare our approach with Sakoe-Chiba and Itakura methods, which utilize global constraints. Instead, we compared our approach with techniques that either apply local constraints or do not apply any constraints at all.

1) PERFORMANCE
For this analysis, we generated a synthetic dataset of 20, 000 IEEE 802.11n frames using Rhode & Schwarz®SMBV100B vector signal generator at a center frequency of 5.5 Ghz. To obtain a spectral trace Ellisys Bluetooth analyzer is used, and for obtaining a protocol trace Wireshark + Wi-Fi card in monitor mode is used. After capturing the traces, we manually extracted a gap-free sequence from both domains to get a labelled ground truth.
We calculated the F1-score using true positives (TP), false positives (FP) and false negatives (FN). The positive and negative factors are defined as follows: Let us assume spectral analysis sequence χ contains g frames, protocol analysis sequence β contains h frames and P represents an optimal warp path of length L, where P = p 1 , p 2 , . . . p L , with p t = {(χ i , β j )} i∈ [1:g],j∈ [1:h] . If {(χ a , β b )} a≤g,b≤h is a detected pair then: We statistically compared the F1-scores of basic DTW and ADTW with VADTW using Wilcoxon signed-rank test [33].
Wilcoxon signed-rank test, without making any assumptions about the form of distribution of the observations, estimate whether the difference between the medians of two related set of observations is statistically significant with a significance level α. We select α = 0.05 for the test.
We calculated the F1-scores of basic DTW, ADTW, and VADTW for the frame drop percentages of 5%, 15%, 30%, and 50%, each with 100 samples. When comparing basic DTW with VADTW using the Wilcoxon signed-rank test, we observed that there is a significant difference between their F1-scores (p-value=1.35 × 10 −7 and Z-score=−5.27). There is also a significant difference observed between the F1-scores of ADTW and VADTW (p-value=0.0002 and Z-score=−3.64). It is also interesting to see that there is no significant difference between ADTW and basic DTW (p-value=0.5 and Z-score=−0.63). Further, Figure 5 shows the box plot comparing the F1-scores of all the three approaches for the various frame drop percentages. It could be observed from Figure 5 that VADTW performs better than ADTW and basic DTW under the various frame drop scenarios.

2) COMPUTATIONAL COMPLEXITY
To assess the performance of VADTW in terms of computational cost, we calculate the computational complexity based on the number of operations made by various approaches to produce a final warp path.
If the spectral analysis sequence χ contains g frames and the protocol analysis sequence β contains h frames, then the number of comparisons made by basic DTW is given as: g × h, since in basic DTW every frame of one sequence is compared with every frame of another sequence to find a warp path. Figure 6(a) diagrammatically shows the number of comparisons made by basic DTW. The x-axis represents the spectral frames, y-axis represents the protocol frames and every protocol frame is compared with every other spectral frame to find the warp path shown in blue color.
In case of ADTW, the comparisons are made within the adaptive time bins, i.e., the protocol frame will only be VOLUME 11, 2023 64675 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.  compared to spectral frames that fall within the range of adaptive time bin to which the protocol frame belongs. If there are a total of n = |{b 1 , b 2 , ..b n }| adaptive time bins and every bin contains protocol frames, then number of comparisons is given as: Figure 6(b) shows the number of comparisons made in case of ADTW. Here, every protocol frame is compared only with spectral frames which belong to the same time bin as the protocol frame, represented by big boxes. Thus, the number of comparisons get reduced.
In case of VADTW, every protocol frame has a variable window based on its timestamp and the length of the adaptive time bin it belongs to, i.e. if the protocol frame is present at timestamp t 1 in the protocol sequence and the length of the adaptive time bin to which it belongs is t ′ , then its window becomes t 1 − t ′ : t 1 + t ′ . It will only be compared to the spectral frames falling under t 1 − t ′ : t 1 + t ′ . Let the numbers of spectral frames to which protocol frames will be compared be represented by a vector y = y 1 , y 2 , . . . y h such that y i represents the number of spectral frames to which the ith protocol frame will be compared. So, the total number of comparisons is given as: h i=1 y i . Figure 6(c) shows the number of comparisons made in case of VADTW.
It can be seen from Figure 6 that computational cost of basic DTW ≥ VADTW ≥ ADTW. When all the frames fall under one big time bin, the computational cost of basic DTW ≡ VADTW ≡ ADTW which can be considered as the worst case scenario for ADTW and VADTW. However, this case would only occur for very uniform sequences. The occurrence of these long uniform sequences is highly unlikely in practice.
We also computed the execution time incurred by various algorithms while synchronizing the synthetic dataset. On one hand, where basic DTW took 23.8 minutes to synchronize, VADTW achieved the same result in 14.6 seconds. A significant improvement is witnessed by VADTW in terms of execution time. This is of significant importance for our case as the spectral and protocol sequences can contain millions of frames and applying basic DTW for synchronizing them seems impractical, especially in case of online analysis during the measurements. Although ADTW has the lowest computational cost, it incurs more false positives and negatives as compared to VADTW (proved in Section V-B1). Therefore, taking both performance and computational cost in consideration, VADTW performs better than basic DTW and ADTW as it manages to reduce the number of comparisons while maintaining a high level of accuracy.

C. DISCUSSION
Time series analysis has a wide range of applications in domains like science, medicine, ecology, telecommunication and meteorology. Often the time series arise from different sources and analysis is done by applying data mining methods such as classification and clustering to understand their behaviour, like predicting future events or detecting anomalies [27]. However, our case is different. Here, a single source is transmitting the frames which are captured by two different methods resulting in two different time series that represent the same frame sequence but in different forms. It gets more challenging when there are missing frames in the sequences, collisions from different RF-standards and imprecise time information in one of the sequences. The objective is to synchronize such sequences without having any knowledge about the uncertainties and anomalies in the traces.
To fulfil our objective, we proposed two variants of basic DTW in this paper -ADTW and VADTW which differ mainly in the concept of choosing local window constraints for synchronization. In ADTW, the window boundaries are the same for all frames belonging to the subsequence that contains samples of similar properties whereas in case of VADTW window boundaries differ for every frame. Both approaches can be extremely helpful for the research community in analyzing time series with huge number of observations and a lot of sudden change points which do not follow a steady behaviour such as signals with loads of irregular study periods. It can also be helpful in cases where local window constraints are more accurate instead of global ones. For instance, local window constraints would be more effective when predicting road traffic patterns which is more on weekdays as compared to weekends and more on morning and evening hours as compared to other hours of the day.

VI. CONCLUSION
In this paper, we discuss the advantages of synchronizing protocol and spectral frames to obtain more precise information about spectral frames captured via automatic spectrum analysis and use this information further for troubleshooting QoS degradation issues. For synchronizing the frames, we propose a multi-feature DTW based model known as VADTW which uses binning and windowing approaches to overcome the inaccuracies arising from frame losses and imprecise timestamps and to reduce the computational complexity of DTW. By performing experiments on Wi-Fi frames captured in a testbed and an office space environment, we discussed and proved that the proposed approach manages to achieve considerable robustness scores even in the case of 50% random packet drops in both frame sequences, which is a very difficult scenario. We compared our approach with other variants of DTW in terms of performance and computational complexity to prove the supremacy of the proposed algorithm. VADTW is more robust with empirical evidence from statistical significance. It witnesses a significant 99% improvement in execution time as compared to basic DTW. We also discuss the usefulness of the proposed DTW based approaches for the research community. In the future, we would like to incorporate VADTW in the automatic spectrum analysis by using online change point analysis method to perform the synchronization in real-time.
VINEETA JAIN (Member, IEEE) received the master's degree in information security from the Maulana Azad National Institute of Technology Bhopal, India, and the Ph.D. degree in computer science from the Malaviya National Institute of Technology Jaipur, India. She is currently pursuing the Ph.D. degree with the Fraunhofer Institute of Integrated Circuits IIS, Division Engineering of Adaptive Systems EAS, Germany. She has been a Faculty Member of The LNM Institute of Information Technology Jaipur, India. Her research interests include wireless communication, wireless networks, network security, mobile security, and applied cryptography.
VLADIMIR FOKOW is currently pursuing the bachelor's degree in integrated systems and technologies with the National Technical University of Ukraine ''Igor Sikorsky Kyiv Polytechnic Institute.'' His research interests include data science, machine learning, deep learning, and artificial intelligence. He is particularly interested in exploring different fields in AI, and is working to broaden his understanding of the various applications and techniques used in this field, and applying them to projects that aim to bring value to society.
JAKOB WICHT received the Diploma degree in electrical engineering from the Technical University Dresden, Germany. He is currently a Research Scientist with the Division Engineering of Adaptive Systems (EAS), Fraunhofer Institute for Integrated Circuits IIS, Germany. His research interests include wireless communication systems, embedded systems, signal processing, and machine learning.
ULF WETZKER received the Diploma degree in computer science and systems engineering from the Ilmenau University of Technology (TU Ilmenau), Ilmenau, Germany, in 2008. Since October 2008, he has been a Research Scientist with the Division Engineering of Adaptive Systems (EAS), Fraunhofer Institute for Integrated Circuits IIS, Dresden, Germany, where he joined the Industrial Wireless Communication Group, in 2012. His research interests include wireless communication systems, data analytics, and machine learning, with a special focus on anomaly detection and root cause analysis in wireless networks. For more information visit the link (https://www. eas.iis.fraunhofer.de/en/research_topics/wireless-networked_automation. html).