2.1.22.2.1.47 get_window_data


Description

Generate window signal.

Syntax

int get_window_data( int nWindowMethod, int nSize, vector & vWindow, double dAlpha = 0, double dBeta = 0 )

Parameters

nWindowMethod
[input] the window method, now it can be one of the following,
Rectangle_Win, Create a Rectangle Window
Welch_Win, Create a Welch Window
Triangular_Win, Create a Triangular Window
Bartlett_Win, Create a Bartlett Window
Hanning_Win, Create a Hanning Window
Hamming_Win, Create a Hamming Window
Blackman_Win, Create a Blackman Window
Gaussian_Win, Create a Gaussian Window
Kaiser_Win, Create a Kaiser Window
Parzen_Win, Create a Parzen window
nSize
[input] number of points of the window
vWindow
[output]the result of window signal
dAlpha
[input] Alpha value for Gaussian window, As Alpha increases, the width of the Gaussian window will decrease.
default is 0.
dBeta
[input] Belta value for Kaiser window. default is 0.

Return

Returns OE_NOERROR for success or error codes for failure.

Examples

Prior to compilation, load fft_utils.c to the workspace by executing the following LabTalk command:

Run.LoadOC("Originlab\fft_utils.c", 16);

To retain fft_utils.c in the workspace for successive sessions, drag and drop the file from the Temporary folder to the System folder.

EX1

 
#include <fft_utils.h> 
void get_window_data_ex1()
{                
    //enum {                         // Window method
        //Rectangle_Win = 0,
        //Welch_Win,
        //Triangular_Win,
        //Bartlett_Win,
        //Hanning_Win,
        //Hamming_Win,
        //Blackman_Win,
        //Gaussian_Win,
        //Kaiser_Win,
        //Parzen_Win
    //};

    int nSize = 50, nType = 1;
    vector vWindow(nSize);
    
    ///Create a Welch window for example
    int nRet = get_window_data(nType, nSize, vWindow);
    if( 0 != nRet )
    {
        printf("get_window_data function returned error: %d\n", nRet);
        return;
    }
}

Remark

See Also

apply_window_data

Header to Include

fft_utils.h

Reference