Package: sigwin
Construct flat top window object
The use of sigwin.flattopwin
is not recommended.
Use flattopwin
instead.
sigwin.flattopwin
creates a handle to a flat
top window object for use in spectral analysis and FIR filtering by
the window method. Object methods enable workspace import and ASCII
file export of the window values.
H = sigwin.flattopwin
returns a flat top
window object H
of length 64 with symmetric sampling.
H = sigwin.flattopwin(
returns
a flat top window object of length Length
)Length
with
symmetric sampling. Length
must be a positive
integer. Entering a positive noninteger value for Length
rounds
the length to the nearest integer. Entering a 1 for Length
results
in a window with a single value of 1.
H = sigwin.flattopwin(
returns
a flat top window object Length
,SamplingFlag
)H
of length Length
with
sampling SamplingFlag
. The SamplingFlag
can
be either 'symmetric'
or 'periodic'
.

Flat top window length. Must be a positive integer. Entering
a positive noninteger value for 


generate  Generates flat top window 
info  Display information about flat top window object 
winwrite  Save flat top window in ASCII file 
Handle. To learn how copy semantics affect your use of the class, see Copying Objects (MATLAB) in the MATLAB^{®} Programming Fundamentals documentation.
The following equation defines the flat top window of length N
:
$$w(n)={a}_{0}{a}_{1}\mathrm{cos}\frac{2\pi n}{N1}+{a}_{2}\mathrm{cos}\frac{4\pi n}{N1}{a}_{3}\mathrm{cos}\frac{6\pi n}{N1}+{a}_{4}\mathrm{cos}\frac{8\pi n}{N1},\text{\hspace{1em}}0\le n\le M1,$$
where M is N/2 for N even and (N + 1)/2 for N odd.
The second half of the symmetric flat top window $$M\le n\le N1$$ is obtained by flipping the first half around the midpoint. The symmetric option is the preferred method when using a flat top window in FIR filter design by the window method.
The periodic flat top window is constructed by extending the desired window length by one sample, constructing a symmetric window, and removing the last sample. The periodic version is the preferred method when using a flat top window in spectral analysis because the discrete Fourier transform assumes periodic extension of the input vector.
The coefficients are listed in the following table:
Coefficient  Value 

a_{0}  0.21557895 
a_{1}  0.41663158 
a_{2}  0.277263158 
a_{3}  0.083578947 
a_{4}  0.006947368 
Oppenheim, Alan V., and Ronald W. Schafer. DiscreteTime Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1989.
flattopwin
 window
 wvtool