# Enhanced LoRaWAN Adaptive Data Rate for Mobile Internet of Things Devices
## 3 Proposed ADR Schemes
### Gaussian Filter-Based ADR (G-ADR)  
The signal strength that is received at the GW can be thought of as a Gaussian distribution [27]. For example, we show through real-time experiments and computer simulations that the SNR received at the NS follows a Gaussian distribution using SF 7 and SF 12, as shown in Figure 4a,b, respectively. Therefore, we propose the use of a Gaussian filter in order to estimate the value of the SNR to accurately compute SF, TP, or both because these parameters (SF and TP) are dependent on the SNR. Through a computer simulation, we computed the received signal strength based on a link measurement model, which considers various aspects, such as TP, shadowing, fast fading, and antenna gains, as shown in [6]. The steps that are involved in the proposed G-ADR scheme are as follows:  
Figure 4: The probability density function (PDF) of the SNR of \(M\) packets received at the network server using real-time experiment and computer simulation: (**a**) PDF of SNR using SF7; (**b**) PDF of SNR using SF12, and (**c**) deployment of two EDs with SF7 and SF12.  
Figure 3: Working procedure of I-SFA scheme [24].  
When the NS receives an UL packet with the ACK bit enabled in the frame header of the \(ADRACKReq\) MAC command, the NS starts tracking the SNR of the \(M\) received packets. The G-ADR algorithm is initiated by computing the mean (\(\mu\)) and variance (\(\sigma\)) using (1) and (2) [28], respectively.  
\[\mu=\frac{1}{M}\sum_{i=0}^{M}SNR_{i}, \tag{1}\]  
\[\sigma^{2}=\frac{1}{M-1}\sum_{i=0}^{M}(SNR_{i}-\mu)^{2}, \tag{2}\]  
where \(i\) is the \(i\)th packet among \(M\), where \(M\) = 20.  
Now, the probability density function (PDF) is expressed, as follows [28]:  
\[f(SNR)=\frac{1}{\sigma\sqrt{2\pi}}e\frac{-(SNR-\mu)^{2}}{\sigma^{2}}. \tag{3}\]
2. The proposed G-ADR accepts the centralized SNR values that lie within the effective range of \(\mu+\sigma\) and \(\mu-\sigma\). The SNR value is estimated by averaging the values that are within the effective range.
3. Finally, the G-ADR obtains the SNR required (\(SNR_{req}\), a demodulation threshold based on the current data rate (DR), as shown in Table 1) and computes the SNR margin (\(SNR_{margin}\)) and \(N_{step}\) while using (4) and (5) [17], respectively. \[SNR_{margin}=SNR_{m}-SNR_{req}(DR)-margin_{dBm},\] (4) \[N_{step}=int\left(\frac{SNR_{margin}}{3}\right).\] (5)  
In (5), \(N_{step}\) represents the number of times the algorithm is executed [17]. When \(N_{step}\) is 0, the ED is already using the best possible configuration condition. If \(N_{step}\) is greater than 0, it indicates that there is still a reasonable margin to optimize the configurable parameters. First, the number of SFs is decreased until it reaches a minimum limit (note that NS-managed ADR does not increase the SF, and only the ED-managed ADR is responsible for increasing this number). Second, the TP is decreased by 2 until it reaches a minimum limit (i.e., 2 dBm). Finally, when \(N_{step}\) is negative, only the TP is increased by 2 until the maximum limit is reached (i.e., 14 dBm). These parameter (SF and TP) settings are transmitted to the corresponding ED while using the \(LinkADRReq\) MAC command as unconfirmed (i.e., NS requires no ACK notification from the EDs). Algorithm 1 describes the detailed operation of the G-ADR method.