Introduction

The recent demand for advanced localization techniques in a range of sectors, including telecommunications, surveillance, and rescue operations, is driven by the proliferation of wireless communication systems and the increase of 5G network devices. The localisation process, which is an essential component of wireless communication, finds the actual physical location of signals or devices.

Localization allows for network security maximisation, distribution of resources, and improved network performance. Conventional methods depend on the Received Signal Strength Indicator (RSSI), Time Difference of Arrival (TDoA), Angle of Arrival (AoA), and Frequency of Arrival (FoA) for localization1,2,3. These have limitations, including environmental factors, noise, and interference, necessitating consistent and accurate methods.

The wireless localisation process in dynamic environments with accuracy needs is influenced by noise, interference, and multipath propagation. The irregularity of individual localisation metrics, such as RSSI, TDoA, and AoA, is the main problem in noisy or cluttered environments.

In applications where these measurements are sensitive to external conditions, including signal reflections, obstacles, and interference from other devices, substantial errors are possible4. Further, the quality of signal measurements gets degraded by environmental factors, such as temperature, weather, and object or human movement, limiting accurate localization5.

In the case of high-frequency transmissions in 5G, real-time signal processing or localisation presents a greater difficulty. For, real-time localisation accounts for fast data acquisition, processing, and analysis, which are computationally burdensome themselves, and are further affected by the pipeline delays in signal processing6.

There is a proliferation in the complexity of communication environments in highly populated metropolitan areas or industrial environments. The regular bouncing of signals from many surfaces generates multipath effects, and this affects the traditional localization accuracy7.

Due to the above challenges, the existing methods including RSSI-based localization, TDoA, AoA, and FoA, often fail in terms of accuracy in dynamic and noisy environments8,9,10. The traditional TDoA or AoA methods usually depend on a single type of measurement, which is insufficient in complex environments.

The increased sensitivity of RSSI-based localization in the surrounding environment or interference-induced signal strength generates significant position estimate errors11. Even if TDoA and AoA are strong, it is prone to errors in multipath propagation settings. Thus, to improve accuracy, there arises the need for a hybrid approach, which takes into account multiple measurements (TDoA, AoA, and FoA) in the form of a fused framework.

Such an approach should also implement Machine learning (ML)-based advanced signal processing methods12,13,14, which consider interference and noise to enhance the localization performance.

Major contributions of the work

The main objective of this work is to develop an advanced localization system for generating accurate position estimates in dynamic and noisy surroundings. The specific objectives include:

  • 1) To design and implement a real-time localization approach for signal acquisition and processing using HackRF One software-defined radios (SDRs).

  • 2) To combine multiple localization metrics (TDoA, AoA, and FoA) through fusion of Extended Neural Network (ENN) and Extended Kalman Filter (EKF).

  • 3) To evaluate the model on real-world scenarios such as 5G network localization under varying environmental conditions.

The novelty involves a unique combination of TDoA, AoA, and FoA using two advanced signal processing techniques viz., ENN and EKF. While conventional methods focus on basic data fusion approaches or individual localization, this proposed research aims to develop a fusion technique based on ENN and EKF respectively for noise reduction and data fusion.

This combination improves localization accuracy, mainly in challenging environments with high interference or noise levels. Another contribution involves the real-time data streaming from HackRF One SDR for continuous localization. This is processed using GNURadio and MATLAB. This setup is designed to handle high-frequency signals in real-time, making it suitable for modern communication networks like 5G.

Background

The research will focus on optimization strategies, hardware constraints, and cooperative localization techniques. So, this section presents the important research achievements in these areas.

5G localization schemes

Discovering 5G Network Strategies15 involves research works on deep learning (DL) to improve handover efficiency in wireless networks. This method allows a non-deterministic, self-learning network to dynamically change system policies, considering the past actions and reactions of channels and users.

The network receives two kinds of training: the first stage employs a supervised 3GPP model, and the second stage involves optimization. The optimizing stage aims to minimize undesired handovers by maintaining connection quality. This approach ensures that DL can restrict user movement in crowded network scenarios, thus maximizing network performance.

Two-way localization techniques in16uses Collaborative Localization Protocol (CLP) and the Round-Trip Localization Protocol (RLP). Using two rounds of transmissions between base stations (BS) and user equipment (UE), these systems allow the user position, thus allowing the localization. CLP runs better than RLP in mmWave21, where angular estimation is more important than temporal accuracy.

In satellite-based localization17 aimed at high-precision localization in open-sky scenarios using Real-Time Kinematics (RTK) based on the Global Navigation Satellite System (GNSS).

This simulates RTK localization errors using constellations based on GNSS. This provides approximating localization errors over a wide range and this increases their accuracy.

Cooperative localization18 uses a distributed optimization approach designed to split the computing process. Redefining cooperative localization as a constraint fulfillment issue and providing a distributed solution greatly reduces the processing burden while retaining a reasonable degree of localization accuracy. When computational resources are limited, this technique works well.

Behavior-based Clustering Method (BCM)19 provides an input to vehicle localization, where it investigates the link between vehicle behavior and the clustering of actions. Future vehicle positions are projected using the proposed Clustering-learning-based Long-term Predictive Localization (CLPL) system. It applies DL models to predict placements and long-term mobility by segmenting traffic roads, thus enabling efficient traffic control and mobility forecasts.

As per the study in20, in 5G scenarios, SDR requires the capability of localization systems that aim at extracting navigation from cellular 5G signals. This approach generated a range error standard deviation of 1.19 m.

The impact of hardware limits (HWIs) on localization accuracy21 shows that non-linearities in hardware components such as filters and power amplifiers cause the deterioration of signals.

The HWIs produced a drop in accuracy, necessitating the development of robust hardware solutions to offset the effects on the 5G localization performance.

Comparatively, in22 the Phase-difference-of-arrival (PDOA) system is evaluated with a time of arrival (TOA) system. Big receiver arrays of PDOA-based devices enabled narrowband signal localization, where it reduced the need for synchronization systems between transmitters and receivers. This approach shows the possibility to increase indoor localization accuracy through less complicated hardware configuration.

To improve the feature extraction from synchronizing signal block (SSB), the Hi-Loc indoor localization system in23 uses convolutional neural networks (CNNs) with bidirectional long-term memory (BiLSTM) layers. Hi-Loc uses hybrid DL (dual-attention mechanism) in densely populated indoor settings to increase the accuracy of indoor localization during field tests.

A ML-based approach for indoor localization was developed in24 using RSSI data from UE. To identify indoor users using a binary-classification problem, ML methods are used to predict user localizations. Sub-carrier Average (SA) technique, which is a ML-based conventional localization technique with channel compensation, showed the possibility of better accuracy.

This provides a consistent method to examine SNR for 5G transmissions in indoor positioning systems (IPS). The accuracy maintained the processing complexity, making a solution for the challenges related with 5G localization.

In25, the TOA estimation for an IPS composed of distributed 5G small cells was performed using an Iterative Adaptive Approach (IAA), which involves sequentially averaging over several successive sub-carriers, along with Orthogonal Frequency Division Multiplexing (OFDM) signals. This SA-based fast IAA (SA-FIAA) algorithm performed effectively and significantly decreased computational cost in real-world experiments.

A localization system, which is a combination of 5G/geomagnetism/visual-inertial odometry (VIO)26, culminated data sources with an Artificial Neural Network (ANN) to increase the indoor accuracy. In order to control the constraints of single-sensor localization and providing consistent global localization, a combination of 5G frequencies and geomagnetic signals is used.

The multi-path effects, rigid body joint localization, and environment sensing increases the localization accuracy. By exploiting signal reflections, this approach offered novel environmental sensing and increased the possibilities for using localization data for sensing.

A novel method in28 addresses the problems linked with AoA ambiguity in WiFi localization using both one-way and two-way WiFi Channel State Information (CSI). Using a two-way CSI, the study provides novel methods for combining the available coherent bandwidth and allowing a significant improvement in localization accuracy.

By resolving the AoA ambiguity and applying complexity reduction techniques, this localization reaches a median accuracy of 58 cm in multipath conditions and reduces the computational complexity by 98%.

In29, the 5G localization challenges are tackled by employing ToA measurements, and UE and base transceiver stations (BTS) deal with synchronization problems or imprecise localization. A Range-Weighted Majorization Minimization (RW-MM) approach increases the localization precision.

Then, a Robust Range-Weighted Semidefinite Relaxation (RRW-SDR) estimates the error covariance to enhance the localization process by lower bound. The study guided the identification of the ideal user-gNB geometrical localization, which improves the localization accuracy in 5G.

In30, a Kalman filter-based approach is used in GNSS- 5G for localization to achieve an increased localization accuracy. This technique constantly matches new scenario using adaptive step-size Kalman filtering. It applies a non-linear vehicle dynamic model using multi-frequency GNSS data and a strong stepwise fusion. This improves the localization even in uncertainties.

Finally, in31 indoor localization is done using Decision Tree Regressor (DTR) based algorithms. The tests carried out in indoor 5G/WiFi show that the neighborhood detection accuracy is enhanced due to the combination of Decision Tree (DT) with radio maps. At every map with restricted data, the combination of these technologies reveal improved accuracy.

Table 1 given below presents a summary of the 5G localization techniques discussed so far in this review of literature section.

Table 1 Summary of 5G localization techniques.

Considering the advancements in localization, various challenges remain and this involves attaining high accuracy in non-line-of-sight (NLoS) scenarios32,33,34,35, optimizing localization systems, and handling multipath effects under real-world constraints.

Methods

The proposed method integrates HackRF One SDR hardware with ENN and EKF to improve localization accuracy through real-time measurements and data fusion. The method follows a multi-step approach as illustrated in Fig. 1.

Fig. 1
figure 1

The Proposed 5G Localization Model.

Multi-Source localization in 5G

Initially, a 5G NR signal is generated using certain parameters, including a carrier frequency of f = 28 GHz with a sampling frequency fs of 30.72 MHz, 256 subcarriers, and a single slot with 14 symbols. The sensors are placed in a 3D space, which observes the arrival time, reception angle, and signal frequency.

The signal is expressed as:

$$s\left(t\right)=\mathit{exp}\left(j2\pi t\frac{f}{{f}_{s}}\right)$$
(1)

The TDOA for each sensor, source, and timestamp is computed as:

$${\tau }_{i,s}=\frac{{d}_{i,s}}{c}$$
(2)

where, di,s is the distance between the ith sensor and the sth source, and c = 3 × 108 m/s is the speed of light.

The AoA for each sensor, source, and timestamp is given by:

$${\phi }_{i,s}=\mathit{arctan}\left(\frac{{y}_{s}-{y}_{i}}{{x}_{s}-{x}_{i}}\right)$$
(3)

for azimuth, and:

$${\theta }_{i,s}=\mathit{arctan}\left(\frac{\sqrt{{\left({x}_{s}-{x}_{i}\right)}^{2}+{\left({y}_{s}-{y}_{i}\right)}^{2}}}{{z}_{s}-{z}_{i}}\right)$$
(4)

The FoA is calculated by:

$${f}_{i,s}=f\left(1+\frac{{d}_{i,s}}{c}\right)$$
(5)

Figure 2 provides the localization of sensors with its measurement based on single, multiple, and dynamic sources, carried out on each source to estimate its position over time based on cooperative measurements from all sensors: 1) a total of 8 sensors were positioned at various coordinates including (0, 0, 0), (0, 10, 0), (10, 0, 0), (10, 10, 0), (0, 0, 10), (0, 10, 10), (10, 0, 10), and (10, 10, 10) meters, with the source at (50, 50, 5) meters (Table 2); 2) 4 sensors were located at (0, 0), (0, 1), (1, 0), and (1, 1) meters, with the source placed at (5, 5) as illustrated in Fig. 2(a), and then the TDOA, AoA (both azimuth and elevation), and FoA were finally computed based on the sensor readings as in Table 2. This shows how the sensors contribute well on localizing the signals using mixed spatial/temporal data. 3) 8 sensors positioned at coordinates (0, 0, 0), (0, 10, 0), (10, 0, 0), (10, 10, 0), (0, 0, 10), (0, 10, 10), (10, 0, 10), and (10, 10, 10) meters, with four sources at user-defined positions were set up as illustrated in Fig. 2(b) and the measurements thereof are given in Table 3. Table 3 shows the observations from the multi-source localization, where the TDOA ranges between 88.98 and 488.98 ns across four different sources and there is a consistent FoA (28 GHz), and AoA over two azimuth and elevations. This result shows its capability of localization in handing multiple sources simultaneously, and providing a complete spatial–temporal localization. 4) 8 sensors positioned at coordinates (0, 0, 0), (0, 10, 0), (10, 0, 0), (10, 10, 0), (0, 0, 10), (0, 10, 10), (10, 0, 10), and (10, 10, 10) meters, with 4 dynamic sources at user-defined initial positions was set up as illustrated in Fig. 2(c) and the measurements thereof are given in Table 4. The dynamic positioning of real-time measurements as seen in Table 4 reveal smaller TDOA values, and slightly varying AoA and FoA. This shows the real-time dynamic localization achieved by adapting to source position changes with accurate angle and timing measurement.

Fig. 2
figure 2

3D Visualization of Sensor position/Source position with TDOA, AoA, and FoA Measurements (a) multi-source sensors (b) multi-source with user defined locations (c) Dynamic Multi-source.

Table 2 Localization Measurements with the source at (50, 50, 5) meters measured using TDOA, AoA and FoA in 5G NR.
Table 3 Multi-Source Localization Measurements with user defined localized sensors measured using TDOA, AoA and FoA in 5G NR.
Table 4 Real-Time Multi-Source Localization Measurements with 4 dynamic sources measured using TDOA, AoA and FoA in 5G NR.

Cooperative network modelling

The positions of the Ues and gNBs are defined in a 3D space and the positions of ith UE are given by:

$${{\varvec{p}}}_{i}^{UE}=\left({x}_{i},{y}_{i},{z}_{i}\right),i=\text{1,2},\dots ,{N}_{UE}$$
(6)

where, NUE is the number of UEs. The positions of the jth gNB are given by:

$${{\varvec{p}}}_{j}^{gNB}=\left({x}_{j},{y}_{j},{z}_{j}\right),j=\text{1,2},\dots ,{N}_{gNB}$$
(7)

where, NgNB is the number of gNBs.

The distance between the ith UE and the jth gNB is calculated as:

$${d}_{ij}=\Vert {{\varvec{p}}}_{i}^{UE}-{{\varvec{p}}}_{j}^{gNB}\Vert$$
(8)

For TDoA, the time delay measurement between two gNBs j and k for the ith UE is given by:

$$\Delta {t}_{ijk}=\frac{{d}_{ij}-{d}_{ik}}{c}$$
(9)

where, c is the speed of light.

The AoA measurement is given by the angle between the line connecting the UE and the gNB and the reference axis:

$${\theta }_{ij}=\mathit{arctan}\left(\frac{{y}_{i}-{y}_{j}}{{x}_{i}-{x}_{j}}\right)$$
(10)

The FoA measurement considers the frequency shift due to movement, calculated as:

$$\Delta {f}_{ij}=\frac{{d}_{ij}\cdot {f}_{c}}{c}$$
(11)

where, fc is the carrier frequency.

Algorithm 1
figure a

5G cooperative localization.

Dynamic multi-source localization with ENN

This dynamic multi-source localization is further improved using an ENN model to improve localization accuracy. ENN is trained on the collected TDOA, AoA, and FoA measurements to estimate the source positions. The multiple layers and their corresponding learning rate optimise the performance of identifying the source positions. It shows a similar observation as in Table 4.

The progress of ENN training, including Root Mean Squared Error (RMSE) and loss over several iterations, is shown in Fig. 3(a). The comparison of localization errors with the.

Fig. 3
figure 3

(a) ENN Training Progress (b) Comparison of Localization Errors for Neural Network and Benchmark Localization method.

conventional method shows a significant reduction in error, as in Fig. 3 (b).

The input features for the neural networks include the measurements from TDoA, AoA, and FoA. The target outputs are the true positions of the UEs.

$${\varvec{F}}=\left[\begin{array}{c}{{\varvec{T}}}_{TDOA}\\ {{\varvec{T}}}_{AOA}\\ {{\varvec{T}}}_{FOA}\end{array}\right]$$
(12)

where, T represents the measurement matrices for TDoA, AoA, and FoA.

The loss function minimized during training is the mean squared error between the predicted and actual positions:

$$L=\frac{1}{N}{\sum }_{i=1}^{N}{\Vert {\widehat{{\varvec{p}}}}_{i}-{{\varvec{p}}}_{i}\Vert }^{2}$$
(13)

where, \({\widehat{{\varvec{p}}}}_{i}\) the predicted position of the ith UE.

The estimated positions from each neural network are compared against the true positions. The mean and median errors for each localization method are calculated as follows:

$${e}_{mean}=\frac{1}{N}{\sum }_{i=1}^{N}\Vert {\widehat{{\varvec{p}}}}_{i}-{{\varvec{p}}}_{i}\Vert$$
(14)
$${e}_{med}=median\left(\Vert {\widehat{{\varvec{p}}}}_{i}-{{\varvec{p}}}_{i}\Vert \right)$$
(15)

Fusion of localization measurements in ENN

The input features for the neural network include TDoA, AoA, FoA measurements, and contextual data:

$${\mathbf{F}} = \, \left[ {{\mathbf{T}}_{{{\text{TDoA}}}} ,{\mathbf{T}}_{{{\text{AoA}}}} ,{\mathbf{T}}_{{{\text{FoA}}}} ,{\mathbf{C}}} \right]$$
(16)

The loss function minimized during training is the mean squared error between the predicted and actual positions. These are given in Fig. 4 (a,b,c,d,e,f,g) and defined in Eq. (12). The fusion of TDoA, AoA, FoA, and contextual data significantly improves the localization accuracy when compared to individual methods. The neural network effectively integrates diverse measurements and context, reducing the mean localization error to approximately 30.88 m, which is a substantial improvement as illustrated in Fig. 4(h) and 4(i).

Algorithm 2
figure b

Fusion-based localization algorithm.

Fig. 4
figure 4

Results of Localization.

The analysis revealed that the system maintained consistent performance across training, validation, and test datasets, with a mean error well below the acceptable threshold. The low values of the two metrics viz., standard deviation and maximum error, as presented in Table 5, further indicate the system’s reliability in various conditions.

Table 5 Summary of localization performance using ENN on various data split.

The training was completed with a significant reduction in error metrics as illustrated in Fig. 4, where the localization errors for each source are compared between the neural network and the traditional method. Thus, the mean localization error using the neural network is significantly reduced to 2.33 m. Further, the estimated positions from the fusion method are compared with those from individual methods and the actual UE positions. The results thereof are given in Table 6.

Table 6 Performance Comparison of Different Localization Methods.

Localization error reduction using extended kalman filtering (EKF)

To achieve cooperative localization, the localization of multiple signal sources is simulated using an array of sensors in a dynamic 5G NR environment. The localization measurements, including TDOA, AoA, and FoA, are combined with EKF, as shown in Fig. 5. The 5G NR signal is generated using 256 subcarriers, 14 symbols per slot, and a sampling frequency of 30.72 MHz at a carrier frequency of 28 GHz.

Fig. 5
figure 5

Localization Errors using EKF.

The sensor movement is then simulated over 100 timestamps, with each sensor’s position changing randomly within a specified range. The localization measurements are then estimated for each sensor. Finally, EKF is implemented for each source to estimate its position over time based on cooperative measurements from all sensors. Based on the position and velocity of an object relative to its previous state and input signals, the localization process is mathematically defined as:

$${{\varvec{H}}}_{k}={\left.\frac{\partial h\left({x}_{k},{u}_{k}\right)}{\partial {x}_{k}}\right|}_{{x}_{k}={x}_{k|k-1}}$$
(17)

where, Hk is the Jacobian matrix, and h(xk,uk) represents the measurement model.

Enhanced localization

Initially, the initial state estimate \({\widehat{{\varvec{x}}}}_{0}\) and error covariance P0 are defined, then the state transition model F and control input model B are set. The process noise covariance Q and observation noise covariance R are defined. At each time step k, the next state and error covariance are predicted.

The new data is measured and the Kalman Gain is computed. The state estimate and error covariance are updated based on the new measurement. The prediction step is performed using ENN, based on the uncertainty (error) of the position and velocity updated at each step. This is given in the equation below:

$${\widehat{{\varvec{x}}}}_{k|k-1}={\varvec{F}}{\widehat{{\varvec{x}}}}_{k-1|k-1}+{\varvec{B}}{u}_{k}$$
(18)

Real-world measurements are taken (from sensors) and the state estimate is adjusted based on how accurate those measurements are.

$${{\varvec{P}}}_{k|k-1}={\varvec{F}}{{\varvec{P}}}_{k-1|k-1}{{\varvec{F}}}^{T}+{\varvec{Q}}$$
(19)

The update step is then defined as follows:

$${{\varvec{K}}}_{k}={{\varvec{P}}}_{k|k-1}{{\varvec{H}}}^{T}{\left({\varvec{H}}{{\varvec{P}}}_{k|k-1}{{\varvec{H}}}^{T}+{\varvec{R}}\right)}^{-1}$$
(20)
$${\widehat{x}}_{k|k-1}={\widehat{x}}_{k|k-1}+{{\varvec{K}}}_{k}\left({z}_{k}-{\varvec{H}}{\widehat{x}}_{k|k-1}\right)$$
(21)

The best balance between predictions and measurements are calculated, ensuring that the final result is as accurate as possible.

$$P_{K\left| K \right.} \; = \left( {I - K_{K} H} \right)P_{{K\left| {K - 1} \right.}}$$
(22)

where,

xˆk|k−1 is the predicted state estimate, \({\widehat{x}}_{k|k-1}\) is the updated state estimate, Pk|k−1 is the predicted error covariance, Pk|k is the updated error covariance, Kk is the Kalman Gain, F is the state transition model, B is the control input model, uk is the control vector, Q is the process noise covariance, H is the observation model, R is the observation noise covariance, zk is the measurement vector, and I is the identity matrix.

Real-time 3D localization of sensor positions, true emitter positions, and EKF estimated positions at a given timestamp is shown in Fig. 6(a). A 3D TDOA emitter localization with multiple sensors is shown in in Fig. 6(b).

Fig. 6
figure 6

a) Real-time 3D localization of sensor positions, true emitter positions, and EKF estimated positions at a given timestamp b) A 3D TDOA emitter localization with multiple sensors c) A histogram of RMSE values across simulations d) The distribution of localization errors across X, Y, and Z coordinates for each simulation index e) The distribution of RMSE values over the X and Y coordinates f) Time series of RMSE values across simulations in g) A graph plotting between the estimated and true positions in X, Y, and Z coordinates h) a scatter plot of errors in X, Y, and Z coordinates.

A histogram of RMSE values across simulations is shown in Fig. 6(c). The distribution of localization errors across X, Y, and Z coordinates for each simulation index is given in Fig. 6(d). The distribution of RMSE values over the X and Y coordinates in Fig. 6(e). Time series of RMSE values across simulations in Fig. 6 (f). A graph plotting between the estimated and true positions in X, Y, and Z coordinates is presented in Fig. 6(g). Finally, a scatter plot of errors in X, Y, and Z coordinates is given in Fig. 6(h).

Figure 6 illustrates the localization accuracy using TDoA, AoA, and FoA techniques in conjunction with EKF-ENN fusion. The data highlights the significant reduction in localization error when applying the fusion method, showing its superiority over individual localization methods. This demonstrates the efficiency of combining multiple techniques for precise positioning in a 5G environment, offering insights into how different factors contribute to enhanced performance in dynamic scenarios.

Thus, the research employs HackRF One SDRs for signal transmission and reception, modeling the transmitted signal and received signal with noise. The system uses TDoA, AoA, and FoA for localization, while noise reduction is achieved through EKF. The ENN model predicts the signal source’s position. Offline and real-time signal processing are compared, with real-time EKF-ENN fusion applied to 5G signals, enhancing localization accuracy and system performance.

Hardware implementation

The proposed ENN-based fusion method is compared against traditional localization techniques such as individual TDoA, AoA, and FoA measurements, and basic data fusion methods. In particular, EKF is compared to standard Kalman filtering for noise reduction and localization accuracy.

1) For simulations, MATLAB and Python are used for advanced data processing, visualization, and machine learning implementation. MATLAB is primarily utilized for signal analysis and visualization, particularly for generating AoA, FoA, and TDoA measurements, while Python is employed for data preprocessing, ENN modeling, and performance evaluation. The experimental setup also involves two computers: one for signal transmission and another for signal reception and analysis, each equipped with Intel i7 processors, 16 GB of RAM, and running Windows OS to support GNURadio and SDR processing. 2) The hardware implementation focuses on continuous measurement of FoA, AoA, and RSSI using live data streaming from a HackRF One SDR. The experimental setup utilizes a HackRF One for signal acquisition and is configured to stream I/Q data continuously. A GNURadio flow graph is then used to process the data from SDR and stream it to a named pipe, where the flow graph consists of the following blocks: osmocom Source (HackRF One), Complex to Float, and File Sink (to named pipe).

Enhanced HackRF-based ENN cooperative localization

HackRF is utilized for the localization using ENN + fusion of accurate measurements to improve its localization accuracy. The estimated positions from the fusion are compared with individual methods from the actual UE positions. This involves two different setups for fusion:

FoA, AoA and RSSI fused measurement

The hardware experimentation involves the following key steps: 1) continuous data acquisition from the HackRF One through named pipe, 2) real-time processing of IQ data to estimate FoA, AoA, and RSSI, 3) Dynamic measurement visualization (Fig. 7) and data logging for further analysis.

Fig. 7
figure 7

Real-time visualization of Frequency Spectrum including FoA, AoA, and RSSI measurements.

FoA Estimation: The FoA is estimated using the Fast Fourier Transform (FFT) of the received signal:

$$X\left(f\right)=\underset{f}{argmax}\left|{\sum }_{n=0}^{N-1}x[n]\cdot {e}^{-j\frac{2\pi }{N}fn}\right|,\hspace{1em}f=\text{0,1},2,\dots ,N-1$$
(23)

where, x[n] is the received signal and X(f) is its frequency domain representation.

AoA Estimation: For this simulation, AoA is estimated based on the RSSI values at different angles:

$$\theta =20{\mathit{log}}_{10}\left(\frac{1}{N}{\sum }_{n=1}^{N}{\left|x\left[n\right]\right|}^{2}\right)+\eta \left(\theta \right)$$
(24)

where, θ is the angle, N is the number of samples, and η(θ) is a noise term simulating antenna pattern and environmental effects.

RSSI Estimation: The RSSI is calculated using the below given equation:

$$S=10log{}_{10}\left(\frac{1}{N}{\sum }_{n=1}^{N}|x[n]{|}^{2}\right)$$
(25)
Algorithm 3
figure c

Real-time FoA, AoA, and RSSI.

This experimentation shows the real-time approach to signal classification in localization. The FoA, AoA, and RSSI measurement offers dynamic signal environment, where FoA estimation allows for the identification of primary frequency components in the signal being received and this is crucial for classifying it between different emitters or understanding frequency drift.

Further, AoA visualization simulated in real-time in this setup shows the obtained directional information. It involves physical antenna (or an antenna array) rotation. Finally, RSSI time series provide data of signal strength variations over time and this is indicative of emitter movement, environmental changes, or interference.

FoA, AoA and TDoA fused measurement

The research further involves antennas for signal reception, GNU Radio [Fig. 8(e)] for signal processing and MATLAB for data analysis. It uses HackRF for localization through TDoA, AoA, and FoA measurements and the HackRF devices capture the RF signals. TDoA is estimated by determining the time difference between signals received at different antennas.

Fig. 8
figure 8

Real-time analysis with TDoA measurement on Fusion Localization (a) Real-Time Spectrum from HackRF 1 and HackRF 2, (b) Real-Time AoA- ENN Fusion Localization, (c) Real-Time Spectrum from HackRF 1 and HackRF 2, (d) Real-Time AoA.

Using the phase difference between signals, AoA is estimated, and by measuring the frequency shift thereof, the FoA is determined. Finally, the values of TDoA, AoA, and FoA are combined to estimate the position of the signal source.

The results of the experiment include real-time TDoA measurements for the MATLAB command window output. Real-time Spectrum from HackRF 1 and HackRF 2 is presented in Fig. 8(a). Real-Time AoA- ENN Fusion Localization is presented in Fig. 8(b). The observed average power level is − 35.8 dBfs, which indicate the received signal strength with a sample rate of 2 MHz and a center frequency of 2.4 GHz.

A 4.0 MiB/second data transfer rate is achieved, where TDoA is calculated based on the time difference of the received signals at different antennas. The observed average power level and data transfer rate indicate the effectiveness of the HackRF setup in capturing and analyzing signals.

The experiment thus shows that the HackRF based localization for TDoA, AoA, and FoA measurements with MATLAB and GNU Radio tools provide a proposed framework for signal processing and data analysis.

Figure 8(c) and Fig. 8(d) illustrates how ENN is used for advanced signal processing and data fusion to combine measurements. Training ENN predicts the position based on fusion of TDOA, AoA, and FoA measurements. The combination of multiple measurements improves the accuracy, while the processed and fused data using ENN enables determining the signal source position.

The spectrum analysis from both HackRF devices shows the magnitude of captured signal. Its ENN localization results given in Fig. 9(a) and the fused position estimates in Fig. 9(b) show the improved accuracy w.r.t the combined results given in Fig. 9(c).

Fig. 9
figure 9

ENN Localization (a) ENN Fusion Localization on Predicted Position (b) Fused Position Estimates and (c) Combined Localization Results.

Figure 10 presents a comparison of the MSE for the various methods tested, specifically focusing on the performance of the EKF-ENN fusion method with HackRF in 5G environments. The results clearly show that the fusion method leads to the lowest MSE, indicating a more accurate and stable localization system. The data suggests that integrating signal processing and prediction models can significantly improve the reliability of localization in real-time applications.

Fig. 10
figure 10

Performance Assessment in Matlab (a) Best Validation (b) Gradient Descent and Other Parameters (c) Error Histogram with 20 Bins.

The validation performance is given in Fig. 10(a) and gradient descent plots illustrating the training of ENN are presented in Fig. 10(b). The error histogram given in Fig. 10(c) shows the localization errors distribution with significant improvements in localization accuracy using ENN and data fusion.

HackRF-localization with python data analysis

A Python interface is utilized for enhanced data analysis and preprocessing of data from two HackRF devices-based experiments. Localization accuracy is improved by integrating Python for advanced data processing and analysis. The setup includes HackRF devices for signal reception, and python scripts for data processing and analysis. Further, GNU Radio is used for signal processing (as given in Fig. 11) and MATLAB provides advanced visualization.

Fig. 11
figure 11

GNU Radio Flow Graph.

Mathematical modeling

The mathematical model of ENN is modified w.r.t the above conditions as in:

$${\mathbf{y}} = g\left( {{\mathbf{W}}_{{3}} g\left( {{\mathbf{W}}_{{2}} g\left( {{\mathbf{W}}_{{1}} {\mathbf{x}} + {\mathbf{b}}_{{1}} } \right) \, + {\mathbf{b}}_{{2}} } \right) \, + {\mathbf{b}}_{{3}} } \right)$$
(26)

where, x is the input data vector; W1, W2, W3 are the weight matrices; b1, b2, b3 are the bias vectors; g is the ReLU activation function; and y is the output estimate.

The spectrum analysis from both HackRF devices show the captured signal magnitudes as in Fig. 12(a) and (b), and the real-time measurement of AoA is given in Fig. 12(c). The position estimates from multiple sources were fused using the weighted average method to reduce error. Localization results using ENN and fused position estimates given respectively in in Fig. 12(d) and (e), show the improved accuracy.

Fig. 12
figure 12

Hack RF Signal.

The corresponding error histogram of the fused position estimates can be viewed in Fig. 12(g) The data stored in a csv file is further analyzed to understand the localization performance. The summary of the analysis is provided in Table 5. Thus, the Python scripts enhances the data processing capabilities and provides a detailed analysis of the localization results.

Performance evaluation

In this section, the signal transmission and reception performance using HackRF One SDRs is analyzed. The experiment involves transmitting a signal using a signal source and receiving it using another HackRF device. The signal transmission and reception process can be mathematically modeled as below.

$${\text{S}}\left( {\text{t}} \right) \, = {\text{ A }}\cdot{\text{ cos}}\left( {{2}\pi {\text{fct }} + \, \phi } \right)$$
(27)

where, S(t) is the transmitted signal, A is the amplitude, fc is the carrier frequency, t is time, and ϕ is the phase.

The received signal can be represented as:

$${\text{R}}\left( {\text{t}} \right) \, = {\text{ S}}\left( {\text{t}} \right) \, + {\text{ N }}\left( {\text{t}} \right)$$
(28)

where, R(t) is the received signal, and N (t) is the noise.

The frequency domain analysis shows the presence of the transmitted signal at the expected frequency as in Fig. 13(a) and (b). The time domain analysis viewed in Fig. 13 (c) and (d) confirm the received signal’s consistency over time. The SNR calculation indicates the quality of the received signal under the current experimental setup. The amplitude of the received signal matches the expected value, confirming the successful transmission and reception of the signal.

Fig. 13
figure 13figure 13

Localization Results.

In Fig. 13(e), the ENN shows a high accuracy in predicting the signal source position based on the MSE. AoA, TDoA and FoA estimates align with the ground truth values, indicating the reliability of the model. The performance evaluation presented in Table 7 highlights the capability of ENN to generalize well on unseen data, making it suitable for real-time localization applications.

Table 7 Statistical Analysis.

To improve the localization accuracy, EKF is used. For, it is an optimal recursive data processing algorithm that estimates the state of a dynamic system from a series of incomplete and noisy measurements.

The results in Fig. 14 show how the application of EKF enhances the localization accuracy with HackRF and ENN. The data analysis using EKF provides more accurate localization results with reduced errors. The localization analysis with Kalman filtering is illustrated in Table 8.

Fig. 14
figure 14

Results of HackRF on EKF application.

Table 8 Localization Analysis with Kalman Filtering.

Analysis on offline FoA/AoA from captured IQ data

Offline Captured data focuses on post-processing of IQ data to estimate FoA and AoA. Here, the data is processed in offline manner, where it initially loads IQ data captured by the HackRF One. It is then processed to estimate Peak frequency (FoA) using spectral analysis. Finally, AoA estimation is simulated based on RSSI values at different angles.

This offline analysis (which is viewed in Fig. 15) provides a detailed overview of the captured IQ signal’s spectral classification and directional properties. The FoA estimation allows for precise identification of the signal’s frequency components, vital for signal classification, and emitter identification.

Fig. 15
figure 15

Offline analysis of Frequency Spectrum, AoA, and RSSI.

The AoA visualization based on simulated data shows the directional information in real-time. This is derived from directional antenna measurements obtained from an antenna array at various angles. The offline analysis allows for sophisticated processing of data and potentially improves the estimated localization accuracy compared to real-time. This can be viewed in Fig. 14(a).

However, the offline analysis lacks in capturing dynamic changes in signal environment than real-time. For, real-time processing in the latter allows immediate response to changing signal conditions, making it suitable for dynamic environments or moving emitters.

Finally, the evaluation of the EKF-ENN model on a 5G signal using HackRF is done. This involves performing signal acquisition, preprocessing, signal analysis (ENN) and EKF for noise reduction over various metrics such as TDoA, AoA, FoA, MSE and SNR. The results from the analysis of the 5G signal are shown in Fig. 16. The data analyzed is presented in Table 9.

Fig. 16
figure 16

Analysis of EKF-ENN model on a 5G signal using HackRF.

Table 9 5G Signal Metrics.

The analysis shows that the 5G signal has a mean TDoA rate of 0.020 s with a standard deviation of 0.003 s. The AoA has a mean of 0.08 rad with a standard deviation of 0.014 rad. The FoA has a mean of 0.49 Hz with a standard deviation of 0.09 Hz. The MSE of the position estimate is 1.06e6 with a standard deviation of 0.09e6.

The SNR is 11.7 dB with a standard deviation of 0.4 dB. These results indicate the effective performance of the signal acquisition/processing system. For, the EKF effectively reduces noise, resulting in accurate estimations of the signal parameters using ENN. This is vital for reliable 5G signal analysis and localization.

The GNU Radio analysis (Fig. 17) confirms the signal characteristics observed in the MATLAB analysis, showing the consistency and reliability of the results across different platforms. To provide a clear comparison of the results obtained from different methods, the results of key metrics is given in Table 10 and Table 11.

Fig. 17
figure 17

5G Signal Analysis in GNU Radio.

Table 10 Comparison of Various Localization Measurements in 5G spectrum.
Table 11 Comparison of MSE and SNR in 5G spectrum.

From Table 10, it can be seen that the EKF-ENN Fusion + HackRF- 5G method consistently outperforms other techniques. The TDoA mean of 0.020 s with a standard deviation (SD) of 0.003 is the lowest among all methods, showing superior accuracy and lower variability.

For AoA, it achieves a mean of 0.08 and a SD of 0.014, indicating enhanced precision compared to HackRF alone and other methods. Additionally, FoA results demonstrate reliable performance with a mean of 0.49 and SD of 0.09, marginally better than standalone EKF-ENN fusion.

Table 11 further reinforces these findings through MSE and SNR comparisons. The EKF-ENN Fusion + HackRF- 5G method shows an MSE of 1.06 (x e6), which is slightly higher than the standalone EKF-ENN Fusion (1.05) but still notably better than the other approaches.

Moreover, the highest SNR of 11.7 dB with minimal variation (SD = 0.4) indicates strong signal clarity and reduced noise interference. Thus, the EKF-ENN Fusion + HackRF- 5G approach provides the most accurate and reliable localization results, improving performance in dynamic and noisy 5G environments by integrating advanced fusion techniques and real-time signal processing.

Table 12 compares the statistical performance of TDoA, AoA, and FoA for different methods. The proposed method performs consistently better than the existing techniques across all metrics. It shows a lower mean for TDoA, AoA, and FoA, indicating improved accuracy in localization. The reduced standard deviation (SD) shows better precision in estimates, while the Min–Max range suggests more consistent performance under varying conditions compared to the other methods.

Table 12 Comparative Analysis.

The EKF-ENN fusion with HackRF demonstrated superior localization accuracy in 5G environments. Results showed significant improvements in TDoA, AoA, and FoA, with reduced noise and better precision. The EKF-ENN Fusion + HackRF- 5G method yielded a mean TDoA of 0.020 s, AoA of 0.08 radians, and FoA of 0.49 Hz, outperforming other methods. The method also achieved higher SNR and lower MSE, validating its effectiveness for real-time localization in dynamic 5G environments.

Advantages of the proposed method

The proposed fusion methodology utilizing ENN and EKF offers several key advantages over the existing, state-of-the-art methods. Firstly, it enhances the accuracy of localization by integrating multiple sensor modalities, which reduces the errors inherent in individual techniques. The use of dynamic adaptability allows the system to adjust to environmental changes, thus improving its robustness in real-world applications.

Moreover, the mathematical modeling, despite its complexity, offers a high degree of precision in state estimation, particularly in challenging conditions like signal noise or dynamic environments. Compared to methods like PSO or WiFi-based CSI fusion, the proposed method demonstrates better consistency with lower mean and standard deviation values in TDoA, AoA, and FoA, which suggests its higher reliability and precision.

Disadvantages of the proposed method

Despite its several outstanding capabilities, the proposed approach also has certain limitations. The primary challenge lies in the computational complexity of the ENN and EKF fusion, which requires more processing power and might result in a slower real-time performance than simpler methods like Adaptive Kalman Filter or RW-MM.

Additionally, while the proposed method is adaptable to various conditions, its performance may degrade in extremely complex or unknown environments, where sensor data fusion might not be as effective. One more limitation is that the mathematical formulation could be challenging for practitioners with limited expertise in advanced filtering techniques.

Conclusion

The study sought to address the major challenge of high-precision localization demands in real-time applications in dynamic and noisy environments. It proposed a novel approach to enhancing localization accuracy in 5G environments by combining Extended Kalman Filter (EKF), Extended Neural Network (ENN), and HackRF-based software-defined radios (SDRs).

The hybrid EKF-ENN Fusion method, when combined with real-time 5G signal processing, proves to be highly effective in mitigating noise, improving precision, and offering dynamic adaptability. Its dynamic adaptability is expressed in terms of responding to fluctuating signal strength, mobility, or sensor noise, which improves the system’s accuracy under varying conditions.

The comprehensive experimental analysis compared various localization techniques, including time difference of arrival (TDoA), angle of arrival (AoA), and frequency of arrival (FoA), across different configurations. The evaluation results highlighted the superiority of EKF-ENN Fusion with HackRF- 5G in terms of Mean Squared Error (MSE) and Signal-to-Noise Ratio (SNR).

This method achieved a mean TDoA of 0.020 s, an AoA mean of 0.08 radians, and an FoA mean of 0.49 Hz, demonstrating significant accuracy improvements over traditional standalone methods. The research also showcased the capabilities of real-time signal acquisition and data fusion using HackRF SDRs, alongside the importance of advanced machine learning algorithms like ENN in complex signal environments.

Existing frameworks often fail in terms of accuracy in dynamic and noisy environments as they usually depend on a single type of measurement, due to its inadequacy in complex environments. The fusion of TDoA, AoA, and FoA measurements with EKF provided optimal state estimates despite the incomplete and noisy data. This is vital in real-world 5G networks.

Thus, the research offers a robust framework (with strong signal clarity) for real-time localization in 5G networks using low-cost hardware and sophisticated data fusion algorithms. It not only enhances localization precision but also sets a foundation for further advancements in real-time signal processing and machine learning-based localization systems for future wireless networks.