#include <RunningAutocorrelation.h>
Inherits Marsyas::MarSystem.
Public Member Functions | |
| MarSystem * | clone () const |
| Implementation of the MarSystem::clone() method. | |
| void | myProcess (realvec &in, realvec &out) |
| Implementation of the MarSystem::myProcess method. | |
| RunningAutocorrelation (const RunningAutocorrelation &a) | |
| RunningAutocorrelation copy constructor. | |
| RunningAutocorrelation (std::string name) | |
| RunningAutocorrelation constructor. | |
| ~RunningAutocorrelation () | |
| RunningAutocorrelation destructor. | |
Private Member Functions | |
| void | addControls () |
| Add specific controls needed by this MarSystem. | |
| void | myUpdate (MarControlPtr sender) |
| Reads changed controls and sets up variables if necessary. | |
Private Attributes | |
| realvec | acBuffer_ |
| Internal buffer of the running autocorrelation values. | |
| MarControlPtr | ctrl_clear_ |
| MarControlPtr for the clear control. | |
| MarControlPtr | ctrl_doNotNormalizeForLag0_ |
| The doNotNormalizeForLag0 control. | |
| MarControlPtr | ctrl_maxLag_ |
| MarControlPtr for the gain control. | |
| MarControlPtr | ctrl_normalize_ |
| The normalize control. | |
| MarControlPtr | ctrl_unfoldToObservations_ |
| MarControlPtr for the unfoldToObservations control. | |
| mrs_bool | doNotNormalizeForLag0_ |
| Cache of the doNotNormalizeForLag0 control value. | |
| mrs_natural | maxLag_ |
| Cache of the maxLag control value. | |
| realvec | memory_ |
| Buffer of previous samples. | |
| mrs_bool | normalize_ |
| Cache of the normalize control value. | |
| mrs_bool | unfoldToObservations_ |
| Cache for the unfoldToObservations control value. | |
This MarSystem calculates the autocorrelation function of the input signal defined by successive input slices. Unlike the AutoCorrelation MarSystem, the calculations are done across slice boundaries in a seamless fashion (RunningAutocorrelation keeps an internal buffer of the appropriate number of samples from previous slices to implement this feature). Calculations are done in time domain for time lags from 0 to a user defined maximum lag (in number of samples). Note that this assumes that the input slices are non overlapping slices.
The autocorrelation values are laid out in the output slice along the time/samples dimension from lag zero to the maximum lag. Multiple input observation channels are supported. For example, if there are two input channels and the maximum lag is 4, the output slice will have two rows and five (not four) columns:
with
the autocorrelation of the first channel for lag
and
the autocorrelation of the second channel.
TODO: support overlap between slices (e.g. provide a control for skipping a certain amount of samples).
Controls:
Definition at line 72 of file RunningAutocorrelation.h.
| RunningAutocorrelation | ( | std::string | name | ) |
RunningAutocorrelation constructor.
Add any specific controls needed by this MarSystem.
Definition at line 27 of file RunningAutocorrelation.cpp.
References RunningAutocorrelation::addControls().
Referenced by RunningAutocorrelation::clone().
| RunningAutocorrelation | ( | const RunningAutocorrelation & | a | ) |
RunningAutocorrelation copy constructor.
All member MarControlPtr have to be explicitly reassigned in the copy constructor.
Definition at line 34 of file RunningAutocorrelation.cpp.
References RunningAutocorrelation::ctrl_clear_, RunningAutocorrelation::ctrl_doNotNormalizeForLag0_, RunningAutocorrelation::ctrl_maxLag_, RunningAutocorrelation::ctrl_normalize_, and RunningAutocorrelation::ctrl_unfoldToObservations_.
| void addControls | ( | ) | [private] |
Add specific controls needed by this MarSystem.
Add any specific controls needed by this MarSystem.
Reimplemented from MarSystem.
Definition at line 56 of file RunningAutocorrelation.cpp.
References RunningAutocorrelation::ctrl_clear_, RunningAutocorrelation::ctrl_doNotNormalizeForLag0_, RunningAutocorrelation::ctrl_maxLag_, RunningAutocorrelation::ctrl_normalize_, and RunningAutocorrelation::ctrl_unfoldToObservations_.
Referenced by RunningAutocorrelation::RunningAutocorrelation().
Implementation of the MarSystem::myProcess method.
Iterate over the observations and samples and do the processing.
Implements MarSystem.
Definition at line 143 of file RunningAutocorrelation.cpp.
References RunningAutocorrelation::acBuffer_, RunningAutocorrelation::doNotNormalizeForLag0_, RunningAutocorrelation::maxLag_, RunningAutocorrelation::memory_, RunningAutocorrelation::normalize_, and RunningAutocorrelation::unfoldToObservations_.
1.5.6