blackman — Generate a Blackman window as an N-by-1 real column vector.
blackman generates Blackman windows for signal-processing workflows where lower spectral leakage is desired. RunMat supports the common MATLAB symmetric and periodic forms, including optional single-precision output.
How blackman works
blackman(L)returns anL x 1symmetric 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.- If
Lis noninteger, RunMat rounds it to the nearest integer before constructing the window. blackman(0)returns an empty0 x 1tensor.blackman(1)returns1.- For the symmetric case and
L > 1, coefficients follow0.42 - 0.5*cos(2*pi*n/(L-1)) + 0.08*cos(4*pi*n/(L-1)). - The periodic form is constructed by evaluating a symmetric window of length
L + 1and 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)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.
Related Math functions
Elementwise
abs · angle · complex · conj · double · exp · expm1 · factorial · gamma · hypot · imag · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · sign · single · sqrt · times
Trigonometry
acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · deg2rad · rad2deg · sin · sind · sinh · tan · tand · tanh
Reduction
all · any · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · mean · median · min · nnz · prod · std · sum · trapz · var
Structure
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.
- Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
- Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
- A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.