1 Introduction

In recent years, the Internet of Things (IoT) has experienced remarkable growth. Within the realm of emerging smart rail systems, the integration of IoT and 5G has opened up new possibilities for traffic management and transportation systems [1]. By integrating advanced positioning technologies into smart rail systems, we can achieve real-time train and pedestrian tracking, optimize traffic flow, and enhance transportation efficiency. This not only helps alleviate traffic congestion but also improves road safety [2].

The effectiveness of smart rail systems relies on precise positioning and real-time monitoring of spatial information. Advanced positioning technologies provide a solid foundation for smart rail systems, allowing rail operators to better understand passenger flow, train movement, and resource utilization. Through continuous monitoring and data analysis, rail operators can devise more efficient operational strategies, ultimately enhancing the reliability and performance of smart rail systems [3].

Currently, the most prevalent positioning method is the Global Navigation Satellite System (GNSS). However, GNSS often encounters limitations in areas such as tunnels and urban canyons due to its limited coverage [4]. In the realm of 5G and emerging communication technologies, leveraging communication waves has emerged as a dependable alternative for determining user positions. This approach benefits from the expanding bandwidth available [5,6,7]. The increased bandwidth offers several advantages for precise time-based measurements, including Time of Arrival (TOA), Time Difference of Arrival (TDOA), and Round Trip Time (RTT) [8]. By operating at higher frequencies, shorter wavelengths become available, which enables the utilization of massive Multiple Input Multiple Output (MIMO) antennas and enhances angular resolution for angle-based measurements, such as Angle of Arrival (AOA) and Angle of Departure (AOD) [9]. These measurements can be harnessed to compute positioning solutions using methods such as trilateration, triangulation, or hybrid techniques. Although it’s worth noting that the coverage range of 5G Frequency Range 2 (FR2) is limited in some situations, ongoing efforts are focused on addressing this limitation through network enhancements, particularly via cell densification [10]. By increasing the number of cells, a continuous and more precise positioning solution can be achieved. Recently, line-of-sight (LOS) positioning is always studied. However, in many situations the LOS link is not stable, the usage of non-line-of-sight (NLOS) links is significant.

As urban buildings soar to greater heights and cities become increasingly crowded, the limitations of base stations (BS) emerge, unable to guarantee a Line-of-Sight (LOS) link for tracking mobile user equipment (UE). UE extends to all transportation participants, predominantly comprised of trains. Nevertheless, due to the scattering from unsmooth surfaces, the range and angle measurements between the UE and BS would be highly distorted, which may lead to significant positioning errors [11].

In this case, it is significant to obtain accurate positioning information such as AOA, AOD and TOA [12,13,14,15,16]. In [17], it conducted a study in the millimeter-wave frequency band, replicating three positioning methods based on received signal strength indicator (TOA, AOD and AOA). Their research demonstrated that employing AOA for positioning can yield good localization performance. For 5G ultra-dense networks, in [18], it investigated the relationship between random node distribution and TOA-based positioning performance, leading to the derivation of the Cramer-Rao lower bound (CRLB). In [19], it introduced an innovative ultra-dense network architecture that achieved sub-meter positioning accuracy. This accuracy was attained by estimating AOA values through linear arrays deployed on multiple nodes. Considering the characteristics of 5G massive antenna systems, shown in [20], it leveraged the improved angle estimation precision brought by massive MIMO to propose a direct AOA positioning method for both far-field and near-field scenarios, achieving sub-meter positioning performance. In the context of massive MIMO systems [21], it presented a TOA-based localization model that defines intersecting lines of identical delay profiles, utilizing local root mean square error as a new metric to evaluate positioning performance.

Several methods have been proposed to solve the problem of target tracking in NLOS environments as well, such as utilizing the hybrid of LOS and NLOS for tracking [22,23,24], multiple BS assisted tracking [25], and single BS tracking based on multiple paths [26, 27]. The example hybrid usage of LOS and NLOS channels is introduced in [24, 28], which uses NLOS paths assisted LOS channel to track UE and utilize enhanced Kalman Filter (EKF) for estimation. This kind of solution, although completing the task of tracking, is very limited due to the reliable of LOS channel and EKF algorithm, which need adjustment in different situation and hard to calculate. In [25], it proposed a multi-BS method. It assumes more than one BS can receive the scattered paths from the same UE. Analyzing information received in multi-BS, the error caused by scatters can be decreased. However, the exchange of information between multi-BS may bring heavy burden to communication system and this method have a serious delay in tracking. Single BS tracking method is used in paper [26]. To address the challenge posed by the time-varying nature of the channel, it introduces a two-state Kalman filter (KF) approach. The initial KF is responsible for estimating channel parameters such as AOA and AOD, while the second KF is dedicated to estimating the position of the UE. Although this method can improve the quality of tracking, the calculation needed is hard to meet and the parameter of KF is hard to adjust.

In this paper, we introduce a novel model assist the intelligent transportation system with one single BS to complete the tasks of NLOS sensing and tracking. Considering a scatter channel model in NLOS environments, we construct a geometric model which shows the relationship between BS, UE and each scattering points (SPs), including the information of AOA, AOD, TOA. To enhance positioning accuracy, we introduce a time bias and orientation to formulate a minimum error problem. Employing straightforward algorithms like the Newton-Raphson method, we can pinpoint the ideal intersection of each scattered path, consequently achieving precise positioning. Considering the mobile nature of UEs, we further address the challenge of continuous tracking using a single BS, leveraging our positioning data. Since the future moving states of UEs are expected to be predicted by the past moving states, a prediction algorithm for tracking is proposed to combine with the long short-term memory (LSTM) network and ordinary differential equation (ODE). After the output of hidden layer of LSTM network is dealt with by ODE, the final output of LSTM network, i.e. the predicted tracking can be obtained continuously instead of discretely [29]. Simulations verified that, compared with traditional KF or EKF, the proposed ODE-LSTM network shows better performance in nonlinear tracking.

Section 2 introduces a MIMO system for NLOS positioning in intelligent transportation. Section 3 describes how to obtain positioning information. Section 4 proposes our positioning and tracking method. The simulation results are shown in Sect. 4. Conclusion is drawn in Sect. 5.

2 System model

5G/B5G technology delivers faster data transmission and lower latency, enabling real-time processing of extensive traffic data in transportation systems, making the technology highly promising for the field of smart transportation.

In 5G/B5G communication system, MIMO system can be widely used at BS [30]. We consider a communication system where a single BS is outfitted with a linear array of transmit antennas, while the UE is equipped with a linear array of receive antennas (\(N_t\ge N_r\) ) [31]. We assume a L-scatterer channel while NLOS channel exists as shown in Fig. 1. The transmitted steering vector \(\alpha _t (\phi )\) and the received steering vector \(\alpha _r (\theta )\) can be given as [32]:

$$\begin{aligned}{} & {} {\varvec{a}}_t\left( \phi \right) \triangleq \frac{1}{\sqrt{N_t}}\left[ \begin{matrix} 1&{} e^{-j\pi \cos \phi }&{} \cdots &{} e^{-j\pi \left( N_t-1 \right) \cos \phi }\\ \end{matrix} \right] ^{\text {T}}, \end{aligned}$$
(1)
$$\begin{aligned}{} & {} {\varvec{a}}_r\left( \theta \right) \triangleq \frac{1}{\sqrt{N_r}}\left[ \begin{matrix} 1&{} e^{-j\pi \cos \theta }&{} \cdots &{} e^{-j\pi \left( N_r-1 \right) \cos \theta }\\ \end{matrix} \right] ^{\text {T}}, \end{aligned}$$
(2)

where \({ \phi _l }\) and \({ \theta _l}\) represent AODs and AOAs, respectively, for \({ l=1,\ldots ,L }\), and L represents the number of multipath components. Hence, the subcarrier n in transmitted channel matrix with \(N_r \times N_t\) channels can be written as:

$$\begin{aligned} {\textbf{H}} [n] = a_r \Gamma [n] a_t^H [n], \end{aligned}$$
(3)

where \(\Gamma [n]\) is a diagonal channel coefficient matrix which equals \(\begin{bmatrix} \gamma _0&\cdots&\gamma _{L-1} \end{bmatrix}\) and the k-th element can be defined as:

$$\begin{aligned} \gamma _l = \sqrt{N_t N_r}\frac{h_l}{\sqrt{\eta _l}} e^{-j2\pi \tau _l /(NT_s)}, \end{aligned}$$
(4)

where \(h_l\), \(\eta _l\) and \(\tau _l\) represent the channel coefficient, path loss coefficient, and TOA of the l-th path, respectively [33].

Fig. 1
figure 1

Scatterer channel model in L paths NLOS environment for emerging smart rail systems

For convenience, we divide AOD and AOA into rectangular components, in which \(\phi _{l,h}, \phi _{l,v}\) represent horizontal component and vertical component of AOD, respectively, and \(\theta _{l,h}\) \(, \theta _{l,v}\) represent horizontal component and vertical component of AOA, respectively.

With the channel model above, we assume the number of transmit antennas \(N_{t}\) equals with receive antennas \(N_{r}\). Hence, the received signal is clear:

$$\begin{aligned} y\left( t \right) ={\varvec{W}}^{{\varvec{H}}}\sum _{l=0}^L{h_l}{\varvec{a}}_r\left( \theta _l \right) {\varvec{a}}_{t}^{H}\left( \phi _l \right) s\left( t-\tau _l \right) +n\left( t \right) , \end{aligned}$$
(5)

where \({\varvec{W}}^{{\varvec{H}}}\) represents the combining matrix, \(h_l\) means the complex path gain, \(s\left( t \right)\) is a transmitted signal, \(n\left( t \right)\) is an additional Gaussian noise with zero mean. The information of each NLOS path can be solved at BS by analyzing signal \(y\left( t \right)\) received.

3 Channel parameter estimation

In this section, we will focus on the estimation of channel parameters. Our methodology for estimating AOA, AOD, and TOA is based on compressed sensing (CS) principles, as detailed in [34]. By scrutinizing the received signal, we effectively convert the parameter estimation challenge into a CS problem.

CS is a signal processing technique that enables the recovery of sparse signals from a limited number of measurements, even in cases where the measurements are incomplete or contaminated by noise. In the context of channel parameter estimation, CS helps to estimate the AOA, AOD, and TOA efficiently and accurately.

To solve the CS problem for channel parameter estimation, we utilize the Distributed Compressed Sensing (DCS) method [35]. This technique enhances the efficiency of solving the CS problem by distributing the computation among multiple nodes or processing units. As a result, we can obtain the AOA, AOD, and TOA of each signal path in the channel.

By employing CS technique and leveraging DCS methodology, we can enhance the precision of estimating channel parameters such as AOA, AOD, and TOA, while reducing computational complexity.

The received signal for the n-th OFDM symbol and g-th subcarrier can be transformed using the Fast Fourier Transform (FFT) as follows:

$$\begin{aligned} y_g[n] = {\textbf{H}}[n]{\textbf{F}}_g[n]{\textbf{x}}_g[n]+{\textbf{n}}_g[n], \end{aligned}$$
(6)

where \({\textbf{n}}_g\) is zero mean complex Gaussian noise and \({\textbf{F}}_g\) is a beamforming matrix. We aim to solve channel parameters and further propose an estimator for more accurate positioning.

3.1 Beamspace channel representation

To transform the NLOS channel into a proper angular dimension, a pair of transformation matrix is introduced as \(\mathbf {U_{tx}}\) and \(\mathbf {U_{rx}}\), consisted by \(N_t \times N_t\) and \(N_r \times N_r\) respectively. Both of them are unitary matrices. Then, the NLOS channel can be given as:

$$\begin{aligned} {\textbf{H}}_\phi [n]&= \mathbf {U_{rx}}^H {\textbf{H}}[n] \mathbf {U_{tx}}, \end{aligned}$$
(7)
$$\begin{aligned} \mathbf {U_{rx}}&= [\mathbf {u_r}(-(N_t-1)/2),\ldots ,\mathbf {u_r}((N_r-1)/2)], \end{aligned}$$
(8)
$$\begin{aligned} \mathbf {u_{rx}}(n)&= [e^{-j2\pi \frac{N_t-1}{2}\frac{p}{N_r}},\ldots ,e^{j2\pi \frac{N_r-1}{2}\frac{p}{N_r}}], \end{aligned}$$
(9)

where \(\mathbf {U_{tx}}\) is similar to \(\mathbf {U_{rx}}\). p is a parameter. The partial virtual representation of the channel concerning the angular domain can be expressed as follows:

$$\begin{aligned} {\textbf{y}}_\phi&= \mathbf {\Omega } [n]{\textbf{h}}_\phi [n]+{\textbf{n}}_\phi [n], \end{aligned}$$
(10)
$$\begin{aligned} \mathbf {\Omega }[n]&= [\mathbf {\Omega _{0,n}},\ldots ,\mathbf {\Omega }_{G-1,n}], \end{aligned}$$
(11)
$$\begin{aligned} \mathbf {\Omega }_{g}[n]&= (\mathbf {T_t}^H{\textbf{F}}_g[n]{\textbf{x}}_g[n])^T\bigotimes \mathbf {U_r}, \end{aligned}$$
(12)
$$\begin{aligned} \mathbf {\check{h}}[n]&= \textrm{vec}(\mathbf {\check{H}} [n]). \end{aligned}$$
(13)

Hence, by solving (8) as a CS problem, positioning information can be achieved. The estimation of AOA/AOD is consistent to the columns of \(\mathbf {U_{tx}}\) and \(\mathbf {U_{rx}}\) ssponding to non-zero entries of the sparse vector \(\mathbf {\check{h}}[n]\).

3.2 Estimation of AOA and AOD

To tackle the CS problem for acquiring channel parameters \(\phi _{l}\) and \(\theta _{l}\), we employ the Distributed Compressed Sensing-Simultaneous Orthogonal Matching Pursuit (DCS-SOMP) method [36, 37]. The comprehensive steps of the DCS-SOMP approach are outlined in Algorithm 1. Given the uncertainty of the number of paths, this algorithm operates in a rank-blind fashion.

Thus, the fitting error at each iteration t can be given as \(\sum _{n=0}^{N-1}\Vert {\textbf{r}}_{m}[n]-{\textbf{r}}_{m-1}[n] \Vert _2 ^2\). We adjust the threshold \(\sigma\) according to the estimated signal noise ratio (SNR) [38].

According to [39], the iterate function of AOA and AOD can be given as:

$$\begin{aligned} {\hat{\phi }}_m=& \arcsin {\left( \frac{\lambda _c}{d_{ant}N_t}\left( q_{t,m}-\frac{N_t -1}{2}\right) \right) }, \end{aligned}$$
(14)
$$\begin{aligned} {\hat{\theta }}_m&= \arcsin {\left( \frac{\lambda _c}{d_{ant}N_r}\left( q_{r,m}-\frac{N_r -1}{2}\right) \right) }, \end{aligned}$$
(15)

where \(\lambda _c\) is equivalent to twice of the distance between antenna elements, resembling the wavelength of the n-th subcarrier. This helps to attain an initial estimate of AOA/AOD.

Algorithm 1
figure a

DCS-SOMP for estimation of AOA, AOD

3.3 Estimation of TOA

Based on deduction above, the channel can be obtained by performing QR factorization of mutilated basis \(\Omega _{L_m}[n] = [\omega _{\tilde{n1}[n],\ldots , \omega _{\tilde{n}{\hat{L}} +1 }}[n]] = \Upsilon [n]{\textbf{R}}[n]\), where \(\Upsilon [n] = [\rho _1[n],\ldots , \rho _{{\hat{L}} +1}[n]]\) and \({\textbf{R}}[n]\) is an upper triangular matrix. Therefore, the channel can be given as:

$$\begin{aligned} {\hat{\check{\textbf{h}}}}[n] = {\textbf{R}}^{-1}[n]\hat{\beta }_n. \end{aligned}$$
(16)

Thus, the set of \({\hat{\check{\textbf{h}_{l}}}}\) can be summarized by each subcarrier, which can be given as:

$$\begin{aligned} {\hat{\check{\textbf{h}_{\text {l}}}}} = [{\hat{\check{\textbf{h}_{\text {l}}}}}[0],\ldots ,{\hat{\check{\textbf{h}_{\text {l}}}}}[N-1]]. \end{aligned}$$
(17)

According to the analyzing above, we can also have:

$$\begin{aligned} {\hat{\check{\textbf{h}}}}_{l} = \tilde{h_l}{\textbf{a}}(\tau _l){\textbf{z}}_{l}+{\textbf{v}}_{(l)}, \end{aligned}$$
(18)

where

$$\begin{aligned} {\textbf{a}}(\tau _l)&= [1,\ldots , e^{-j2\pi (N-1)\tau _k/NT_s)}], \end{aligned}$$
(19)
$$\begin{aligned} z_l&= {\textbf{u}}_{rx}^H (\frac{n_{rx,l}-(N_r-1)/2-1}{N_r}){\textbf{a}}_{rx,n} ({\hat{\theta }} _{l}) {\textbf{a}}_{tx,n}^H(\phi _l){\textbf{u}}_{tx} (\frac{n_{tx,l}-(N_t-1)/2-1}{N_t}). \end{aligned}$$
(20)

Therefore, a least squares (LS) problem can be formed to approach \(\tau _l\) and \(h_l\) [40]. The objective function can be given as

$$\begin{aligned}{}[{\hat{\tau }}_l, \hat{\tilde{h_l}}] = \mathop {\arg \min }\limits _{\tau _l,\tilde{h_l}} \Vert \hat{\check{{\textbf{h}}_l} - \tilde{h_l} {z_l} \mathbf {a (\tau _l)\Vert ^2_2}} \quad . \end{aligned}$$
(21)

Thus, TOA can be simply solved as:

$$\begin{aligned} \hat{\tau }_l = \mathop {\arg \max }\limits _{\tau _l}|{\textbf{a}}^H(\tau _l){\hat{\check{\textbf{h}}_{l}}}|^2. \end{aligned}$$
(22)

4 Positioning and tracking method

4.1 UE positioning in NLOS environment

Having derived the positioning information through the channel parameter estimation method outlined earlier, the spatial interplay among the BS, SPs, and UE becomes apparent. This section endeavors to elucidate this spatial relationship in the context of positioning.

By leveraging the estimated channel parameters, such as AOA, AOD, and TOA, we can infer the spatial positions of the various entities within the wireless communication scenario. This approach enables us to delineate the precise spatial arrangement, contributing to a comprehensive understanding of the positioning dynamics in the system.

We assume a known position of BS, \(X_{BS}\in {\mathbb {R}}^3\). Each NLOS path corresponds a set of information, including the AOA, TOA and AOD. According to the information from channels, the vague relationship can be solved [41]. To improve the accuracy of positioning, we assume the position of UE and SP as \(X_{UE},X_{SP_l}\in {\mathbb {R}}^3\), with uncertain time bias as \(\text {T}\), unknown angle between UE’s orientation and the vertical as \(\alpha\). By considering these biases, an optimization problem of the UE position will be proposed.

First, the geometric relationship between BS, UE and SPs can be given as:

$$\begin{aligned}{} & {} TOA:\tau =\Vert X_{SP_l}-X_{BS} \Vert +\Vert X_{SP_l}-X_{UE} \Vert +T, \end{aligned}$$
(23)
$$\begin{aligned}{} & {} AOA:\left\{ \begin{array}{l} \theta _{l,h}=\pi +\arctan \left( y_{SP_l}-y,x_{SP_l}-x \right) -\alpha ,\\ \theta _{l,v}=\arcsin \left( \left( z_{SP_l}-z \right) /\Vert X_{SP_l}-X_{UE} \Vert \right) ,\\ \end{array} \right. \end{aligned}$$
(24)
$$\begin{aligned}{} & {} AOD:\left\{ \begin{array}{l} \phi _{l,h}=\arcsin \left( y_{SP_l},x_{SP_l} \right) ,\\ \phi _{l,v}=\arcsin \left( \left( z_{SP_l}-z_{BS} \right) /\Vert X_{SP_l}-X_{BS} \Vert \right) ,\\ \end{array} \right. \end{aligned}$$
(25)
$$\begin{aligned}{} & {} X_{SP_l}=\left[ x_{SP_l},y_{SP_l},z_{SP_l} \right] ,\end{aligned}$$
(26)
$$\begin{aligned}{} & {} X_{ UE}=\left[ x,y,z \right] ,\end{aligned}$$
(27)
$$\begin{aligned}{} & {} X_{BS}= \left[ x_{BS},y_{BS},z_{BS} \right] . \end{aligned}$$
(28)

Since the AOA, AOD and TOA with bias that help to decrease the positioning error are presented above, the line segment that \(SP_l\) lies in can be defined as:

$$\begin{aligned} L_{SP_l}=X_{BS}+\left( \tau _l-T \right) \left[ \begin{array}{c} \cos \phi _{l,v}\cos \phi _{l,h}\\ \cos \phi _{l,v}\sin \phi _{l,h}\\ \sin \phi _{l,v}\\ \end{array} \right] .\end{aligned}$$
(29)

The line segment which UE lies on can also be defined as:

$$\begin{aligned} L_{UE}=X_{BS}+\left( \tau _l-T \right) \left[ \begin{array}{c} \cos \theta _{l,v}\cos \left( \theta _{l,h}+\alpha -\pi \right) \\ \cos \theta _{l,v}\sin \left( \theta _{l,h}+\alpha -\pi \right) \\ \sin \theta _{l,v}\\ \end{array} \right] .\end{aligned}$$
(30)

The geometric model in horizontal plane is shown in Fig. 2. The relationship between BS, SP and UE in each path can be clear [42].

Fig. 2
figure 2

The relationship between each points in each NLOS path in smart rail systems

In practice, owing to the inherent imprecision associated with AOAs, AODs, and path lengths, it’s possible that each path may not converge precisely at the same point. To achieve the position of UE more accurately, the error metric can be defined by the distance between each line to UE:

$$\begin{aligned} \varepsilon \left( \alpha ,T \right) =\frac{1}{L\left( L-1 \right) }\sum _{l=1}^L{\sum _{l'\ge l}{d_l}},\end{aligned}$$
(31)

where \(d_l\) means the distance between the estimated UE position to the l-th line defined above.

Hence, the estimation of UE position can be formulated as an optimization problem with the uncertain time bias T and the orientation \(\alpha\). The objective function can be formed below and the best guess of \(\left( \alpha ,T \right)\) should be:

$$\begin{aligned} \left( \alpha _{UE},T_{UE} \right) =\text {arg}\min _{\left( \alpha ,T \right) }\varepsilon \left( \alpha ,T \right) ,\end{aligned}$$
(32)

where the minimum of \(\varepsilon \left( \alpha ,T \right)\) can be found by setting the gradient with respect to \(\alpha\) and T, which means the best guess of true position of UE.

Briefly, based on linear equations which contain the position information of UE and SPs, we enumerate an optimistic guess of the true position of UE. The optimal problem could be solved by simple ways, such as Newtown method.

4.2 UE tracking and moving prediction

Based on the accurate position estimation above, it is essential to track the UE. However, in typical scenarios, the UE is not stationary and may move over time. Tracking the UE’s movement allows us to predict its future positions and grasp its trajectory. One common approach for tracking is to use LSTM network, which are well-suited for sequential data analysis. However, it’s worth noting that LSTM network can only generate discrete outputs and might not directly provide continuous predictions of UE’s future positions.

To overcome this limitation and achieve uninterrupted predictions of the UE’s movement in various time slots, this paper employs an ODE derivation solver. By leveraging the ODE derivation solver, we can represent the UE’s motion as a continuous function over time, thereby ensuring a seamless and accurately modeled trajectory. This approach enhances our ability to capture the dynamic nature of the UE’s movements, contributing to more robust and realistic predictions.

The ODE derivation solver takes the initial position of the UE, along with the direction and speed derived from previous position estimates as input for the next iteration. By solving the ODEs, it can predict the UE’s future positions and velocities at any desired time slot. By combining the accurate position estimation with the ODE derivation solver for tracking, it can effectively predict the movement of the UE over time, enabling a better understanding of its trajectory and improving the overall tracking performance. This approach ensures that the tracking predictions are not limited to discrete time steps and provide a more continuous representation of the UE’s motion.

We define the UE moving state at time t as:

$$\begin{aligned} L\left( t \right) =\left[ \begin{matrix} x\left( t \right) &{} y\left( t \right) &{} z\left( t \right) &{} \gamma \left( t \right) \\ \end{matrix} \right] ^{\text {T}},\end{aligned}$$
(33)

where \(x\left( t \right)\), \(y\left( t \right)\), \(z\left( t \right)\) represent UE’s position. \(\gamma \left( t \right)\) is the orientation of the UE at time instant t. In our proposed algorithm, the tracking system input equals moving states \(L\left( t \right)\) at time t, and the output will be continuous moving states \(L^*\left( t \right)\). Specific algorithm will be described below.

4.2.1 ODE-LSTM architecture

Fig. 3
figure 3

a Hidden states on LSTM architecture. b Flowchart of proposed deep learning model based on ODE-LSTM architecture

To complete moving prediction at arbitrary instant, we propose an ODE-LSTM architecture by inserting an ODE derivation solver after hidden layer in LSTM network. In Fig. 3, it can be observed that a conventional LSTM cell is responsible for computing the hidden states of UE motion state during the process of obtaining new received motion vectors. To capture the hidden state trajectories, an ODE derivation solver is employed between LSTM processing steps. A simple LSTM cell should be defined by a set of state vectors \(\{c(t_n), h(t_n)\}\), representing the memory cell and the hidden state, respectively. The purpose of \(c(t_n)\) is to endow the LSTM with the capability to capture long-term regularity of changing, while \(h(t_n)\) enables the LSTM to adjust nonlinear statistics by incorporating discrete sampling regularly.

We manage an ODE derivation solver to calculate and reflect the evolution process of the hidden state \(h\left( t_n \right)\), which can help to overcome the shortage of LSTM network that can only obtain discrete data. A problem of ODE initial value can be formulated as:

$$\begin{aligned} \frac{\text {d}h\left( t \right) }{\text {d}t}=f_{\theta }\left( h\left( t \right) ,t \right) \quad \text {with}\quad h_0=h\left( t_n \right) ,\end{aligned}$$
(34)

where f represents the dynamics of hidden state and \(\theta\) represents the weights of fitted neural network, while the output state of the predicted position at the n-th time instant, denoted as \(h(t_n)\), is set equal to the initial value \(h_0\) in the ODE.

Combining simple calculation cells in LSTM with ODE derivation solver, the hidden state information could be solved at arbitrary instant:

$$\begin{aligned} \left( c\left( t_n \right) ,h\left( t_n \right) \right)= & {} \text {LSTM}\left( \left( c\left( t_{n-1} \right) ,h\left( t_{n-1} \right) \right) ,s_n \right) , \end{aligned}$$
(35)
$$\begin{aligned} h\left( {\bar{t}} \right)&= \text {ODESOLVE}\left( f_{\theta },h\left( t_n \right) ,{\bar{\tau }} \right) , \end{aligned}$$
(36)

where \(s_n\) represents the input feature vector at the n-th time instant. As depicted by the equation above, precise UE positions at any given time instant can be predicted based on the corresponding hidden state.

4.2.2 Prediction model

As depicted in the Fig. 3, the proposed ODE-LSTM architecture incorporates a scheduled batch normalization (BN) layer that operates on the moving state at the n-th time instant. This BN layer effectively differentiates and normalizes the raw statistics. In addition, the conventional neural network and pooling layers are utilized for extracting preliminary features \(s_n\). LSTM cells can update the states \(\{c\left( t_n \right) ,h\left( t_n \right) \}\) based on preliminary features \(s_n\) and the latest state vector \(\{\text {(}c\left( t_{n-1} \right) .h\left( t_{n-1} \right) \}\). Furthermore, in order to acquire the hidden state value at any given time t, the ODE derivation solver utilizes the most recent hidden state value \(h(t_n)\) as the initial value for the ODE. Subsequently, it solves out the normalized prediction time \(\tau\) indicating the passage of time. In more explicit terms, the ODE-LSTM architecture incorporates a dedicated ODE derivation solver comprising fully connected (FC) layers tasked with approximating the derivative function \(f\left( h(t), t\right)\). Additionally, an integrator component is incorporated into the ODE derivation solver, responsible for accumulating the values of the derivative function over discrete time intervals ranging from 0 to \(\tau\), thereby effectively approximating the hidden state h(t). This cumulative process plays a crucial role in modeling the temporal dynamics and behavior of the estimation system under investigation.

Algorithm 2
figure b

ODE-LSTM Assisted Position Prediction

Following the ODE-LSTM architecture, the hidden state statistic transforms to candidate transmit states through FC layer. Subsequently, a softmax activation layer is employed to transform the output of FC layer into a set of probability values through normalization. The output can be given as:

$$\begin{aligned} {\hat{\varvec{o}}}\left( {\bar{t}} \right) =\text {Soft}\max \left( {\varvec{W}}_{{\varvec{o}}}h\left( {\bar{t}} \right) +{\varvec{b}}_{{\varvec{o}}} \right) , \end{aligned}$$
(37)

where \({\hat{\varvec{o}}}\left( t \right) =\left[ \begin{array}{llll} \hat{o}_1\left( {\bar{t}} \right) &{} \hat{o}_2\left( {\bar{t}} \right) &{} \cdots &{} \hat{o}_Q\left( {\bar{t}} \right) \\ \end{array} \right]\) represents each probability of the candidate position, \({\varvec{W}}_{{\varvec{o}}}\) and \({\varvec{b}}_{{\varvec{o}}}\) denote the weighs and bias of the FC layer, respectively.

The optimal estimated position can be selected by the probability vector. The selected index can be written as:

$$\begin{aligned} \hat{L}^{*}\left( t \right) =\text {arg}\mathop {\arg \max }\limits _{L'\in \{1,2,\ldots ,Q\}}\hat{o}_q\left( {\bar{t}} \right) . \end{aligned}$$
(38)

In short, we proposed an ODE-LSTM algorithm model to solve the continuous time prediction. The total moving prediction algorithm can be summarized in Algorithm 2 above, with predict system’s input of moving states \(L\left( t \right)\) and output of continuous moving states \(L^*\left( t \right)\).

5 Simulations

This section demonstrates the availability of the NLOS positioning and tracking in smart rail systems. We provide simulation results to highlight the effectiveness of the proposed algorithm. For simplicity, we assume that UEs are exclusively composed of trains, given that trains constitute a significant portion of transportation participants.

Fig. 4
figure 4

Flow Chart of Positioning and Tracking in NLOS Environment

The simulation is processed according to the method proposed in this paper, and the flow chart is shown in Fig. 4.

Fig. 5
figure 5

Scene of one single BS and UE, together with 5 SPs

Given the flexibility of the NLOS channel in transportation systems, we assume that the position of SPs is randomly distributed in simulation space, while BS is fixed at the point (0,0,30). Based on the proposed positioning algorithm, Fig. 5 shows an accurate performance in positioning SPs and UE. Further, we can analyze the influence of the number of SPs on the accuracy of positioning.

We tested the root mean square error (RMSE) of our positioning method with different number of channels. The result is shown in Fig. 6, and the statistics are shown in Table 1.

Table 1 RMSE with different number of SPs

It is obviously that an inadequate or excessive number of channels will result in significant errors in the process of positioning. On one hand, too few channels may deprive us of sufficient position information, which makes precise measurements at the meter-level to be a great challenge. On the other hand, an excessive number of channels incurs measurement errors,which leads to substantial inaccuracies.

Fig. 6
figure 6

RMSE with different number of NLOS paths in smart rail systems

To address this challenge effectively, we have determined that our model performs optimally with 5 to 7 channels. After careful consideration, we have chosen to focus on a 5-channel configuration with the strongest signal. This decision not only helps to simplify the calculations involved but also strikes a balance between owning enough position data and minimizing the measurement errors. In so doing, we can attain a more reliable and accurate position estimation.

Therefore, the simulation parameters can be listed in Table 2. We consider a transmitted wave with carrier frequency \(f_c = 60\textrm{GHz}\) and bandwidth \(B = 200\textrm{MHz}\). The number of transmit antennas, the same as receive antennas, equals to 32. BS is stable while UE may occur randomly around BS. Furthermore, an additional reflection loss of 5 dB is considered each NLOS path.

Table 2 Simulation parameters

The RSME of UE position estimation is shown in Fig. 7. Apart from the LOS scenario as one of the optimal positioning methods, we will evaluate three different positioning methods. In the first approach, five NLOS paths are considered as proposed in this paper. In the second case, we consider a scene with multi-BS assisted positioning. UE was positioned by identifying the different paths scattered to BSs from the same scatter. Finally, the last approach combines LOS and NLOS path received for positioning.

Fig. 7
figure 7

Estimation RMSE for the UE using different methods in smart rail systems

The accuracy of positioning is subject to fluctuations of NLOS paths due to the inherent instability of it, particularly in cases of poor SNR. Moreover, the presence of NLOS paths can even diminish the accuracy of LOS positioning. This decrease in accuracy is attributed to the introduction of additional unknown parameters, like scatter positions, which can disrupt the LOS measurements.

Despite the unstable nature of accuracy, our simulations demonstrate that the RMSE of the proposed positioning method closely approximates the accuracy achieved by combining LOS and NLOS paths. Notably, the additional NLOS information to the LOS path does not improve positioning accuracy. In some cases, it can even lead to worse accuracy. However, the proposed positioning algorithm achieves accuracy levels similar to the combined LOS and NLOS approach and its accuracy comes close to that of ideal LOS positioning scenario.

Comparatively, the multi-BS positioning method performs the worst among the approaches investigated. The inferior performance of this method can be attributed to various factors, including the complexities involved in identifying different scattered paths to multi-BS and the challenges in accurately estimating UE positions.

In summary, our proposed algorithm overcomes the challenges posed by NLOS paths and achieves accuracy levels that are competitive with the combination of LOS and NLOS approaches, while also outperforming the multiple BS positioning method. By adjusting the instabilities and complexities associated with NLOS paths, our method shows promising potential in achieving accurate positioning, even in challenging scenarios with limited SNR and uncertain SPs.

Further, we set the BS at \(x_{BS}=0; y_{BS}=0;z_{BS}=30\) and a train’s trajectory and the prediction from the proposed method are shown in Fig. 8.

Fig. 8
figure 8

Train’s trajectory and the estimated positions in smart rail systems

Fig. 9
figure 9

Prediction results in x (a) and y (b) components with different algorithm

In Fig. 9, it is observed that the KF performs poorly in tracking prediction due to the nonlinearity of the motion, resulting in a noticeable delay in accurately tracking the moving UE. Although the EKF can predict motion changes in a more timely manner, it introduces uncertainties and biases during tracking, making it difficult to adapt to different situations. The same result can also be seen in Table 3, the ODE-LSTM algorithm has better performance than the traditional tracking algorithm.

Table 3 RMSE of different algorithm

In contrast to other methods, the ODE-LSTM approach stands out as a highly effective and reliable technique for accurate moving prediction, with a performance improvement of at least 10%. Its remarkable predictive capabilities are not affected by external environmental factors. Furthermore, the computational complexity of the ODE-LSTM is similar to that of the EKF, while its predictive performance is superior.

The advantage of ODE-LSTM lies in its excellent handling of nonlinear motion patterns, enabling precise and real-time moving predictions. Unlike the EKF, ODE-LSTM avoids introducing uncertain biases during tracking, resulting in a more robust and dependable solution. Therefore, ODE-LSTM demonstrates great potential for moving prediction in dynamic scenarios, where its adaptability and accuracy play an important role in tracking applications.

6 Conclusions

In this paper, we present an innovative approach tailored for precise positioning and tracking within NLOS environments, with a particular emphasis on its application in smart rail systems. Our method enhances positioning accuracy by analyzing key parameters like AoA, AOD, TOA, and solving an optimal problem based on geometric relationships. Additionally, we employ an ODE-LSTM algorithm to enable continuous nonlinear tracking, outperforming traditional methods like KF and EKF. This advancement is crucial for smart rail systems, offering precise and timely tracking capabilities in dynamic rail environments, thereby enhancing operational efficiency and safety.