CxScaledWindow
- Updated2023-02-21
- 3 minute(s) read
CxScaledWindow
Advanced Analysis Library Only
AnalysisLibErrType CxScaledWindow (NIComplexNumber xArray[], ssize_t numberOfElements, int windowType, double windowParameter, WindowConst *windowConstants);
Purpose
Applies a scaled window to a complex signal.
This function scales the result so that when the power or amplitude spectrum of the windowed waveform is computed, all windows provide the same level within the accuracy constraints of the window. ScaledWindowEx also returns important window constants for the selected window. These constants are useful when you use functions that perform computations on the power spectrum, such as PowerFrequencyEstimate and SpectrumUnitConversion.
for i = 0, 1, 2, ...
where wi and cg are the coefficients and coherent gain of the window without scaling, respectively.
This function also returns the coherent gain (CG) and equivalent noise bandwidth (ENBW) of the selected window. For cosine windows, these two properties are constants, as listed in the following table.
Window Type | Window Properties | |
---|---|---|
CG | ENBW | |
Rectangle | 1.0 | 1.0 |
Hanning | 0.5 | 1.5 |
Hamming | 0.54 | 1.362826 |
Blackman-Harris | 0.42323 | 1.708538 |
Exact Blackman | 0.42659071367 | 1.693699 |
Blackman | 0.42 | 1.726757 |
Flat Top | 0.215578948 | 3.770246506303 |
4 Term B-Harris | 0.35875 | 2.004353 |
7 Term B-Harris | 0.27105140069342415 | 2.631905 |
Low Sidelobe | 0.323215218 | 2.215350782519 |
Blackman Nuttall | 0.3635819 | 1.9761117 |
If xArray is an empty input array and the selected window is a cosine window, this function returns the window properties. If xArray is an empty input array and the selected window is not a cosine window, this function sets the window properties to NaN and returns an error. For Triangle, Kaiser, Dolph-Chebyshev, and Gaussian windows, the window properties depend on the window length and the window parameters.
Parameters
Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
numberOfElements | ssize_t | The number of elements in xArray. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
windowType | int | The type of window to apply. Specify one of the following values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
windowParameter | double | The window parameter. This parameter is referenced only if windowType is one of the following values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
xArray | NIComplexNumber [] | On input, the input signal. On output, this parameter returns the input signal with the selected window applied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
windowConstants | WindowConst | Pointer to a structure that contains the following useful constants for the selected window:
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 2012 and later
Example
Refer to analysis\cxwindowing.cws for an example of using the CxScaledWindow function.