RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

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.

LicensePrivacy
/
See all docs
Builtin Reference
    • pskmod
    • qammod

pskmod — Map integers or bit groups to PSK constellation points in MATLAB and RunMat.

pskmod(X, M) maps integer symbols or bit groups to unit-magnitude M-PSK complex-baseband samples. Phase offset, Gray ordering, binary ordering, custom symbol ordering, bit input, and output precision follow the MATLAB Communications Toolbox surface.

Syntax

Y = pskmod(X, M)
Y = pskmod(X, M, phaseoffset, symorder, Name, Value)

Inputs

NameTypeRequiredDefaultDescription
XNumericArrayYes—Integer symbols or grouped bit input.
MNumericScalarYes—Modulation order greater than one.
argsAnyVariadic—Optional phase offset, symbol order, and name-value options.

Returns

NameTypeDescription
YNumericArrayComplex M-PSK baseband samples.

Errors

IdentifierWhenMessage
—Symbols, modulation order, phase, mapping, or options are invalid.pskmod: invalid argument

How pskmod works

  • X must contain finite integer symbols in the inclusive range [0, M-1] when InputType is 'integer'.
  • M must be an integer greater than one. Bit input additionally requires M to be a power of two. MATLAB-compatible calls supply this control as a double; typed-integer M is available in runmat compatibility mode.
  • The default phase offset is zero radians. MATLAB-compatible calls supply an explicit phase offset as a double; a typed-integer phase offset is available in runmat compatibility mode.
  • The default symbol order is 'gray'; 'bin' maps symbol k to angle phaseoffset + 2*pi*k/M.
  • Custom symbol order vectors must have length M, contain each integer in [0, M-1] exactly once, and label constellation points counter-clockwise starting at phaseoffset. Integer-valued double vectors are MATLAB-compatible controls; typed-integer custom-order vectors are available in runmat compatibility mode.
  • InputType='bit' groups rows by log2(M) bits per symbol with the first bit as the MSB, preserving remaining dimensions as independent channels.
  • OutputDataType='single' rounds real and imaginary samples through single precision before returning the complex tensor or resident complex gpuArray output.
  • PlotConstellation=true is accepted as a recognized option but raises an explicit not-implemented error.

Does RunMat run pskmod on the GPU?

RunMat represents complex GPU tensors as interleaved real/imaginary buffers with complex storage metadata, so downstream GPU-aware FFT and signal paths can consume the modulation output without a host result.

The provider hooks receive a validated constellation table and write the complex output on device. They read back only a compact validation state for MATLAB-compatible symbol or bit errors.

GPU memory and residency

The builtin declares NewHandle residency for gpuArray inputs. Integer-symbol and bit-input gpuArray inputs stay resident through provider-side constellation modulation and produce a complex-interleaved GPU handle when provider support is available.

Examples

Default 8-PSK Gray mapping

y = pskmod(0:7, 8)

QPSK with a phase offset

y = pskmod(0:3, 4, pi/4)

Binary symbol ordering

y = pskmod(0:3, 4, 0, 'bin')

Bit input

bits = [0 0; 0 1; 1 0; 1 1];
y = pskmod(bits, 4, InputType='bit')

Using pskmod with coding agents

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

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

FAQ

Does pskmod execute on the GPU?⌄

Yes when the active provider implements the modulation hooks. Integer-symbol and bit-input gpuArrays can produce resident complex-interleaved outputs directly.

Is custom symbol ordering supported?⌄

Yes. Supply a vector whose first element labels the constellation point at phaseoffset; later elements label points counter-clockwise around the unit circle.

Related Comms functions

Modulation

qammod

Conversion

bi2de · bin2dec · de2bi · dec2bin · dec2hex · hex2dec

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how pskmod is executed, line by line, in Rust.

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

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 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
  • How pskmod works
  • Does RunMat run pskmod on the GPU?
  • GPU memory and residency
  • Examples
  • Default 8-PSK Gray mapping
  • QPSK with a phase offset
  • Binary symbol ordering
  • Bit input
  • Using pskmod with coding agents
  • FAQ
  • Related Comms functions
  • Modulation
  • Conversion
  • Open-source implementation
  • About RunMat