Install any skill in seconds. Free to start, no credit card required.
Get Started Free →matlab/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. This skill specifies the correct calling conventions for ofdmmod, ofdmdemod, ofdmChannelResponse, ofdmEqualize, and critical anti-patterns that must be avoided.
Passed 20 of 21 test cases with the skill, and 9 of 21 without it.
and 9 more in the full report
12 fixed10 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 11 test cases the skill fixed. Same model, same prompt, with and without the skill.
I need a MATLAB script for an OFDM link with 128-point FFT, 32 CP length, 15 kHz SCS, guard subcarriers [1:8, 65, 121:128]', uncoded 16-QAM, and no pilots. Generate the code.
| Checked | Without skill | With skill |
|---|---|---|
| Stops to ask clarification questions regarding missing parameters before generating code. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
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).
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.
ALWAYS use ofdmmod/ofdmdemod — NEVER implement OFDM by directly calling ifft/fft — The functions handle CP insertion/removal, ifftshift/fftshift for 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 use ifft directly, since ofdmmod applies ifftshift which changes the even/odd bin assignment. Windowing: ofdmmod does not support windowing. For raised cosine windowing, use comm.OFDMModulator for the transmitter only (always use ofdmdemod function for demodulation). See references/ofdm-system-guide.md for capability comparison.
Always use a symOffset variable in ofdmdemod — when passing nullidx (5th arg), symOffset must be explicitly provided as the 4th arg. The default symOffset value is cpLen (skip entire CP). Note: cpLen/2 is more robust when timing synchronization is imperfect.
Use explicit signal power in awgn, NEVER 'measured' or 0 — ofdmmod output power is NOT 1W. It equals nActiveSC / nFFT^2 due to MATLAB's 1/N IFFT normalization. Using awgn(x, snr, 0) adds far too much noise. Compute sigPow = 10*log10(nActiveSC / nFFT^2) once before any loop — it is a constant determined by OFDM parameters.
Use ofdmChannelResponse for frequency-domain channel response — do NOT compute H = fft(h, nFFT) directly. ofdmmod uses ifftshift internally, so direct FFT-based channel responses have wrong subcarrier mapping. Pass the result to ofdmEqualize for 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), and ldpcPCM (R2025a) are not available on older releases. Unless the user specifically asks for code compatible with a previous version, call version('-release') to get the current MATLAB release, then choose the appropriate API path.
| Function | Purpose | Since |
|---|---|---|
ofdmmod | OFDM modulation (IFFT + CP insertion) | R2018a |
ofdmdemod | OFDM demodulation (CP removal + FFT) | R2018a |
test cases passed, vs 9 / 21 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.