当前位置: 首页>>代码示例>>C++>>正文


C++ Series::addMarSystem方法代码示例

本文整理汇总了C++中Series::addMarSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::addMarSystem方法的具体用法?C++ Series::addMarSystem怎么用?C++ Series::addMarSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Series的用法示例。


在下文中一共展示了Series::addMarSystem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cmd_play

void Talk::cmd_play(mrs_natural start, mrs_natural end, mrs_natural lineSize)
{
  communicator_->send_message("From Server: Play command received\n");



  src_->updControl("mrs_natural/pos", (mrs_natural)start * lineSize);
  src_->updControl("mrs_natural/inSamples", lineSize);



  Series *series = new Series("playbacknet");
  series->addMarSystem(src_);
  series->addMarSystem(dest_);


  series->updControl("AudioSink/dest/mrs_natural/nChannels",
                     series->getctrl("SoundFileSource/src/mrs_natural/nChannels")->to<mrs_natural>());
  for (int i=0; i < end-start; ++i)
  {
    series->tick();
    // communicator_->send_message("tick\n");
  }

}
开发者ID:Amos-zq,项目名称:marsyas,代码行数:25,代码来源:Talk.cpp

示例2: in

void
Talk::cmd_load(mrs_string fname, mrs_natural lineSize)
{
  cout << "cmd_load called" << endl;

  src_ = new SoundFileSource("src");
  src_->updControl("mrs_string/filename", fname);
  fname_ = fname;
  src_->updControl("mrs_natural/inSamples", lineSize);
  AbsMax* absmax = new AbsMax("absmax");

  Series *series = new Series("plot");
  series->addMarSystem(src_);
  series->addMarSystem(absmax);


  mrs_natural hops = src_->getctrl("mrs_natural/size")->to<mrs_natural>() * src_->getctrl("mrs_natural/nChannels")->to<mrs_natural>() / src_->getctrl("mrs_natural/inSamples")->to<mrs_natural>() + 1;


  Accumulator* acc = new Accumulator("acc");
  acc->updControl("mrs_natural/nTimes", hops);
  acc->addMarSystem(series);



  realvec in(acc->getctrl("mrs_natural/inObservations")->to<mrs_natural>(),
             acc->getctrl("mrs_natural/inSamples")->to<mrs_natural>());

  realvec out(acc->getctrl("mrs_natural/onObservations")->to<mrs_natural>(),
              acc->getctrl("mrs_natural/onSamples")->to<mrs_natural>());



  acc->process(in,out);

  out.send(communicator_);



//   Util util;
//   fname_ = fname;
//   src_ = util.sfopen(fname, MRS_SF_READ);
//   if (src_ == NULL)
//     cout << "src_ = NULL" << endl;

//   if (src_ != NULL)			// File exists
//     {
//       src_->initWindow(lineSize, lineSize, 0, 0);
//       PlotExtractor pextractor(src_, src_->winSize());
//       fvec res(src_->iterations());
//       pextractor.extract(0, src_->iterations(), res);
//       res.send(communicator_);
//     }
//   else
//     {
//       fvec res(0);
//       res.send(communicator_);
//     }
}
开发者ID:Amos-zq,项目名称:marsyas,代码行数:59,代码来源:Talk.cpp

示例3: b

void
ERB::myUpdate(MarControlPtr sender)
{
  (void) sender;  //suppress warning of unused parameter(s)
  MRSDIAG("ERB.cpp - ERB:myUpdate");

  //FilterBank creation
  if (numChannels != getctrl("mrs_natural/numChannels")->to<mrs_natural>()) {
    numChannels = getctrl("mrs_natural/numChannels")->to<mrs_natural>();
    if (filterBank) delete filterBank;
    filterBank = new Fanout("filterBank");
    stringstream name;
    for(mrs_natural i = 0; i < numChannels; ++i) {
      name << "channel_" << i;
      Series* channel = new Series(name.str());
      name.str("");
      name << "filter_" << i << "_" << 0;
      Filter* filter_0 = new Filter(name.str());
      name.str("");
      name << "filter_" << i << "_" << 1;
      Filter* filter_1 = new Filter(name.str());
      name.str("");
      name << "filter_" << i << "_" << 2;
      Filter* filter_2 = new Filter(name.str());
      name.str("");
      name << "filter_" << i << "_" << 3;
      Filter* filter_3 = new Filter(name.str());
      name.str("");
      channel->addMarSystem(filter_0);
      channel->addMarSystem(filter_1);
      channel->addMarSystem(filter_2);
      channel->addMarSystem(filter_3);
      filterBank->addMarSystem(channel);
    }
    centerFreqs.create(numChannels);
    fcoefs.create(numChannels, 10);
  }

  setctrl("mrs_natural/onSamples", getctrl("mrs_natural/inSamples"));
  setctrl("mrs_natural/onObservations", numChannels*getctrl("mrs_natural/inObservations")->to<mrs_natural>());
  setctrl("mrs_real/osrate", getctrl("mrs_real/israte"));

  //Coefficients computation
  lowFreq = getctrl("mrs_real/lowFreq")->to<mrs_real>();
  fs = getctrl("mrs_real/israte")->to<mrs_real>();
  highFreq = fs/2;
  EarQ = 9.26449f;
  minBW = 24.7f;
  order = 1;

  for (mrs_natural i = 0; i < numChannels; ++i) {
    centerFreqs(i) = - (EarQ*minBW) + exp((i+1)*(-log(highFreq+EarQ*minBW) + log(lowFreq+EarQ*minBW))/numChannels)*(highFreq + EarQ*minBW);
  }

  A0 = 1/fs;
  A2 = 0.0f;
  B0 = 1.0f;

  for (mrs_natural i = 0; i < numChannels; ++i) {
    fcoefs(i,0) = A0;
    fcoefs(i,1) = A11(centerFreqs(i), B(E(centerFreqs(i))));
    fcoefs(i,2) = A12(centerFreqs(i), B(E(centerFreqs(i))));
    fcoefs(i,3) = A13(centerFreqs(i), B(E(centerFreqs(i))));
    fcoefs(i,4) = A14(centerFreqs(i), B(E(centerFreqs(i))));
    fcoefs(i,5) = A2;
    fcoefs(i,6) = B0;
    fcoefs(i,7) = B1(centerFreqs(i), B(E(centerFreqs(i))));
    fcoefs(i,8) = B2( B(E(centerFreqs(i))));
    fcoefs(i,9) = gain(centerFreqs(i), B(E(centerFreqs(i))));
  }

  //Controls update
  stringstream channel,filter,ctrl;
  realvec b(1,3),a(1,3);
  channel << "Series/channel_0/";
  ctrl << channel.str() << "mrs_natural/inSamples";
  filterBank->setctrl(ctrl.str(), getctrl("mrs_natural/inSamples"));
  ctrl.str("");
  ctrl << channel.str() << "mrs_natural/inObservations";
  filterBank->setctrl(ctrl.str(), getctrl("mrs_natural/inObservations"));
  ctrl.str("");
  ctrl << channel.str() << "mrs_natural/onObservations";
  filterBank->setctrl(ctrl.str(), getctrl("mrs_natural/inObservations"));
  ctrl.str("");
  ctrl << channel.str() << "mrs_real/israte";
  filterBank->setctrl(ctrl.str(), getctrl("mrs_real/israte"));
  for(mrs_natural i = 0; i < numChannels; ++i) {
    //filter 0
    channel.str("");
    channel << "Series/channel_" << i << "/";
    filter.str("");
    filter << channel.str() << "Filter/filter_" << i << "_" << 0 << "/";
    ctrl.str("");
    ctrl << filter.str() << "mrs_natural/inSamples";
    filterBank->setctrl(ctrl.str(), getctrl("mrs_natural/inSamples"));
    ctrl.str("");
    ctrl << filter.str() << "mrs_natural/inObservations";
    filterBank->setctrl(ctrl.str(), getctrl("mrs_natural/inObservations"));
    ctrl.str("");
    ctrl << filter.str() << "mrs_natural/onObservations";
//.........这里部分代码省略.........
开发者ID:Amos-zq,项目名称:marsyas,代码行数:101,代码来源:ERB.cpp


注:本文中的Series::addMarSystem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。