00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "SliceDelta.h"
00020
00021 using namespace std;
00022 using namespace Marsyas;
00023
00024 MarSystem*
00025 SliceDelta::clone() const
00026 {
00027 return new SliceDelta(*this);
00028 }
00029
00030 void
00031 SliceDelta::myUpdate(MarControlPtr sender)
00032 {
00033
00034 MarSystem::myUpdate(sender);
00035
00036
00037 mrs_natural rows = getctrl("mrs_natural/inObservations")->to<mrs_natural>();
00038 mrs_natural cols = getctrl("mrs_natural/inSamples")->to<mrs_natural>();
00039 this->previousInputSlice_.stretch(rows, cols);
00040 this->previousInputSlice_.setval(0.0);
00041 }
00042
00043 void
00044 SliceDelta::myProcess(realvec& in, realvec& out)
00045 {
00046 mrs_natural t,o;
00047
00048 for (o=0; o < inObservations_; o++)
00049 {
00050 for (t = 0; t < inSamples_; t++)
00051 {
00052
00053 out(o, t) = in(o, t) - this->previousInputSlice_(o, t);
00054
00055 this->previousInputSlice_(o, t) = in(o, t);
00056 }
00057 }
00058 }