# liquidinstruments/moku-examples architecture

> Architecture diagram of the GitHub repository liquidinstruments/moku-examples, 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/liquidinstruments/moku-examples
- Repository: https://github.com/liquidinstruments/moku-examples

## Overview

This repository is a collection of runnable Moku device examples, not a shared application or runtime library. The typical workflow is to configure a device address, run an example to connect and set up an instrument, then acquire, stream, analyze, visualize, or save results. The graph preserves the README’s instrument, neural-network, multi-instrument, and multi-language branches. Some unsampled examples are represented by their directory; their specific call relationships are not inferred.

Main entry points: [`python-api`](https://github.com/liquidinstruments/moku-examples/tree/main/python-api) (Instrument Examples), [`neural-network`](https://github.com/liquidinstruments/moku-examples/tree/main/neural-network) (Neural Network Examples), [`python-api/oscilloscope_averaging.py`](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/oscilloscope_averaging.py) (Oscilloscope), [`python-api/pidcontroller_plotting.py`](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/pidcontroller_plotting.py) (PID Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_py["Python Instruments"]
  node_py_examples["Instrument Examples"]
  node_scope["Oscilloscope"]
  node_pid["PID Control"]
  node_wavegen["Waveform Generation"]
  node_logging["Logging and Streaming"]
  node_analysis["Signal Analysis"]
  node_control["Other Instruments"]
end

subgraph group_nn["Neural Network"]
  node_nn_examples["Neural Network Examples"]
  node_anomaly["Anomaly Detection"]
  node_qpd["Photodiode Regression"]
  node_radar["Radar Processing<br/>[matchedFilter.py]"]
  node_nn_control["Neural Control"]
end

subgraph group_multi["Multi Instrument"]
  node_mim["Multi-Instrument Examples<br/>[mim_wg_rtm_osc.py]"]
  node_swept["Swept Pulse Setup"]
end

subgraph group_langs["Other Languages"]
  node_language_examples["Language Examples"]
end

subgraph group_custom["Custom Designs"]
  node_boxcar["Boxcar Controls"]
  node_dual_boxcar["Dual Boxcar Controls"]
  node_compile["Compile Designs"]
end

node_user(("Example User"))
node_device(("Moku Device"))
node_moku_api["Moku API"]
node_plots["Plots and Results"]
node_saved_model["Saved Model"]

node_user -->|"runs"| node_py_examples
node_user -->|"runs"| node_nn_examples
node_user -->|"runs"| node_mim
node_user -->|"runs"| node_language_examples
node_py_examples -->|"includes"| node_scope
node_py_examples -->|"includes"| node_pid
node_py_examples -->|"includes"| node_wavegen
node_py_examples -->|"includes"| node_logging
node_py_examples -->|"includes"| node_analysis
node_py_examples -->|"includes"| node_control
node_scope -->|"configures and reads"| node_moku_api
node_pid -->|"configures and reads"| node_moku_api
node_scope -->|"plots acquired data"| node_plots
node_pid -->|"plots acquired data"| node_plots
node_moku_api -->|"controls instruments"| node_device
node_nn_examples -->|"includes"| node_anomaly
node_nn_examples -->|"includes"| node_qpd
node_nn_examples -->|"includes"| node_radar
node_nn_examples -->|"includes"| node_nn_control
node_qpd -->|"saves trained model"| node_saved_model
node_radar -->|"plots correlations"| node_plots
node_mim -->|"configures instruments"| node_device
node_swept -->|"configures multi-instrument mode"| node_device
node_swept -->|"records streamed data"| node_plots
node_boxcar -->|"controls design"| node_device
node_dual_boxcar -->|"controls design"| node_device
node_compile -->|"demonstrates device design"| node_device
node_language_examples -->|"calls device API"| node_device

click node_py_examples "https://github.com/liquidinstruments/moku-examples/tree/main/python-api"
click node_scope "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/oscilloscope_averaging.py"
click node_pid "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/pidcontroller_plotting.py"
click node_wavegen "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/waveformgenerator_modulation.py"
click node_logging "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/datalogger_streaming.py"
click node_analysis "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/spectrumanalyzer_plotting.py"
click node_control "https://github.com/liquidinstruments/moku-examples/tree/main/python-api"
click node_nn_examples "https://github.com/liquidinstruments/moku-examples/tree/main/neural-network"
click node_anomaly "https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/utils_anomaly_detection.py"
click node_qpd "https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/Quadrant_Photodiode.py"
click node_radar "https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/PulsedRADAR/matchedFilter.py"
click node_nn_control "https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/nonlinear_actuator.py"
click node_mim "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/mim_wg_rtm_osc.py"
click node_swept "https://github.com/liquidinstruments/moku-examples/blob/main/mc/Moderate/SweptPulse/MokuPro/mim_mpro_wg_mcc_la_osc.py"
click node_boxcar "https://github.com/liquidinstruments/moku-examples/blob/main/mc/HDLCoder/hdlcoder_boxcar/python/BoxcarControlPanel.py"
click node_dual_boxcar "https://github.com/liquidinstruments/moku-examples/blob/main/mc/HDLCoder/hdlcoder_boxcar/python/DualBoxcarControlPanel.py"
click node_compile "https://github.com/liquidinstruments/moku-examples/blob/main/python-api/moku_compile_arithmetic.py"
click node_language_examples "https://github.com/liquidinstruments/moku-examples/tree/main/other-language-api"

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_py_examples,node_scope,node_pid,node_wavegen,node_logging,node_analysis,node_control,node_user toneBlue
class node_nn_examples,node_anomaly,node_qpd,node_radar,node_nn_control toneAmber
class node_mim,node_swept,node_moku_api toneMint
class node_language_examples toneRose
class node_boxcar,node_dual_boxcar,node_compile,node_device,node_plots,node_saved_model toneIndigo
```

## Components

### Python Instruments

- [Instrument Examples](https://github.com/liquidinstruments/moku-examples/tree/main/python-api): `python-api`
- [Oscilloscope](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/oscilloscope_averaging.py): `python-api/oscilloscope_averaging.py`
- [PID Control](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/pidcontroller_plotting.py): `python-api/pidcontroller_plotting.py`
- [Waveform Generation](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/waveformgenerator_modulation.py): `python-api/waveformgenerator_modulation.py`
- [Logging and Streaming](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/datalogger_streaming.py): `python-api/datalogger_streaming.py`
- [Signal Analysis](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/spectrumanalyzer_plotting.py): `python-api/spectrumanalyzer_plotting.py`
- [Other Instruments](https://github.com/liquidinstruments/moku-examples/tree/main/python-api): `python-api`

### Neural Network

- [Neural Network Examples](https://github.com/liquidinstruments/moku-examples/tree/main/neural-network): `neural-network`
- [Anomaly Detection](https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/utils_anomaly_detection.py): `neural-network/utils_anomaly_detection.py`
- [Photodiode Regression](https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/Quadrant_Photodiode.py): `neural-network/Quadrant_Photodiode.py`
- [Radar Processing](https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/PulsedRADAR/matchedFilter.py): `neural-network/PulsedRADAR/matchedFilter.py`
- [Neural Control](https://github.com/liquidinstruments/moku-examples/blob/main/neural-network/nonlinear_actuator.py): `neural-network/nonlinear_actuator.py`

### Multi Instrument

- [Multi-Instrument Examples](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/mim_wg_rtm_osc.py): `python-api/mim_wg_rtm_osc.py`
- [Swept Pulse Setup](https://github.com/liquidinstruments/moku-examples/blob/main/mc/Moderate/SweptPulse/MokuPro/mim_mpro_wg_mcc_la_osc.py): `mc/Moderate/SweptPulse/MokuPro/mim_mpro_wg_mcc_la_osc.py`

### Other Languages

- [Language Examples](https://github.com/liquidinstruments/moku-examples/tree/main/other-language-api): `other-language-api`

### Custom Designs

- [Boxcar Controls](https://github.com/liquidinstruments/moku-examples/blob/main/mc/HDLCoder/hdlcoder_boxcar/python/BoxcarControlPanel.py): `mc/HDLCoder/hdlcoder_boxcar/python/BoxcarControlPanel.py`
- [Dual Boxcar Controls](https://github.com/liquidinstruments/moku-examples/blob/main/mc/HDLCoder/hdlcoder_boxcar/python/DualBoxcarControlPanel.py): `mc/HDLCoder/hdlcoder_boxcar/python/DualBoxcarControlPanel.py`
- [Compile Designs](https://github.com/liquidinstruments/moku-examples/blob/main/python-api/moku_compile_arithmetic.py): `python-api/moku_compile_arithmetic.py`

### Other components

- **Example User**
- **Moku Device**
- **Moku API**
- **Plots and Results**
- **Saved Model**

## Connections

- Example User → Instrument Examples: runs (evidence: `README.md`)
- Example User → Neural Network Examples: runs (evidence: `README.md`)
- Example User → Multi-Instrument Examples: runs (evidence: `README.md`)
- Example User → Language Examples: runs (evidence: `README.md`)
- Instrument Examples → Oscilloscope: includes (evidence: `README.md`)
- Instrument Examples → PID Control: includes (evidence: `README.md`)
- Instrument Examples → Waveform Generation: includes (evidence: `README.md`)
- Instrument Examples → Logging and Streaming: includes (evidence: `README.md`)
- Instrument Examples → Signal Analysis: includes (evidence: `README.md`)
- Instrument Examples → Other Instruments: includes (evidence: `README.md`)
- Oscilloscope → Moku API: configures and reads (evidence: `python-api/oscilloscope_averaging.py`)
- PID Control → Moku API: configures and reads (evidence: `python-api/pidcontroller_plotting.py`)
- Oscilloscope → Plots and Results: plots acquired data (evidence: `python-api/oscilloscope_averaging.py`)
- PID Control → Plots and Results: plots acquired data (evidence: `python-api/pidcontroller_plotting.py`)
- Moku API → Moku Device: controls instruments (evidence: `README.md`)
- Neural Network Examples → Anomaly Detection: includes (evidence: `README.md`)
- Neural Network Examples → Photodiode Regression: includes (evidence: `neural-network/Quadrant_Photodiode.py`)
- Neural Network Examples → Radar Processing: includes (evidence: `neural-network/PulsedRADAR/matchedFilter.py`)
- Neural Network Examples → Neural Control: includes (evidence: `README.md`)
- Photodiode Regression → Saved Model: saves trained model (evidence: `neural-network/Quadrant_Photodiode.py`)
- Radar Processing → Plots and Results: plots correlations (evidence: `neural-network/PulsedRADAR/matchedFilter.py`)
- Multi-Instrument Examples → Moku Device: configures instruments (evidence: `README.md`)
- Swept Pulse Setup → Moku Device: configures multi-instrument mode (evidence: `mc/Moderate/SweptPulse/MokuPro/mim_mpro_wg_mcc_la_osc.py`)
- Swept Pulse Setup → Plots and Results: records streamed data (evidence: `mc/Moderate/SweptPulse/MokuPro/mim_mpro_wg_mcc_la_osc.py`)
- Boxcar Controls → Moku Device: controls design (evidence: `README.md`)
- Dual Boxcar Controls → Moku Device: controls design (evidence: `mc/HDLCoder/hdlcoder_boxcar/python/DualBoxcarControlPanel.py`)
- Compile Designs → Moku Device: demonstrates device design (evidence: `README.md`)
- Language Examples → Moku Device: calls device API (evidence: `other-language-api/main.rs`)
