#include <Window.h>
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) |
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:
The Window type can be selected using the setWindowType() method.
Additionally a Custom window can be specified using the setWindow() method.
enum WindowType |
Specifies the type of the window.
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() |
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.
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.
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. |
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().