Code Packages  1
Add-on code processing modules
Public Types | Static Public Member Functions | List of all members
dsp.Window Class Reference

Provides common window (tapering) functions More...

Public Types

enum  Type {
  Type.Rectangular, Type.Blackman, Type.Hamming, Type.Hann,
  Type.Triangular, Type.FlatTop
}
 Window function enumeration types More...
 

Static Public Member Functions

static double [] Blackman (int samples, bool periodic)
 Returns a Blackman window More...
 
static double [] FlatTop (int samples, bool periodic)
 Returns a flat-top window More...
 
static double [] Hamming (int samples, bool periodic)
 Returns a Hamming window More...
 
static double [] Hann (int samples, bool periodic)
 Returns a Hann (raised cosine) window More...
 
static double [] Rectangular (int samples)
 Returns a rectangular window More...
 
static double [] Triangular (int samples)
 Returns a triangular window More...
 

Detailed Description

Provides common window (tapering) functions

Member Enumeration Documentation

◆ Type

enum dsp.Window.Type
strong

Window function enumeration types

Enumerator
Rectangular 

Rectangular Window Type

Blackman 

Blackman Window Type

Hamming 

Hamming Window Type

Hann 

Hann Window Type

Triangular 

Triangular Window Type

FlatTop 

FlatTop Window Type

Member Function Documentation

◆ Blackman()

static double [] dsp.Window.Blackman ( int  samples,
bool  periodic 
)
static

Returns a Blackman window

For a symmetric window the number of samples should be an odd number.

Parameters
sampleswindow size
periodicTrue for periodic, False for symmetric

Example

double[] A = Window.Blackman(7, false);
A = NArray.Round(A, 8);
Console.WriteLine(NArray.ToString(A));
0 0.13 0.63 1 0.63 0.13 0

◆ FlatTop()

static double [] dsp.Window.FlatTop ( int  samples,
bool  periodic 
)
static

Returns a flat-top window

For a symmetric window the number of samples should be an odd number.

Parameters
sampleswindow size
periodicTrue for periodic, False for symmetric

Example

double[] A = Window.FlatTop(7, false);
A = NArray.Round(A, 8);
Console.WriteLine(NArray.ToString(A));
-0.00042105 -0.05126316 0.19821053 1 0.19821053 -0.05126316 -0.00042105

◆ Hamming()

static double [] dsp.Window.Hamming ( int  samples,
bool  periodic 
)
static

Returns a Hamming window

For a symmetric window the number of samples should be an odd number.

Parameters
sampleswindow size
periodicTrue for periodic, False for symmetric

Example

double[] A = Window.Hamming(7, false);
A = NArray.Round(A, 8);
Console.WriteLine(NArray.ToString(A));
0.08 0.31 0.77 1 0.77 0.31 0.08

◆ Hann()

static double [] dsp.Window.Hann ( int  samples,
bool  periodic 
)
static

Returns a Hann (raised cosine) window

For a symmetric window the number of samples should be an odd number.

Parameters
sampleswindow size
periodicTrue for periodic, False for symmetric

Example

double[] A = Window.Hann(7, false);
A = NArray.Round(A, 8);
Console.WriteLine(NArray.ToString(A));
0 0.25 0.75 1 0.75 0.25 0

◆ Rectangular()

static double [] dsp.Window.Rectangular ( int  samples)
static

Returns a rectangular window

Parameters
sampleswindow size

◆ Triangular()

static double [] dsp.Window.Triangular ( int  samples)
static

Returns a triangular window

Parameters
sampleswindow size

Example

double[] A = Window.Triangular(7);
A = NArray.Round(A, 8);
Console.WriteLine(NArray.ToString(A));
0.25 0.5 0.75 1 0.75 0.5 0.25