# fair-acc/gnuradio4 architecture

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

- Interactive diagram: https://gitdiagram.com/fair-acc/gnuradio4
- Repository: https://github.com/fair-acc/gnuradio4

## Overview

##### Project Type and Purpose
- This project is a signal processing toolkit and runtime (i.e. a software-defined radio framework) based on modern C++ (C++23). It supports various signal processing functionalities (algorithms, filters, FFT, etc.) and is organized as a modular framework with plugin support.
- The README emphasizes improved scheduling, high-performance processing, enhanced data types, and a plugin system, implying a well-separated architecture ready for extensibility.

##### File Structure Analysis
- Key directories include:
- core: Contains essential components like the scheduling system, block registry, core utilities (e.g. Graph, Buffer, and Scheduler). It represents the backbone of the runtime.
- blocks: Divided into subdirectories (basic, electrical, fileio, filter, fourier, http, math, soapy, testing) – each containing implementations of various signal processing blocks.
- algorithm: Focuses on implementing core signal processing algorithms (like FFT, SchmittTrigger, filters, and dataset utilities).
- meta: Provides meta-programming and reflection utilities as well as additional helper functionalities.
- bench: Contains benchmarking and performance evaluation code.
- Other folders (cmake, docker, docs, devtools, third_party) support build configuration, deployment, and third-party dependencies (e.g. exprtk and magic_enum).

##### PlantUML Code

-------------------------- PlantUML Code --------------------------
@startuml
' Define a consistent style
skinparam componentStyle rectangle
skinparam packageBorderColor DarkBlue
skinparam packageTitleFontColor DarkBlue

package "GNU Radio 4.0 Prototype" {

' Core module
[Core] <<component>> as core

' Blocks module with subdivisions
package "Blocks" {
[Basic Blocks] <<component>> as basic
[Electrical Blocks] <<component>> as electrical
[File I/O Blocks] <<component>> as fileio
[Filter Blocks] <<component>> as filter
[Fourier Blocks] <<component>> as fourier
[HTTP Blocks] <<component>> as http
[Math Blocks] <<component>> as math
[Soapy Blocks] <<component>> as soapy
[Testing Blocks] <<component>> as testingBlocks
}
' Group Blocks as one container for high-level view
[Blocks] <<component>> as blocks

' Algorithm module
[Algorithm] <<component>> as algorithm

' Meta module
[Meta] <<component>> as meta

' Benchmarks module
[Benchmarks] <<component>> as benchmarks
}

' External third-party dependencies
package "Third Party" {
[Exprtk] <<library>> as exprtk
[Magic_Enum] <<library>> as magic_enum
}

' Define relationships between modules
core --> blocks : "Registers & Manages\nBlock Plugins"
core --> algorithm : "Schedules & Coordinates\nProcessing"
core --> meta : "Loads Plugins & Provides\nReflection Support"
blocks --> algorithm : "Utilizes Algorithms"
benchmarks --> core : "Performance Evaluation"
benchmarks --> blocks : "Tests Block Functionality"

' Show dependency with external libraries
algorithm --> exprtk : "Uses for Expression Parsing"
meta --> magic_enum : "Uses for Type Reflection"

' Optional: indicate dynamic relationships
blocks ..> core : "Dynamic Plugin Loading"

@enduml
-------------------------- End of PlantUML Code --------------------------

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "GNU Radio 4.0 Prototype"
        Core["Core"]:::core
        subgraph "Blocks"
            Basic["Basic Blocks"]:::blocks
            Electrical["Electrical Blocks"]:::blocks
            FileIO["File I/O Blocks"]:::blocks
            Filter["Filter Blocks"]:::blocks
            Fourier["Fourier Blocks"]:::blocks
            HTTP["HTTP Blocks"]:::blocks
            Math["Math Blocks"]:::blocks
            Soapy["Soapy Blocks"]:::blocks
            Testing["Testing Blocks"]:::blocks
        end
        BlocksGroup["Blocks"]:::blocksGroup
        Algorithm["Algorithm"]:::algorithm
        Meta["Meta"]:::meta
        Benchmarks["Benchmarks"]:::bench
    end

    subgraph "Third Party"
        Exprtk["Exprtk"]:::external
        MagicEnum["Magic_Enum"]:::external
    end

    Core -->|"Registers&Manages\nBlockPlugins"| BlocksGroup
    Core -->|"Schedules&Coordinates\nProcessing"| Algorithm
    Core -->|"LoadsPlugins&Provides\nReflectionSupport"| Meta
    BlocksGroup -->|"UtilizesAlgorithms"| Algorithm
    Benchmarks -->|"PerformanceEvaluation"| Core
    Benchmarks -->|"TestsBlockFunctionality"| BlocksGroup
    Algorithm -->|"UsesforExpressionParsing"| Exprtk
    Meta -->|"UsesforTypeReflection"| MagicEnum
    BlocksGroup -.->|"DynamicPluginLoading"| Core

    click Core "https://github.com/fair-acc/gnuradio4/tree/main/core"
    click BlocksGroup "https://github.com/fair-acc/gnuradio4/tree/main/blocks"
    click Algorithm "https://github.com/fair-acc/gnuradio4/tree/main/algorithm"
    click Meta "https://github.com/fair-acc/gnuradio4/tree/main/meta"
    click Benchmarks "https://github.com/fair-acc/gnuradio4/tree/main/bench"
    click Exprtk "https://github.com/fair-acc/gnuradio4/tree/main/third_party/exprtk"
    click MagicEnum "https://github.com/fair-acc/gnuradio4/tree/main/third_party/magic_enum"

    classDef core fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
    classDef blocks fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef blocksGroup fill:#D6EAF8,stroke:#2E86C1,stroke-width:2px;
    classDef algorithm fill:#A9DFBF,stroke:#28B463,stroke-width:2px;
    classDef meta fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
    classDef bench fill:#F1948A,stroke:#C0392B,stroke-width:2px;
    classDef external fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
```
