matlab-transmit-capture-usrp
Transmit and capture RF waveforms using Wireless Testbench with NI USRP radios (X410, X310, N310, N320, N321, N300, X300, E320)
Install / Use
npx skills add matlab/matlab-agentic-toolkit --skill matlab-transmit-capture-usrpInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of matlab-transmit-capture-usrp
matlab-transmit-capture-usrp scores 93/100 on our quality scale, 820th of 4,646 Development & Engineering skills we index (top 18%).
Its SKILL.md is 21 KB long, well organised into 16 sections with 24 code examples: a thorough specification that gives an agent plenty to work with.
With 1,098 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 18 days ago, so matlab-transmit-capture-usrp is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
matlab-transmit-capture-usrp compared with similar skills
All 4 of these similar skills score higher than matlab-transmit-capture-usrp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matlab-transmit-capture-usrp (this skill)by matlab | 93 | 1.1k | 18d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install matlab-transmit-capture-usrp?
- Run
npx skills add matlab/matlab-agentic-toolkit --skill matlab-transmit-capture-usrp. The install tabs above show the steps for each supported agent. - Which AI agents does matlab-transmit-capture-usrp work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is matlab-transmit-capture-usrp safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is matlab-transmit-capture-usrp still maintained?
- The repository was last updated 18 days ago, so matlab-transmit-capture-usrp is actively maintained.
Skill content
View source on GitHubname: matlab-transmit-capture-usrp description: > Transmit and capture RF waveforms using Wireless Testbench with NI USRP radios (X410, X310, N310, N320, N321, N300, X300, E320). Use when generating test signals, transmitting over the air, capturing IQ data, performing loopback tests, configuring multi-antenna setups, or troubleshooting dropped samples and gain settings. Covers basebandTransceiver, basebandTransmitter, basebandReceiver, continuous and once transmit modes, foreground and background capture, and UseRadioBuffer options. Also use when the user mentions transmit waveform, capture signal, IQ data, loopback, RF gain, sample rate, or antenna configuration. license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.0"
Transmit and Capture Waveforms with Wireless Testbench
Generate, transmit, and capture RF waveforms using NI USRP radios in MATLAB.
When to Use
- Transmitting a waveform (test tone, standard-compliant signal, custom IQ) over the air
- Capturing IQ data from a frequency band
- Loopback testing (transmit and capture on the same radio)
- Multi-antenna transmit or capture
- Continuous transmission for prolonged testing
- Background capture for long-duration acquisition
When NOT to Use
- Setting up or connecting a USRP radio for the first time — use the matlab-set-up-usrp-radio skill
- FPGA targeting workflows — see Target NI USRP Radios
- Triggered (wake-on-signal) capture with preamble/energy detection — use the matlab-detect-capture-usrp skill
- Multi-device synchronization — see Radio Management
Prerequisites
A saved radio configuration must exist before using any transmit/capture object. List available configurations and let the user choose which one to use:
configs = radioConfigurations;
disp(configs)
If multiple configurations exist, ask the user which one they want to work with. If no configuration exists, guide the user to set one up first (see the matlab-set-up-usrp-radio skill).
Before generating code, confirm these parameters with the user if not already specified:
- Center frequency — Accept any numeric value within the radio's supported range. Do not present a constrained list of bands; let the user type a frequency.
- Sample rate — Ask what sample rate they need. Suggest common values (30.72 MHz, 61.44 MHz, 122.88 MHz, 245.76 MHz) but accept any valid rate.
Choosing the Right Object
Default to basebandTransceiver. It supports all workflows — transmit only, capture only, or both simultaneously. Use it unless you have a specific reason not to.
| Object | When to Use |
|--------|-------------|
| basebandTransceiver | Default choice. Transmit, capture, or both. Works for loopback, signal generation, spectrum monitoring, and full-duplex |
| basebandTransmitter | Only when you need a dedicated transmit-only object (e.g., a separate script controlling TX independently) |
| basebandReceiver | Only when you need a dedicated receive-only object (e.g., a separate script controlling RX independently) |
Why default to basebandTransceiver: A single radio configuration can only be used by one object at a time. Since basebandTransceiver handles transmit, capture, or both, it covers the vast majority of workflows without needing to switch objects. The standalone objects (basebandTransmitter, basebandReceiver) are useful when separate scripts or applications each need independent control of one direction.
Property naming differs between object types:
| | basebandTransceiver | basebandTransmitter / basebandReceiver |
|--|-----|------|
| Gain | TransmitRadioGain, CaptureRadioGain | RadioGain |
| Frequency | TransmitCenterFrequency, CaptureCenterFrequency | CenterFrequency |
| Antennas | TransmitAntennas, CaptureAntennas | Antennas |
The transceiver uses Transmit/Capture prefixes to distinguish directions. The standalone objects do not need prefixes since they only handle one direction.
Workflow
Step 1: Create the Radio Object
radio = radioConfigurations("MyN310");
bbtrx = basebandTransceiver(radio);
Preload option: Pass Preload=true to load the FPGA application at construction time rather than on first use. This avoids a multi-second delay on the first transmit or capture call.
bbtrx = basebandTransceiver(radio, Preload=true);
Standalone objects (only when needed for independent single-direction control):
bbtx = basebandTransmitter(radio); % TX only
bbrx = basebandReceiver(radio); % RX only
Step 2: Configure Properties
Configure the object before transmitting or capturing. Setting properties after object creation is valid, but some changes cause a reload delay.
bbtrx.SampleRate = 30.72e6;
bbtrx.TransmitCenterFrequency = 3.5e9;
bbtrx.CaptureCenterFrequency = 3.5e9;
bbtrx.TransmitRadioGain = 20;
bbtrx.CaptureRadioGain = 40;
Only set the properties for the direction you need. For transmit-only workflows, skip the Capture* properties (and vice versa).
If using standalone objects (basebandTransmitter / basebandReceiver), properties are unprefixed:
bbtx.SampleRate = 30.72e6;
bbtx.CenterFrequency = 3.5e9; % not TransmitCenterFrequency
bbtx.RadioGain = 20; % not TransmitRadioGain
Property guidance:
| Property | Guidance |
|----------|----------|
| SampleRate | Must match waveform bandwidth. Common values: 30.72 MHz (LTE/NR), 61.44 MHz, 122.88 MHz, 245.76 MHz |
| TransmitRadioGain | Start low (10–20 dB) to avoid clipping. Increase until signal strength is adequate |
| CaptureRadioGain | Start moderate (30–40 dB). Too high clips the ADC; too low buries the signal in noise |
| TransmitCenterFrequency / CaptureCenterFrequency | Must be within the radio's supported range (device-dependent, typically 1 MHz – 6/8 GHz) |
| DroppedSamplesAction | Set to "warning" during development to continue despite drops; use "error" in production |
Step 3: Prepare the Transmit Waveform
The waveform must be a complex column vector (single antenna) or complex matrix (multi-antenna, one column per antenna). Values must be normalized to the range [-1, 1].
Test tone:
numSamples = 30720;
t = (0:numSamples-1)' / bbtrx.SampleRate;
txWaveform = 0.8 * exp(1j*2*pi*1e6*t);
Random OFDM-like signal:
numSamples = 30720;
txWaveform = complex(randn(numSamples,1), randn(numSamples,1));
txWaveform = 0.7 * txWaveform / max(abs(txWaveform));
Load a pre-generated waveform from file:
waveStruct = load("myWaveform.mat");
txWaveform = waveStruct.waveform;
txWaveform = 0.8 * txWaveform / max(abs(txWaveform));
Use this pattern with waveforms generated by 5G Toolbox, LTE Toolbox, WLAN Toolbox, or any custom signal generation workflow.
Waveform requirements:
| Requirement | Details |
|-------------|---------|
| Data type | Complex double, single, or int16 (controlled by TransmitDataType) |
| Amplitude | Peak magnitude ≤ 1.0 for double/single (values > 1 clip at the DAC) |
| Dimensions | Column vector (single antenna) or N×M matrix (M = number of TX antennas) |
| Row count | Must be an even number of rows |
| Minimum length | Waveforms < 513 samples reserve up to 1024 samples for underflow protection |
Pass TransmitDataType to the constructor when using Preload=true:
The FPGA application is configured for a specific transmit data class at construction time. Without preload, the class is inferred from the waveform on the first transmit call. With preload, the transceiver has no waveform to infer from, so pass TransmitDataType explicitly — otherwise the FPGA reloads on the first transmit call and defeats the point of preloading.
bbtrx = basebandTransceiver(radio, Preload=true, TransmitDataType="double");
% ... configure frequency/gain/sample rate ...
transmit(bbtrx, txWaveform, "continuous"); % waveform class must match TransmitDataType
Step 4: Transmit
Once (single-shot) — transmit the waveform exactly once:
transmit(bbtrx, txWaveform, "once");
The radio transmits the waveform one time and then stops automatically. Use for pulsed or one-shot testing. Add a few redundant samples to the end of the waveform for reliability in this mode.
Continuous — transmit repeatedly until stopped:
transmit(bbtrx, txWaveform, "continuous");
The waveform loops continuously on the radio until stopTransmission is called. Use for:
- Sustained interference or signal generation
- Loopback testing where capture timing is decoupled from transmit
- Over-the-air tests where a receiver needs a persistent signal
Stop continuous transmission:
stopTransmission(bbtrx);
Step 5: Capture
Foreground capture (blocks MATLAB until complete):
[data, timestamp, droppedSamples] = capture(bbtrx, milliseconds(10));
The length argument accepts a duration value (e.g., seconds(1), milliseconds(10)) or a sample count as a positive integer.
Output arguments:
| Output | Type | Description |
|--------|------|-------------|
| data | complex vector/matrix | IQ samples — rows = samples, columns = antennas. Data type matches CaptureDataType property. First samples may contain transients |
| timestamp | datetime | Timestamp created immediately before hardware capture request |
| droppedSamples | logical | true if samples were dropped (network/host issue), false if clean |
CaptureDataType defaults to int16 — cast before FFT, filtering, or arithmetic:
The captured data is a complex vector/matrix whose class matches CaptureDataType. The default is "int16" (fixed-point) to minimize memory. Most MATLAB signal-processing functions — including fft, abs, filter, bandpass, pwelch, and element-wise math — do not accept complex int16 and will error at runtime. Handle this in one of two ways:
% Option A — set the property before capture (all downstream code sees double)
bbtrx.CaptureDataType = "double";
[data, ~, dropped] = capture(bbtrx, milliseconds(10));
X = fft(data); % works
% Option B — cast after capture (keep the memory savings during transfer)
[data, ~, dropped] = capture(bbtrx, milliseconds(10));
data = double(data);
X = fft(data); % works
Use Option A by default. Only prefer Option B when memory during capture is tight and you want the compact int16 payload until processing begins.
Background capture (non-blocking):
Use background capture when:
- Capture duration is long (> a few seconds) and MATLAB must remain responsive
- You want to do post-processing, display updates, or other work during acquisition
- You are combining capture with continuous transmit and need to monitor both
Use foreground capture (the default) when:
- Capture is short and you need the data immediately for the next step
- The script is linear (no concurrent work needed)
Choosing the right pattern:
| Scenario | Pattern |
|----------|---------|
| Short capture, need data now | [data,~,dropped] = capture(bbtrx, milliseconds(100)); |
| Long capture, data fits in RAM | capture(bbtrx, seconds(30), Background=true); then captureOutputs |
| Long capture, too large for RAM | capture(bbtrx, seconds(60), Background=true, SaveLocation="data.mat", UseRadioBuffer=false); |
| Need notification when done | Add CompletionFcn=@(data,ts,dropped) myCallback(data) |
Background capture with polling:
capture(bbtrx, seconds(30), Background=true);
% Poll until complete
while isCapturing(bbtrx)
pause(1);
end
% Retrieve results
[data, timestamp, droppedSamples] = captureOutputs(bbtrx);
**Back
Truncated for display — read the full file on GitHub.
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
