# anarkiwi/samples2djidroneid architecture

> Architecture diagram of the GitHub repository anarkiwi/samples2djidroneid, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anarkiwi/samples2djidroneid
- Repository: https://github.com/anarkiwi/samples2djidroneid

## Overview

This small command-line tool takes a complex-float32 SDR recording and prints decoded DJI DroneID frames as JSON. Its main workflow invokes an external Octave processing script to detect and extract frames, writes those frames to a temporary file, then invokes the Python decoder to parse fields and emit JSON. The detector implementation is outside this repository, so its internal stages are not represented. The README documents Occusync 2.0 decoding and sample-rate constraints; the shown source supports the orchestration and decoding links.

Main entry points: [`samples2djidroneid.py`](https://github.com/anarkiwi/samples2djidroneid/blob/main/samples2djidroneid.py) (CLI orchestration), [`decode_djidroneid.py`](https://github.com/anarkiwi/samples2djidroneid/blob/main/decode_djidroneid.py) (Frame decoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Frame workflow"]
  node_cli["CLI orchestration"]
  node_octave["Octave frame detector"]
  node_tempframes["Temporary frame file"]
end

subgraph group_decode["Frame decoding"]
  node_decoder["Frame decoder"]
  node_json["JSON output"]
end

node_operator(("Recording operator"))

node_operator -->|"provides recording"| node_cli
node_cli -->|"runs detector"| node_octave
node_octave -->|"returns frames"| node_cli
node_cli -->|"writes frames"| node_tempframes
node_cli -->|"runs decoder"| node_decoder
node_decoder -->|"reads frames"| node_tempframes
node_decoder -->|"prints JSON"| node_json

click node_cli "https://github.com/anarkiwi/samples2djidroneid/blob/main/samples2djidroneid.py"
click node_decoder "https://github.com/anarkiwi/samples2djidroneid/blob/main/decode_djidroneid.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_cli,node_octave,node_tempframes toneBlue
class node_decoder,node_json toneAmber
class node_operator toneIndigo
```

## Components

### Frame workflow

- [CLI orchestration](https://github.com/anarkiwi/samples2djidroneid/blob/main/samples2djidroneid.py): `samples2djidroneid.py`
- **Octave frame detector**
- **Temporary frame file**

### Frame decoding

- [Frame decoder](https://github.com/anarkiwi/samples2djidroneid/blob/main/decode_djidroneid.py): `decode_djidroneid.py`
- **JSON output**

### Other components

- **Recording operator**

## Connections

- Recording operator → CLI orchestration: provides recording (evidence: `README.md`)
- CLI orchestration → Octave frame detector: runs detector (evidence: `samples2djidroneid.py`)
- Octave frame detector → CLI orchestration: returns frames (evidence: `samples2djidroneid.py`)
- CLI orchestration → Temporary frame file: writes frames (evidence: `samples2djidroneid.py`)
- CLI orchestration → Frame decoder: runs decoder (evidence: `samples2djidroneid.py`)
- Frame decoder → Temporary frame file: reads frames (evidence: `decode_djidroneid.py`)
- Frame decoder → JSON output: prints JSON (evidence: `decode_djidroneid.py`)
