Marsyas
0.6.0-alpha
|
Apply sliding window with certain hop size and window size. More...
#include <ShiftInput.h>
Inherits MarSystem.
Public Member Functions | |
MarSystem * | clone () const |
void | myProcess (realvec &in, realvec &out) |
Processes data. | |
ShiftInput (std::string name) | |
ShiftInput (const ShiftInput &a) | |
~ShiftInput () |
Apply sliding window with certain hop size and window size.
The ShiftInput MarSystem is useful for generating slices from an input source in a sliding window fashion with certain window size and hop size.
The **hop size** between the overlapping windows is defined by the number of input samples to the ShiftInput.
The **window size** can be set with the *winSize* control.
If the hop size is smaller than the window size, there will be overlap between successive output slices. If the hop size is larger than the window size, the output slices will be trimmed versions of the input slices.
A typical example is a SoundFileSource followed by a ShiftInput, in a Series. Mind that he number of input samples to a MarSystem is automatically determined from the number of output samples of the **preceding** MarSystem. Hence, to define the hop size of the sliding window produced by the ShiftInput, one has to make sure that the *onSamples* control of the SoundFileSource equals the desired hop size. Because each MarSystem automatically determines its output number of samples from it's input number of samples, that in turn requires setting the *inSamples* control of the SoundFileSource.
Controls:
Definition at line 72 of file ShiftInput.h.
ShiftInput | ( | std::string | name | ) |
Definition at line 24 of file ShiftInput.cpp.
ShiftInput | ( | const ShiftInput & | a | ) |
Definition at line 35 of file ShiftInput.cpp.
~ShiftInput | ( | ) |
Definition at line 31 of file ShiftInput.cpp.
Implements MarSystem.
Definition at line 49 of file ShiftInput.cpp.
Processes data.
in | Input data to read. |
out | Output data to write. |
Implement this method in subclass to define specific data processing.
Implements MarSystem.
Definition at line 113 of file ShiftInput.cpp.