Marsyas  0.5.0-beta1
Public Member Functions
ShiftInput Class Reference

Apply sliding window with certain hop size and window size. More...

#include <ShiftInput.h>

Inherits MarSystem.

Public Member Functions

MarSystemclone () const
void myProcess (realvec &in, realvec &out)
 Processes data.
 ShiftInput (std::string name)
 ShiftInput (const ShiftInput &a)
 ~ShiftInput ()

Detailed Description

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.


See also:
SoundFileSourceHopper for generating an audio slices from a SoundFileSource in a sliding/hopping window fashion.

Definition at line 72 of file ShiftInput.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

MarSystem * clone ( ) const [virtual]

Implements MarSystem.

Definition at line 49 of file ShiftInput.cpp.

void myProcess ( realvec in,
realvec out 
) [virtual]

Processes data.

inInput data to read.
outOutput data to write.

Implement this method in subclass to define specific data processing.

Implements MarSystem.

Definition at line 113 of file ShiftInput.cpp.

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