This folder contains a Python-based post-processing pipeline for analysing Sequence Time Domain Reflectometry (STDR) simulation results exported from MATLAB/Simulink.
| File | Description |
|---|---|
stdr_analysis.py |
Main analysis script — loads CSV output from MATLAB, computes statistics, and generates publication-quality figures |
Python 3.9+ is required. Install the dependencies using:
pip install pandas numpy matplotlib seabornOr, if you prefer a virtual environment:
python -m venv .venv
.venv\Scripts\activate # Windows
pip install pandas numpy matplotlib seaborn-
First, run the MATLAB simulation (
STDR.m) to generateSTDR_Noise_Sweep_Results.csvin the root project directory. -
Copy or move the CSV to the
analysis/folder:analysis/STDR_Noise_Sweep_Results.csv -
Run the analysis script from inside the
analysis/folder:cd analysis python stdr_analysis.py
All outputs are generated automatically into local subdirectories (not tracked by Git):
| Figure | Description |
|---|---|
error_vs_noise_line.png |
Mean fault location error vs noise level (line + error bars) |
error_vs_noise_boxplot.png |
Error distribution box plot by noise level |
error_vs_distance.png |
Error vs fault distance, grouped by noise level |
correlation_peak_vs_noise.png |
Correlation peak (Tau) degradation with noise |
effectiveness_vs_noise.png |
Detection effectiveness (%) vs noise level |
| File | Description |
|---|---|
summary_table.csv |
Full per-phase, per-noise, per-distance results |
accuracy_vs_noise.csv |
Aggregate error statistics grouped by noise |
accuracy_vs_distance.csv |
Aggregate error statistics grouped by distance |
accuracy_by_fault_type.csv |
Error statistics grouped by fault type |
response_characteristics.csv |
Correlation peak stats and missed detection counts |
effectiveness_summary.csv |
Effective detection rate per noise level |
performance_summary.csv |
Combined performance table with interpretation |
additional_metrics.csv |
Stability (CV) and detectability metrics |
The script runs six sequential analysis phases:
- Data Loading & Preprocessing — Expands 3-phase rows to per-phase records, computes percentage errors
- Fault Location Accuracy — Grouped statistics by noise, distance, and fault type
- Visualisation — Generates 5 publication-quality plots
- Response Characteristics — Analyses correlation peak (Tau) behaviour
- Fault Location Effectiveness — Computes detection success rate using ±5% error criterion
- Performance Summary — Consolidated summary table with qualitative interpretation
Note: The
figures/andresults/directories are excluded from Git tracking (see.gitignore). Re-runstdr_analysis.pyto regenerate them locally.