Previous: Implicit patching advantages, Up: Implicit patching


6.2.3 Patching example of Feature extraction

Suppose we wish to create a typical feature extraction program:

images/feature-extraction.png
     MarSystemManager mng;
     MarSystem* Series1 = mng.create("Series", "Series1");
     MarSystem* Fanout1 = mng.create("Fanout", "Fanout1");
     MarSystem* Series2 = mng.create("Series", "Series2");
     MarSystem* Fanout2 = mng.create("Fanout", "Fanout2");
     MarSystem* Fanout3 = mng.create("Fanout", "Fanout3");
     Fanout3->addMarSystem(mng.create("Mean", "Mean"));
     Fanout3->addMarSystem(mng.create("Variance", "Variance"));
     Fanout2->addMarSystem(mng.create("Centroid", "Centroid"));
     Fanout2->addMarSystem(mng.create("RollOff", "Rolloff"));
     Fanout2->addMarSystem(mng.create("Flux", "Flux");
     Series2->addMarSystem(mng.create("Spectrum, "Spectrum");
     Series2->addMarSystem(Fanout2);
     Fanout1->addMarSystem(mng.create("ZeroCrossings", "ZeroCrossings");
     Fanout1->addMarSystem(Series2);
     Series1->addMarSystem(mng.create("SoundFileSource", "Source"));
     Series1->addMarSystem(Fanout1);
     Series1->addMarSystem(mng.create("Memory", "TextureMemory"));
     Series1->addMarSystem(Fanout3);
     Series1->addMarSystem(mng.create("classifier", "Classifier"));