Skip to content

Commit 5391c26

Browse files
authored
Merge pull request #9 from Wireless-Information-Networking/develop
Develop
2 parents ea16e9d + 1be4cf9 commit 5391c26

File tree

4 files changed

+750
-502
lines changed

4 files changed

+750
-502
lines changed

CITATION.cff

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software in your research, please cite it as below."
3+
title: "Bayesian Enhanced AoA Estimator"
4+
type: software
5+
authors:
6+
- family-names: "Martínez Benelmekki"
7+
given-names: "Nedal"
8+
orcid: "https://orcid.org/0009-0003-1955-5006"
9+
affiliation: "Wireless Information Networking Group, UAB"
10+
repository-code: "https://github.com/Wireless-Information-Networking/Bayesian-Enhanced-AoA-Estimator"
11+
url: "https://github.com/Wireless-Information-Networking/Bayesian-Enhanced-AoA-Estimator"
12+
abstract: >-
13+
This software provides code, setup instructions, and tools to implement a Bayesian Enhanced Angle of Arrival (AoA) Estimator.
14+
It conducts the full pipeline, starting by conducting classic antenna-array signal processing to estimate the AoA. Then, these
15+
estimations are computed into physical-informed priors, and this is fed into a Bayesian Regression Model, which produces
16+
the final AoA estimation. The software is designed to be modular, allowing for easy integration with various antenna arrays and signal processing techniques.
17+
keywords:
18+
- RFID
19+
- Bayesian Machine Learning
20+
- Physics-Informed
21+
- Signal Processing
22+
- Antenna-Array
23+
- Wireless Communication
24+
- Radio Frequency
25+
license: MIT
26+
version: 1.0.0
27+
date-released: 2025-09-02
28+
preferred-citation:
29+
type: software
30+
authors:
31+
- family-names: "Martínez Benelmekki"
32+
given-names: "Nedal"
33+
orcid: "https://orcid.org/0009-0003-1955-5006"
34+
affiliation: "Wireless Information Networking Group, UAB"
35+
title: "Bayesian Enhanced AoA Estimator: A Physics-Informed Machine Learning Approach for Accurate Angle of Arrival Estimation"
36+
year: 2025
37+
url: "https://github.com/Wireless-Information-Networking/Bayesian-Enhanced-AoA-Estimator"
38+
repository-code: "https://github.com/Wireless-Information-Networking/Bayesian-Enhanced-AoA-Estimator"
39+
abstract: >-
40+
This software provides code, setup instructions, and tools to implement a Bayesian Enhanced Angle of Arrival (AoA) Estimator.
41+
It conducts the full pipeline, starting by conducting classic antenna-array signal processing to estimate the AoA. Then, these
42+
estimations are computed into physical-informed priors, and this is fed into a Bayesian Regression Model, which produces
43+
the final AoA estimation. The software is designed to be modular, allowing for easy integration with various antenna arrays and signal processing techniques.
44+
keywords:
45+
- RFID
46+
- Bayesian Machine Learning
47+
- Physics-Informed
48+
- Signal Processing
49+
- Antenna-Array
50+
- Wireless Communication
51+
- Radio Frequency
52+
license: MIT
53+
version: 1.0.0

README.md

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,46 @@
22

33
AoA estimator for passive UHF RFID based on Bayesian regression and classical antenna array signal processing. Combines physics-informed priors with Pyro-based uncertainty quantification.
44

5+
## 📑 Table of Contents
6+
7+
- [Bayesian-Enhanced-AoA-Estimator](#bayesian-enhanced-aoa-estimator)
8+
- [📑 Table of Contents](#-table-of-contents)
9+
- [🔍 Overview](#-overview)
10+
- [📊 Dataset Structure](#-dataset-structure)
11+
- [📂 File Naming Convention](#-file-naming-convention)
12+
- [📁 Directory Structure](#-directory-structure)
13+
- [🧮 MATLAB Implementation](#-matlab-implementation)
14+
- [📄 `process_experimental_data.m`](#-process_experimental_datam)
15+
- [📄 `antenna_array_processing.m`](#-antenna_array_processingm)
16+
- [🐍 Python Implementation](#-python-implementation)
17+
- [📄 `bayesian_regression.py`](#-bayesian_regressionpy)
18+
- [📄 `beamforming.py`](#-beamformingpy)
19+
- [📄 `data_management.py`](#-data_managementpy)
20+
- [📄 `MUSIC.py`](#-musicpy)
21+
- [📄 `phase_difference.py`](#-phase_differencepy)
22+
- [📄 `visualization.py`](#-visualizationpy)
23+
- [📁 Repository Structure](#-repository-structure)
24+
- [`/data`](#data)
25+
- [`/figures`](#figures)
26+
- [`/MATLAB`](#matlab)
27+
- [`/results`](#results)
28+
- [`/src`](#src)
29+
- [📄 License](#-license)
30+
31+
## 🔍 Overview
32+
33+
The Bayesian-Enhanced-AoA-Estimator provides a comprehensive framework for estimating the Angle of Arrival (AoA) in passive UHF RFID systems. This project combines:
34+
35+
1. **Classical Antenna Array Processing**: Implements traditional techniques like Phase-difference estimation, Delay-and-Sum beamforming, and MUSIC algorithm.
36+
37+
2. **Bayesian Regression Approach**: Leverages probabilistic programming with Pyro to incorporate physics-informed priors and estimate uncertainty.
38+
39+
3. **Multi-frequency Fusion**: Combines data from multiple frequencies to improve estimation accuracy and robustness.
40+
41+
4. **Uncertainty Quantification**: Provides confidence metrics for all estimates, essential for real-world deployment.
42+
43+
This approach significantly improves AoA estimation accuracy compared to classical methods alone, particularly in challenging low-SNR environments and multi-path scenarios typical in indoor RFID deployments.
44+
545
## 📊 Dataset Structure
646

747
### 📂 File Naming Convention
@@ -114,16 +154,55 @@ A comprehensive end-to-end RFID AoA estimation pipeline that:
114154
- Performs error analysis and method comparison
115155
- Outputs organized figures and complete analysis reports
116156

157+
## 🐍 Python Implementation
158+
159+
The repository includes Python implementations that use Bayesian methods through Pyro:
160+
161+
### 📄 `bayesian_regression.py`
162+
163+
Core implementation of the Bayesian AoA estimator:
164+
165+
- Defines physics-informed prior distributions based on antenna array geometry
166+
- Implements probabilistic model for phase and RSSI observations
167+
- Performs Bayesian inference using Pyro's SVI engine
168+
- Provides posterior distributions for AoA estimates with uncertainty quantification
169+
- Handles multi-frequency data fusion through hierarchical modeling
170+
171+
### 📄 `beamforming.py`
172+
173+
Provides functions to conduct classic antenna-array analysis of DS Beamforming and Weigthed DS Beamforming.
174+
175+
### 📄 `data_management.py`
176+
177+
Utility module for preprocessing and managing the dataset:
178+
179+
- Reads and parses CSV files from RFID experiments
180+
- Converts raw measurements to complex phasors
181+
- Handles data cleaning and outlier removal
182+
- Provides data loaders compatible with PyTorch/Pyro
183+
184+
### 📄 `MUSIC.py`
185+
186+
Provides functions to conduct classic antenna-array analysis of the MUSIC algorithm.
187+
188+
### 📄 `phase_difference.py`
189+
190+
Provides functions to conduct classic antenna-array analysis of the phase difference analysis.
191+
192+
### 📄 `visualization.py`
193+
194+
Comprehensive visualization tools.
195+
117196
## 📁 Repository Structure
118197

119198
The repository is organized with the following key directories:
120199

121-
### `/MATLAB`
200+
### `/data`
122201

123-
Contains all MATLAB implementation scripts:
202+
Raw and processed datasets:
124203

125-
- `process_experimental_data.m`: Preprocessing script for raw CSV data
126-
- `antenna_array_processing.m`: Complete end-to-end AoA analysis pipeline
204+
- `/2025-07-09`: Original CSV files from RFID experiments
205+
- `/testing`: Data collected during environment and set up testing
127206

128207
### `/figures`
129208

@@ -137,12 +216,34 @@ Stores generated visualization outputs from the analysis:
137216

138217
Example figures are included to demonstrate the expected output format.
139218

219+
### `/MATLAB`
220+
221+
Contains all MATLAB implementation scripts:
222+
223+
- `process_experimental_data.m`: Preprocessing script for raw CSV data
224+
- `antenna_array_processing.m`: Complete end-to-end AoA analysis pipeline
225+
140226
### `/results`
141227

142228
Contains processed data and analysis results:
143229

144230
- `rfid_array_data.mat`: Preprocessed dataset ready for analysis
145231
- `complete_analysis.mat`: Comprehensive results from all estimation methods
146-
- Performance metrics and statistical evaluations
232+
- `ZIP files`: Contains ZIP files of the full analysis pipeline.
147233

148234
Example result files are provided to illustrate the data structure.
235+
236+
### `/src`
237+
238+
Contains all Python implementations:
239+
240+
- `bayesian_regression.py`: Core Bayesian estimation implementation
241+
- `beamforming.py`: DS and Weighted DS Beamforming
242+
- `data_management.py`: Dataset processing and management
243+
- `music.py`: MUSIC algorithm
244+
- `phase_difference.py`: Phase-difference methods
245+
- `visualization.py`: Visualization tools
246+
247+
## 📄 License
248+
249+
This project is licensed under the MIT License - see the LICENSE file for details.

main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
import glob # Unix style pathname pattern expansion for file searching. #
1313
import re # Regular expression operations for pattern matching in filenames. #
1414
import numpy as np # Mathematical functions. #
15+
import pandas as pd # Data manipulation and analysis library. #
1516
import scipy.constants as sc # Physical and mathematical constants. #
1617
import matplotlib.pyplot as plt # Data visualization. #
1718
import src.data_management as dm # Data management functions for importing and organizing data. #
18-
import src.phase_difference as pd # Phase difference calculations for AoA estimation. #
19+
import src.phase_difference as pad # Phase difference calculations for AoA estimation. #
1920
import src.beamforming as bf # Beamforming methods for AoA estimation. #
2021
import src.music as music # MUSIC algorithm for high-resolution AoA estimation. #
2122
import src.bayesian_regression as br # Bayesian regression for machine learning models on AoA data. #
@@ -27,7 +28,8 @@
2728
# =================================================================================================================================== #
2829
# ------------------------------------------------------- CONFIGURATION SETTINGS ---------------------------------------------------- #
2930
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) # Get the directory of the current script. #
30-
PROJECT_ROOT = os.path.dirname(SCRIPT_DIR) # Go up one level to project root. #
31+
# PROJECT_ROOT = os.path.dirname(SCRIPT_DIR) # Go up one level to project root. #
32+
PROJECT_ROOT = SCRIPT_DIR # Use the script directory as the project root. #
3133
DATA_DIRECTORY = os.path.join(PROJECT_ROOT, 'data', '2025-07-09') # Directory containing the data files. #
3234
RESULTS_BASE_DIR = os.path.join(PROJECT_ROOT, 'results') # Store results in a separate folder. #
3335
EXPERIMENT_NAME = 'AoA_Analysis' # Name of the experiment for output directory. #
@@ -68,8 +70,8 @@ def analyze_aoa(phasor1, phasor2, rssi1, rssi2, L, wavelength, aoa_scan, true_an
6870
- dict: Dictionary with AoA estimates and spectra for all methods
6971
"""
7072
# 1. Phase difference method
71-
dphi = dm.compute_phase_difference(phasor1, phasor2)
72-
theta_ph = dm.phase_difference_aoa(dphi, L, wavelength)
73+
dphi = pad.compute_phase_difference(phasor1, phasor2)
74+
theta_ph = pad.phase_difference_aoa(dphi, L, wavelength)
7375
# 2. Beamforming methods
7476
B_ds, B_w, theta_ds, theta_w = bf.beamforming_spectrum_calculation(
7577
phasor1, phasor2, rssi1, rssi2, L, wavelength, aoa_scan)

0 commit comments

Comments
 (0)