matlab-design-ofdm-system
Read 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.
Install / Use
npx skills add matlab/matlab-agentic-toolkit --skill matlab-design-ofdm-systemInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of matlab-design-ofdm-system
matlab-design-ofdm-system scores 93/100 on our quality scale, 248th of 1,199 Content & Media skills we index (top 21%).
Its SKILL.md is 15 KB long, well organised into 24 sections with 6 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-design-ofdm-system 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-design-ofdm-system compared with similar skills
All 4 of these similar skills score higher than matlab-design-ofdm-system; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matlab-design-ofdm-system (this skill)by matlab | 93 | 1.1k | 18d ago | SKILL.md |
| siyuanby siyuan-note | 100 | 46.6k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 12d ago | SKILL.md |
Frequently asked questions
- How do I install matlab-design-ofdm-system?
- Run
npx skills add matlab/matlab-agentic-toolkit --skill matlab-design-ofdm-system. The install tabs above show the steps for each supported agent. - Which AI agents does matlab-design-ofdm-system 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-design-ofdm-system 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-design-ofdm-system still maintained?
- The repository was last updated 18 days ago, so matlab-design-ofdm-system is actively maintained.
Skill content
View source on GitHubname: matlab-design-ofdm-system description: "Read 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." license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.0"
OFDM System Design
When To Use
Use this skill when the user wants to build a custom (non-standard) OFDM transmitter/receiver, configure subcarrier allocation, add noise to OFDM signals, equalize OFDM through fading channels, implement synchronization, or add LDPC coding.
When Not To Use
Do NOT use this skill for standards-specific OFDM (use 5G Toolbox for 5G NR, WLAN Toolbox for Wi-Fi, LTE Toolbox for 4G/LTE, Bluetooth Toolbox for Bluetooth, Satellite Communications Toolbox for satellite links).
GATE — Ask Before Coding
If the user's request does not specify or unambiguously imply ALL of the following, STOP and ask before generating any code. Present unclear items as a numbered list and ask whether the user wants to: (a) specify values, (b) have you derive them from other constraints (e.g., CP from delay spread, SCS from Doppler), or (c) use typical defaults. Do not assume defaults. Do not proceed until the user responds.
- OFDM parameters — FFT size, CP length, subcarrier spacing, subcarrier allocation
- Channel model — AWGN only, fading with perfect CSI, or fading with pilot-based estimation
- Pilots — needed for channel estimation or phase tracking?
- Coding — uncoded, or coded with a specific rate?
- Synchronization — perfect sync, or include timing/CFO estimation?
Must-Follow Rules
-
ALWAYS use
ofdmmod/ofdmdemod— NEVER implement OFDM by directly callingifft/fft— The functions handle CP insertion/removal,ifftshift/fftshiftfor centered-frequency ordering, and pilot/null subcarrier management. Direct IFFT/FFT gets subcarrier mapping wrong (silent error). Input is[nDataSC × nSym]for SISO. Output is a time-domain column vector. Note: sync preambles (e.g., Schmidl-Cox) that require DFT-order subcarrier mapping may useifftdirectly, sinceofdmmodappliesifftshiftwhich changes the even/odd bin assignment. Windowing:ofdmmoddoes not support windowing. For raised cosine windowing, usecomm.OFDMModulatorfor the transmitter only (always useofdmdemodfunction for demodulation). Seereferences/ofdm-system-guide.mdfor capability comparison. -
Always use a
symOffsetvariable inofdmdemod— when passingnullidx(5th arg),symOffsetmust be explicitly provided as the 4th arg. The defaultsymOffsetvalue iscpLen(skip entire CP). Note:cpLen/2is more robust when timing synchronization is imperfect. -
Use explicit signal power in
awgn, NEVER'measured'or0—ofdmmodoutput power is NOT 1W. It equalsnActiveSC / nFFT^2due to MATLAB's 1/N IFFT normalization. Usingawgn(x, snr, 0)adds far too much noise. ComputesigPow = 10*log10(nActiveSC / nFFT^2)once before any loop — it is a constant determined by OFDM parameters. -
Use
ofdmChannelResponsefor frequency-domain channel response — do NOT computeH = fft(h, nFFT)directly.ofdmmodusesifftshiftinternally, so direct FFT-based channel responses have wrong subcarrier mapping. Pass the result toofdmEqualizefor equalization. -
When deriving OFDM parameters from physical specs, show the computation with comments — do not just state the values. Show how you calculate subcarrier spacing, FFT size, CP length, sample rate, guard subcarriers, etc. from bandwidth, delay spread, and Doppler spread. Add comments explaining each derivation step.
-
Check MATLAB version before using version-gated APIs — Functions like
ofdmChannelEstimate,ofdmPilotConfig(R2026a), andldpcPCM(R2025a) are not available on older releases. Unless the user specifically asks for code compatible with a previous version, callversion('-release')to get the current MATLAB release, then choose the appropriate API path.
Key Functions
| Function | Purpose | Since |
|----------|---------|-------|
| ofdmmod | OFDM modulation (IFFT + CP insertion) | R2018a |
| ofdmdemod | OFDM demodulation (CP removal + FFT) | R2018a |
| ofdmChannelResponse | Per-subcarrier channel response from path gains | R2023a |
| ofdmEqualize | ZF/MMSE frequency-domain equalization | R2022b |
| ofdmPilotConfig | Pilot location and symbol configuration | R2026a |
| ofdmChannelEstimate | Pilot-based channel estimation (LS + denoising) | R2026a |
| convertSNR | SNR conversion (snrsc, snr, ebno) | R2022a |
| awgn | Add white Gaussian noise with explicit signal power | — |
Subcarrier Allocation
Subcarrier indices use centered-frequency ordering: index 1 = most negative frequency, index nFFT/2 + 1 = DC, index nFFT = most positive frequency.
Rules for subcarrier indices:
nullIdxandpilotIdxmust be vectors of 1-based integers in[1, nFFT]- They must not overlap
- DC subcarrier =
nFFT/2 + 1(always null it) ofdmmodinput X has size[nDataSC x nSym]— null and pilot subcarriers are excludedofdmdemodoutput has size[nDataSC x nSym]— nulls stripped, pilots returned separately
Example (WiFi-like 64-FFT):
nullIdx = [1:6, 33, 60:64].'; % 12 nulls (6 lower guard + DC + 5 upper guard)
pilotIdx = [12; 26; 40; 54]; % 4 pilots
nActiveSC = nFFT - length(nullIdx); % 52 (data + pilots)
nDataSC = nFFT - length(nullIdx) - length(pilotIdx); % 48
Basic OFDM Tx/Rx (AWGN)
% Parameters
nFFT = 64; cpLen = 16;
nullIdx = [1:6, 33, 60:64].'; % 12 nulls
nActiveSC = nFFT - length(nullIdx); % 52
nDataSC = nActiveSC; % no pilots
M = 4; % QPSK
nSym = 100;
snr_sc = 10; % dB, per-subcarrier SNR
% Transmit
data = randi([0 M-1], nDataSC, nSym);
modData = pskmod(data, M, InputType="integer");
txSig = ofdmmod(modData, nFFT, cpLen, nullIdx);
% SNR conversion and noise
sigPow = 10*log10(nActiveSC / nFFT^2); % OFDM signal power (dBW)
snr_wb = convertSNR(snr_sc, "snrsc", "snr", ...
FFTLength=nFFT, NumActiveSubcarriers=nActiveSC);
rxSig = awgn(txSig, snr_wb, sigPow);
% Receive
symOffset = cpLen;
rxData = ofdmdemod(rxSig, nFFT, cpLen, symOffset, nullIdx);
demodData = pskdemod(rxData, M, OutputType="integer");
[numErr, ber] = biterr(data(:), demodData(:));
SNR Handling for OFDM
SNR per subcarrier (SNR_sc) is the standard noise reference for OFDM simulations. If you need other noise metrics — Eb/No for theoretical BER comparison, or wideband SNR for awgn — use convertSNR to derive them from SNR_sc. See matlab-add-awgn for full convertSNR patterns and awgn usage.
For theoretical BER: convert SNR_sc to Eb/No via convertSNR(snr_sc, "snr", "ebno", BitsPerSymbol=log2(M)), then call berawgn(ebno, 'qam', M). Do NOT pass SNR_sc directly to berawgn or use it as Eb/No in erfc/qfunc closed-form expressions — SNR_sc ≠ Eb/No.
OFDM-specific points (beyond what the AWGN skill covers):
- Signal power =
10*log10(nActiveSC / nFFT^2)dBW — due to MATLAB's 1/N IFFT normalization nActiveSCincludes data AND pilot subcarriers- Always capture noise variance from
awgn's second output:[rxSig, nVar] = awgn(...). Do NOT compute noise variance manually from SNR formula — use the valueawgnreturns to stay in sync with its internal rounding. - Noise variance after
ofdmdemodscales by nFFT:nVar_sc = nVar * nFFT(FFT sums N terms) convertSNR"snr" type = per-subcarrier SNR when converting from Eb/No or Es/No (each OFDM subcarrier carries one symbol). To convert per-subcarrier SNR to wideband SNR (forawgn), useconvertSNR(snr_sc, "snrsc", "snr", FFTLength=nFFT, NumActiveSubcarriers=nActiveSC).
Critical Gotchas
awgn(x, snr, 0) is WRONG for OFDM
OFDM signal power depends on nActiveSC and nFFT, not 1W.
% WRONG — assumes unit power (adds ~19 dB too much noise for 64-FFT)
rxSig = awgn(txSig, snr_wb, 0);
% CORRECT — explicit power, capture noise variance
sigPow = 10*log10(nActiveSC / nFFT^2);
[rxSig, nVar] = awgn(txSig, snr_wb, sigPow);
symOffset is required in ofdmdemod
symOffset = cpLen; % skip entire CP (or cpLen/2 for imperfect timing)
rxData = ofdmdemod(rxSig, nFFT, cpLen, symOffset, nullIdx);
Modulator/demodulator input must be a column vector for single-stream
All Communications Toolbox modulators (qammod, pskmod, etc.) process by columns — each column is an independent channel/stream. For single-stream OFDM, always pass bits or integers as a column vector:
% WRONG — [nSym x k] matrix: each column is treated as a separate stream
txData = reshape(txBits, nBitsPerSym, []).';
txSymbols = qammod(txData, M, InputType="bit", UnitAveragePower=true);
% CORRECT — column vector in, then reshape output to OFDM grid
txSymbols = qammod(txBits, M, InputType="bit", UnitAveragePower=true);
txSymbols = reshape(txSymbols, nActiveSC, nSym);
Use multiple columns only when modulating independent MIMO streams or parallel codewords simultaneously.
DC subcarrier index
DC = nFFT/2 + 1. For nFFT=64, DC is index 33. Always include it in nullIdx.
ofdmEqualize hEst dimensions
With default DataFormat="3-D", hEst dimensions are:
[nSC × NS × NR]— static: same estimate applied to all OFDM symbols[(nSC*nSym) × NS × NR]— time-varying: per-symbol estimates collapsed into first dimension
Passing [nSC × nSym] directly is wrong — dim 2 is read as NS, not nSym:
% WRONG — hEst [nSC x nSym] misinterpreted as [nSC x NS=nSym]
eqData = ofdmEqualize(rxData, hEst_per_sym, nVar);
% CORRECT — collapse first dim to (nSC*nSym), keep stream/antenna dims
eqData = ofdmEqualize(rxData, reshape(hEst_per_sym, [], Ns, Nr), nVar);
OFDM with Pilots
To insert pilots, pass pilotIdx and pilot symbols as additional arguments to ofdmmod/ofdmdemod. Signal power is based on nActiveSC (data + pilots), not nDataSC alone.
See references/ofdm-pilots-and-estimation.md for the full pilot insertion example.
Pilot-Based Channel Estimation (R2026a)
Use ofdmPilotConfig + ofdmChannelEstimate for pilot-based channel estimation without perfect CSI. If you have not already checked, get the current MATLAB version before deciding between the R2026a workflow and the pre-R2026a manual LS approach.
The ofdmChannelEstimate workflow differs from the legacy pilotIdx approach:
nullIdxcontains only guard bands (NOT DC) — DC becomes an active-grid position that you zero out manually.- No
pilotIdxargument toofdmmod/ofdmdemod— build a full[nActiveSC x nSym]grid with data, pilots, and DC=0, then pass it directly. - Pilot locations come from
ofdmPilotConfig, not from function arguments. rxSymis 3-D:[nActiveSC x nSym x nRx]— add the receive-antenna dimension even for SISO.
See references/ofdm-pilots-and-estimation.md for complete code examples.
OFDM over Fading Channels
Two approaches for channel equalization:
- Perfect CSI (R2023a) — use
ofdmChannelResponsewith path gains fromcomm.RayleighChannel(requiresPathGainsOutputPort=true). GetpathFiltersfrominfo(channel).ChannelFilterCoefficients. Pass `H(
Truncated for display — read the full file on GitHub.
Related Skills
siyuan
46.6kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
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…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
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.
