# GHANNING

## Purpose:

Generates a Hanning Window.

## Syntax:

GHANNING(N, spacing, alpha, "sym")

N

-

An integer, the number of points to generate.

spacing

-

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

alpha

-

Optional. Scaling parameter. Defaults to 0.5.

"sym"

-

Optional. A string, the symmetry flag.

 "symmetric" : Starting and ending points are equal, but leading and trailing zeros are removed (default). "periodic" : Periodically extended window where the leading zero is preserved. Conforms to the ISO standard. "direct" : Starting and ending points are equal and both zero. "iso" : Same as "periodic".

A series.

## Example:

ghanning(100,.01)

creates a 100-point symmetric Hanning window with points spaced with an interval of 0.01 by the following formula:

where n is the nth point (1 <= n <= N) and N = L+1 where L is the number of points to generate. The leading zero is removed. The spacing between samples is set to 0.01.

## Example:

ghanning(100,.01, "periodic")

creates a 100-point periodic Hanning window with points spaced with an interval of 0.01 by the following formula:

where n is the nth point (1 <= n <= N) and N = L where L is the number of points to generate. The spacing between samples is set to 0.01. The leading zero is preserved.

## Example:

ghanning(100,.01, "direct")

creates a 100-point direct Hanning window with points spaced with an interval of 0.01 by the following formula:

where n is the nth point (1 <= n <= N) and N is the number of points to generate. The spacing between samples is set to 0.01. The leading and trailing zeros are preserved.

## Remarks:

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 leading zero is removed.

"Periodic" or "iso" creates a periodic window function useful in spectrum analysis applications where the starting zero is preserved and the trailing zero is removed. "Periodic" or "iso" 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 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 direct form of the window can be constructed by setting N to N-1. The symmetric Hanning window is formed by creating a N+1 periodic window and removing the leading zero.

For the default Hanning window:

Use HANNING to automatically create and multiply a Hanning window with a series. For example:

hanning(W2)

multiplies Window 2 with a Hanning window of the same length and spacing as the series in W2.

The Hanning window is sometimes referred to as a Hann window.

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

FFT

GBLACKMAN

GBLACKMANHARRIS

GCHEBWIN

GFLATTOP

GHAMMING

GKAISER

GTAYLORWIN

HANNING

PSD

SPECTRUM

## References:

Oppenheim and Schafer.

Digital Signal Processing

Prentice Hall, 1975

Digital Signal Processing Committee

Programs for Digital Signal Processing

I.E.E.E. Press, 1979