Matlab Generate 5g Waveform
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Software development
- BSD-2-Clause
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to generating standard-compliant 5G New Radio (NR) baseband waveforms using the nrWaveformGenerator function. It covers the configuration of both downlink and uplink channels, including PDSCH, PUSCH, PDCCH, and various reference signals. The workflow emphasizes using simplified constructors for standard configurations while providing guidance for manual adjustments in complex scenarios like multi-bandwidth-part or multi-numerology layouts. It is designed for engineers performing conformance testing, RF instrument playback, or IQ baseband synthesis.
What it does
- Generates 3GPP-compliant 5G NR downlink and uplink waveforms.
- Configures data, control, and broadcast channels including PDSCH, PUSCH, PDCCH, and PUCCH.
- Supports complex setups like multi-bandwidth-part and multi-numerology configurations.
- Provides methods for creating standard test models (TM) and fixed reference channels (FRC).
- Handles channel multiplexing, power scaling, and OFDM modulation automatically.
- Enables visualization of resource grids for verification.
When to use it
- When you need to generate 5G NR signals for test and measurement or simulation.
- When creating test vectors for conformance testing.
- When you need to configure specific bandwidth, subcarrier spacing, or modulation parameters.
- When you need to generate standard-compliant test model (TM) or fixed reference channel (FRC) waveforms.
Advantages
- Ensures 3GPP compliance through standardized configuration objects.
- Simplifies complex waveform generation with automated constructor defaults.
- Provides a consistent API for both simple and advanced multi-carrier layouts.
- Reduces configuration errors by separating primitive signal processing from waveform construction.
Usage examples
- “Generate a default 5G NR downlink waveform for a 20 MHz channel with 30 kHz subcarrier spacing.”
- The agent creates a configuration object using nrDLCarrierConfig('FR1', 20, 30), generates the waveform with nrWaveformGenerator, and displays the resource grid.
- “Create a 5G NR test model TM1.1 waveform.”
- The agent uses the hNRReferenceWaveformGenerator helper to set up the TM1.1 configuration, generates the waveform, and provides the resource grid information.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/matlab-generate-5g-waveform/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip matlab-generate-5g-waveform.zip -d .agents/skills
Documentation by MathWorks
Generate 5G NR Waveforms
Generate standard-compliant 5G NR downlink and uplink waveforms for test and
measurement, simulation, and verification using nrWaveformGenerator.
When to Use
Generate a 5G, NR, or New Radio waveform (DL: PDSCH, PDCCH, SSBurst, CSI-RS; UL: PUSCH, PUCCH, SRS)
Generate NR test model (TM) or fixed reference channel (FRC) waveforms
Configure bandwidth, SCS, modulation, power, or multi-bandwidth-part layouts
When Not to Use
Channel modeling or propagation — use
nrCDLChannel,nrTDLChannelReceiver processing or decoding — use
nrPDSCHDecode,nrDLSCHDecoderLink-level simulation end-to-end
API Choice
| Need | API |
|---|---|
| Custom DL waveform | nrDLCarrierConfig + nrWaveformGenerator |
| Custom UL waveform | nrULCarrierConfig + nrWaveformGenerator |
| Standard test model (TM) or FRC | hNRReferenceWaveformGenerator |
Do not use primitive-level functions (nrCarrierConfig + nrPDSCH +
nrOFDMModulate) for waveform generation, and do not mix primitive config
objects (nrPDSCHConfig, nrPUSCHConfig, nrCarrierConfig) with
nrWaveformGenerator — use the nrWavegen* objects. nrWaveformGenerator
handles channel multiplexing, power scaling, and OFDM modulation correctly.
Full function catalog, property names, and the incompatible-object table:
references/api-reference.md.
Core Workflow (custom DL/UL)
Create the carrier config with the simplified constructor (R2026a+), which auto-sizes SCSCarriers, BandwidthParts, SSBurst/CORESET (DL), and a default PDSCH/PUSCH to the bandwidth:
cfg = nrDLCarrierConfig('FR1', 20, 30); % DL: FR1, 20 MHz, 30 kHz SCS
cfg = nrULCarrierConfig('FR1', 20, 15); % UL: FR1, 20 MHz, 15 kHz SCSFor DL, if the requested SCS differs from the default SSB numerology the
constructor adds a dedicated SSB SCS carrier (e.g. nrDLCarrierConfig('FR1', 5, 30)
adds a hidden 15 kHz carrier). Pre-R2026a, or to control the SCS-carrier count
exactly, build manually with nrDLCarrierConfig (no args).
Customize only what the task requires (see the rule below). Set non-defaults such as
cfg.PDSCH{1}.Modulation = '64QAM';. Never overwrite a constructor-placed value with a different one (e.g. forcingNStartBWP = 0when the constructor centered it) — that breaks the validated layout.Generate —
validateConfigchecks structural rules but does not catch channel conflicts (overlapping PDSCH/CSI-RS, CSI-RS/SSBurst); always run the generator, which returns the waveform and the resource-grid info:
[waveform, info] = nrWaveformGenerator(cfg);What the simplified constructor builds is generation-ready as-is — an
unedited nrDLCarrierConfig(fr, bw, scs) or nrULCarrierConfig(fr, bw, scs)
generates for every FR1/FR2 bandwidth/SCS combination, so do not re-check what
it set. This does not apply to the no-argument nrDLCarrierConfig /
nrULCarrierConfig, whose defaults (15 kHz, Case A SSB, 52-RB PRBSet) must be
resized by hand. One silent caveat: at 3 MHz / 15 kHz the SSB is wider than
the 15-RB carrier, so the PBCH is punctured — this is expected; keep the SSB
(details in Critical Rules). Check the Critical Rules for
whatever you change or build by hand: a no-argument (manual) carrier, an
edited NSizeGrid/BWP/CORESET/PRBSet, a BlockPattern override, an added SCS
carrier or BWP (Point A centering), CSI-RS or PDCCH across BWPs, or 2 codewords
(layers/DM-RS). Those edits cause the most generation failures.
Set Only What the Task Requires
Set every property the task requires — including parameters forced by a
requested feature, even when the prompt never names them — and nothing else. For
example, 2 codewords → NumLayers 5–8 → a DM-RS that supports more than 4 ports
(see Critical Rules); a requested CSI-RS →
CSIRS{1}.Enable = true (off by default). These are required, not over-config.
SSBurst is already enabled by default, so a requested SS burst needs no
Enable line.
Recipes and References
Open the reference that matches the task; each has copy-ready, verified code:
Common single-carrier waveforms (Basic DL with dual-grid plot, Basic UL, power spectrum): references/patterns.md
Narrow-band 11-RB carriers, manual build only (5 MHz/30 kHz, 10 MHz/60 kHz). The simplified constructor already handles these — skip this reference when you use it. Open it only for a no-argument build (pre-R2026a, or to avoid the auto-added SSB carrier), where the defaults fail and need
NSizeGrid = 11, a disabled/rehomed SSB, a shrunk CORESET, AL1, and an explicitPRBSet: references/narrow-band-manual-config.mdMulti-BWP / multi-numerology layouts: references/multi-bwp-guidance.md
Test models (TM) and fixed reference channels (FRC) — use the example helper
hNRReferenceWaveformGenerator(RC, BW, SCS)(e.g.'DL-FRC-FR1-64QAM','NR-FR1-TM1.1'), thengenerateWaveform+displayResourceGrid. It is not on the path by default: first make it available with a portable setup (setupExample('5g/NRTestModelWaveformGenerationExample', ...)+copyfile+cd, oropenExample) — never a hardcoded path, never a made-up namespaced name. Valid names, portable-setup block, andmakeConfigWritableedits: references/test-models-and-frc.mdFull API catalog + output structure (fields of
info, correct property names): references/api-reference.mdOnline documentation links: references/documentation-links.md
Conventions
After generating a waveform, unless the user asks for something specific:
Tell the user the waveform variable name and that it is in the workspace
Plot the resource grid from
info.ResourceGrids(k).ResourceGridBWP(BWP-sized, one per BWP); useResourceGridInCarrieronly for a full-carrier view. The SS burst is a separate grid — whenSSBurst.Enableis true and the SS burst is asked for, also plotinfo.ResourceGridSSBurst.ResourceGrid(it is not part ofResourceGridBWP)Save the generation code as a
.mscript and open it in the MATLAB editor withedit('scriptName.m')
Start with the simplified constructor
nrDLCarrierConfig('FR1', bw, scs)when possibleCorrect property names:
DMRSPower(not PowerDMRS),PTRSPower(not PowerPTRS),NSizeGrid(not NRB),ChannelBandwidth(not Bandwidth)SCSCarriers,BandwidthParts,CORESET,PDSCH,PUSCHare cell arrays — use{};SSBurstis a direct object — use.not{}Use
tiledlayout/nexttilefor multi-panel figures; always label axes with units and include figure titlesComment non-obvious, interdependent choices (why a given
NSizeGrid, why SSBurst is disabled, why a specificAggregationLevel) so the code explains itself
Copyright 2026 The MathWorks, Inc.
Files
- ATTRIBUTION.mdAdded by AutoGineer1.1 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md7.9 KiB
- manifest.yaml440 B
- references/api-reference.md3.4 KiB
- references/critical-rules.md8.0 KiB
- references/documentation-links.md2.4 KiB
- references/multi-bwp-guidance.md17.7 KiB
- references/narrow-band-manual-config.md4.5 KiB
- references/patterns.md1.8 KiB
- references/test-models-and-frc.md5.0 KiB
references/api-reference.md
API Reference
Canonical function/class names and the output structure for
nrWaveformGenerator. If you need to verify property names, check valid values
for a config object, or look up parameters not covered here, consult the online
documentation links in documentation-links.md.
Key Functions
| Function / Class | Purpose |
|---|---|
nrWaveformGenerator | Generate time-domain waveform from carrier config |
nrDLCarrierConfig | DL carrier config (wraps all DL channels) |
nrULCarrierConfig | UL carrier config (wraps all UL channels) |
nrSCSCarrierConfig | SCS carrier: SubcarrierSpacing, NSizeGrid, NStartGrid |
nrWavegenBWPConfig | BWP: SubcarrierSpacing, NSizeBWP, NStartBWP |
nrWavegenPDSCHConfig | PDSCH: Modulation, Power, DMRSPower, PRBSet |
nrWavegenPUSCHConfig | PUSCH: Modulation, Power, DMRSPower |
nrWavegenPUCCH0Config .. nrWavegenPUCCH4Config | PUCCH formats 0–4 |
nrWavegenSRSConfig | SRS config |
nrWavegenPDCCHConfig | PDCCH config (links via SearchSpaceID) |
nrCORESETConfig | CORESET: FrequencyResources, Duration |
nrSearchSpaceConfig | Links PDCCH to CORESET via IDs |
nrWavegenSSBurstConfig | SS burst: BlockPattern, TransmittedBlocks |
nrWavegenCSIRSConfig | CSI-RS config |
hNRReferenceWaveformGenerator | Standard TMs and FRCs (example helper) |
validateConfig | Check structural rules (method on carrier config) |
openInGenerator | Open config in 5G Waveform Generator app |
DM-RS power note: Power and DMRSPower (dB) are optional. DMRSPower is
DM-RS power relative to data REs; per TS 38.214 Table 4.1-1 it is boosted 0, 3,
or 4.77 dB for 1, 2, or 3 CDM groups without data (R2026b+ applies this
automatically when DMRSPower = []).
Do Not Mix API Levels
These primitive objects are incompatible with nrWaveformGenerator:
Use with nrWaveformGenerator | Do not use with nrWaveformGenerator |
|---|---|
nrDLCarrierConfig / nrULCarrierConfig | nrCarrierConfig |
nrWavegenPDSCHConfig | nrPDSCHConfig |
nrWavegenPUSCHConfig | nrPUSCHConfig |
Do not use primitive-level functions (nrCarrierConfig + nrPDSCH +
nrOFDMModulate) for waveform generation — those are for individual channel
signal processing, not waveform construction. nrWaveformGenerator handles
channel multiplexing, power scaling, and OFDM modulation correctly.
Output Structure
[waveform, info] = nrWaveformGenerator(cfg) returns:
| Field | Contents |
|---|---|
waveform | Complex time-domain samples (N x P, P = antennas) |
info.ResourceGrids(k).ResourceGridBWP | Grid sized to BWP (NSizeBWP*12 subcarriers) |
info.ResourceGrids(k).ResourceGridInCarrier | Grid sized to full carrier |
info.ResourceGrids(k).Info.SampleRate | Waveform sample rate |
info.ResourceGridSSBurst.ResourceGrid | SSB grid (DL only) |
info.WaveformResources.PDSCH | Per-slot PDSCH resources (indices, symbols) |
There is no field called ResourceGrid in info.ResourceGrids. Use
ResourceGridBWP or ResourceGridInCarrier.
For hNRReferenceWaveformGenerator, [waveform, waveinfo] = generateWaveform(wavegen)
returns the grid in waveinfo.ResourceGridBWP and the rate in waveinfo.Info.SampleRate.
Copyright 2026 The MathWorks, Inc.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- MathWorks
- Publisher
- MathWorks (Official)
- Source
- matlab/matlab-agentic-toolkit · skills-catalog/wireless-communications/matlab-generate-5g-waveform · commit 2a7f215
- Licence
- BSD 2-Clause License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-generate-5g-waveform.zip