windata

Description

Generate window signal based on selected type.

Syntax

vector windata(int type, int n)

Parameters

type

The window type, 0 = rectangle, 1 = Welch, 2 = Triangular, 3 = Bartlett, 4 = Hanning, 5 = Hamming, 6 = Blackman

n

The size for the window.

Return

Return a vector of size n.

Example

// Import the signal data
string fname$ = system.path.program$ + "Samples\Signal Processing\fftfilter1.DAT";
impASC fname:=fname$;
 
// Define a range variable for input signal
range rSignal = col(2);

// Define window size, should be the same as input signal
int wSize = rSignal.GetSize();

// Calculate magnitude with DC offset removal and Welch window type
col(C) = fftmag(fftc((rSignal - mean(rSignal))* windata(1, $(wSize))));

See Also

fftc, fftmag, fftamp