This class can be used for generating Windows and for zeropadding the windowed data. More...
#include <WindowGenerator.hxx>
Public Types | |
typedef WindowGeneratorConfig | Config |
Public Member Functions | |
WindowGenerator (const WindowGeneratorConfig &c=Config()) | |
~WindowGenerator () | |
const ProcessingConfig & | GetConfig () const |
Configuration getter. | |
bool | Do (void) |
Supervised mode execution method (using ports). | |
bool | Do (DataArray &output) |
bool | Do (Spectrum &output) |
bool | Do (Audio &output) |
bool | MayDisableExecution () const |
void | SetSize (TSize size) |
Protected Attributes | |
AudioOutPort | mOutput |
This class can be used for generating Windows and for zeropadding the windowed data.
The Do functions accept different types of data, which are simple Arrays, Audio and Spectrum.
If the window is smaller as the Data Array then the rest of the Array is filled with Zeroes.
The Size of the window can be changed via a control, the Type (Hamming,Kaiser, etc) is fixed. A configuration option is to generate the window everytime the Do() function is called. This is settable via the UseTable element of the configuration.
Note: The last and the first element of the window always have the same value, therefore, if you want to use it for windowing an FFT, you have to create a window of size FFTSize+1. (if you care for correctness) This class can be used for generating Windows and for zeropadding the windowed data. The Do functions accept different types of data, which are simple Arrays, Audio and Spectrum.
If the window is smaller as the Data Array then the rest of the Array is filled with Zeroes.
The Size of the window can be changed via a control, the Type (Hamming,Kaiser, etc) is fixed. A configuration option is to generate the window everytime the Do() function is called. This is settable via the UseTable element of the configuration.
Note: The last and the first element of the window always have the same value, therefore, if you want to use it for windowing an FFT, you have to create a window of size FFTSize+1. (if you care for correctness)
Definition at line 80 of file WindowGenerator.hxx.
Reimplemented from CLAM::Processing.
Definition at line 82 of file WindowGenerator.hxx.
CLAM::WindowGenerator::WindowGenerator | ( | const WindowGeneratorConfig & | c = Config() |
) |
Definition at line 45 of file WindowGenerator.cxx.
References CLAM::Processing::Configure().
CLAM::WindowGenerator::~WindowGenerator | ( | ) |
Definition at line 52 of file WindowGenerator.cxx.
bool CLAM::WindowGenerator::Do | ( | Audio & | output | ) |
Definition at line 125 of file WindowGenerator.cxx.
References Do().
bool CLAM::WindowGenerator::Do | ( | Spectrum & | output | ) |
Definition at line 133 of file WindowGenerator.cxx.
References CLAM_ASSERT, and Do().
bool CLAM::WindowGenerator::Do | ( | DataArray & | output | ) |
Definition at line 96 of file WindowGenerator.cxx.
References CLAM::EWindowType::eHamming, CLAM::InControl< ControlDataType >::GetLastValue(), CLAM::Array< T >::GetPtr(), and CLAM::Array< T >::Size().
bool CLAM::WindowGenerator::Do | ( | void | ) | [virtual] |
Supervised mode execution method (using ports).
Implements CLAM::Processing.
Definition at line 85 of file WindowGenerator.cxx.
References CLAM::Processing::AbleToExecute(), CLAM_ASSERT, CLAM::AudioOutPort::GetAudio(), mOutput, and CLAM::OutPort< Token >::Produce().
Referenced by Do().
const ProcessingConfig& CLAM::WindowGenerator::GetConfig | ( | ) | const [inline, virtual] |
Configuration getter.
Gets the configuration parameters used to create the object.
Reimplemented from CLAM::Processing.
Definition at line 98 of file WindowGenerator.hxx.
bool CLAM::WindowGenerator::MayDisableExecution | ( | ) | const [inline] |
Definition at line 106 of file WindowGenerator.hxx.
void CLAM::WindowGenerator::SetSize | ( | TSize | size | ) | [inline] |
Definition at line 108 of file WindowGenerator.hxx.
References CLAM_DEBUG_ASSERT, and CLAM::InControl< ControlDataType >::DoControl().
AudioOutPort CLAM::WindowGenerator::mOutput [protected] |
Definition at line 115 of file WindowGenerator.hxx.
Referenced by Do().