💬 Analyze random signals through conversation. 🧩 Build communication pipelines with blocks.
Diting brings Random Signals and Communication Principles experiments into one ocean-themed workspace. Generate noisy signals, compare filters and inspect time-frequency features, or connect coding, modulation, channel and receiver blocks to explore an end-to-end transmission.
🎓 Built for UESTC Random Signals and Communication Principles coursework, with local computation, seeded reproduction and optional model-assisted dialogue.
🌐 Experiment preview 📦 Download v0.5.2 📘 Installation guide
🧭 Explore
✨ Features
| Capability |
What you can do |
| 🐳 Ocean UI |
Layered ocean/lilac gradients and AI-generated 3D whale art for desktop, tablet and mobile. |
| 📡 Communication lab (v0.5.2) |
234 addable blocks, 131 presets, 4 experiment tools and 12 courses: Scratch-style assembly, whole-graph experiments, baseline replay and verified bundles. |
| 🔑 Model API setup |
Choose a provider/model, enter a key and test/apply in the UI; optional per-session persistence. |
| 📄 PDF analysis reports (v0.4.12) |
Preview and export Chinese brief/standard reports with vector plots, measured metrics, optional diagnosis and reproduction details. |
| 🩺 Diagnostic laboratory |
Linked STFT and event timeline, six seeded fault types, blind challenge evaluation, and reversible evidence-based processing trials. |
| 💾 Experiment workbench |
Create from templates, save, reopen, duplicate, search, rename or delete snapshots, and resume after a restart. |
| 📥 Data import wizard |
Preview CSV/TXT, select time and signal columns, convert time units and locate invalid rows. |
| 🔍 Snapshot comparison |
Overlay 2–4 saved results, compare parameters and metrics, and download a standalone HTML report. |
| ⏳ Tasks and storage |
Inspect the queue, cancel work at safe checkpoints, unload idle sessions and clean unreferenced sample files after preview. |
| 📦 Data and reports |
Export full-resolution CSV, standalone HTML reports, manifests and portable experiment ZIPs. |
| 🧮 Explainable comparison |
Choose denoising, waveform or transient preservation; inspect score terms, parameters and timings. |
| 🎲 Reproducible simulation |
Set sample rate, duration, frequency, noise, and random seed. |
| 🧹 Six preprocessing methods |
Compare robust moving average, median, exponential smoothing, FFT low-pass, hybrid, and Kalman filtering. |
| 📈 Time and frequency analysis |
Inspect statistics, FFT peaks, correlations, and spectral features. |
| 🔬 Random-process analysis |
Explore AR models, Welch power spectra, and residuals. |
| 🤖 Agent mode |
Compare methods and parameters automatically, inspect tool traces, and review recommendations. |
| 🎙️ Multiple inputs |
Analyze simulated signals, CSV/TXT samples, or browser microphone audio; download processed audio. |
📡 Communication-principles lab Build a transmitter and receiver with blocks
Drag in blocks, edit their parameters, click 🔨 Build to check the pipeline, then ▶️ Run to inspect the transmission. Six block categories provide 234 addable blocks, a fixed sink and 131 presets.
🎲 Sources → 🔀 Transmit converters → 📡 Modulators → 🌊 Channels → 🎛️ Demodulators → 🔄 Receive converters → 📺 Sink
| Module |
Included techniques |
| 🎲 Sources |
Random/custom bits, UTF-8 text, sine, square and Gaussian sources; PRBS7/9/15 m-sequences and correlation views. Audio, image, file and probabilistic byte sources. |
| 🔀 Transmit converters |
Uniform/companded PCM, DPCM and delta modulation; repetition, Hamming, convolutional and LDPC coding, CRC, scrambling, interleaving and ten line codes. Huffman, ADPCM, BCH, RS, packetization, DSSS, SIMO training, Alamouti and MIMO spatial multiplexing. |
| 📡 Modulators |
BPSK/QPSK/16QAM, OOK/2ASK, 2FSK, DBPSK/DQPSK, MSK/GMSK; AM/DSB-SC/SSB/VSB/FM/PM, PAM; real/complex pulse shaping, preambles, pilots and OFDM/IFFT/CP. |
| 🌊 Channels |
AWGN, band limits, attenuation, phase shifts, erasures, AC coupling, ISI and clock/timing offsets; carrier offset, phase noise, unknown frame delay, complex multipath, Rayleigh/Rician fading, independent time-varying paths and Markov burst noise. Chip multipath, fixed/block-Rayleigh antenna matrices and independent receiver noise. |
| 🎛️ Demodulators |
Paired demodulation and PSK/QAM LLRs; matched filtering, symbol/carrier/frame recovery, ZF/MMSE/DFE, real/complex LMS/NLMS/RLS, CMA, pilot LS and OFDM/FFT/frequency-domain equalization; AGC, estimated N0, rational resampling, T/2 FSE and OFDM CFO/pilot tracking. |
| 🔄 Receive converters |
Line decoding, deinterleaving, descrambling, CRC checks, repetition/Hamming correction, hard/soft Viterbi, iterative LDPC and PCM/companding/DPCM/delta reconstruction. Huffman/ADPCM/BCH/RS decoding, reassembly, code acquisition, despreading, RAKE, SC/MRC, Alamouti and MIMO ZF/MMSE. |
| 📺 Sink |
Received bits, text and analog waveforms, with source overlays, bit-error markers and full-sequence browsing. Audio playback, image reconstruction/PSNR and downloadable files with SHA256 comparison. |
-
🔌 v0.5.2 dual-board UART Generate separate transmitter and receiver projects for Pico, Pico W and ESP32-S3, mix C++ with MicroPython, and inspect frames and CRC in the text, PRBS and Hamming experiments. Dual-board lab guide
-
🧪 v0.5.1 board experiments Send UTF-8 text or reproducible PRBS through UART, inject a bit error and inspect the Hamming syndrome, or compare QPSK I/Q symbols against desktop results. Board experiments
-
🔌 v0.5.0 development boards Generate standalone C++ or MicroPython for Pico and Pico W, navigate between blocks and source lines, and compare BPSK and wired UART runs against desktop results. Pico guide.
-
🧩 v0.4.12 Scratch-style assembly: snapping blocks, inline parameters, parallel receiver containers, copy/cut/paste, folded groups and notes preserve the ocean theme and existing algorithms.
-
🔬 v0.4.12 whole-project experiments: probes, reference comparisons, metric summaries and acceptance conditions run with the complete graph across seeded batches, scans, constrained searches and classroom checks.
-
📚 v0.4.12 courses and delivery: 12 complete lessons, named baselines, configuration/result differences and exact-seed replay; verified ZIP bundles contain the project, executable Python, measured CSV/JSON, inputs, charts, PDF and manifest. Report previews display the final PDF with saved material order.
📘 v0.4.12 complete guide
- 🪸 v0.4.11 visual wiring: 2–4 receiver branches, a two-input symbol / LLR merge and one common decoder tail. Editable ports, saved positions and undo share one canonical graph; partial runs reuse the actual frozen channel input.
- 🎯 v0.4.11 multi-target sensing: target lists, two-dimensional CA-CFAR, measured power / threshold / noise grids and detection tables, with complete JSON, Python and PDF exports.
- 🆕 v0.4.10 autonomous reception: MLSE, MUSIC-guided MVDR and 3GPP TDL-A/B/C; protected self-describing headers recover packet lengths, MCS and payload offsets directly from continuous I/Q recordings.
- 🔁 v0.4.10 coding and feedback: Turbo Log-MAP / Max-log BCJR, convolutional IR-HARQ and equal-budget Chase comparisons, with actual extrinsic messages, RV indices, mother-code coverage and resource counts.
- 🔬 v0.4.10 experiments and teaching: actual-run algorithm replay, measurement diagnostics and block timing, constrained two-parameter Pareto design, teacher batch review and frame-level event/recovery scenarios.
- 🔱 v0.4.10 merging and sensing: two receive paths share channel samples and merge symbols or LLRs; single-target OFDM sensing estimates range and velocity alongside communication decoding. Themed analysis pages retain the ocean design and project workflow.
- 🔍 v0.4.9 advanced receivers: LMMSE, Kalman, per-stream soft MIMO, Polar SC/CRC-SCL, angular array channels, MRT/SVD precoding and MVDR beamforming.
- 🌊 v0.4.9 waveform and RF: DFT-s-OFDM/SC-FDMA, memory polynomial PA and measured-loopback DPD, Schmidl–Cox/Zadoff–Chu burst synchronization and sampling-clock recovery.
- 🧰 v0.4.9 experiments: conditional breakpoints, durable batch/grid/search checkpoints, statistical plots and trial replay, staged student submissions, linked spatial views and configurable PDF reports.
- 🔁 v0.4.8 closed-loop links: run ARQ, Chase HARQ and AMC through your current block pipeline, measuring ACK/NACK, retries, soft combining, airtime and goodput.
- 🛰️ v0.4.8 spatial communication: ZF-SIC/MMSE-SIC, dynamic correlated MIMO and pilot tracking, MIMO-OFDM, independent-user OFDMA and FHSS; inspect antenna samples, stream constellations, channel matrices and SIC layers.
- 🧩 v0.4.8 projects and teaching: versioned subprojects with typed ports and public parameters, an assignment editor, multi-project seeded batches and minimum-SNR search; import SigMF/raw I/Q into receiver blocks and export recordings.
- 🎙️ v0.4.7 business payloads: audio, images, files and probabilistic sources; Huffman, IMA ADPCM, BCH, RS and packet assembly; playback, image reconstruction and SHA256 verification.
- 📡 v0.4.7 spread spectrum and antennas: DSSS, code acquisition, despreading, RAKE, SIMO SC/MRC, Alamouti 2×1 and 2×2 MIMO ZF/MMSE with correlation, path and pilot-estimation views.
- 🎓 v0.4.7 teaching experiments: shared formulas, 2D sweeps, algorithm traces, nine challenges, experiment differences and Python/JSON/SVG export; ARQ/HARQ and five-profile AMC feedback experiments.
- 🧭 v0.4.6 layout and interaction: compact controls, searchable experiments, parameter/receiver tabs, unified analysis, enlarged charts and mobile parameter drawers; explicit task, timestamp and parameter provenance.
- 🆕 v0.4.5 RF and analysis: 8PSK/64QAM/256QAM, I/Q/DC correction, Rapp/Saleh PA, ADC, OFDM clipping, tone interference/notch filtering and punctured convolutional coding; Welch/CCDF/ACLR, carrier EVM, resource grids, automatic alignment and seven guided comparisons.
- 🧰 Block programming experience: search/favorites, typed connections and receiver completion, real stepping, linked scopes, named projects and snapshots, reusable composite blocks, shared-channel branches, resumable generic sweeps, stateful frames and Chinese PDF reports.
- 🧩 Build and edit: an ocean-themed palette, compact connected blocks and a parameter inspector; drag/drop, reordering, undo/redo, draft recovery and project JSON import/export.
- 📈 Inspect and save: processing-stage waveforms, preamble correlation, OFDM grids, eyes and recovery traces; seeded BER/SER/FER sweeps, Eb/N₀ calibration, 95% intervals, curve comparisons and full JSON/CSV export.


📘 v0.4.11 guide
📘 v0.4.9 advanced transceivers and debugging guide v0.4.8 closed-loop and spatial communication guide
📘 v0.4.7 business and teaching guide
📘 v0.4.5 RF and measurement guide

🆕 v0.4.4 algorithms and experiments

📚 Lab guide Analog modulation Line codes and channels Timing and equalization
🎬 Interface
v0.3.4 uses cyan, lavender and coral-pink gradients, 4 px outer borders and 2 px inner borders. Chinese text uses STZhongsong when installed; Latin text and numbers use Times New Roman. A larger, bold clock sits above the local-computing badge. Agent method comparisons separate conclusions, recommended metrics and next steps. Switching between the six views preserves inputs and experiment state.
These captures show v0.3.4, including the visual update shipped in its deployment ZIP. Fonts are loaded from the visitor’s computer, with serif fallbacks when unavailable.

Explore templates, diagnostics and API setup
Templates and experiments: compare six methods, save named snapshots and import/export full experiment packages.

Diagnostic laboratory: inspect linked time-frequency and waveform plots, locate events and verify processing trials.

Models and settings: choose your provider, model and persistence options in the browser.

Watch the ocean walkthrough (v0.3.0)
Agent acquisition and analysis → save a snapshot → inspect fault diagnostics → open model settings. The walkthrough uses the local signal tools.

📄 Export a PDF analysis report
After collecting or restoring an experiment, open 模板与实验 → PDF 分析报告 (Templates & Experiments → PDF report). Set the title, author, purpose, units and brief/standard edition. Select 预览摘要与章节 to review the summary, then 下载 PDF to download.
Reports currently use Chinese. Standard reports include waveform metrics, FFT, Welch PSD, autocorrelation, existing method comparisons/diagnostics and reproduction details; brief reports focus on the overview, key metrics, waveform and FFT. Narrative statements use the measured data and require no model key. True SNR/RMSE need a clean reference, and blind experiments must be revealed first.

Example PDF Report guide (Chinese)
New in v0.3.2: Select up to 50 recent processing results, optionally include saved snapshots, and arrange them chronologically. Export one PDF with a shared cover, summary, clickable contents and plots for every group. History survives server restarts; older unsaved results cannot be recovered.
🚀 Quick start
Use Python 3.12–3.14 or Docker Compose v2. v0.4.12 uses FastAPI; deployment checks cover Python 3.12–3.14 on Windows and Linux, plus Docker on Linux.
1. Get the project
Download the v0.5.2 deployment ZIP and extract it, then open a terminal in 工程文件/代码 inside the extracted folder.
Or clone the repository:
git clone https://github.com/PatrickStar-cmd/random-signal-agent.git
cd "random-signal-agent/工程文件/代码"
2. Install and start
Windows PowerShell — use Python 3.12–3.14:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements-repro.txt
.\.venv\Scripts\python.exe server.py --host 127.0.0.1 --port 8000
Linux / macOS
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements-repro.txt
.venv/bin/python server.py --host 127.0.0.1 --port 8000
Run with Docker instead
From the same 工程文件/代码 directory:
cp .env.example .env
docker compose up -d --build --wait --wait-timeout 120
On Windows, replace the first command with Copy-Item .env.example .env. Uploads and generated outputs persist in local folders. Use docker compose logs --tail 100 to inspect the service and docker compose down to stop it.
3. Open the application
Visit http://127.0.0.1:8000. Simulation, filtering, and analysis are available without configuring an external model.
The online preview shows the saved experiment and interface captures. Interactive experiments run with the Python backend.
🧪 Your first experiment
-
Open 信号工作区 (Workspace). Enable Agent mode to compare six preprocessing methods automatically, then enter this command. The local command parser supports Chinese:
采集一段 8 秒、采样率 200Hz、主频 8Hz 的正弦信号加高斯噪声,随机种子 42
This creates an 8-second sine signal with Gaussian noise at 200 Hz, with an 8 Hz target frequency and seed 42.
-
Inspect the waveform, spectrum and statistics. In command mode, continue with:
使用滑动平均预处理并分析时域和频域特征
This applies a moving average and analyzes time/frequency features.
-
Open 模板与实验 (Templates), enter a name and save a snapshot. Export an experiment ZIP to restore full samples, results and tool records later. Successful operations automatically save the current experiment. After running or restoring, comparisons reuse current data; select another template to generate a new signal.
-
For your own data, open 导入数据 (Import) and upload UTF-8 CSV/TXT. Select the time/signal columns and time unit, or enter a sample rate when no time column exists. Confirm the preview, then compare and save results in Templates.
-
Open 对比与报告 (Comparison), select 2–4 snapshots and inspect overlays and metrics or download an HTML report. Scores are directly comparable only when inputs, references, goals and scoring versions match.
For anomaly detection, save your current experiment before loading the fault demo in 诊断实验室 (Diagnostics). Inspect evidence, select an interval and verify a processing trial. Adopt a result and save it as a snapshot. Blind mode hides truth and reference error until reveal and restricts full experiment export and comparisons; the diagnostic report remains available.
External models are optional. Open 模型与设置 → 模型 API 配置 (Settings → Model API); see Configuration below.
Keep the same parameters and seed to reproduce simulated samples. The import wizard selects one signal from multicolumn data. Quick upload reads a single value column or the first two columns as time in seconds and values; see the data guide.
🏗️ How it works
flowchart TD
UI["Web chat / Agent mode"] --> Agent["Dialogue and tool routing"]
Model["Optional model API"] -.-> Agent
Agent --> Input["Simulation / CSV / microphone"]
Input --> Filter["Preprocessing and method comparison"]
Filter --> Analysis["Time / frequency / random-process analysis"]
Analysis --> Results["Plots, metrics, tool traces, and recommendations"]
| Component |
Responsibility |
web/chat.html + server.py |
Web interface, uploads, HTTP endpoints, and streamed responses. |
src/dialogue_agent.py |
Interpret tasks and coordinate the signal tools. |
src/acquisition.py |
Acquire simulated signals, uploaded samples, and audio. |
src/preprocessing.py |
Filter signals and compare candidate methods. |
src/analysis.py + src/advanced_analysis.py |
Calculate time, frequency, and random-process features. |
src/llm_client.py |
Connect to an optional Chat Completions-compatible service. |
All component paths are relative to 工程文件/代码.
⚙️ Configuration
The local toolchain is the default. To connect an external model, open 模型与设置 → 模型 API 配置 (Settings → Model API):
- Choose OpenAI, DeepSeek or a custom Chat Completions-compatible provider and enter its key.
- Load the model list and select a model, or enter the exact model ID manually.
- Choose 测试并应用 (Test and apply). The current browser session updates immediately without restarting; you can switch back to local tools or remove the configuration.
Keys stay in server memory by default. Opting into restart persistence stores them in plaintext in data/model-settings.sqlite3. Browser storage, experiment ZIPs and task history contain no keys. See the model setup guide for compatibility, persistence and advanced parameters.
Server defaults and startup scripts
Administrators can copy config/server.env.example to config/server.env to set service-wide defaults. Per-session configuration takes precedence.
| Setting |
Purpose |
RS_AGENT_HOST / RS_AGENT_PORT |
Server bind address and port; use 127.0.0.1 for local access. |
RS_AGENT_LLM_BASE_URL |
Model API base URL, such as https://your-provider.example.com/v1. |
RS_AGENT_LLM_MODEL |
Model identifier accepted by your provider. |
RS_AGENT_LLM_API_KEY |
Your provider’s API key. |
RS_AGENT_LLM_TIMEOUT |
Model request timeout in seconds; default: 45. |
RS_AGENT_LOG_FILE |
Startup-script log path; default: logs/server/server.log. |
After activating the virtual environment, use scripts/start_server.ps1 on Windows or bash scripts/start_server.sh on Linux/macOS to load this file. Directly running server.py does not load config/server.env.
Docker Compose reads .env in the code directory. See the deployment guide for Docker settings, HTTPS hosting, and service management.
📊 Reproducible example
The saved showcase uses a random process with mixed noise: 200 Hz, 8 seconds, 1,600 samples, an 8 Hz target frequency, and seed 42. A robust moving average uses a 7-sample window.
| Metric |
Result |
| Detected dominant frequency |
8.000 Hz |
| Original SNR |
2.859 dB |
| Processed SNR |
4.781 dB |
| SNR improvement |
1.922 dB |
Results depend on the input signal and filter parameters.
Sample CSV Analysis results Experiment configuration Reproduction guide
Check your deployment
With the application running, open another terminal in 工程文件/代码 and use the same Python environment:
# Windows
.\.venv\Scripts\python.exe scripts/smoke_deployment.py --base-url http://127.0.0.1:8000
# Linux / macOS
.venv/bin/python scripts/smoke_deployment.py --base-url http://127.0.0.1:8000
The check covers the application version, ocean assets, model settings API, Agent mode, streaming, import/export, diagnostics and PDF download. Its result is written to logs/deployment/latest.log. Release assets also include SHA256SUMS.txt and verification.json.
🔧 Troubleshooting
| Question |
Answer |
| Why does the online preview not run new experiments? |
GitHub Pages serves the saved showcase. Start the backend locally or deploy it with Docker for interactive use. |
| Do I need an API key? |
The local signal tools do not require one. Model-assisted dialogue is optional. |
| Which Python versions work? |
v0.4.12 supports Python 3.12, 3.13 and 3.14. |
| Why can I not activate the virtual environment on Windows? |
The quick-start commands call .venv\Scripts\python.exe directly and do not require activation. |
| Why is the microphone unavailable? |
Open the app on localhost or HTTPS and allow microphone access in the browser. |
| Why does my uploaded signal have no SNR value? |
Reference-based SNR requires a clean signal. Uploaded samples and microphone audio do not provide that reference. |
| What if port 8000 is occupied? |
Start with --port 8001, then open http://127.0.0.1:8001; update the smoke-check URL too. |
📚 Documentation
| Guide |
Contents |
| PDF report guide |
Report options, preview, sections and measured evidence (Chinese). |
| Model API setup |
Browser configuration, key persistence and compatibility. |
| UI guide |
Six-view navigation, responsive layout and controls. |
| Installation & release |
Deployment ZIP, platform commands, and checksums. |
| Experiment guide |
Saved data, parameters, file formats, and reproduction. |
| Code overview |
Modules and model configuration. |
| Communication lab |
Block pipelines, Build/Run, metrics, exports and baseband model (Chinese). |
| Running & configuration |
Commands, settings, and logs. |
| Features & validation |
Implemented capabilities, checks, and current limits. |
| Algorithm principles |
Signal-processing methods and analysis. |
| Deployment |
Docker, HTTPS, systemd, and health checks. |
| Changelog |
Release history. |
The code and algorithm guides are in Chinese.
🤝 Contributing
Issues and pull requests are welcome for bug fixes, signal-processing methods, experiment examples, and documentation. For a bug report, include your Python version, input parameters, steps to reproduce, and relevant logs. For an algorithm change, include a reproducible signal and a before/after comparison.
Open an issue View pull requests
📄 License
Licensed under the MIT License. Retain the license and copyright notice when using, modifying, or distributing the project. Third-party dependencies and assets retain their respective licenses.
评论