1 Introduction

Wireless local area networks (WLANs) are a hot issue in smart devices, versatile software applications, lifestyle changes and wireless communications network technology. This interesting technology, the first standard of which was published in 1999, is still evolving toward a more flexible network topology, stronger security, higher data rate, and greater mobility, among other areas.

For the area of localization technology, WLAN has contributed as a measurement source of the position estimation. Usually, the received signal strength (RSS) has been the most important measurement parameter. A typical example is the XPS technology which was suggested by Skyhook Inc. It utilizes the massive reference database to improve the performance of GPS, where the massive reference database contains the information on the WLAN RSS and the cell tower ID. This is a commercialized example of various WLAN RSS fingerprint-based research activities, the localization accuracy of which is around 10–20 m.

Another popular measurement parameter for WLAN localization in this research field is time-of-arrival (ToA). To obtain ToA, RTT has been widely used due to its simplicity. It is well known that WLAN has no standard for localization or ranging; actually to a limited extent, Task Group V in the IEEE802.11 standard committee is dealing with the standard issue of localization management entities, but the current standard has no way to estimate the ToA. To handle this problem, previous researches have used the existing command and/or data frames to measure RTT over the medium access control layer using RTS/CTS frames, Data/Ack frames, or other means [14]. The methods in [13] are software-based ranging methods, where a 1 MHz embedded clock on the WLAN card is used for the measurement. The method in [4] is also a software-based ranging method where another high-resolution clock of 44 MHz is used for measurements. Uncertain delays introduced by a measurement limit the quality of research. In [1] through [4], statistical estimation methods are suggested for reducing uncertain delay components contained in the measurements, which are mainly introduced through the use of a WLAN card, which is discussed in the next section. The authors in [5, 6] also presented ToA-based position estimation methods, where a Kalman filter and linear least squares estimation were used in the positioning algorithm to improve the ToA ranging performance. However, the positioning accuracy is still around 10–20 m in spite of these algorithms. To increase this accuracy, we present a new ToA estimation method in the WLAN physical layer RTT, the ranging accuracy of which can be increased by reducing the effects of uncertain delays.

In [7], the experimental results of the ToA ranging performance for various indoor channel environments and transmit signal bandwidths were analyzed. From [7], it is important that the WLAN ToA ranging should deal with whether a channel condition is line-of-sight (LOS) or non-LOS (NLOS). Also, transmit bandwidth is a critical factor in ranging accuracy, but in reality is not a controllable factor for commercial WLAN products. It is preferable to set the sampling frequency of the analog-to-digital converter in WLAN receivers as low as possible as this setting is directly related to system power consumption. These two factors, i.e., the transmit channel condition and effect of low sampling frequency, are important as our proposed method is performed at the physical layer. A sampling frequency of 80 MHz is considered in this paper, and is a normal frequency used in state-of-art WLAN products. Handling of the channel condition is performed by proposing an LOS/NLOS identification method, where the WLAN channel estimate is used for determining whether the channel condition during the ToA measurement is LOS or NLOS.

This paper is organized as follows. In section II, we analyze uncertain system delays and discuss how to reduce the delay effect during a WLAN ToA measurement. Our proposed method for ToA measurement using the WLAN physical layer RTT is presented in Sect. 3. In Sect. 4, indoor and outdoor field test results of our proposed method are presented. The LOS/NLOS channel identification and corresponding simulation results are presented in Sect. V. In Section VI, we provide some concluding remarks of this research.

2 ToA estimation of WLAN systems

In WLAN, ToA measurement is conducted by measuring the RTT between two devices, as depicted in Fig. 1, where \(T_\mathrm{rtt}\) is the RTT time and \(T_\mathrm{wait}\) is the time between the reception of a request frame and the transmission of a response frame. ToA, \(T_{f}\) is written as

$$\begin{aligned} T_f =( {T_\mathrm{rtt} -T_\mathrm{wait} })/2. \end{aligned}$$
(1)

\(T_{f}\) can be averaged over several times to reduce clock drift errors caused by two un-synchronized devices [8, 9]. Many different articles on this problem can be found in research regarding ultra-wideband localization technology such as impulse-radio ultra-wideband, where the functions for ToA ranging already exist.

Fig. 1
figure 1

Round-trip time measurement

In contrast to ultra-wideband technology, there is no localization-specific function in the WLAN standard. To measure \(T_{f}\), RTS/CTS frames or Data/Ack frames [10] can be used in the WLAN system. However, \(T_{f}\) cannot be measured directly in a WLAN system. As written in [3], it is assumed that a WLAN system should provide time stamps taken for either sending or receiving frames, and also provide an access method for RTS/CTS and Data/Ack frames. Most commercial WLAN products do not provide the prior-mentioned functions in their device driver entities [3]. Furthermore, the time stamp is based on a 1 MHz clock, whose measurement resolution and its drift up to 100 ppm are not appropriate for ToA measurements compared with a clock resolution of 1 ns for ultra-wideband systems. When \(T_{f}\) is measured over a medium access control layer, possible delays can be introduced by the WLAN system. When frames are processed, \(T_\mathrm{rtt}\) contains the system delays, i.e., \(T_{d1}\), \(T_{d2}\), and \(T_{d3}\), as shown in Fig. 2, where \(T_{d1}\) is the time delay between the triggering time of a request frame transmit command and its actual transmit time at the physical layer output, \(T_{d2}\) is the time delay between the reception time of the request frame at the physical layer and its indication time at the medium access control layer, and \(T_{d3}\) is the time delay between the reception time of the request frame and the transmit time of the response frame at the physical layer. The time delays consist of \(T_\mathrm{mac}\), \(T_\mathrm{phy,tx}\), and \(T_\mathrm{phy,rx}\).

$$\begin{aligned} T_{d1}&= T_\mathrm{mac} +T_\mathrm{phy,tx} \\ T_{d2}&= T_\mathrm{mac} +T_\mathrm{phy,rx} \\ T_{d3}&= T_\mathrm{mac} +T_\mathrm{phy,tx} +T_\mathrm{phy,rx} \end{aligned}$$
Fig. 2
figure 2

System delays in WLAN

Generally speaking, \(T_\mathrm{phy,tx}\) and \(T_\mathrm{phy,rx}\) are the deterministic delays, which only depend on the modulation mode, forward error correction rate, and other fixed delays such as RF component delays. However, \(T_\mathrm{mac}\) is not deterministic. As shown in Fig. 3, there is a buffer interface block between the medium access control layer and physical layer, in which several first-input-first-output (FIFO) buffers send or receive data in-between the two layers. The medium access control hardware and software are connected with the buffer interface block through the system bus. Operating system schedules many tasks to handle the frame transmit, receive, and management procedures. When processing a message transaction, for example, how to send a corresponding response frame for a requested frame, the operating systems use the time synchronization function (TSF) timer block for the task scheduling, such as inter-frame space (IFS) counters. Because tasks are scheduled, the scheduling delay is induced during the message transaction process. In the scheduling, uncertainty in the TSF clock is added. Also, the FIFO in the interface block may induce additional delays if frame data are waiting in the FIFO. If MAC software operation is required in the message transaction process, the uncertain scheduling delay due to the software tasks is added. The resultant time delay of the medium access control layer, \(T_\mathrm{mac}\), is written as

$$\begin{aligned} T_\mathrm{mac} =T_\mathrm{sched,tsf} +T_\mathrm{buff} +T_\mathrm{sched,soft} \end{aligned}$$

where \(T_\mathrm{sched,tsf} \) is the delay of the TSF clock, \(T_\mathrm{buff} \) is the delay of the buffer interface, and \(T_\mathrm{sched,soft} \) is the delay of the software scheduling. Delay uncertainty due to the \(T_\mathrm{mac}\), for example, can be seen an IFS counter values. To see this property, we took a measurement of the IFS of a commercial WLAN access point (AP). It is hard to measure the IFS itself directly. We took a measurement of the \(T_\mathrm{rtt}\) of the RTS/CTS message transaction process, in which a single short IFS timer is included. The measurement setup is shown in Fig. 4. Our physical layer measurement system is used for the \(T_\mathrm{rtt}\) measurement, where all the system delays of our measurement system are deterministic. The measurement system is connected to the AP through a coaxial cable, the model number of which is N604V. We also added a custom RF connector to the AP and disconnected the original connection between the antenna connectors and RF port inside the AP. The transmission mode is the BPSK of IEEE802.11g, where the operating frequency is 2.4 GHz and the modulation is OFDM. With this setup, the measurement system measures \(T_\mathrm{rtt}\) by transmitting a RTS frame and receiving the corresponding CTS frame. Thus, it can be said that a variance in the measurement is caused by the AP. The resolution of the measurement is 12.5 ns using an 80 MHz analog-to-digital converter. We recorded \(T_\mathrm{rtt}\) 50,000 times, the results of which are shown in Fig. 5. The figure shows the histogram of the measurement results, where the horizontal axis is the number of counters of the measured \(T_\mathrm{rtt}\), and the vertical axis is the number of occurrences of the corresponding counters. The distribution of the AP’s system delay is almost uniform with the range of highly frequent occurrences. Thus, it can be said that the AP induces a system delay uncertainty of over 360 ns, which may result in significant ranging errors. The probability density function of the system delay can be approximated as

$$\begin{aligned} p_D (d)=\left\{ {{\begin{array}{l@{\quad }l} {2.7778\times 10^6} &{} {82.5625\times 10^{-6}<T_\mathrm{rtt} <82.925\times 10^{-6}} \\ 0 &{} \mathrm{others} \\ \end{array} }} \right. . \end{aligned}$$
(2)

Some statistical techniques are used to handle the delay uncertainty and the low clock resolution/accuracy problem [14]. For example, using 1,000 packets per range estimation, the authors in [1] showed that the stochastic resonance and beat frequency method achieves a ranging error of about 8 m.

Fig. 3
figure 3

General WLAN system architecture

Fig. 4
figure 4

ToA estimation of a commercial AP

Fig. 5
figure 5

RTT measurement results of a commercial AP

The drawback of these software-based ranging methods is that they require a number of measurements and their performances are not terribly accurate in relation to the effort they require. It can also be said that statistical techniques are unsuitable for real-time localization applications.

3 ToA estimation of WLAN physical layer

3.1 System architecture and range estimation

In the previous section, we showed that the commercial AP used in our experiment has almost uniform distribution with the support of (82.5625 us, 82.925 us). These delays result in uncertain ranging errors that are difficult to reduce without time-consuming statistical approaches.

Thus, avoiding this uncertainty might enhance the ranging performance as well as the real-time performance of a WLAN system. To do this, we propose a physical layer ToA measurement system for IEEE802.11 OFDM-PHY. The overall system architecture is shown in Fig. 6. The block diagram of the ToA estimator in Fig. 6 is shown in Fig. 7. This system eliminates the random delay component induced by the medium access control layer in \(T_{d1}\), \(T_{d2}\), and \(T_{d3}\) in Fig. 2. The sampling frequency of the analog-to-digital converter in Fig. 7 is 80 MHz. The PD block detects an IEEE802.11g OFDM-PHY frame. The cross correlator block detects the coarse arrival time of the OFDM frame. As the resolution of the coarse time is 12.5 ns, of which the range resolution is 37.5 m, the interpolator block estimates the fine time of the coarsely detected arrival time, where the well-known linear interpolation method is used due to its simplicity.

Fig. 6
figure 6

ToA estimation system architecture

Fig. 7
figure 7

Block diagram of the ToA estimator

To perform the ranging estimation between the two WLAN devices shown in Fig. 6, a measurement system is connected to each WLAN device. We assume that one device is set to a station and the other set to an AP. We use the probe request/response frames for our ToA estimation method instead of the RTS/CTS and/or the data frames used in previous researches [14] as probe request/response frames can be used between the station and AP for ToA estimation without the use of a connection procedure, whereas the RTS/CTS and data frames require a connection between the two devices. Furthermore, probe request/response frames are easy to use for symmetric double-sided two-way ranging (SDS-TWR), which is one method for reducing ranging errors due to clock drifts between two different devices. Our method is more advantageous than the four-way ranging (FWR) used in [3], in which a RTS/CTS/DATA/ACK frame sequence is used for the ToA measurement, as shown in Fig. 8. First, a burdensome network connection procedure is required to perform the FWR. Second, data should be transmitted even if only a ToA measurement is required. Last, the ToA estimation error can be increased when long length data are transmitted. To see this effect, let \(\hat{T}_f \) be the measured ToA using the FWR. The error induced by the clock drift of the FWR, \(\hat{T}_f -T_f \), is written as

$$\begin{aligned} \hat{T}_f -T_f&= \frac{1}{4}((T_{r1} +T_{r2} +T_{rG} )(1+e_A )-(T_{rA} +T_{rB} )(1+e_B ) \\&\quad -\,(T_{r1}+T_{r2} +T_{rG} )+(T_{rA} +T_{rB} )) \\&= T_f +\frac{1}{4}((T_{rA} +T_{rB} )(e_A -e_B)+T_{rG} e_A ). \end{aligned}$$

where

$$\begin{aligned} T_f&= \frac{T_{r1} -T_{rA} }{2} = \frac{T_{r2} -T_{rB} }{2}=\frac{1}{4}(T_{r1} +T_{r2} +T_{rG} -T_{rA} -T_{rB} )\\ \hat{T}_f&= \frac{1}{4}((T_{r1} +T_{r2} +T_{rG} )(1+e_A )-(T_{rA} +T_{rB} )(1+e_B )) \end{aligned}$$

Assuming that \(T_{rA} +T_{rB} >>T_f \) and \(T_{rG} >>T_f \), we can write

$$\begin{aligned} \hat{T}_f -T_f \approx \frac{1}{4}(T_{rA} +T_{rB} )(e_A -e_B )+\frac{1}{4}T_{rG} e_A , \end{aligned}$$
(3)
Fig. 8
figure 8

FWR procedure

where \(t_{rB}=t_\mathrm{Data}\textit{SIFS}\). The first term on the right side is always bigger than that of the SDS-TWR; the ToA measurement error analysis of the SDS-TWR in Fig. 8 is as follows [23, 24]:

$$\begin{aligned} \hat{T}_f -T_f \approx \frac{1}{4}(T_{r\alpha } -T_{r\beta } )(e_A -e_B ). \end{aligned}$$

The second term is the error for only the FWR, but this term is small enough to be ignored. The measurement error of the FWR can become serious when the first term on the right side in (3) increases as the length of data elongates. For example, when a length of 1,000 bytes/frame is transmitted using 6 Mbps mode, \(t_\mathrm{Data}\) is 6.69 ms. Assuming that \(e^{A}-e^{B}=10^{-5}\), the first term on the right side in (3) is 16.725 ns, which results in ranging errors of about 1 m. Thus, the mode and frame length should be carefully chosen for the FWR.

The frame sequence of our measurement system is PREQ/PRSP/ACK, where PREQ is the probe request, and PRSP is the probe response. As shown in Fig. 9, it is easy to use the SDS-TWR with this sequence. Using this sequence, a WLAN device needs no connection setup procedure with other WLAN devices for ranging, and if two WLAN devices already have a connection with each other they do not have to disconnect their connection to perform the ToA measurement with other unconnected WLAN devices. Because the connection procedure includes several steps such as scanning, authentication, and association, this characteristic is very advantageous in saving time and reducing load on a WLAN network when a WLAN device wants to measure ToAs with other devices.

Fig. 9
figure 9

PREQ/PRSP/ACK procedure

To see the ranging performance of our measurement system, we conducted a ranging experiment, the setup of which is depicted in Fig. 10. Two types of antenna, sector and patch, were used for the AP, while an omni-directional dipole antenna was used for the station, where the vertical beam-width of the three antenna is 9, 80, and 360\(^\circ \), respectively. An AP is fixed at position A in Fig. 10a and b, and a station in Fig. 10a and b moves along the horizontal line from position B to position C, where measurements were performed every meter within each distance between B and C in Fig. 10a and b. The channel condition between the two devices in Fig. 10 is LOS. Figures 11 and 12 show the experimental ranging results for the patch and sector antennas, respectively. In Fig. 11a, the red line indicates the real distance, and the blue line represents the estimated distance. The blue line is very close to the red line, and the average ranging error is 176 cm, and the histogram of the error is shown in Fig. 11b. For the patch antenna, we obtain a better ranging performance, as shown in Fig. 12, where the average ranging error is 49.7 cm. Antenna selection is an important issue for localization technology as it is dependent on the wireless environment, which is beyond the scope of this paper. The two experimental results show us that accurate ranging can be obtained using our measurement system in an open LOS channel condition.

Fig. 10
figure 10

Layout for outdoor LOS ranging test: a sector antenna test, b patch antenna test

Fig. 11
figure 11

Measurement results for sector antenna: a ranging result and b ranging error distribution

Fig. 12
figure 12

Measurement results for patch antenna: a ranging results and b ranging error distribution

3.2 LOS/NLOS channel identification

In this section, LOS/LNOS identification is considered for OFDM-PHY-based WLAN. According to researches on ultra-wideband ranging technology [1122], the ToA of the NLOS channel deteriorates the performance of the ranging estimation. Thus, NLOS identification is necessary to reduce performance degradation. Some statistical methods for LOS/NLOS identification were proposed in [1118]. The Rician K-factor is used for a decision function of the identification in [11], where the moment-based method is applied to the K-factor estimation. Five-hundred samples are needed to correctly estimate the K-factor in [11], for which at least 26 ms are required for ranging with only one AP. Considering that the beacon frame is generally transmitted every 100 ms, 26 ms would cause a heavy load on a WLAN network; the minimum frame in the IEEE802.11 OFDM-PHY requires 52 us, i.e., 16 us for the preamble, 4 us for the signal field, and two 16 us for two SIFS, and thus a minimum of 500 frames requires their transmission time of 26 ms. The authors in [12, 14] suggested a ToA estimation method with a decision function based on the signal energy using the probability density functions of the standard IEEE802.15.4a channel models. The authors in [12] and [14] also use the statistics of direct path energy and delay, and thus the effective statistical models are a prerequisite for the estimation. Other reports [1517] are similar to [11, 12, 14] in the sense that statistics on the channels or sensed data are required for LOS/NLOS identification.

In contrast to the high data rate ultra-wideband technology with a bandwidth of 500 MHz, the bandwidth of WLAN is 20 or 40 MHz, of which the transmission rate is much slower than that of ultra-wideband. Thus, the above-mentioned statistical methods are not suitable for real-time WLAN localization. Figure 13 shows an example of the histogram of the ToA measurement results in our indoor ranging experiment. As shown in the figure, WLAN also has an NLOS problem for the ToA measurement similar to that in ultra-wideband technology. To enhance the ranging performance against the NLOS problem without using the existing statistical methods, we present a deterministic LOS/NLOS identification method for WLAN OFDM-PHY. Our identification method is based on the physical layer measurement similar to those of ultra-wideband technology. WLAN OFDM-PHY already has a channel estimate block that is used for obtaining a one-tap equalizer. In our LOS/NLOS identification method, a channel impulse response is required for our hypothesis test. To obtain the channel impulse response efficiently for WLAN OFDM-PHY, we present a simplified channel impulse response and a simple way to obtain such a response.

Fig. 13
figure 13

Histogram of indoor ToA estimation without LOS/NLOS identification

The long preamble of IEEE802.11 OFDM-PHY is a cyclic-prefixed OFDM symbol. Thus, the channel estimation is possible by simply using a fast Fourier Transform (FFT) plus several multiplications. The received signal y is written as

$$\begin{aligned} {\mathbf {y}}=H{\mathbf {x}}+{\mathbf {n}}=\left[ {{\begin{array}{c@{\quad }c@{\quad }c@{\quad }c} {h_0 } &{} {h_{N-1} } &{} \cdots &{} {h_1 } \\ {h_1 } &{} {h_0 } &{} \cdots &{} {h_2 } \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ {h_{N-1} } &{} {h_{N-2} } &{} \cdots &{} {h_0 } \\ \end{array} }} \right] {\mathbf {x}}+{\mathbf {n}}' \end{aligned}$$
(4)

where \(H\) is the circulant channel matrix, \(\varvec{x}\) is the transmitted signal, and \(\varvec{n}\) is the noise signal. We can write (4) in the frequency domain as follows,

$$\begin{aligned} {Fy}=Y=H_\mathrm{eig} X+N={FHF}^{HX}+{Fn}, \end{aligned}$$

where \(H_\mathrm{eig}\) is a diagonal matrix, the elements of which consist of a frequency domain channel response, \(H\) is the hermitian operator, and \(F\) is the following discrete Fourier transform matrix:

$$\begin{aligned} \left[ {{\begin{array}{l@{\quad }l@{\quad }l@{\quad }l@{\quad }l} 1 &{} \quad 1 &{} 1 &{} \ldots &{} \quad 1 \\ 1 &{} \quad w &{} {w^2} &{} \ldots &{} \quad {w^{N-1}} \\ 1 &{} \quad {w^2} &{} {w^4} &{} \ldots &{} \quad w^{2(N-1)}\\ \vdots &{} \quad \vdots &{} \vdots &{} \ddots &{} \quad \\ 1 &{} \quad {w^{(N-1)}} &{} {w^{2(N-1)}} &{} &{} \quad {w^{(N-1)(N-1)}} \\ \end{array} }} \right] , \end{aligned}$$

where \(w=e^{-j2\pi /N}\). Thus, the channel estimate, \(\hat{H}_\mathrm{eig} \), of \(H_\mathrm{eig}\) can be simply obtained by multiplying \(Y\) with \(X^{-1}\), in which \(X^{-1}\) is a known long preamble signal in the frequency domain. To obtain the estimated time domain channel response, \(\hat{H}\), we can insert an FFT and inverse FFT into \(\hat{H}_\mathrm{eig} \), i.e., \(F^H\hat{H}_\mathrm{eig} F\). Our LOS/NLOS identification method uses this time domain channel response. A simpler way to get \(\hat{H}\) is as follows. Define a column vector as

$$\begin{aligned} \hat{H}_\mathrm{eig}^\mathrm{vec} =\left[ {\hat{H}_\mathrm{eig} (0,0)\,\,\,\hat{H}_\mathrm{eig} (1,1)\ldots \hat{H}_\mathrm{eig} (N-1,N-1)} \right] ^T. \end{aligned}$$
(5)

By taking the inverse FFT at (5), we obtain a simplified channel impulse response, \(\hat{h}_\mathrm{eig}^\mathrm{vec} \), as \(\hat{h}_\mathrm{eig}^\mathrm{vec} =F^H\hat{H}_\mathrm{eig}^\mathrm{vec} \). We can write \(\hat{h}_\mathrm{eig}^\mathrm{vec} \) as

$$\begin{aligned} \hat{h}_\mathrm{eig}^\mathrm{vec} =F^H\hat{H}_\mathrm{eig} {\mathbf{1}}=F^HF\hat{H}F^H{\mathbf{1}}=\hat{H}F^H{\mathbf{1}} \end{aligned}$$

where \({\mathbf{1}}=\left[ {{\begin{array}{l@{\quad }l@{\quad }l} 1 &{} \ldots &{} 1 \\ \end{array} }} \right] ^T\). This can be written as

$$\begin{aligned} \hat{h}_\mathrm{eig}^\mathrm{vec} =N\left[ {{\begin{array}{l@{\quad }l@{\quad }l@{\quad }l} {\hat{h}_0 } &{} {\hat{h}_1 } &{} \ldots &{} {\hat{h}_{N-1} } \\ \end{array} }} \right] ^T. \end{aligned}$$
(6)

Equation (6) shows that \(\hat{h}_\mathrm{eig}^\mathrm{vec} \) is the scaled version of the first column of \(\hat{H}\). We call (6) a simplified channel impulse response, which is used for LOS/NLOS identification in our method, a block diagram of which is depicted in Fig. 14.

Let \(P\) be a group of elements in \(\hat{h}_\mathrm{eig}^\mathrm{vec} \) that exceed the threshold \(h_\mathrm{thld} \), and \(P\) can then be written as

$$\begin{aligned} P=\{\hat{h}_i \vert \,\hat{h}_i >h_\mathrm{thld} \,,\,\,i=0,\ldots ,N-1\}=\{p_0 ,p_1 ,\ldots ,p_{M-1} \}. \end{aligned}$$

The dominant path of \(P\) is written as \(p_D =\max \{P\}\). We define a metric \(\sigma \) as \(\sigma =\sum \nolimits _{m=0,i\ne D}^{M-1} {p_i } \,/\,p_D \).

We then conduct a binary hypothesis test using two hypotheses, H\(_{0}\) and H\(_{1}\), which are defined as

$$\begin{aligned}&\text {H}_{0} : \sigma \ge \sigma _\mathrm{thld}, \text { NLOS}\\&\text {H}_{1} : \sigma <\sigma _\mathrm{thld}, \text { LOS} \end{aligned}$$

In our experiment, \(\sigma _\mathrm{thld} \) is set to 0.5; in this case, the magnitude of the dominant path is twice the sum of the magnitudes of the other paths. The value of \(h_\mathrm{thld} \) is set to the average of \(\hat{h}_\mathrm{eig}^\mathrm{vec} \), i.e., \(h_\mathrm{thld} =1/N\sum \nolimits _{i=0}^{N-1} {\hat{h}_i } \). By applying the above hypothesis test, the ToA estimation performance of our indoor experiment, of which setup is explained in the next section, is enhanced, as shown in Fig. 14, where serious ranging errors shown in Fig. 13 can be avoided. In the next section, the performance of this method for indoor/outdoor positioning is presented.

Fig. 14
figure 14

Histogram of indoor ToA estimation with LOS/NLOS identification

4 Experiments in indoor/outdoor ToA estimation

In the previous section, we presented a ToA estimation method for IEEE802.11 OFDM-PHY in the physical layer. The method consists of two parts: one is a range estimator and the other is a LOS/NLOS identifier. Figure 15 illustrates the layout of our indoor measurement location and measurement points. Three APs, A, B, and C, are set at the three fixed points, and a station moves along with the closed dashed line on which 19 points are selected for measuring the ToAs. Walls, indoor plants, and office furniture make a rich scattering channel environment in the measurement location, and are common items in office buildings. The horizontal axis is the \(x\)-axis, the vertical axis is the \(y\)-axis, and the AP C is set to the origin. A position is estimated every second by averaging the measurement results within each second. In this experiment, the measurement rate \(r_{m}\) is set to 10 Hz. Measurement data are acquired in 50 experimental campaigns. With no LOS/NLOS identification, the average positioning estimation errors of the 19 points are depicted in Fig. 16. In case of indoor positioning, serious errors can easily happen if the interior around a point is complex. In this experiment, four serious errors happen, where positioning errors are over 10 m at 2nd, 6th, 7th, and 8th points. Average positioning error over all the measurement points is 5.5 m. When the LOS/NLOS identification is applied, serious errors can be avoid, where all the positioning errors are within 10 m. Average positioning error over all the measurement points is also reduced to 3.4 m (Fig. 17). The 8th point, where the edge of a wall is near and there is no AP around there, has big scattering environment, thus the LOS/NLOS identification works at the point worse than other points. Characteristic of the positioning error distribution corresponding to various \(r_{m}\) is considered. In Fig. 18, the distribution of the position estimation at the 5th point is depicted for three different \(r_{m}\). The distribution for \(r_{m}= 5\) is similar to that for \(r_{m}=100\). Figure 19 shows the cumulative distribution function of the positioning errors of the 5th point according to \(r_{m}=5\), 10, 100. Ninety percent of the positioning errors are within 2 and 2.6 m for all \(r_{m}\). Thus, it can be said that this small measurement rate is suitable for real-time positioning applications.

Fig. 15
figure 15

Layout for indoor positioning test

Fig. 16
figure 16

Positioning error with no LOS/NLOS identification

Fig. 17
figure 17

Positioning error with LOS/NLOS identification

Fig. 18
figure 18

Distributions of position estimations: a \(r_m\) = 100, b \(r_m\) = 5

Fig. 19
figure 19

Cumulative distribution function of the positioning errors for three different \(r_m\) values

Outdoor positioning experiment is as follows. Soccer play ground is selected as the test site of which size is 111 \(\times \) 78 square meters as shown in Fig. 20. With the same when indoor experiment, three APs are used in the outdoor experiment. As similar to the indoor experiment, three APs are used and placed at the three corners of the test site. There are 52 measurement locations and they are marked as numbered circles. Estimated positions for the measurement locations are marked as diamonds, rectangles, triangles, and Xs. To enhance the visibility of Fig. 20, the estimated position marks are connected with dashed lines. The value of \(r_{m}\) is set to 5 in this experiment. LOS environment is guaranteed in the middle area of the test site, but the LOS environment gets worse at the border of the test site. The performance degradation at the border of the site can be reduced using the LOS/NLOS identification algorithm. Compared with the indoor experiments, significant positioning error rarely happens in the outdoor experiment. Average positioning error over the measurement points is 2.13 m, which is better than that of indoor experiment. Even if the outdoor environment, we had two serious positioning errors at the orange-colored 10th point and the blue-colored 2nd point as shown in Fig. 20a. These serious errors can be avoided using the LOS/NLOS identification algorithm as shown in Fig. 20b. With LOS/NLOS identification, the average positioning error over measurement points was reduced to 2.1 m.

Fig. 20
figure 20

Layout and estimation results for outdoor positioning: a with no LOS/NLOS identification, b with LOS/NLOS identification

5 Conclusions

WLAN is a popular wireless solution for various digital devices such as smart phones, tablet PCs, and notebooks. These devices are equipped with several sensors related to positioning estimation, such as GPS and digital compasses. Recently, WLAN itself has been used for the positioning estimation as its service area widens. However, the existing RSS-based WLAN positioning estimation is inaccurate and requires a number of RSS databases. Furthermore, it consistently requires many APs near the positioning point. In this paper, we presented a ranging method for ToA-based positioning estimation in the physical layer. Also, a LOS/NLOS identification method is presented to reduce the performance degradation due to a misdetection of the dominant path. The performance of our method is shown through indoor/outdoor experiments. Our method achieved about 2.5 m positioning errors on average at nearly real time; only 5 to 10 samples per second is sufficient for accurate performance. We also attained a performance enhancement using LOS/NLOS identification in a deterministic way differently from previous statistical approaches. Our work presented makes it possible to use WLAN as a ToA-based positioning system. We expect that the future indoor positioning system should adopt the combination of the ToA, RSS, and AoA for the state-of-the-art MIMO WLAN. Thus, our future work will focus on how accurate indoor positioning can be achieved by the combination technology.