Multiplies a series with an alternate 4 term Flattop window.
FLATTOPWIN(series, ampflag, "sym")
series 
 
A series or array.  
ampflag 
 
Optional. An integer, the amplitude correction flag:
 
"sym" 
 
Optional. A string, the symmetry flag:

FLATTOPWIN(N, ampflag, "sym")
N 
 
An integer, the window length.  
ampflag 
 
Optional. An integer, the amplitude correction flag:
 
"sym" 
 
Optional. A string, the symmetry flag:

A series or array.
W1: gsin(1000, .001, 45)
W2: spectrum(flattopwin(W1))
W1 is multiplied by an alternate symmetric flattop window. The MAX of
where N
is the length of the window and n
is the nth point
W3: flattopwin(1000, "periodic")
Generates a 1000 point alternate periodic flattop window.
where N is the length of the window and n is the nth point (1 <= n <= N).
The Flattop window preserves the amplitude of a series at the expense of frequency resolution. It will accurately measure the amplitude of a series at any frequency, even if the frequency lies between FFT bins.
If ampflag == 1, the correction factor is the mean of the spectral window. This assures that the spectrum of a sinusoid of amplitude A has a peak of A.
If ampflag == 2, the correction is applied as follows:
w = flattopwin(s) * rms(s) / rms(flattopwin(s))
This assures that:
sqrt(area(psd(w))) == rms(s) approximately
If ampflag == 3, the correction is applied as follows:
w = winfun(s) / sqrt(mean(win * win)
where win is the windowing function.
The "sym" flag controls the window symmetry as follows:
"Symmetric" sets the last point to be the same value as the first point. For an N point symmetric window, a N1 point periodic window is effectively created and the Nth point is set to the first point.
"Periodic" creates a periodic window function useful in spectrum analysis applications.
The Hamming, Hanning, Flattop and Blackman windows are part of the family of cosine window functions. The ISO 184311 standard periodic form of these windowing functions are defined by:
where K is the number of window coefficients and N is the length of the window. The symmetric form of the window can be constructed by setting N to N1.
For the alternate 4 point flattop window:
However, these coefficients do not conform to the ISO standard for a flattop window. See FLATTOP for an ISO 184311 compatible flattop window.
See GFLATTOPWIN to generate an alternate 4 point Flattop window.