# Acoustic TDOA Measurement and Accurate Indoor Positioning for Smartphone
## 4 Experiments and Results
### Experimental Results and Analysis  
In the experiment, we used a smartphone to record 5 min acoustic data at each test point. The recorded data will be processed and analyzed with the MATLAB platform. The length of time for each effective acoustic data segment is 2 s. In order to describe the results of each processing stage more vividly, we choose test point C (0.8 m, 4 m) in scenario 1 as an example. First, we set four different filters (FIR1, FIR2, FIR3 and FIR4) to filter the effective acoustic data segment (This process corresponds to step 1 of Figure 8). We can obtain four filtered signals by using four filters. Four filtered signals are obtained, which are recorded as F1, F2, F3 and F4. In order to illustrate the effect of the four filters, we drew the time-frequency diagram. It can be seen from the above Figure 15, it is not practical by using time-frequency characteristics to distinguish acoustic nodes (fuzzy time-frequency characteristics). It can also be seen from the above Figure 15, it is not practical to use time-frequency characteristics to obtain TDOA information (complex computation). So, we use prior template signals to correlate with the filtered signal (s1 is cross-correlated with F1, s2 is cross-correlated with F2, s3 is cross-correlated with F3, and s4 is cross-correlated with F4). The schematic diagram of the cross-correlation operation is as follows:  
From Figure 16, it can be seen that the four signals can be decoded by simple cross-correlation operation. In order to ensure the robustness of decoding, we implement the decoding method by using algorithm 1 in this paper. Algorithm 1 includes not only decoding but also signal extraction (This process corresponds to step 2 of Figure 8). After P1, P2, P3 and P4 are extracted by using Algorithm 1, we use Algorithm 2 for TOA estimation (this process corresponds to step 3 of Figure 8). In the experiment, we obtained 100 results for each test point. To make it easier to see the TDOAs measurement results at test point C, we selected the first 10 TDOA measurement results to display as follows:  
Figure 15: Time-frequency distribution after using different filters. (**a**) Time-frequency distribution of F1; (**b**) Time-frequency distribution of F2; (**c**) Time-frequency distribution of F3; (**d**) Time-frequency distribution of F4. From Figure 17, it can be seen that we can obtain three different TDOAs each time. At test point C, the actual TDOAs are 8.7 ms, 13.3 ms, and 8.7 ms, respectively. We can see that our TDOA measurement value is also close to the actual value. The three TDOAs are different due to the different distances between the smartphone and the four acoustic nodes. In order to further explain the improvement of TDOA measurement accuracy by Algorithms 2 and 3, we use the average of absolute values of TDOA measurement error (simply referred to as TDOA measurement average error) to explain. We assume that the speed of sound propagation is 340 m/s. TDOA error of 1 ms corresponds to a distance  
Figure 16: Cross-correlation operation between prior signals and filtered signals: (**a**) s1 is cross-correlated with F1; (**b**) s2 is cross-correlated with F2; (**c**) s3 is cross-correlated with F3; (**d**) s4 is cross-correlated with F4. Figure 17: TDOAs measurement results for the first time to ten times at test point C.  
error of 34 cm. We draw the TDOA measurement average error histogram as shown in Figures 18 and 19. From Figure 18, it can be seen that the TDOAs obtained using the cross-correlation algorithm always have large errors. At test point 1, TDOA3 has a large average measurement error. At test point 2, TDOA1 and TDOA2 have large average measurement errors. At test point 3, TDOA1 has a large average measurement error. At test point 4, TDOA3 has a large average measurement error. Therefore, TDOA1, TDOA2, and TDOA3 may all have large errors. When we use the ML algorithm for positioning, divergence occurs (i.e., the positioning result tends to infinity). Hence, stable and reliable TDOA measurements are a prerequisite for positioning.