Main Content


Flat top weighted window



w = flattopwin(L) returns an L-point symmetric flat top window

w = flattopwin(L,sflag) returns an L-point symmetric flat top window using the window sampling method specified by sflag.


collapse all

Create a 64-point symmetric flat top window. View the result using wvtool.

N = 64;
w = flattopwin(N);

Figure Window Visualization Tool contains 2 axes objects and other objects of type uimenu, uitoolbar, uipanel. Axes object 1 with title Time domain, xlabel Samples, ylabel Amplitude contains an object of type line. Axes object 2 with title Frequency domain, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

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

Flat top window, returned as a column vector.


Flat top windows are summations of cosines. The coefficients of a flat top window are computed from the following equation:


where 0nL1. The coefficient values are:


Flat top windows have very low passband ripple (< 0.01 dB) and are used primarily for calibration purposes. Their bandwidth is approximately 2.5 times wider than a Hann window.


[1] D’Antona, Gabriele, and A. Ferrero. Digital Signal Processing for Measurement Systems. New York: Springer Media, 2006, pp. 70–72.

[2] Gade, Svend, and Henrik Herlufsen. “Use of Weighting Functions in DFT/FFT Analysis (Part I).” Windows to FFT Analysis (Part I): Brüel & Kjær Technical Review. Vol. x, Number 3, 1987, pp. 1–28.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

See Also