DeltaFirstOrderRegression Class Reference
[Processing]

Calculate simple time domain delta in first order regression fashion. More...

#include <DeltaFirstOrderRegression.h>

Inherits Marsyas::MarSystem.


Public Member Functions

MarSystemclone () const
 Implementation of the MarSystem::clone() method.
 DeltaFirstOrderRegression (const DeltaFirstOrderRegression &a)
 DeltaFirstOrderRegression copy constructor.
 DeltaFirstOrderRegression (std::string name)
 DeltaFirstOrderRegression constructor.
void myProcess (realvec &in, realvec &out)
 Implementation of the MarSystem::myProcess method.
 ~DeltaFirstOrderRegression ()
 DeltaFirstOrderRegression 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 memory_
 Buffers of previous samples.


Detailed Description

Calculate simple time domain delta in first order regression fashion.

This Delta calculation is typically used for Delta-MFCC features.

The calculation of the first order regression delta is as follows. Given a signal $x[t]$ (discrete time $t$). For the delta at time $t$, we consider the three samples $x[t-1]$, $x[t]$ and $x[t+1]$ and fit a linear function $y=a t + b$ to these points in the least squares sense. The slope $a$ of this function is used as delta $\Delta[t]$ for time $t$. Mathematically, this regression problem with three points at uniform time point simplifies to a simple calculation

\[\Delta[t] = \frac{x[t+1] - x[t-1]}{2}\]

.

This MarSystem uses the calculation above, but adds a time lag of one sample to make the calculation causal (otherwise we need a sample from the future).

Works with multiple observation channels and works across slices (the MarSystem keeps an internal buffer of two samples from previous slice).

This MarSystem has no additional controls.

Definition at line 51 of file DeltaFirstOrderRegression.h.


Constructor & Destructor Documentation

DeltaFirstOrderRegression ( std::string  name  ) 

DeltaFirstOrderRegression constructor.

Add any specific controls needed by this MarSystem.

Definition at line 24 of file DeltaFirstOrderRegression.cpp.

References DeltaFirstOrderRegression::addControls().

Referenced by DeltaFirstOrderRegression::clone().


Member Function Documentation

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 65 of file DeltaFirstOrderRegression.cpp.

References DeltaFirstOrderRegression::memory_.

void myUpdate ( MarControlPtr  sender  )  [private, virtual]

Reads changed controls and sets up variables if necessary.

Use the default MarSystem setup with equal input/output stream format.

Reimplemented from MarSystem.

Definition at line 51 of file DeltaFirstOrderRegression.cpp.

References DeltaFirstOrderRegression::memory_, Marsyas::obsNamesAddPrefix(), realvec::setval(), and realvec::stretch().


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