Go SDR demodulator. Single-module, single-binary project.
# UI (run from ui/)
cd ui && npm ci && npm run build # builds to content/
cd ui && npm run dev # dev server with proxy to :8080
# Go
go build -o segdsp .
go test -v -race ./...
golangci-lint run
go vet ./...
go fmt ./...No Makefile or task runner exists.
- Entry point:
segdsp.go(package main, all root*.gofiles) dsp/— DSP primitives (FIR, FFT, NCO, AGC, resamplers). Contains arch-specific code:dsp/native/amd64/— AMD64 assembly optimizationsdsp/native/c/— C fallback implementations
demodcore/— Demodulator interface + FM/AM implementationseventmanager/— Channel-based pub/sub event busrecorders/— WAV file recordingcontent/— Built web UI (Vite output), embedded viago:embedui/— Preact + Vite source for the web UIcontrol.go— WebSocket control message handler (runtime param changes)helpers.go— Message types (FFT, device, control)websocket.go— WebSocket server with broadcast + incoming control read loop
- Docker builds use
CGO_ENABLED=0for static binaries despite native C code existing - Binary is named
segdsplocally butsegdsp_workerinside Docker containers - The app cannot start without a running
radioserverinstance (external SDR IQ source, not in this repo) - Default branch is
master; releases are tag-triggered via GitHub Actions (release.yml) - Multi-arch Docker builds (amd64, arm32v6, arm64v8) use QEMU emulation in CI — no host-side cross-compilation needed
content/is auto-generated bynpm run buildinui/— do not edit directly- The Dockerfile has a multi-stage build: node → go → alpine runtime
All tests are pure unit tests (DSP math primitives). No integration tests, no external service dependencies, no test fixtures. Benchmark files exist (benchmark_*.go).
- HTTP routing uses stdlib
http.HandleFuncdirectly, no router library - CLI flags parsed with stdlib
flag, env vars set incommon.go:setEnv() - WebSocket endpoint at
/ws, UI at/, assets at/assets/* - Control messages: clients send
{"MessageType":"control", ...}JSON to/wswhenWebCanControl=true - Runtime changes to demod mode / filter BW / squelch trigger a DSP pipeline rebuild
- Frequency changes are applied directly to the RadioServer without rebuild