# Adaptive Parameters for LoRa-Based Networks Physical-Layer
## 3 Proposal
### SlidingChange: A Proposal of a Sliding Window for Automatic Parameter Changing
Considering that the LR-ADR is based on simple linear regression with smoothing for the last SNR measure, the results are very intuitive, keeping the tendency of the next SNR value, which is not always the best configuration. Table 4 shows the frequency of the shifts that occurred and the average of nine measurements from the changes for each setup. The highlighted values represent the biggest and smallest frequency shift averages. From an analysis of Table 4, it is possible to note that the SlidingChange technique with the window length equal to 10 elements, considering the average values, reached the highest number of carrier changes, scoring even higher values than the InstantChange technique. The technique with \(W=20\) elements had a moderate reduction, while the windows with 30 and 40 elements presented the most significant changes compared to the InstantChange technique. It is worth noting that the technique with 40 elements scored a reduction ratio of more than 50% on carrier changes

\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multirow{3}{*}{**Window**} & \multirow{3}{*}{**Experiment**} & \multicolumn{6}{c}{**BW**} \\ \cline{3-10}  & & & \multicolumn{2}{c}{**125 kHz**} & \multicolumn{2}{c}{**250 kHz**} & \multicolumn{2}{c}{**500 kHz**} & \multirow{3}{*}{**Average**} \\ \cline{3-10}  & & & \multicolumn{2}{c}{**SF**} & & \multicolumn{2}{c}{**SF**} & & \multicolumn{2}{c}{**SF**} & \\ \cline{3-10}  & & **10** & **11** & **12** & **10** & **11** & **12** & **10** & **11** & **12** \\ \hline \multirow{3}{*}{LR-ADR [28]} & 1 & 4.01\% & 3.22\% & 4.14\% & 3.10\% & 4.37\% & 2.92\% & 2.98\% & 2.21\% & 3.78\% \\ \cline{2-10}  & 2 & 3.92\% & 2.75\% & 3.33\% & 3.34\% & 2.54\% & 2.88\% & 2.34\% & 2.02\% & 2.09\% \\ \cline{2-10}  & 3 & 4.03\% &compared with the InstantChange technique. The LR-ADR obtained the worst result, generating the highest number of configuration shifts, even more than the configuration with window \(W=10\). We believe that this is due to the use of the trend of the value of the next SNR found by the linear regression method simple, which is not always correct in environments with mobility, as is the case of the evaluated environment. Based on the data from Tables 3 and 4, Table 5 illustrates the increase in SNR gains by percentage when compared with the results obtained from the InstantChange technique presented in [14]. For each window length evaluated in this paper, it showed a reduction in the number of changes in the carrier modulation compared with the InstantChange technique. From the analysis of Table 5, we observed that the window with \(W=10\) is the one that achieved the best SNR gains, scoring an improvement of 44.89% compared with the InstantChange technique. However, it reached a higher number of frequency changes, as 37.80% more changes were recorded regarding that parameter. In contrast, compared to the InstantChange technique, the sliding window of \(W=40\) is the one that achieved the highest reduction on the average number of carrier changes, scoring 53.25% fewer changes. However, the sliding change technique showed the smallest SNR gain, scoring a reduction of 8.92% of the average SNR gain. The window with \(W=0\) was represented by the InstantChange technique. From the analysis of the results, we concluded that the larger sliding window does not always mean a higher SNR gain. We identified the most efficient setups have between 0 and 30 units of length. The sliding window of 20 units of length could be considered the one with the best efficiency ratio since it achieved a considerable reduction in the carrier frequency changes and still had an SNR gain. Considering the LR-ADR, we would like to highlight that the proposed technique by [28] was created to be applied in a LoRa network with more than one gateway. Once it is not our scenario, the LR-ADR was evaluated, keeping the parameters (i.e., SF, BW, Frequency) values or shifting to another one.