RunMat
GitHub

hamming — Generate a Hamming window as an N-by-1 real column vector.

hamming generates Hamming windows for signal-processing workflows such as spectral analysis and filter design. RunMat supports the standard MATLAB symmetric and periodic forms.

How hamming works

  • hamming(L) returns an L x 1 symmetric Hamming window.
  • hamming(L, 'periodic') returns the periodic form used in spectral-analysis workflows.
  • If L is noninteger, RunMat rounds it to the nearest integer before constructing the window.
  • hamming(0) returns an empty 0 x 1 tensor.
  • hamming(1) returns 1.
  • For the symmetric case and L > 1, coefficients follow 0.54 - 0.46*cos(2*pi*n/(L-1)).
  • The periodic form is constructed by evaluating a symmetric window of length L + 1 and dropping the final sample.

Examples

Generate a short Hamming window

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

Generate a periodic Hamming window

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

FAQ

When should I use the periodic Hamming window?

Use 'periodic' when the window will be paired with FFT-based spectral analysis. The periodic form is built from a symmetric window of length L + 1 with the final sample removed.

What shape does hamming(L) return?

It returns an L x 1 column vector.

Does RunMat support a typeName overload for hamming?

RunMat currently implements the documented hamming(L) and hamming(L, sflag) forms.

Signal

blackman · conv · conv2 · deconv · filter · hann

Elementwise

abs · angle · 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 · cosh · deg2rad · rad2deg · sin · sinh · tan · tanh

Reduction

all · any · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · mean · median · min · nnz · prod · std · sum · trapz · var

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · eig · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · pinv · rank · rcond

Fft

fft · fft2 · fftshift · ifft · ifft2 · ifftshift

Optim

fsolve · fzero · optimset

Interpolation

interp1 · interp2 · pchip · ppval · spline

Ode

ode15s · ode23 · ode45

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.

Getting started · Benchmarks · Pricing

Try RunMat for free

Write code or describe what you want to compute. The sandbox is free, no account required.