## 3 Quasi-Standardized 2-D Dynamic Time Warping
### Single and Two-Dimensional Dynamic Time Warping  
The problem of detection at hand can technically be approached using 1-D DTW or 2-D DTW depending on how environment reading is represented. Let \(D^{t}=\{d_{1}^{t},d_{2}^{t},\ldots,d_{S}^{t}\}\) represent the set of distance reading of \(S\) sensor beams at time \(t\). For 1-D approach, direct  
Figure 1: Alignment between two signals differs in phase. (**a**) is the result of Euclidean distance alignment, while (**b**) shows the resulting DTW. use of \(D\) as the signals to aligned can be applied, i.e., \(\mathcal{P}=\ D^{t-1}\) and \(\mathcal{Q}=\ D^{t}\). For 2-D approach, the signals consist of 2-D point clouds \(\mathcal{P}=\left[ \begin{array}{cc}\mathcal{P}_{x}&\mathcal{P}_{y}\end{array} \right]\) and \(\mathcal{Q}=\left[ \begin{array}{cc}\mathcal{Q}_{x}&\mathcal{Q}_{y}\end{array} \right]\) extracted from \(D^{t-1}\) and \(D^{t}\), respectively, by the following function  
\[\mathcal{P}=\left[ \begin{array}{cc}D^{t-1}\cos(\varphi)&D^{t-1}\sin(\varphi )\end{array} \right],\ \mathcal{Q}=\left[ \begin{array}{cc}D^{t}\cos(\varphi)&D^{t}\sin(\varphi) \end{array} \right] \tag{1}\]  
where \(\varphi\) is the angle of each sensor beam \(s\) which corresponds to \(d_{s}^{t}\) with respect to a robot's local coordinate frame. In this section, we investigate the performance of the two approaches in solving kidnapping detection. Let \(\mathcal{M}\) define the detection parameter value of an arbitrary kidnapping detector method (\(\mathcal{M}\) can be particles weight, similarity degree, measurement entropy, etc., depending on the detector). For each detector, the detector performance evaluator of each trial is expressed as  
\[\mathcal{F}(\mathcal{M})=\left\{ \begin{array}{cc}1-\left(\underset{2\leq t \leq t\leq t-1}{\max}(\mathcal{M})/\mathcal{M}_{tk}\right)\text{, \ }\mathcal{M}_{t}\text{ is }HPTF\\ 1-\left(\mathcal{M}_{tk}/\underset{2\leq t\leq t-1}{\min}(\mathcal{M})\right) \text{, \ }\mathcal{M}_{t}\text{ is }LPTF\end{array} \right. \tag{2}\]  
where \(t\) is the time interval of the robot's operation and \(2\leq t\leq T\) is the kidnapping points, i.e., the time instance at which kidnapping event occurred with kidnapping destination. LPTF is a short form of Low Pass Threshold Function, which we define as a threshold function in which the function holds true when the value is lower than the specified threshold. Similarly, we define HPTF (High Pass Threshold Function) as a threshold function in which the function holds true when the value is higher than the specified threshold. This performance evaluator is intended to measure the ability of \(\mathcal{M}\) to distinguish between the kidnapping condition and the normal condition around the kidnapping points, based on how far the value at \(t=t\_k\) from the value at any other prior points. Negative value of \(\mathcal{F}(\mathcal{M})\) implies that there is another value(s) of \(\mathcal{M}_{\left\{2\leq t\leq t,k-1\right\}}\) higher (for HPTF) or lower (for LPTF) than \(\mathcal{M}_{t,k}\) itself, indicating a misdetection for kidnapping at \(t=t\_k\). In order to obtain the performance index of 1D-DTW and 2D-DTW, a 20 trials performance test is executed and the complete algorithm for the performance test is shown in Algorithm 2 below. ```
1. \(\mathcal{M}\) Performance Test Algorithm
2. For all \(2\leq t\_k\leq 100\), do
3. Let the robot run normally. At \(t=t\_k\) the robot is kidnapped to a certain place and after that it continues to run normally until \(t=100\)
4. See if the robot can detect that it has been kidnapped at \(t=t\) by measuring \(\mathcal{F}(\mathcal{M})\)
5. Add \(\mathcal{F}(\mathcal{M})\) to a vector of size \([20\times 1]\ \eta\)
6.