RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.2, Nov 26, 2026 ·

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • pskmod
    • qammod

qammod — Map integer symbols or grouped bits to rectangular QAM points.

qammod(X,M) maps whole-valued symbols or grouped bits to complex QAM points. Gray and binary orders, a custom symbol permutation, unit-average-power scaling, and output class can be selected.

Syntax

Y = qammod(X, M)
Y = qammod(X, M, symorder, Name, Value)

Inputs

X
Type
NumericArray
Required
Yes
Description
Integer symbols or grouped bit input.
M
Type
NumericScalar
Required
Yes
Description
Power-of-two modulation order greater than one.
args
Type
Any
Required
Variadic
Description
Optional symbol order and name-value options.
NameTypeRequiredDefaultDescription
XNumericArrayYes—Integer symbols or grouped bit input.
MNumericScalarYes—Power-of-two modulation order greater than one.
argsAnyVariadic—Optional symbol order and name-value options.

Returns

Y
Type
NumericArray
Description
Complex rectangular-QAM baseband samples.
NameTypeDescription
YNumericArrayComplex rectangular-QAM baseband samples.

Errors

—
When
Symbols, modulation order, mapping, or options are invalid.
Message
qammod: invalid argument
IdentifierWhenMessage
—Symbols, modulation order, mapping, or options are invalid.qammod: invalid argument

Constellation and controls

X must contain finite whole symbols from 0 through M-1. M must be a power of two greater than one. Square orders use symmetric odd in-phase and quadrature amplitudes; non-square powers of two use a rectangular grid with the longer in-phase axis.

Gray order is the default and applies to each grid axis. 'bin' uses binary order; a custom permutation labels constellation points. InputType='bit' groups rows in log2(M) chunks per channel, first bit most significant. Logical inputs, including scalars, require bit input. UnitAveragePower=true scales the constellation to average unit power.

PlotConstellation=true is recognized but explicitly unsupported. The output precision defaults to single only when X has single storage, otherwise double; OutputDataType selects 'single' or 'double'.

Execution and residency

Supported resident symbol and bit arrays use the owning acceleration provider's modulation hooks and produce complex-interleaved resident output. Unsupported hooks use host validation and protected re-upload; malformed provider output is rejected. Modulation terminates fusion.

This pure operation has no callback, workspace, filesystem, network, randomness, or time effects. Explicit GPU input keeps device intent through the supported hook or the fallback upload.

Examples

Default 16-QAM Gray mapping

y = qammod(0:15,16);

Expected output:

y = [-3+3i -3+1i -3-3i -3-1i -1+3i -1+1i -1-3i -1-1i 3+3i 3+1i 3-3i 3-1i 1+3i 1+1i 1-3i 1-1i]

Use binary order

y = qammod(0:4,16,'bin');

Expected output:

The first points begin -3+3i, -3+1i, -3-1i, -3-3i.

Normalize average constellation power

y = qammod(0:15,16,'UnitAveragePower',true); p = mean(abs(y).^2);

Expected output:

p = 1

Group bit rows into QAM symbols

bits = [0 1;0 1;0 1;0 1]; y = qammod(bits,16,'InputType','bit');

Expected output:

y = [-3+3i 1-1i]

Preserve single input precision

y = qammod(single(0:3),4);

Using qammod with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how qammod changes the result.

Run a small qammod example, explain the result, then change one input and compare the output.

FAQ

Does qammod execute on the GPU?⌄

When the owning provider has modulation hooks, resident symbol and bit inputs produce resident complex output. Unsupported hooks can use host validation and re-upload.

Is bit input supported?⌄

Yes. InputType='bit' accepts numeric zero/one or logical arrays and groups log2(M) rows per symbol for each channel.

Related Comms functions

Modulation

pskmod

Conversion

bi2de · bin2dec · de2bi · dec2bin · dec2hex · hex2dec

Source you can read

Every RunMat function's source is public. Read exactly how qammod is executed, line by line, in Rust.

  • View the source for qammod in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Constellation and controls
  • Execution and residency
  • Examples
  • Default 16-QAM Gray mapping
  • Use binary order
  • Normalize average constellation power
  • Group bit rows into QAM symbols
  • Preserve single input precision
  • Using qammod with coding agents
  • FAQ
  • Related Comms functions
  • Modulation
  • Conversion
  • Source you can read
  • About RunMat