name: Window : public AlgorithmBase

synopsis:

g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a

#include <Window.h>

Window(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, ALIGNMENT alignment = DEF_ALIGNMENT, NORMALIZATION normalization = DEF_NORMALIZATION, float duration = DEF_DURATION);
boolean setAlgorithm(ALGORITHM type);
boolean setNormalization(NORMALIZATION normalization);
quick start:

Window win(BLACKMAN);
VectorFloat input;
VectorFloat output;
win.setSize(10);
input.assign(L"2.0, 3.0, 8.0, 4.0, 2.0, 1.0, 1.0, 3.0, 4.0, 5.0");
win.compute(output, input);
description:

The Window class is used to design various types of windows. The following window functions are currently supported: rectangular, Bartlett, Blackman, Dolph-Chebyshev, Gaussian, Hamming, Hanning, Kaiser, and Lifter. A custom mode is also supported that allows user-defined windows to be used.

Many DSP textbooks contain extensive discussion of the theory of windowing. A good on-line reference on the application of time domain windows in speech recognition is:
The mathematical descriptions of the windows supported in this class are described below for reference purposes. The design parameters for these window functions are specified through a parameter vector that is passed to the object through the setConstants method. For each window type, the elements of this vector have a different meaning. The correspondence between the constants vector and the window design parameters is included in the description below.


Within the member functions that implement each window, which are private methods listed below, you will find detailed references to the textbooks from which the implementations were modeled. In addition to the basic shape of the window, a UNIT_ENERGY normalization mode is supported in which the window is normalized such that the sum of the squares of its values is equal to 1.0.

This class supports modes defined by the enumeration DMODE, which is in turn defined in the class AlgorithmBase. FRAME_INTERNAL is used when a user simply wants to window N points of data stored in a vector. CROSS_FRAME is used when dealing with a frame-based analysis of a time series. In this case, the window of data often extends outside the current frame, and suitable histories of signal samples must be maintained. The CROSS_FRAME mode, typically used in conjunction with the apply method, handles such cases. The CROSS_FRAME mode is used extensively by isip_transform.

The user can also control the alignment of the window with respect to the frame. Three choices are available: LEFT, CENTER, and RIGHT. The figure below demonstrates the basic concept of windowing:


In LEFT alignment mode, the first sample of the frame coincides with the first sample of the window (which means the window can extend into the future beyond the last sample in the frame). In RIGHT alignment mode, the last sample of the frame coincides with the last sample of the window (which means the window extends entirely in the past). In CENTER alignment mode, the center sample of the frame coincides with the center sample of the window. This means the window will typically extend into the previous and next frames of the signal. This mode is demonstrated in the figure above, and is the most popular mode for research systems. RIGHT alignment mode is popular for real-time systems since it minimizes system delay.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

notes: