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
    • blackman
    • butter
    • buttord
    • cheb2ord
    • conv
    • conv2
    • deconv
    • downsample
    • envelope
    • filter
    • filtfilt
    • fir1
    • freqz
    • gauspuls
    • hamming
    • hann
    • hilbert
    • periodogram
    • pulstran
    • pwelch
    • rectpuls
    • resample
    • sawtooth
    • sinc
    • spectrogram
    • square
    • tripuls
    • unwrap
    • upsample
    • zplane

blackman — Generate a Blackman window vector in MATLAB and RunMat.

blackman generates a Blackman window from a nonnegative scalar length. The length accepts single, double, or any of the eight built-in integer classes; floating lengths round to the nearest integer.

Syntax

w = blackman(n)
w = blackman(n, sampling)
w = blackman(n, precision)
w = blackman(n, sampling, precision)

Inputs

NameTypeRequiredDefaultDescription
nSizeArgYes—Window length.
samplingStringScalarNo"symmetric"Sampling mode: "symmetric" or "periodic".
precisionStringScalarNo"double"Output precision: "double" or "single".

Returns

NameTypeDescription
wNumericArrayBlackman window column vector.

Errors

IdentifierWhenMessage
RunMat:blackman:InvalidLengthLength input is not a finite nonnegative scalar value.blackman: expected a nonnegative scalar length
RunMat:blackman:InvalidOptionAn option argument is not a string-like sampling/precision token.blackman: unrecognized option
RunMat:blackman:UnknownOptionAn option string is not recognized by blackman.blackman: unrecognized option
RunMat:blackman:InternalErrorWindow materialization fails internally.blackman: internal error
RunMat:blackman:ArgumentCountMore than a sampling option and an output-type option are supplied.blackman: too many input arguments

How blackman works

  • blackman(L) returns an L x 1 symmetric Blackman window.
  • blackman(L, 'periodic') returns the periodic form used in spectral-analysis workflows.
  • blackman(..., 'single') returns a single-precision window; 'double' is the default.
  • Length L accepts single, double, int8, int16, int32, int64, uint8, uint16, uint32, or uint64; noninteger floating values round to the nearest integer.
  • A logical scalar length is available only as an explicitly gated RunMat extension.
  • blackman(0) returns an empty 0 x 1 tensor.
  • blackman(1) returns 1.
  • For the symmetric case and L > 1, coefficients use cospi evaluation of 0.42 - 0.5*cospi(2*n/(L-1)) + 0.08*cospi(4*n/(L-1)), matching the current enhanced-accuracy algorithm.
  • The periodic form is constructed by evaluating a symmetric window of length L + 1 and dropping the final sample.

Examples

Generate a short Blackman window

w = blackman(8);
disp(w')

Generate a periodic Blackman window

w = blackman(8, 'periodic');
disp(w')

Generate a single-precision Blackman window

w = blackman(8, 'single');
class(w)

Using blackman with coding agents

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

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

FAQ

Why would I use blackman instead of hann or hamming?⌄

A Blackman window is often used when you want lower spectral leakage at the cost of a wider main lobe. It is a common tradeoff choice in spectral analysis workflows.

What is the difference between the symmetric and periodic Blackman window?⌄

Use the symmetric form for filter-design style workflows. Use 'periodic' for FFT-based spectral analysis, where RunMat constructs a symmetric window of length L + 1 and removes the final sample.

Does blackman support single precision?⌄

Yes. Pass 'single' as the final option to request a single-precision output. The default output type is double precision.

Does an integer length produce an integer window?⌄

No. Every integer length class is a structural input; output is double by default or single when requested explicitly.

Does blackman accept a gpuArray input?⌄

No interactive gpuArray input form exists because the only numeric input is a host scalar length. GPU code generation is a separate documented capability; RunMat may internally materialize the new floating window on its active provider.

Related Math functions

Signal

butter · buttord · cheb2ord · conv · conv2 · deconv · downsample · envelope · filter · filtfilt · fir1 · freqz · gauspuls · hamming · hann · hilbert · periodogram · pulstran · pwelch · rectpuls · resample · sawtooth · sinc · spectrogram · square · tripuls · unwrap · upsample · zplane

Elementwise

abs · angle · bsxfun · complex · conj · double · erf · erfcinv · exp · expm1 · factorial · flintmax · gamma · gammaln · heaviside · hypot · idivide · imag · intmax · intmin · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · realmax · realmin · realsqrt · rescale · sign · single · sqrt · swapbytes · times · typecast · uint16 · uint32 · uint8

Trigonometry

acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · cospi · deg2rad · pol2cart · rad2deg · sin · sind · sinh · sinpi · tan · tand · tanh

Reduction

all · any · bounds · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · maxk · mean · median · min · mink · movmax · movmean · movmedian · movmin · movprod · movstd · movsum · movvar · nnz · prod · rms · std · sum · trapz · var

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · decomposition · eig · eigs · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Optim

coneprog · fminbnd · fminunc · fsolve · fzero · integral · linprog · lsqcurvefit · lsqnonlin · optimoptions · optimset · quad · secondordercone

Ops

cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose

Symbolic

digits · int · limit · piecewise · sym · syms · vpa

Fft

fft · fft2 · fftn · fftshift · ifft · ifft2 · ifftn · ifftshift

Interpolation

griddedInterpolant · interp1 · interp1q · interp2 · pchip · ppval · spline

Discrete

lcm · primes

Ode

ode15s · ode23 · ode45

Poly

polyder · polyfit · polyint · polyval · roots

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 blackman works
  • Examples
  • Generate a short Blackman window
  • Generate a periodic Blackman window
  • Generate a single-precision Blackman window
  • Using blackman with coding agents
  • FAQ
  • Related Math functions
  • Signal
  • Elementwise
  • Trigonometry
  • Reduction
  • Structure
  • Rounding
  • Factor
  • Solve
  • Optim
  • Ops
  • Symbolic
  • Fft
  • Interpolation
  • Discrete
  • Ode
  • Poly
  • About RunMat