## 3 Methods and Tools
### Propagation Model
Finally, in Figure 3 it can also be observed that the received power at the first measured distance is not zero, but it has an offset that depends on the conditions evaluated. This effect is considered in the LNSPL model by the base path losses (BPL) at a reference distance \(d_{0}\). These base path losses are generally calculated by the Free Space Path Loss (FPSL) formula (Equation (2)) where \(d_{0}\) takes the value of 1 m for convenience and comparability of results and \(\lambda\) is the wavelength of the working frequency [36]:  
\[PL(d,\;n,\;\sigma)_{dB}=BPL(d_{0})+10\;n\log_{10}\left(\frac{d}{d_{0}}\right)+ \text{X}_{\sigma} \tag{1}\]  
\[FSPL(d_{0},\lambda)=10\log_{10}\left(\frac{4\;\pi\;d_{0}}{\lambda}\right)^{2} \tag{2}\]  
Once the appropriate propagation model is chosen, it is adjusted to replicate the acquired data (Figure 3). To do so, we have minimized the sum square error (SSE) between the real data and the propagation model (Equation (3)). Mathematically the SSE is defined as follows:  
\[SSE=\sum_{i=i}^{n}(y_{i}-\hat{y_{i}})^{2} \tag{3}\]  
where \(y_{i}\) represents the real data and \(\hat{y_{i}}\) the predicted data for a given measure \(i\). In turn, \(\hat{y_{i}}\) is computed by Equation (1) and \(y_{i}\) is obtained by calculating the difference between transmitted and received signal's power in the VNA. The value of Equation (3) is then minimized by Gradient Descent, a well-known iterative optimization algorithm extensively used in the IoT and WSN arena [37; 38; 39]. Such an algorithm is able to find (in this case) a pair of \(n\) and \(\sigma\) that reduces the differences between predicted and real data. This approach is particularly suitable for the LNSPL model as it exhibits good mathematical properties such as differentiability and convexity (features desirable to reach the global minimum of the SSE in the network under study). Table 1 shows the exact values of the LNSPL model for the three visibility conditions and the two working frequency bands as well obtained following the described procedure. \begin{table}
\begin{tabular}{c c} \hline \hline
**Scenario** & **LNSPL Model** \\ \hline
915 MHz - LOS & \(PL(d)_{dB}=31.67+10\cdot 1.642\cdot\log_{10}(d)+\text{X}_{2.876}\) \\
915 MHz - OLOS & \(PL(d)_{dB}=31.67+10\cdot 1.924\cdot\log_{10}(d)+\text{X}_{3.131}\) \\
915 MHz - NLOS & \(PL(d)_{dB}=31.67+10\cdot 2.520\cdot\log_{10}(d)+\text{X}_{3.033}\) \\
2400 MHz - LOS & \(PL(d)_{dB}=40.05+10\cdot 1.888\cdot\log_{10}(d)+\text{X}_{4.775}\) \\
2400 MHz - OLOS & \(PL(d)_{dB}=40.05+10\cdot 2.346\cdot\log_{10}(d)+\text{X}_{4.582}\) \\
2400 MHz - NLOS & \(PL(d)_{dB}=40.05+10\cdot 2.788\cdot\log_{10}(d)+\text{X}_{3.962}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Obtained propagation model’s parameters for both frequency bands and different visibility conditions. It is worth mentioning that, as expected, the path-loss exponents are greater for the NLOS than OLOS or LOS communications. On the other hand, the 915 MHz frequency band, gives rise to more predictable links (lower values of \(\sigma\)) in comparison with the 2400 MHz band. Figure 4 shows the good fit of the LNSPL model to the data. The depicted markers represent the acquired data (i.e. the average values of Figure 3) whereas the continuous lines illustrate the fitted model (whose formulae for each scenario are detailed in Table 1). Aside from the received power at a specific distance, the presence of electromagnetic interferences (EMI) has also been analyzed for both frequency bands. This is of paramount importance as EMI plays an important role in scenarios like substations where there are many potential sources of background noise (such as switchgears, transformers, etc.) [40; 41]. A FSH3 spectrum analyzer (Rhode & Schwarz(r), Munich, Germany) has been used to this end. Although each medium/high voltage substation might be different, most of them share many common features such as the presence of big-sized metallic structures (transformers, switchgears, etc.)