# danilodsp/tdoa_methods architecture

> Architecture diagram of the GitHub repository danilodsp/tdoa_methods, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danilodsp/tdoa_methods
- Repository: https://github.com/danilodsp/tdoa_methods

## Overview

##### Main Components Identification
- Algorithms Module: Represented by the “algorithms” directory, this includes various TDOA and AoA estimation methods (e.g., BeamScan, CC, CRLB, Capon, Fourier, etc.). These are core implementations for signal processing and localization.
- Distortion Models: Captured in the “distortion_models” directory, these MATLAB files generate synthetic channels (Gaussian, Gaussian mixtures, reverberation, and more) that simulate different noise and distortion conditions.
- Simulation Environment: The “simulations” directory contains a collection of scripts (main.m, param_CRLB.m, param_SRP.m, etc.) that run experiments. It orchestrates the evaluation, invoking both algorithms and distortion models.
- Auxiliary Utilities: Located in the “aux_codes” directory, these scripts provide supportive functionality like data loading, checking, evaluation, and saving outputs. They help manage the experimental pipeline by handling I/O and data preparations.
- Campaign Script: The “campaign.m” file likely serves as an overarching experiment runner, coordinating large-scale simulation studies.

##### Relationships and Interactions
- Data Flow: The simulation components (in “simulations” and “campaign.m”) are the central orchestrators, pulling together signal generation (using aux_codes), applying distortion models, processing the signal through various algorithms, and ultimately saving performance metrics and plots.
- Inter-module Dependencies: The simulation scripts call upon the algorithms for signal processing and the distortion matrices for channel modeling. Utilities are used throughout to prepare inputs and manage outputs.
- Modular Separation: The design illustrates clear separation of concerns—the simulation code is independent and modular, directly integrating with specialized algorithm implementations and distortion models.

##### Architectural Patterns and Design Principles
- Modularity: Each directory encapsulates a specific aspect of the simulation (e.g., “algorithms” for processing, “distortion_models” for channel simulation) that promotes reusability and easier testing.
- Extension Points: The architecture allows for integrating additional algorithms or distortion types with minimal coupling. Highlight these extension points.

##### Key Technologies, Frameworks, and Libraries
- Data Handling and Visualization: Although not explicitly indicated by external libraries, functions in “aux_codes” involve output saving and plotting. Indicate that data visualization is an integral part of outcome evaluation.

##### Final Overview
- Remember to note that the system emphasizes extensive performance evaluation of localization techniques, where each algorithm is tested across various simulated noise and signal conditions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Level: Simulation Runner
    A["Campaign.m"]:::simulation
    B["Simulations (simulations/)"]:::simulation

    %% Middle Level: Core Processing Modules
    C["Auxiliary Utilities (aux_codes/)"]:::utility
    D["Distortion Models (distortion_models/)"]:::distortion
    E["Algorithms Module (algorithms/)"]:::algorithm

    %% Bottom Level: Results & Evaluation
    F["Performance Evaluation & Data Visualization"]:::results
    G["Output Metrics and Plots"]:::results

    %% Data Flow Connections
    A -->|"triggers"| B
    B -->|"initializes"| C
    C -->|"generates signal"| D
    C -->|"prepares data"| E
    D -->|"applies distortion"| E
    E -->|"computes metrics"| F
    F -->|"saves results"| G

    %% Click Events
    click A "https://github.com/danilodsp/tdoa_methods/blob/main/campaign.m"
    click B "https://github.com/danilodsp/tdoa_methods/tree/main/simulations/"
    click C "https://github.com/danilodsp/tdoa_methods/tree/main/aux_codes/"
    click D "https://github.com/danilodsp/tdoa_methods/tree/main/distortion_models/"
    click E "https://github.com/danilodsp/tdoa_methods/tree/main/algorithms/"

    %% Styles
    classDef simulation fill:#f9c,stroke:#333,stroke-width:2px;
    classDef algorithm fill:#bbf,stroke:#333,stroke-width:2px;
    classDef distortion fill:#bfb,stroke:#333,stroke-width:2px;
    classDef utility fill:#ff9,stroke:#333,stroke-width:2px;
    classDef results fill:#fcc,stroke:#333,stroke-width:2px;
```
