Hann (Hanning) window
w = hann(L)
w = hann(L,'sflag')
The window length is .
w = hann(L,'sflag') returns an L-point Hann 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, hann computes a length L+1 window and returns the first L points. When using windows for filter design, the 'symmetric' flag should be used.
 Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999, p. 468.