RunningAutocorrelation Class Reference
[Analysis]

Running calculation (across slices) of the autocorrelation values. More...

#include <RunningAutocorrelation.h>

Inherits Marsyas::MarSystem.


Public Member Functions

MarSystemclone () 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.


Detailed Description

Running calculation (across slices) of the autocorrelation values.

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:

\[\begin{array}{ccccc} R_{xx}[0] & R_{xx}[1] & R_{xx}[2] & R_{xx}[3] & R_{xx}[4] \\ R_{yy}[0] & R_{yy}[1] & R_{yy}[2] & R_{yy}[3] & R_{yy}[4] \\ \end{array}\]

with $R_{xx}[n]$ the autocorrelation of the first channel for lag $n$ and $R_{yy}[n]$ 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.


Constructor & Destructor Documentation

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().


Member Function Documentation

void addControls (  )  [private]

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

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_.


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

Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6