# Design and Implementation of an Indoor Localization System Based on RSSI in IEEE 802.11 ax
## 2 Materials and Methods  
The free-space propagation model is used to predict the signal power when there is a clear line of sight between the transmitter and the receiver. Satellite communication systems and microwave links can be modeled as free-space propagation. The power received in free space by a receiving antenna, separated from the transmitter by a given distance \(d\), is given by the Friis equation:  
\[P_{r}(d)=\frac{P_{t}G_{t}G_{r}\lambda^{2}}{(4\pi)^{2}d^{2}L} \tag{1}\]  
where \(P_{r}(d)\) represents the received power between the transmitter and the receiver, \(P_{t}\) is the transmitted power, \(G_{t}\) denotes the gain of the transmitting antenna, \(G_{r}\) is the gain of the receiving antenna, \(\lambda\) corresponds to the wavelength in meters, \(d\) is the separation distance between the transmitter and the receiver in meters, and \(L\) accounts for system losses unrelated to propagation. The path loss (PL), which represents the attenuation of the signal as a positive magnitude expressed in dB, is defined as follows:  
\[PL=10\log\left(\frac{P_{t}}{P_{r}}\right)=-10\log\left(\frac{G_{t}G_{r}\lambda ^{2}}{(4\pi)^{2}d^{2}}\right) \tag{2}\]  
When the antenna gains are excluded (assumed to be unity), the equation is simplified into  
\[PL=10\log\left(\frac{P_{t}}{P_{r}}\right)=-10\log\left(\frac{\lambda^{2}}{(4 \pi)^{2}d^{2}}\right) \tag{3}\]  
The Friis equation shows that the received power decreases with the square of the distance, implying a 20 dB drop per decade. When the received power at a reference distance \(d_{0}\) is known, the received power at a greater distance is calculated using  
\[P_{r}(d)=P_{r}(d_{0})+20\log\left(\frac{d_{0}}{d}\right) \tag{4}\]  
Large-scale propagation in indoor environments can be modeled using the log-normal shadowing loss model. This empirical model expresses the losses as a function of the distance between the transmitter and the receiver according to the following equation:  
\[PL(d)=PL(d_{0})+10n\log\left(\frac{d}{d_{0}}\right)+X_{\sigma} \tag{5}\]where \(n\) is the path loss exponent, which depends on the type of environment; \(PL(d_{0})\) represents the path loss at a reference distance \(d_{0}\), calculated using the free-space propagation model; \(d\) is the distance between the transmitter and the receiver; \(d_{0}\) is the reference distance; and \(X_{\sigma}\) is a random variable expressed in dB that represents the typical deviation with a standard deviation of \(\sigma\) dB. The RSSI (Received Signal Strength Indicator) describes the relationship between the distance to the transmitter and the signal power received at the receiver. In this case, the transmitter is the unknown node, and the receiver is the anchor node. This relationship is determined using the Friis equation, in Equation (1). Since the received power is measured in watts, it must be converted into dBm, which is the common unit for RSSI. The conversion is carried out using the formula  
\[P_{\text{dBm}}=10\cdot\log_{10}\left([P_{\text{W}}]\cdot 10^{3}\right) \tag{6}\]  
where \(P_{\text{dBm}}\) is the power in decibel-milliwatts (dBm), \(P_{\text{W}}\) is the power in watts (W), and \(10^{3}\) is the conversion factor from watts to milliwatts (\(1,\text{W}=1000,\text{mW}\)). The relationship between distance and RSSI, considering a reference distance of \(1\) m, is given by  
\[\text{RSSI}=-\left(10\cdot n\cdot\log_{10}(d)-A\right) \tag{7}\]  
Solving for the distance from Equation (7), \(d\) can be calculated as  
\[d=10^{\frac{A_{\text{s}}\text{RSSI}}{\text{dBm}}} \tag{8}\]  
where \(A\) is the RSSI value measured at a reference distance (typically \(1\) m), which is a constant for the specific setup; RSSI is the current received signal strength in dBm at an unknown distance; and \(n\) is the path loss exponent, which characterizes the rate at which the signal attenuates as it propagates through the medium. It varies based on the environment (free space, urban space, indoor settings).