This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Hamming window


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


w = hamming(L) returns an L-point symmetric Hamming window in the column vector w. L should be a positive integer. The coefficients of a Hamming window are computed from the following equation.


The window length is L=N+1.

w = hamming(L,'sflag') returns an L-point Hamming window using the window sampling specified by 'sflag', which can be either 'periodic' or 'symmetric' (the default). The 'periodic' flag is useful for DFT/FFT purposes, such as in spectral analysis. The DFT/FFT contains an implicit periodic extension and the periodic flag enables a signal windowed with a periodic window to have perfect periodic extension. When 'periodic' is specified, hamming computes a length L+1 window and returns the first L points. When using windows for filter design, the 'symmetric' flag should be used.

    Note   If you specify a one-point window (L=1), the value 1 is returned.


collapse all

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

L = 64;


[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999, p. 468.

Extended Capabilities

See Also



Introduced before R2006a

Was this topic helpful?