# Simulating Signal Aberration and Ranging Error for Ultrasonic Indoor Positioning
## 3 Simulations Results  
All the following simulations were performed for a set of acoustical apertures D = {25 mm, 20 mm, 15 mm, 13.1 mm, 8.5 mm, 6 mm}. The simulation includes acoustic diffractive phenomena, with the possibility of simulating transducers of every shape and every emitted signal. Finally, it is possible to test every ranging or positioning technique one intends to apply. In Figure 3, it is possible to see the value of the pressure peak, the correlation peak, and the estimated distance when using the position of the correlation peak to evaluate the TOA at varying D within the previously defined set. Given the field symmetry, only the results for angles from 0\({}^{\circ}\) (on the axis) to 90\({}^{\circ}\) (laterally to the transducer) are shown on a path at a constant distance R = 1 m from the center of the transducer and with varying apertures of D.  
Figure 3: _Cont._  
Finally, at the bottom of Figure 3, it is possible to see the results of the estimate of the distance R* using the usual technique based on the search for the maximum position of the cross-correlation peak (\(\tau_{\text{MAX}}\)) [16; 32], which, in favorable conditions, produces the correct estimate of the TOA and, from this, the estimate of the range R*, considering:  
\[c_{air}=331.5\sqrt{1+\frac{T}{273.15}}, \tag{2}\]  
where \(c_{\text{air}}\) (m/s) is the speed of sound in the air, and T (\({}^{\circ}\)C) is the ambient temperature. In particular, the estimate of the range estimate R* is computed as follows:  
\[R^{*}=\left(\frac{\tau_{MAX}}{f_{S}}-TOE\right)c_{air}-R_{cal} \tag{3}\]  
where \(\tau_{\text{MAX}}\) is the lag of the maximum peak, and \(R_{cal}\) is a calibration constant that takes into account all the fixed delays of the considered system. \(R_{cal}\) is independent of the range, and the time of emission of the ultrasonic signal (TOE) can be assumed known through some a priori operation. The cross-correlation along the same path considered in Figure 3--that is, along a quarter of a circumference belonging to a plane passing through the emission axis of the transducer with a radius R = 1 m--is shown in Figure 4 as the grayscale amplitude of the cross-correlation with variable lag for each angle \(\vartheta\) and for the six considered apertures. Figure 3: Numerical results at different transducer apertures D = {25, 20, 16, 13.1, 8.5, 6} mm along a semicircular path at distance R = 1 m from the emitting transducer, using a linear chirp with starting frequency f\({}_{\text{L}}\) = 30 kHz and final frequency f\({}_{\text{H}}\) = 50 kHz. A linearized air absorption around 40 kHz (slope 39.3 dB/m\(\cdot\)MHz, constant term -0.262 dB/m, i.e., about 0.917 dB/m @ 20 kHz and 1.703 dB/m @ 50 kHz) has been assumed, considering the room temperature 20 \({}^{\circ}\)C and atmospheric pressure 1 atm: (**a**) acoustical pressure peak, displayed after normalization and dB conversion, (**b**) cross-correlation peak, displayed after normalization and dB conversion, and (**c**) estimated range from the position of the cross-correlation absolute peak. For the first four aperture diameters, the lag of the cross-correlation peak does not correspond to the correct time of arrival (TOA) (see also, Figure 4). In Figure 5 are displayed the cross-correlations along a semicircular path at a distance R = 1 m from the emitting transducer for two different transducer apertures: D = 25 mm (Figure 5a) and D = 8.5 mm (Figure 5b). The cross-correlation values are normalized to their maximum value for each aperture. Figure 4: Cross-correlation values along a semicircular path at distance R = 1 m from the emitting transducer at different transducer apertures D = {25, 20, 16, 13.1, 8.5, 6} mm. From D = 25 mm down to D = 6 mm, it is possible to appreciate the progressive appearance of a single correlation peak, which makes the identification of the TOA univocal.