# lasidudilshan/software-defined-radio architecture

> Architecture diagram of the GitHub repository lasidudilshan/software-defined-radio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lasidudilshan/software-defined-radio
- Repository: https://github.com/lasidudilshan/software-defined-radio

## Overview

This repository is a GNU Radio/BladeRF communication-system demonstration, with separate digital-file and real-time FM audio examples plus standalone XOR file utilities. The digital flowgraphs provide the main digital communication entry point; their embedded source block emits preamble, Base64 file data, filename, and trailer, while a separate script strips framing and decodes received data. The audio flowgraph reads WAV audio, adjusts and resamples it, modulates it as NBFM, and transmits it through BladeRF. Digital flowgraph excerpts are incomplete, so internal digital block links are not inferred.

Main entry points: [`Real Time Audio/real_time_fm.py`](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py) (NBFM Modulator), [`Digital Communication 1/digital_communication.py`](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/digital_communication.py) (Digital Flowgraph 1), [`Digital Communication 2/digital_communication.py`](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/digital_communication.py) (Digital Flowgraph 2), [`Digital Communication 1/strip_preamble.py`](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/strip_preamble.py) (Preamble Stripper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_digital["Digital Communication"]
  node_dc1["Digital Flowgraph 1"]
  node_dc2["Digital Flowgraph 2"]
  node_txblock1["Framed File Source 1"]
  node_txblock2["Framed File Source 2"]
  node_strip["Preamble Stripper<br/>[strip_preamble.py]"]
end

subgraph group_crypto["File Encryption"]
  node_encrypt["XOR Encrypt<br/>[Encrypt.py]"]
  node_decrypt["XOR Decrypt<br/>[Decrypt.py]"]
  node_encrypt1["XOR Encrypt 1<br/>[Encrypt.py]"]
  node_decrypt1["XOR Decrypt 1<br/>[Decrypt.py]"]
  node_encrypt2["XOR Encrypt 2<br/>[Encrypt.py]"]
  node_decrypt2["XOR Decrypt 2<br/>[Decrypt.py]"]
end

subgraph group_audio["FM Audio"]
  node_audioapp["FM Audio Flowgraph<br/>[real_time_fm.py]"]
  node_wavsource["WAV Source<br/>[real_time_fm.py]"]
  node_volume["Volume and Resampler<br/>[real_time_fm.py]"]
  node_nbfm["NBFM Modulator<br/>[real_time_fm.py]"]
  node_plots["Signal Displays<br/>[real_time_fm.py]"]
end

node_operator(("Operator"))
node_bladerf["BladeRF Device"]

node_operator -->|"runs flowgraph"| node_dc1
node_operator -->|"runs flowgraph"| node_dc2
node_operator -->|"runs decoder"| node_strip
node_operator -->|"starts transmission"| node_audioapp
node_operator -->|"selects file"| node_encrypt
node_operator -->|"selects file"| node_decrypt
node_wavsource -->|"audio samples"| node_volume
node_volume -->|"resampled audio"| node_nbfm
node_nbfm -->|"signal samples"| node_plots
node_nbfm -->|"transmits signal"| node_bladerf

click node_dc1 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/digital_communication.py"
click node_dc2 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/digital_communication.py"
click node_txblock1 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/digital_communication_epy_block_0.py"
click node_txblock2 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/digital_communication_epy_block_0.py"
click node_strip "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/strip_preamble.py"
click node_encrypt "https://github.com/lasidudilshan/software-defined-radio/blob/main/Encrypt.py"
click node_decrypt "https://github.com/lasidudilshan/software-defined-radio/blob/main/Decrypt.py"
click node_encrypt1 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/Encrypt.py"
click node_decrypt1 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/Decrypt.py"
click node_encrypt2 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/Encrypt.py"
click node_decrypt2 "https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/Decrypt.py"
click node_audioapp "https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py"
click node_wavsource "https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py"
click node_volume "https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py"
click node_nbfm "https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py"
click node_plots "https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dc1,node_dc2,node_txblock1,node_txblock2,node_strip toneBlue
class node_encrypt,node_decrypt,node_encrypt1,node_decrypt1,node_encrypt2,node_decrypt2 toneAmber
class node_audioapp,node_wavsource,node_volume,node_nbfm,node_plots toneMint
class node_operator,node_bladerf toneIndigo
```

## Components

### Digital Communication

- [Digital Flowgraph 1](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/digital_communication.py): `Digital Communication 1/digital_communication.py`
- [Digital Flowgraph 2](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/digital_communication.py): `Digital Communication 2/digital_communication.py`
- [Framed File Source 1](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/digital_communication_epy_block_0.py): `Digital Communication 1/digital_communication_epy_block_0.py`
- [Framed File Source 2](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/digital_communication_epy_block_0.py): `Digital Communication 2/digital_communication_epy_block_0.py`
- [Preamble Stripper](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/strip_preamble.py): `Digital Communication 1/strip_preamble.py`

### File Encryption

- [XOR Encrypt](https://github.com/lasidudilshan/software-defined-radio/blob/main/Encrypt.py): `Encrypt.py`
- [XOR Decrypt](https://github.com/lasidudilshan/software-defined-radio/blob/main/Decrypt.py): `Decrypt.py`
- [XOR Encrypt 1](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/Encrypt.py): `Digital Communication 1/Encrypt.py`
- [XOR Decrypt 1](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%201/Decrypt.py): `Digital Communication 1/Decrypt.py`
- [XOR Encrypt 2](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/Encrypt.py): `Digital Communication 2/Encrypt.py`
- [XOR Decrypt 2](https://github.com/lasidudilshan/software-defined-radio/blob/main/Digital%20Communication%202/Decrypt.py): `Digital Communication 2/Decrypt.py`

### FM Audio

- [FM Audio Flowgraph](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py): `Real Time Audio/real_time_fm.py`
- [WAV Source](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py): `Real Time Audio/real_time_fm.py`
- [Volume and Resampler](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py): `Real Time Audio/real_time_fm.py`
- [NBFM Modulator](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py): `Real Time Audio/real_time_fm.py`
- [Signal Displays](https://github.com/lasidudilshan/software-defined-radio/blob/main/Real%20Time%20Audio/real_time_fm.py): `Real Time Audio/real_time_fm.py`

### Other components

- **Operator**
- **BladeRF Device**

## Connections

- Operator → Digital Flowgraph 1: runs flowgraph (evidence: `README.md`)
- Operator → Digital Flowgraph 2: runs flowgraph (evidence: `README.md`)
- Operator → Preamble Stripper: runs decoder (evidence: `Digital Communication 1/strip_preamble.py`)
- Operator → FM Audio Flowgraph: starts transmission (evidence: `README.md`)
- Operator → XOR Encrypt: selects file (evidence: `Encrypt.py`)
- Operator → XOR Decrypt: selects file (evidence: `Decrypt.py`)
- WAV Source → Volume and Resampler: audio samples (evidence: `Real Time Audio/real_time_fm.py`)
- Volume and Resampler → NBFM Modulator: resampled audio (evidence: `Real Time Audio/real_time_fm.py`)
- NBFM Modulator → Signal Displays: signal samples (evidence: `Real Time Audio/real_time_fm.py`)
- NBFM Modulator → BladeRF Device: transmits signal (evidence: `Real Time Audio/real_time_fm.py`)
