Window Class Reference

Algorithm to create and apply several type of windows on vectors of Real or Complex values. More...

#include <Window.h>

List of all members.

Public Types

enum  WindowType {
  RECTANGULAR = 0, HANN = 1, HANNING = 2, HAMMING = 3,
  COSINE = 4, BLACKMAN = 5, BLACKMANHARRIS = 6, NUTTALL = 7,
  BLACKMANNUTTALL = 8, CUSTOM = 9
}
 Specifies the type of the window. More...

Public Member Functions

 Window (int inputSize=1024, WindowType windowType=RECTANGULAR)
 ~Window ()
void process (const MatrixXC &frames, MatrixXC *windowedFrames)
int inputSize () const
void setInputSize (int size, bool callSetup=true)
WindowType windowType () const
void setWindowType (WindowType type, bool callSetup=true)
const MatrixXR & window () const
void setWindow (const MatrixXR &window, bool callSetup=true)


Detailed Description

Algorithm to create and apply several type of windows on vectors of Real or Complex values.

This class represents an object to apply a window on frames of Real or Complex data. The algorithm takes as input N-point vectors of Real (or Complex) values and returns N-point vectors of Real (or Complex) values where the samples are weighted by a weighting window.

5 types of windows are implemented:

  1. Rectangular
  2. Hann or Hanning
  3. Hamming
  4. Cosine
  5. Blackmann
  6. Blackmann Harris
  7. Nuttall
  8. Blackman Nuttall

The Window type can be selected using the setWindowType() method.

Additionally a Custom window can be specified using the setWindow() method.

Author:
Ricard Marxer
See also:
FFT

Member Enumeration Documentation

enum WindowType

Specifies the type of the window.

See also:
windowType
Enumerator:
RECTANGULAR  Rectangular window
HANN  Hann window
HANNING  Alias for a Hann window
HAMMING  Hamming window
COSINE  Cosine window
BLACKMAN  Blackman window
BLACKMANHARRIS  Blackman-Harris window
NUTTALL  Nuttall window
BLACKMANNUTTALL  Blackman-Nuttall window
CUSTOM  Custom window. Note that this window type must be select when setting the window using setWindow()


Constructor & Destructor Documentation

Window ( int  inputSize = 1024,
Window::WindowType  windowType = RECTANGULAR 
)

Constructs a Window object with the given inputSize and windowType parameters given.

References setInputSize(), setWindow(), and setWindowType().

~Window (  ) 

Destroys the algorithm and frees its resources.


Member Function Documentation

void process ( const MatrixXC &  frames,
MatrixXC *  windowedFrames 
)

Applies the window on each of the rows of frames and puts the result in the rows of windowedFrames.

Parameters:
frames matrix of Real (or Complex) values. The number of columns of frames must be equal to the inputSize property.
windowedFrames pointer to a matrix of Real (or Complex) values for the output. The matrix should have the same number of rows and columns as frames.
Note that if the output matrix is not of the required size it will be resized, reallocating a new memory space if necessary.

int inputSize (  )  const

Returns the input size of the algorithm.

By default it is 1024.

void setInputSize ( int  size,
bool  callSetup = true 
)

Specifies the input size of the algorithm.

Referenced by Window().

Window::WindowType windowType (  )  const

Return the type of the window

By default it is RECTANGULAR.

void setWindowType ( WindowType  type,
bool  callSetup = true 
)

Specify the type of the window.

Referenced by setWindow(), and Window().

const MatrixXR & window (  )  const

Return the single row matrix of Real values representing the window.

The number of cols of the window will be equal to inputSize.

By default it is a single row matrix with all values set to 1.0.

void setWindow ( const MatrixXR &  window,
bool  callSetup = true 
)

Specify the single row matrix of Real values representing the window.

The number of cols of the window must be equal to inputSize.

Note that when the window is set, using setWindow(), the window type is automatically set to CUSTOM.

By default it is a single row matrix with all values set to 1.0.

References CUSTOM, and setWindowType().

Referenced by Window().


The documentation for this class was generated from the following files:

Generated on Tue Mar 31 20:38:34 2009 for Loudia by  doxygen 1.5.6