This is machine translation

Translated by Microsoft



Hamming window


w = hamming(L)
w = hamming(L,sflag)



w = hamming(L) returns an L-point symmetric Hamming window.


w = hamming(L,sflag) returns a Hamming window using the window sampling specified by sflag.


collapse all

Create a 64-point Hamming window. Display the result using wvtool.

L = 64;

Design two Hamming windows:

  • The first window has N = 64 and is symmetric.

  • The second window has N = 63 and is periodic.

Display the two windows.

Hs = hamming(64,'symmetric');
Hp = hamming(63,'periodic');
wvt = wvtool(Hs,Hp);

Input Arguments

collapse all

Window length, specified as a positive integer.

Data Types: single | double

Window sampling method, specified as:

  • 'symmetric' — Use this option when using windows for filter design.

  • 'periodic' — This option is useful for spectral analysis because it enables a windowed signal to have the perfect periodic extension implicit in the discrete Fourier transform. When 'periodic' is specified, the function computes a window of length L + 1 and returns the first L points.

Output Arguments

collapse all

Hamming window, returned as a column vector.


The following equation generates the coefficients of a Hamming window:


The window length L = N + 1.



Extended Capabilities

C/C++ Code Generation

See Also



Introduced before R2006a