GFLATTOPWIN

Purpose:

Generates an alternate 4 point  Flattop Window.

Syntax:

GFLATTOPWIN(N, spacing, "sym")

N

-

An integer, the number of points to generate.

spacing

-

A real, the spacing (delta x) between points.

"sym"

-

Optional. A string, the symmetry flag.

"symmetric"

:

Starting and ending points are equal (default).

"periodic"

:

Periodically extended window, however does not conform to the ISO standard.

Returns:

A series.

Example:

gflattopwin(100, .01)

 

generates an alternate symmetric 100-point Flattop Window using the following 4 point formula:

 

 

where n is the nth point (1 <= n <= N) and N is 100, the number of points. The spacing between samples is set to 0.01.

Example:

gflattopwin(100, .01, "periodic")

 

generates an alternate periodic 100-point Flattop Window using the following 4 point formula:

 

 

where n is the nth point (1 <= n <= N) and N is 100, the number of points. The spacing between samples is set to 0.01.

Remarks:

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.

 

The symmetric flattop window is constructed by the formula of the form:

 

 

where N is the length of the window and n is the nth point (1 <= n <= N).

 

The periodic flattop window is constructed by the formula of the form:

 

 

where N is the length of the window and n is the nth point (1 <= n <= N).

 

For both the symmetric and periodic case, the alternate 4 point flattop window coefficients are:

 

 

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 N-1 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 where the starting zero is preserved and the trailing zero is removed. "Periodic" conforms to the ISO 18431-1 standard for windowing functions.

 

The Hamming, Hanning, Flattop and Blackman windows are part of the family of cosine window functions. The ISO 18431-1 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 N-1. The coefficients for the alternative 4 point flattop window are shown above.

 

Note, these coefficients do not conform to the ISO standard for a flattop window. See GFLATTOP for an ISO 18431-1 compatible flattop window.

 

Use FLATTOPWIN to automatically create and multiply an alternative Flattop window with a series. For example:

 

flattopwin(W1)

 

multiplies Window 1 with an alternative Flattop window of the same length and spacing as the series in W1.

 

Blackman, Flattop, Hamming, Hanning and Kaiser Windows are useful in creating FIR filters and in preprocessing series for FFT calculations.

See Also:

FFT

FLATTOP

FLATTOPWIN

GBLACKMAN

GBLACKMANHARRIS

GFLATTOP

GHAMMING

GHANNING

GKAISER

PSD

SPECTRUM