Smart triggered RF capture on NI USRP radios with Wireless Testbench — record only when a signal of interest appears, not continuously (triggered spectrum sensing).
Ships in wireless-communications. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Read references/patterns.md before generating any capture code.Read references/api.md for signatures, property ranges, and threshold constraints. Every generation validates parameters against it before emitting code — see the Always rule below. This read is not optional.references/overview.md — conceptual architecture and detector behavior.references/threshold-calibration.md — the calibration sub-workflow (plotDetectionSignals / plotThreshold step-by-step). Do not load it during first-time code generation.This skill exposes one sub-workflow that is loaded on demand from references/:
| Sub-workflow | What it provides |
|---|---|
Threshold Calibration (references/threshold-calibration.md) | Step-by-step plot -> diagnose -> tune procedure for both energyDetector and preambleDetector, plus combined symptom -> cause -> fix table |
Route into references/threshold-calibration.md whenever any of these conditions hold:
status == 0 (capture timed out, no data captured) and the user expected a signal to fire it. This is the primary trigger.status >= 1 but the captured data is wrong: noise instead of signal, baseline instead of preamble, saturated waveform (max(abs(data)) near 1.414), or sanity ratio fails (r < 50 for energyDetector, r < 100 for preambleDetector).status=0, sometimes status=1); thresholds are sitting on a jittery boundary. Do not run extra captures hunting for this — the Always rule below caps a clean run at one.plotDetectionSignals / plotThreshold.Sanity ratio r — where it comes from. Every Pattern's %% Verify block computes and prints r, so triggers 2 and 3 are read straight off the pattern's own output. No extra run is needed.
| Detector | Formula the pattern prints | Real signal |
|---|---|---|
energyDetector (A/B/E/F) | r = max(abs(data).^2) / median(abs(data).^2) | r >= 50 |
preambleDetector (C/D/G) | same ratio on the matched-filter output, filter(conj(flipud(pd.Preamble)), 1, data) | r > 100 |
| Wideband chirp / OFDM (F) | raw r under-reports — 15-20 is normal; the pattern also prints a matched-filter ratio | matched-filter ratio >> 100 |
Do not route into the sub-workflow for first-time code generation — generate the Pattern from this SKILL.md, run it, and only route into calibration on a failure outcome. The sub-workflow assumes a detector object is already configured and a TX or external signal is present.
If the failure mode is RF-path (no peaks at all on the figure, wrong frequency, broken cable, wrong antenna name), the sub-workflow exits early back to this skill — calibration cannot fix RF problems.
Generate working MATLAB code to detect and capture RF signals using energy detection or preamble detection triggers on NI USRP radios with Wireless Testbench.
Before this skill applies, the user must have:
Trigger this skill when the user wants smart/triggered capture — record only when something interesting appears on the air, not continuously:
energyDetector, Patterns A/B/E/F) — wake-on-signal recording, opportunistic capture, transmit-then-detect verificationpreambleDetector, Patterns C/D/G) — WLAN L-LTF, 5G NR PSS/SSS, LTE PSS, Zadoff-Chu, custom sync sequencesplotDetectionSignals for energyDetector, plotThreshold for preambleDetector)Route to another skill if the user's goal is:
matlab-transmit-capture-usrpmatlab-read-documentation skill for "Live Data I/O" (Wireless Testbench)matlab-set-up-usrp-radiomatlab-read-documentation skill for "Radio Management" (Wireless Testbench)matlab-read-documentation skill for "Target NI USRP Radios" (Wireless Testbench)User request
|
|-- Mentions "untriggered capture", "immediate capture", "basebandReceiver"
| -> REDIRECT to matlab-transmit-capture-usrp
|
|-- Mentions "System object", "streaming loop", "real-time processing"
| -> REDIRECT: use matlab-read-documentation for "Live Data I/O" (Wireless Testbench streaming)
|
|-- Wants triggered capture (detection-based)
| |
| |-- Knows signal structure (preamble sequence available)
| | |-- Adaptive threshold -> Pattern C
| | |-- Fixed threshold -> Pattern D
| | |-- Wants to calibrate threshold -> Pattern D + plotThreshold
| | |-- Frequency scanning loop -> Pattern G
| |
| |-- Explicit energy/power cue (energy rise, power increase), no preamble
| | |-- Adaptive threshold (energy delta + minimum) -> Pattern A
| | |-- Fixed threshold -> Pattern B
| | |-- Wants to calibrate threshold -> Pattern A/B + plotDetectionSignals
| | |-- Multiple captures with timestamps -> Pattern E
| | |-- Transmit-then-detect workflow -> Pattern F
| |
| |-- Ambiguous: no energy/power cue, no preamble, no parameters given
| -> ASK FIRST (do not assume energy): "Do you have a known preamble
| sequence to correlate against, or do you want to trigger on any
| signal energy increase? Also, what threshold values or detection
| parameters would you like to use?"
| Function | Purpose | Toolbox | Available From |
|---|---|---|---|
energyDetector | Arm radio; trigger capture when energy rises above the noise floor | Wireless Testbench | R2023b |
preambleDetector | Arm radio; trigger capture on correlation with a known preamble | Wireless Testbench | R2022a |
capture | Blocking triggered IQ capture (returns on detection or timeout) | Wireless Testbench | with detector object |
capture(..., "NumCaptures", N) | Capture N consecutive triggered signals (Pattern E) | Wireless Testbench | R2024a |
plotDetectionSignals | Calibrate energy threshold — energyDetector only | Wireless Testbench | R2023b |
plotThreshold | Calibrate preamble threshold — preambleDetector only | Wireless Testbench | R2022a |
transmit / stopTransmission | Send / stop a test waveform on the detector object (Pattern F) | Wireless Testbench | with detector object |
zadoffChuSeq | Generate a Zadoff-Chu preamble sequence (Patterns C/D) | Communications Toolbox | R2012b |
wlanLLTF / wlanNonHTConfig | Build the WLAN L-LTF preamble (Pattern G) | WLAN Toolbox | R2015b |
chirp | Generate a test chirp waveform (Pattern F) | Signal Processing Toolbox | before R2006a |
Select on an explicit cue, not on the mere absence of a preamble.
| Signal | User says | Detector |
|---|---|---|
| Energy-based | explicit energy/power cue: "energy", "power increase/rise", "amplitude above the noise floor" | energyDetector |
| Preamble-based | "preamble", "Zadoff-Chu", "L-LTF", "PSS/SSS", "correlation", a known sequence | preambleDetector |
| Ambiguous | only "detect a signal" / "capture when it appears" — no energy/power cue, no preamble, no threshold parameters | Ask first (Guardrails -> Ask First); do not default to energy |
| Parameter | Required | Ask if missing |
|---|---|---|
| Radio name | Yes | Always |
| Center frequency | Yes | Yes |
| Sample rate | Yes | Yes |
| Threshold method | Yes | Yes (adaptive/fixed) |
| Threshold values | Yes | Yes |
| Capture duration | Yes | Yes |
| Timeout | Yes | Default seconds(1) if not specified |
| Preamble sequence | Only for preambleDetector | Yes |
Check parameter values against valid ranges before generating code. See references/api.md for complete constraint tables (WindowLength, FixedThreshold, Preamble length, TriggerOffset, AdaptiveThresholdGain, AdaptiveThresholdOffset).
If a value violates these constraints, inform the user and suggest the valid range. Do NOT generate code with invalid values.
The seven copy-ready patterns (A–G) live in references/patterns.md. Read references/patterns.md now, then use the pattern the Decision Tree selected. Each pattern ships with concrete default values — replace the values marked % <- set with the user's radio and signal parameters, and validate them against the references/api.md ranges (Step 3) before running. For loopback bring-up (transmit-then-detect), follow the Local Hardware Testing table in that file.
| Pattern | Detector | Threshold | Use case |
|---|---|---|---|
| A | energyDetector | adaptive | Wake-on-signal capture on an energy rise |
| B | energyDetector | fixed | Capture above a fixed power level |
| C | preambleDetector | adaptive | Capture on correlation with a known preamble |
| D | preambleDetector | fixed | Preamble capture / plotThreshold calibration |
| E | energyDetector | adaptive | Multiple consecutive captures with timestamps |
| F | energyDetector | adaptive | Transmit-then-detect (loopback) |
| G | preambleDetector | adaptive | Frequency-scanning loop (WLAN channel scan) |
If a generated pattern fires unreliably (timeout despite a real signal, false positives, or captures of noise/baseline), route into the threshold calibration sub-workflow — see the per-pattern calibration notes in references/patterns.md and the procedure in references/threshold-calibration.md.
Organized by when they apply: Always rules fire on every generation, Ask First rules pause for the user, Never rules trigger a refusal and redirect.
radioName variable from user input — never hardcode radio names.clear ed pd — releases any prior radio lease regardless of detector class. The same physical radio can be held by either an energyDetector or a preambleDetector object; clearing only one variable name does not release a lease held by the other, which causes validateLeaseOwner errors when patterns are pasted sequentially into the same MATLAB session.references/api.md for exact valid ranges per parameter (key: energyDetector FixedThreshold [0, 8191], preambleDetector FixedThreshold [0, 4095]). If a value is out of range, state the valid range and do not emit the code.%% Verify section that reports the outcome and prints the sanity ratio r (formulas in the table above). Do NOT hard-assert on status: a timeout (status == 0) is an expected result to handle (warn + route to calibration), not a crash — a hard assert makes a no-signal bench run throw.NumCaptures captures and let Pattern G finish every channel in its scan loop. Once %% Verify reports success (status == 1, or status > 0 for multi-capture) and the printed r clears its threshold — or, for a wideband chirp/OFDM signal, the matched-filter ratio confirms it — the task is done. Do NOT execute the full deliverable again end-to-end or re-open plotDetectionSignals / plotThreshold to double-check — each extra radio round-trip costs real seconds and risks a timeout. Only exception: the user reports earlier inconsistent firing (sub-workflow trigger 3), where a short repeat is allowed — see Exit Criteria in references/threshold-calibration.md.transmit() / stopTransmission() on the detector object for transmit-then-detect — do NOT create a separate basebandTransmitter.ThresholdMethod before calling transmit() — you cannot switch fixed↔adaptive during a continuous transmission (it errors: "stop the ongoing transmission first"). MinimumEnergy, EnergyDeltaThreshold, and FixedThreshold can be tuned live, so sweep those without stopping.plotDetectionSignals is energyDetector-only; plotThreshold is preambleDetector-only. Never cross them.pd.Preamble. Preamble elements must lie in [-1, 1] (references/api.md). Zadoff-Chu via seq / norm(seq, 2) already satisfies this; for a random or protocol-derived sequence, scale it with preamble = preamble / max(abs(preamble)) — raw randn/sample values overflow [-1, 1] and error at assignment.matlab-transmit-capture-usrp.matlab-read-documentation skill for "Live Data I/O", Wireless Testbench).Copyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/matlab-add-awgnRead BEFORE writing any code that adds Additive White Gaussian Noise (AWGN) to signals and converts between SNR, Eb/No, Es/No, and per-subcarrier SNR for communications simulations, using awgn(), convertSNR(), berawgn(). The default MATLAB patterns for AWGN (e.g., 'measured' option, manual SNR formulas) produce subtly incorrect results. This skill specifies the correct calling conventions, required function usage, and critical anti-patterns that must be avoided./matlab-design-ofdm-systemRead BEFORE writing any code that builds or simulates OFDM systems. The default MATLAB patterns for OFDM (e.g., direct ifft/fft, awgn with 0 dBW power, missing symOffset) produce subtly incorrect results — always use ofdmmod/ofdmdemod instead of direct IFFT/FFT. This skill specifies the correct calling conventions for ofdmmod, ofdmdemod, ofdmChannelResponse, ofdmEqualize, and critical anti-patterns that must be avoided. Use when building OFDM transmitters or receivers, allocating subcarriers and guard bands, inserting pilots, computing SNR for OFDM, configuring fading channels (Rayleigh/Rician), estimating and equalizing channels, implementing timing and frequency synchronization, adding LDPC coding, designing resource grids, or setting up OFDM link simulations./matlab-generate-5g-waveformGenerate 3GPP-compliant 5G NR downlink and uplink baseband waveforms. Use to create NR signals, test model (TM) waveforms, fixed reference channels (FRC), test and measurement (T&M) signals, or test vectors for conformance testing. Covers configuring data, control, and broadcast channels and signals: PDSCH, PUSCH, PDCCH, PUCCH, SRS, SSBurst, CSI-RS, DM-RS, PT-RS, CORESET, and BWP parameters including bandwidth, subcarrier spacing (SCS), modulation (QPSK, QAM), numerology, FR1, FR2, TDD, FDD, and multi-bandwidth-part setups. Use for signal generation, RF instrument playback, or IQ baseband synthesis. Requires 5G Toolbox.
/matlab-generate-ble-waveformGenerate Bluetooth Low Energy (BLE) PHY waveforms. Read BEFORE writing any BLE waveform code to avoid hallucinating API patterns. Covers bleWaveformGenerator, bleIdealReceiver, bleCTEIQSample, bleAngleEstimate, bluetoothTestWaveform for LE1M/LE2M/LE500K/LE125K. Bluetooth Toolbox R2022a+.
/matlab-generate-gnss-waveformGenerate GNSS baseband waveforms (GPS, Galileo, NavIC) with physically realistic or user-specified channel impairments using the Satellite Communications Toolbox. Use when generating GPS L1 C/A, L1C, L2C, L5, Galileo E1, E1C, E5a, E5b, E5, or NavIC L5, S, L1 signals. Covers gpsWaveformGenerator, galileoWaveformGenerator, satelliteScenario, Doppler/delay from orbital dynamics or custom values, navigation data encoding with ephemeris, and RINEX integration. Triggers on: GPS waveform, Galileo waveform, NavIC waveform, GNSS signal, satellite scenario, GNSS simulation, receiver test signal, baseband GNSS, L-band satellite signal, navigation signal generation.
/matlab-generate-wlan-waveformGenerate standard-compliant IEEE 802.11 waveforms using MATLAB WLAN Toolbox. Use when creating WLAN waveforms, PPDU packets, or the transmit side of a link-level simulation. Covers all formats: Non-HT (802.11a/g), HT (802.11n), VHT (802.11ac), HE-SU/HE-MU/HE-TB (802.11ax), EHT-MU/EHT-TB (802.11be), UHR-MU/UHR-TB/UHR-ELR (802.11bn). Handles single-user, MU-MIMO, OFDMA, trigger-based uplink, extended range, preamble puncturing, UEQM, and DRU. Use when asked to generate test waveforms, create packets with MAC frames, configure OFDMA resource units, build trigger-based uplink transmissions, target a specific transmit duration, or build multi-packet waveforms.
/wireless-communications:matlab-detect-capture-usrpfrom wireless-communications
npx claudepluginhub matlab/matlab-agentic-toolkit --plugin wireless-communicationsOther plugins' skills for the same job