Admin Production ni-theme
Current Publication

ScaledWindow

LabWindows/CVI

ScaledWindow

Advanced Analysis Library Only

AnalysisLibErrType ScaledWindow (double xArray[], ssize_t numberOfElements, int windowType, WindowConst *windowConstants);

Purpose

Note Note  This function has been superseded by ScaledWindowEx.

Applies a scaled window to the time-domain signal and returns window constants for further analysis.

The windowed time-domain signal is scaled so that when ScaledWindow calculates the power or amplitude spectrum of the windowed waveform, all windows provide the same level within the accuracy constraints of the window. ScaledWindow also returns important window constants for the window you select. These constants are useful when you use functions that perform computations on the power spectrum, such as PowerFrequencyEstimate.

ScaledWindow can perform this operation in place; that is, the input and output arrays can be the same.

Parameters

Input
Name Type Description
numberOfElements ssize_t Number of elements in xArray.
windowType int Type of the window function to apply to the input signal.

windowType has the values shown in the following table.

Value Description
0 (Default) Rectangular
1 Hanning
2 Hamming
3 Blackman-Harris
4 Exact Blackman
5 Blackman
6 Flat Top
7 4-Term Blackman-Harris
8 7-Term Blackman-Harris
9 Low Sidelobe
Output
Name Type Description
xArray double [] On input, the input signal.

On output, this parameter returns the input signal with a scaled window applied.
windowConstants WindowConst Pointer to a structure that contains the following useful constants for the selected window:
  • enbw is the equivalent noise bandwidth of the selected window. You can use this value to calculate the power in a given frequency span.
  • coherentgain is the peak gain of the window, relative to the peak gain of the Rectangular window. ScaledWindow uses this value to normalize peak signal gains to that of the Rectangular window.
WindowConst is defined by the following C typedef statement:

typedef struct {
double enbw;
double coherentgain;
} WindowConst;

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later

Examples

Refer to the following examples that use the ScaledWindow function:

  • analysis\cxwindowing.cws

    Open example
  • analysis\peakest.cws

    Open example
  • analysis\thd.cws

    Open example
  • analysis\windowng.cws

    Open example